From 7e1120780bc9a84c1368bc8033f8187b6b733a86 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Fri, 29 Dec 2023 21:26:48 +1000 Subject: [PATCH 1/6] Regenerated, temp replacement of api dependency --- .../toolchain.dev.openshift.com_useraccounts.yaml | 12 ------------ go.mod | 2 ++ go.sum | 4 ++-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_useraccounts.yaml b/config/crd/bases/toolchain.dev.openshift.com_useraccounts.yaml index 6b32bf28..8f1ef7249 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_useraccounts.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_useraccounts.yaml @@ -61,11 +61,6 @@ spec: description: If set to true then the corresponding user should not be able to login "false" is assumed by default type: boolean - originalSub: - description: OriginalSub is an optional property temporarily introduced - for the purpose of migrating the users to a new IdP provider client, - and contains the user's "original-sub" claim - type: string propagatedClaims: description: PropagatedClaims contains a selection of claim values from the SSO Identity Provider which are intended to be "propagated" @@ -93,13 +88,6 @@ spec: - email - sub type: object - userID: - description: UserID is the user ID from RHD Identity Provider token - (“sub” claim) Is to be used to create Identity and UserIdentityMapping - resources - type: string - required: - - userID type: object status: description: UserAccountStatus defines the observed state of UserAccount diff --git a/go.mod b/go.mod index ca9fe601..4594ee18 100644 --- a/go.mod +++ b/go.mod @@ -110,3 +110,5 @@ require ( ) go 1.20 + +replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20231229111412-eada577c9874 diff --git a/go.sum b/go.sum index dbfd27b3..8cf6b1bb 100644 --- a/go.sum +++ b/go.sum @@ -134,8 +134,6 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/api v0.0.0-20231122125952-9e6527f5e746 h1:By8gc3SbJl1GHf7LfPTxfLYC0IuTeF4wiZHvtBxPx4s= -github.com/codeready-toolchain/api v0.0.0-20231122125952-9e6527f5e746/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= github.com/codeready-toolchain/toolchain-common v0.0.0-20231122135421-3933b292cbb6 h1:+xecIaHMA1T9fioEVWsR9hyh736xHLBZEY6h3LWdj9M= github.com/codeready-toolchain/toolchain-common v0.0.0-20231122135421-3933b292cbb6/go.mod h1:SonFn2Nu9p70l4gYaf4+XUzCn9dQdpFfpqQ+E4MVILU= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -537,6 +535,8 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sbryzak/api v0.0.0-20231229111412-eada577c9874 h1:MwmU2WAWksIBGZs0AMN9A4Uwme1n8mcr8kUktlALfAM= +github.com/sbryzak/api v0.0.0-20231229111412-eada577c9874/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= From f6e88392c1a0971dc13ecc5c0c9590a17b7e2ba0 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Fri, 29 Dec 2023 21:45:37 +1000 Subject: [PATCH 2/6] update toolchain-common --- go.mod | 12 ++++++------ go.sum | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 4594ee18..b9725775 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/codeready-toolchain/member-operator require ( - github.com/codeready-toolchain/api v0.0.0-20231122125952-9e6527f5e746 - github.com/codeready-toolchain/toolchain-common v0.0.0-20231122135421-3933b292cbb6 + github.com/codeready-toolchain/api v0.0.0-20231129193441-f6c9b7feee01 + github.com/codeready-toolchain/toolchain-common v0.0.0-20231218234903-ac94d7a6cdb5 github.com/go-logr/logr v1.2.3 github.com/google/go-cmp v0.5.9 // using latest commit from 'github.com/openshift/api branch release-4.12' @@ -90,12 +90,12 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect - golang.org/x/crypto v0.14.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 8cf6b1bb..651a96b3 100644 --- a/go.sum +++ b/go.sum @@ -134,8 +134,8 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/toolchain-common v0.0.0-20231122135421-3933b292cbb6 h1:+xecIaHMA1T9fioEVWsR9hyh736xHLBZEY6h3LWdj9M= -github.com/codeready-toolchain/toolchain-common v0.0.0-20231122135421-3933b292cbb6/go.mod h1:SonFn2Nu9p70l4gYaf4+XUzCn9dQdpFfpqQ+E4MVILU= +github.com/codeready-toolchain/toolchain-common v0.0.0-20231218234903-ac94d7a6cdb5 h1:gLVwUgGXN1MCy895tlNXRXDBbR/YD/Ko5v4XIt70zpY= +github.com/codeready-toolchain/toolchain-common v0.0.0-20231218234903-ac94d7a6cdb5/go.mod h1:85O2+RctYp1T6QMlXloKWczppOxm7n/CR8P9L4BV/mc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -656,8 +656,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -865,8 +865,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -874,8 +874,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -888,8 +888,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 056cfbcb1fe95c9e040eb92246d1e31687fb6669 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Mon, 1 Jan 2024 08:08:36 +1000 Subject: [PATCH 3/6] updated to use new annotations --- .../useraccount/useraccount_controller.go | 12 ++++----- .../useraccount_controller_test.go | 26 +++++++++---------- go.mod | 2 +- go.sum | 4 +-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/controllers/useraccount/useraccount_controller.go b/controllers/useraccount/useraccount_controller.go index 10bf81f7..eaa3fea6 100644 --- a/controllers/useraccount/useraccount_controller.go +++ b/controllers/useraccount/useraccount_controller.go @@ -390,11 +390,11 @@ func setLabelsAndAnnotations(object metav1.Object, userAcc *toolchainv1alpha1.Us if isUserResource { annotations := object.GetAnnotations() - if _, exists := annotations[toolchainv1alpha1.UserEmailAnnotationKey]; !exists { + if _, exists := annotations[toolchainv1alpha1.EmailUserAnnotationKey]; !exists { if annotations == nil { annotations = map[string]string{} } - annotations[toolchainv1alpha1.UserEmailAnnotationKey] = userAcc.Spec.PropagatedClaims.Email + annotations[toolchainv1alpha1.EmailUserAnnotationKey] = userAcc.Spec.PropagatedClaims.Email object.SetAnnotations(annotations) changed = true } @@ -406,8 +406,8 @@ func setLabelsAndAnnotations(object metav1.Object, userAcc *toolchainv1alpha1.Us if annotations == nil { annotations = map[string]string{} } - annotations[toolchainv1alpha1.SSOUserIDAnnotationKey] = userAcc.Spec.PropagatedClaims.UserID - annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey] = userAcc.Spec.PropagatedClaims.AccountID + annotations[toolchainv1alpha1.UserIDUserAnnotationKey] = userAcc.Spec.PropagatedClaims.UserID + annotations[toolchainv1alpha1.AccountIDUserAnnotationKey] = userAcc.Spec.PropagatedClaims.AccountID object.SetAnnotations(annotations) changed = true @@ -416,8 +416,8 @@ func setLabelsAndAnnotations(object metav1.Object, userAcc *toolchainv1alpha1.Us // Delete the UserID and AccountID annotations if they don't exist in the UserAccount if !set && object.GetAnnotations() != nil { annotations = object.GetAnnotations() - delete(annotations, toolchainv1alpha1.SSOUserIDAnnotationKey) - delete(annotations, toolchainv1alpha1.SSOAccountIDAnnotationKey) + delete(annotations, toolchainv1alpha1.UserIDUserAnnotationKey) + delete(annotations, toolchainv1alpha1.AccountIDUserAnnotationKey) object.SetAnnotations(annotations) changed = true } diff --git a/controllers/useraccount/useraccount_controller_test.go b/controllers/useraccount/useraccount_controller_test.go index 8797ebb6..94bdc664 100644 --- a/controllers/useraccount/useraccount_controller_test.go +++ b/controllers/useraccount/useraccount_controller_test.go @@ -88,7 +88,7 @@ func TestReconcile(t *testing.T) { toolchainv1alpha1.ProviderLabelKey: toolchainv1alpha1.ProviderLabelValue, }, Annotations: map[string]string{ - toolchainv1alpha1.UserEmailAnnotationKey: userAcc.Spec.PropagatedClaims.Email, + toolchainv1alpha1.EmailUserAnnotationKey: userAcc.Spec.PropagatedClaims.Email, }, }, Identities: []string{ @@ -136,8 +136,8 @@ func TestReconcile(t *testing.T) { user.UID = preexistingUser.UID // we have to set UID for the obtained user because the fake client doesn't set it checkMapping(t, user, preexistingIdentity, preexistingIdentityForSsoUserAnnotation) - require.Equal(t, "123456", user.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey]) - require.Equal(t, "987654", user.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey]) + require.Equal(t, "123456", user.Annotations[toolchainv1alpha1.UserIDUserAnnotationKey]) + require.Equal(t, "987654", user.Annotations[toolchainv1alpha1.AccountIDUserAnnotationKey]) // Check the identity is not created yet assertIdentityNotFound(t, r, userAcc, config.Auth().Idp()) @@ -154,8 +154,8 @@ func TestReconcile(t *testing.T) { // Check the created/updated user user := assertUser(t, r, userAcc) - require.NotContains(t, user.Annotations, toolchainv1alpha1.SSOUserIDAnnotationKey) - require.NotContains(t, user.Annotations, toolchainv1alpha1.SSOAccountIDAnnotationKey) + require.NotContains(t, user.Annotations, toolchainv1alpha1.UserIDUserAnnotationKey) + require.NotContains(t, user.Annotations, toolchainv1alpha1.AccountIDUserAnnotationKey) t.Run("reset UserID and reconcile again", func(t *testing.T) { userAcc.Spec.PropagatedClaims.UserID = "123456" @@ -168,8 +168,8 @@ func TestReconcile(t *testing.T) { // Check the created/updated user user := assertUser(t, r, userAcc) - require.Equal(t, "123456", user.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey]) - require.Equal(t, "987654", user.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey]) + require.Equal(t, "123456", user.Annotations[toolchainv1alpha1.UserIDUserAnnotationKey]) + require.Equal(t, "987654", user.Annotations[toolchainv1alpha1.AccountIDUserAnnotationKey]) t.Run("test missing AccountID annotation propagates to User", func(t *testing.T) { // Remove the AccountID annotation from the UserAccount and reconcile again @@ -183,8 +183,8 @@ func TestReconcile(t *testing.T) { // Check the created/updated user user := assertUser(t, r, userAcc) - require.NotContains(t, user.Annotations, toolchainv1alpha1.SSOUserIDAnnotationKey) - require.NotContains(t, user.Annotations, toolchainv1alpha1.SSOAccountIDAnnotationKey) + require.NotContains(t, user.Annotations, toolchainv1alpha1.UserIDUserAnnotationKey) + require.NotContains(t, user.Annotations, toolchainv1alpha1.AccountIDUserAnnotationKey) t.Run("reset AccountID annotation and reconcile again", func(t *testing.T) { userAcc.Spec.PropagatedClaims.AccountID = "987654" @@ -197,8 +197,8 @@ func TestReconcile(t *testing.T) { // Check the created/updated user user := assertUser(t, r, userAcc) - require.Equal(t, "123456", user.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey]) - require.Equal(t, "987654", user.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey]) + require.Equal(t, "123456", user.Annotations[toolchainv1alpha1.UserIDUserAnnotationKey]) + require.Equal(t, "987654", user.Annotations[toolchainv1alpha1.AccountIDUserAnnotationKey]) }) }) }) @@ -1176,7 +1176,7 @@ func TestCreateIdentitiesOKWhenSSOUserIDAnnotationPresent(t *testing.T) { toolchainv1alpha1.ProviderLabelKey: toolchainv1alpha1.ProviderLabelValue, }, Annotations: map[string]string{ - toolchainv1alpha1.UserEmailAnnotationKey: userAcc.Spec.PropagatedClaims.Email, + toolchainv1alpha1.EmailUserAnnotationKey: userAcc.Spec.PropagatedClaims.Email, }, }, Identities: []string{ @@ -1551,7 +1551,7 @@ func assertUser(t *testing.T, r *Reconciler, userAcc *toolchainv1alpha1.UserAcco assert.Equal(t, toolchainv1alpha1.ProviderLabelValue, user.Labels[toolchainv1alpha1.ProviderLabelKey]) assert.NotNil(t, user.Annotations) - assert.Equal(t, userAcc.Spec.PropagatedClaims.Email, user.Annotations[toolchainv1alpha1.UserEmailAnnotationKey]) + assert.Equal(t, userAcc.Spec.PropagatedClaims.Email, user.Annotations[toolchainv1alpha1.EmailUserAnnotationKey]) assert.Empty(t, user.OwnerReferences) // User has no explicit owner reference.// Check the user identity mapping return user diff --git a/go.mod b/go.mod index b9725775..8a870352 100644 --- a/go.mod +++ b/go.mod @@ -111,4 +111,4 @@ require ( go 1.20 -replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20231229111412-eada577c9874 +replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20231231220256-a15468008bab diff --git a/go.sum b/go.sum index 651a96b3..bd3a23b2 100644 --- a/go.sum +++ b/go.sum @@ -535,8 +535,8 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sbryzak/api v0.0.0-20231229111412-eada577c9874 h1:MwmU2WAWksIBGZs0AMN9A4Uwme1n8mcr8kUktlALfAM= -github.com/sbryzak/api v0.0.0-20231229111412-eada577c9874/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/sbryzak/api v0.0.0-20231231220256-a15468008bab h1:9ZgGXi7vXyl7+wQ7eD+ywOGcSV1B0qy6ilJOa6wvJmA= +github.com/sbryzak/api v0.0.0-20231231220256-a15468008bab/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= From 659193a1e83edfc2f56a028c108b717631c18dc5 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Sun, 28 Jan 2024 13:18:32 +1000 Subject: [PATCH 4/6] updated dependencies --- go.mod | 4 +++- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 31143d01..9e51bf74 100644 --- a/go.mod +++ b/go.mod @@ -111,4 +111,6 @@ require ( go 1.20 -replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20231231220256-a15468008bab +replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240122043958-5766c6177c5f + +replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240127001349-e2601d8aaca0 diff --git a/go.sum b/go.sum index ab9aa7f9..f1ca06e2 100644 --- a/go.sum +++ b/go.sum @@ -134,8 +134,6 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240126111814-12ab087b62d2 h1:wObz6g5TFOzn7AZF6hsd7vI+GQRytxQcVAL6/DnNex8= -github.com/codeready-toolchain/toolchain-common v0.0.0-20240126111814-12ab087b62d2/go.mod h1:1oIpmgqMMIir4IjrVkmBaC3GXsObl0vmOFmnYhpbSAQ= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -535,8 +533,10 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sbryzak/api v0.0.0-20231231220256-a15468008bab h1:9ZgGXi7vXyl7+wQ7eD+ywOGcSV1B0qy6ilJOa6wvJmA= -github.com/sbryzak/api v0.0.0-20231231220256-a15468008bab/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/sbryzak/api v0.0.0-20240122043958-5766c6177c5f h1:Yy4DgctB2UhAtKdCTJlNSs0eOlMlrcOFEaGlO7NGY9E= +github.com/sbryzak/api v0.0.0-20240122043958-5766c6177c5f/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/sbryzak/toolchain-common v0.0.0-20240127001349-e2601d8aaca0 h1:+M6r5HekZ3z5N/v1aZEjlkhwumlZAtvCBZEEEsnV3Tk= +github.com/sbryzak/toolchain-common v0.0.0-20240127001349-e2601d8aaca0/go.mod h1:vuxDx4HKxnb8xJV21OufzRhh/6qNP46stTkn2ni06UY= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= From 500b549980d58148f1521d5789dc4881c4166fff Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 6 Feb 2024 20:43:54 +1000 Subject: [PATCH 5/6] updated dependencies --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 9e51bf74..fb587b0b 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/codeready-toolchain/member-operator require ( - github.com/codeready-toolchain/api v0.0.0-20240103194050-d5c7803671c1 + github.com/codeready-toolchain/api v0.0.0-20240116164228-8d18c9262420 github.com/codeready-toolchain/toolchain-common v0.0.0-20240126111814-12ab087b62d2 github.com/go-logr/logr v1.2.3 github.com/google/go-cmp v0.5.9 @@ -111,6 +111,6 @@ require ( go 1.20 -replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240122043958-5766c6177c5f +replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240204045223-0c2f53dbc8f6 -replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240127001349-e2601d8aaca0 +replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240201055525-d57dc5ee80f5 diff --git a/go.sum b/go.sum index f1ca06e2..6dcdad77 100644 --- a/go.sum +++ b/go.sum @@ -533,10 +533,10 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sbryzak/api v0.0.0-20240122043958-5766c6177c5f h1:Yy4DgctB2UhAtKdCTJlNSs0eOlMlrcOFEaGlO7NGY9E= -github.com/sbryzak/api v0.0.0-20240122043958-5766c6177c5f/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= -github.com/sbryzak/toolchain-common v0.0.0-20240127001349-e2601d8aaca0 h1:+M6r5HekZ3z5N/v1aZEjlkhwumlZAtvCBZEEEsnV3Tk= -github.com/sbryzak/toolchain-common v0.0.0-20240127001349-e2601d8aaca0/go.mod h1:vuxDx4HKxnb8xJV21OufzRhh/6qNP46stTkn2ni06UY= +github.com/sbryzak/api v0.0.0-20240204045223-0c2f53dbc8f6 h1:bRkGN6Jj2M47Nu9q+mCebbwvipnaTkXq+2qM0J9a+bQ= +github.com/sbryzak/api v0.0.0-20240204045223-0c2f53dbc8f6/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/sbryzak/toolchain-common v0.0.0-20240201055525-d57dc5ee80f5 h1:wDSLLwumk1CwMpSp36cKcAft8bxHb7IEovdCxabHHnU= +github.com/sbryzak/toolchain-common v0.0.0-20240201055525-d57dc5ee80f5/go.mod h1:oZhXFgrGmPd77Z3vorZMO2vdAC1FEfXsaXOivs0KG5U= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= From 29042ea7556407f70ac6ecaaea7b548bc2d2799c Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Wed, 7 Feb 2024 10:11:18 +1000 Subject: [PATCH 6/6] updated to latest api and toolchain-common --- go.mod | 8 ++------ go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index fb587b0b..a99699f8 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/codeready-toolchain/member-operator require ( - github.com/codeready-toolchain/api v0.0.0-20240116164228-8d18c9262420 - github.com/codeready-toolchain/toolchain-common v0.0.0-20240126111814-12ab087b62d2 + github.com/codeready-toolchain/api v0.0.0-20240207000013-661b63025269 + github.com/codeready-toolchain/toolchain-common v0.0.0-20240207000544-9cd055b3a18c github.com/go-logr/logr v1.2.3 github.com/google/go-cmp v0.5.9 // using latest commit from 'github.com/openshift/api branch release-4.12' @@ -110,7 +110,3 @@ require ( ) go 1.20 - -replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240204045223-0c2f53dbc8f6 - -replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240201055525-d57dc5ee80f5 diff --git a/go.sum b/go.sum index 6dcdad77..eb03bcbb 100644 --- a/go.sum +++ b/go.sum @@ -134,6 +134,10 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/codeready-toolchain/api v0.0.0-20240207000013-661b63025269 h1:YS5Q6YsTYq9Fo8qA6NQOTWAcVg86VEwulT1UfNWknIQ= +github.com/codeready-toolchain/api v0.0.0-20240207000013-661b63025269/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/codeready-toolchain/toolchain-common v0.0.0-20240207000544-9cd055b3a18c h1:WKjD9qRSLqQsi4XduuXjsaF8qFH4yj157qWdA5wOOtg= +github.com/codeready-toolchain/toolchain-common v0.0.0-20240207000544-9cd055b3a18c/go.mod h1:+COaw79DVTLSb2unqVwcBtYOg6sh7MbMHgXU1/ht2I8= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -533,10 +537,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sbryzak/api v0.0.0-20240204045223-0c2f53dbc8f6 h1:bRkGN6Jj2M47Nu9q+mCebbwvipnaTkXq+2qM0J9a+bQ= -github.com/sbryzak/api v0.0.0-20240204045223-0c2f53dbc8f6/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= -github.com/sbryzak/toolchain-common v0.0.0-20240201055525-d57dc5ee80f5 h1:wDSLLwumk1CwMpSp36cKcAft8bxHb7IEovdCxabHHnU= -github.com/sbryzak/toolchain-common v0.0.0-20240201055525-d57dc5ee80f5/go.mod h1:oZhXFgrGmPd77Z3vorZMO2vdAC1FEfXsaXOivs0KG5U= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=