From 7ef1414dc2239400c143ad91f679143524f6260c Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Fri, 29 Dec 2023 21:24:42 +1000 Subject: [PATCH 01/19] regenerated api, temporarily replace API dependency, fixed compile errors --- ...n.dev.openshift.com_masteruserrecords.yaml | 11 ----------- ...olchain.dev.openshift.com_usersignups.yaml | 19 ------------------- .../usersignup/usersignup_controller.go | 3 ++- go.mod | 2 ++ go.sum | 4 ++-- 5 files changed, 6 insertions(+), 33 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml index eb00b64af..521b3d67d 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml @@ -64,11 +64,6 @@ spec: be able to login (but the underlying UserAccounts still exists) "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" @@ -118,12 +113,6 @@ spec: x-kubernetes-list-map-keys: - targetCluster x-kubernetes-list-type: map - userID: - description: UserID is the user ID from RHD Identity Provider token - (“sub” claim) - type: string - required: - - userID type: object status: description: MasterUserRecordStatus defines the observed state of MasterUserRecord diff --git a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml index 5d6b8a7e4..54a78757e 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml @@ -79,15 +79,6 @@ spec: spec: description: UserSignupSpec defines the desired state of UserSignup properties: - company: - description: The user's company name, obtained from the identity provider. - type: string - familyName: - description: The user's last name, obtained from the identity provider. - type: string - givenName: - description: The user's first name, obtained from the identity provider. - type: string identityClaims: description: IdentityClaims contains as-is claim values extracted from the user's access token @@ -145,16 +136,6 @@ spec: description: The cluster in which the user is provisioned in If not set then the target cluster will be picked automatically type: string - userid: - description: The user's user ID, obtained from the identity provider - from the 'sub' (subject) claim - type: string - username: - description: The user's username, obtained from the identity provider. - type: string - required: - - userid - - username type: object status: description: UserSignupStatus defines the observed state of UserSignup diff --git a/controllers/usersignup/usersignup_controller.go b/controllers/usersignup/usersignup_controller.go index d39a05800..850592046 100644 --- a/controllers/usersignup/usersignup_controller.go +++ b/controllers/usersignup/usersignup_controller.go @@ -653,7 +653,8 @@ func (r *Reconciler) provisionMasterUserRecord( // track the MUR creation as an account activation event in Segment if r.SegmentClient != nil { - r.SegmentClient.TrackAccountActivation(compliantUsername, userSignup.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey], userSignup.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey]) + r.SegmentClient.TrackAccountActivation(compliantUsername, userSignup.Spec.IdentityClaims.UserID, + userSignup.Spec.IdentityClaims.AccountID) } else { logger.Info("segment client not configured to track account activations") } diff --git a/go.mod b/go.mod index 0c24fc421..b1b6372f2 100644 --- a/go.mod +++ b/go.mod @@ -114,3 +114,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 d07c64c6c..7c9efcb5e 100644 --- a/go.sum +++ b/go.sum @@ -136,8 +136,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-20231217224957-34f7cb3fcbf7 h1:8Rbzo3EQoQrJakXRKIxcluK0NwHeIWzzG2nDsiKIxsI= -github.com/codeready-toolchain/api v0.0.0-20231217224957-34f7cb3fcbf7/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= github.com/codeready-toolchain/toolchain-common v0.0.0-20231218221155-9d1179b6a349 h1:0xOPCrdPMWZwyyAO/O8U/FAWrp8NR6lvjtkLAXNavG4= github.com/codeready-toolchain/toolchain-common v0.0.0-20231218221155-9d1179b6a349/go.mod h1:cEkJH2jz88KIZt5W8wSnK3Gz6OfszzXv74OIndbTlRE= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -552,6 +550,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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= From d3ca327dc00a8185bb446e15b55d713baf778127 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Fri, 29 Dec 2023 21:33:13 +1000 Subject: [PATCH 02/19] fixed test --- controllers/masteruserrecord/sync_test.go | 9 +-------- test/segment/assertions.go | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/controllers/masteruserrecord/sync_test.go b/controllers/masteruserrecord/sync_test.go index 908137e64..fefa30c93 100644 --- a/controllers/masteruserrecord/sync_test.go +++ b/controllers/masteruserrecord/sync_test.go @@ -101,9 +101,6 @@ func setupSynchronizerItems() (toolchainv1alpha1.MasterUserRecord, toolchainv1al Labels: map[string]string{ toolchainv1alpha1.TierLabelKey: "base1ns", }, - Annotations: map[string]string{ - toolchainv1alpha1.UserEmailAnnotationKey: "foo@bar.com", - }, }, Spec: toolchainv1alpha1.UserAccountSpec{ PropagatedClaims: toolchainv1alpha1.PropagatedClaims{ @@ -113,11 +110,7 @@ func setupSynchronizerItems() (toolchainv1alpha1.MasterUserRecord, toolchainv1al }, } record := toolchainv1alpha1.MasterUserRecord{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - toolchainv1alpha1.UserEmailAnnotationKey: "foo@bar.com", - }, - }, + ObjectMeta: metav1.ObjectMeta{}, Spec: toolchainv1alpha1.MasterUserRecordSpec{ PropagatedClaims: toolchainv1alpha1.PropagatedClaims{ UserID: "foo", diff --git a/test/segment/assertions.go b/test/segment/assertions.go index a34c246dd..5522644e8 100644 --- a/test/segment/assertions.go +++ b/test/segment/assertions.go @@ -12,7 +12,7 @@ import ( ) func AssertMessageQueuedForProvisionedMur(t *testing.T, cl *segment.Client, us *toolchainv1alpha1.UserSignup, murName string) { - assertMessageQueued(t, cl, murName, us.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey], us.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey], "account activated") + assertMessageQueued(t, cl, murName, us.Spec.IdentityClaims.UserID, us.Spec.IdentityClaims.AccountID, "account activated") } func assertMessageQueued(t *testing.T, cl *segment.Client, username, userID, accountID string, event string) { From 0250bf7924f96a12bb585b30dc9d04b798f145cd Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 2 Jan 2024 14:23:37 +1000 Subject: [PATCH 03/19] dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b1b6372f2..92fe81d3e 100644 --- a/go.mod +++ b/go.mod @@ -115,4 +115,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 7c9efcb5e..cb96a73ca 100644 --- a/go.sum +++ b/go.sum @@ -550,8 +550,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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= From 878cfa6c962647a71cfbbd9870e21c8d5ceea4ff Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 2 Jan 2024 14:24:09 +1000 Subject: [PATCH 04/19] regenerated --- .../crd/bases/toolchain.dev.openshift.com_usersignups.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml index 54a78757e..f5787cda5 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml @@ -120,11 +120,6 @@ spec: - preferredUsername - sub type: object - 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 states: description: States contains a number of values that reflect the desired state of the UserSignup. From 8ddfa399048a0f099a040ce5e95c5ccc8765594e Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Sat, 6 Jan 2024 20:02:04 +1000 Subject: [PATCH 05/19] dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 92fe81d3e..9b9d21e68 100644 --- a/go.mod +++ b/go.mod @@ -115,4 +115,4 @@ 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-20240102042357-82134b76d69e diff --git a/go.sum b/go.sum index cb96a73ca..642e940a6 100644 --- a/go.sum +++ b/go.sum @@ -550,8 +550,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-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-20240102042357-82134b76d69e h1:1p4jHPdkwSARcFuJw2o2uQgfZExsm84kuzr+fb9wCLg= +github.com/sbryzak/api v0.0.0-20240102042357-82134b76d69e/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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= From 6d340b79a76f8fdd20ef3d060f4124bf82c40cd0 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 9 Jan 2024 05:53:57 +1000 Subject: [PATCH 06/19] regenerated --- ...toolchain.dev.openshift.com_masteruserrecords.yaml | 2 +- .../toolchain.dev.openshift.com_toolchainconfigs.yaml | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml index 521b3d67d..be5c395fa 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml @@ -24,7 +24,7 @@ spec: - jsonPath: .status.conditions[?(@.type=="Ready")].reason name: Reason type: string - - jsonPath: .spec.userAccounts[].targetCluster + - jsonPath: .status.userAccounts[].cluster.name name: Cluster type: string - jsonPath: .spec.tierName diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index 8dc9da3de..5952c8a12 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -200,11 +200,11 @@ spec: properties: authClientConfigContentType: description: AuthClientConfigContentType specifies the - auth config config content type + auth config content type type: string authClientConfigRaw: description: AuthClientConfigRaw specifies the URL used - to a access the registration service + to access the registration service type: string authClientLibraryURL: description: AuthClientLibraryURL specifies the auth library @@ -214,6 +214,13 @@ spec: description: AuthClientPublicKeysURL specifies the public keys URL type: string + ssoBaseURL: + description: SSOBaseURL specifies the SSO base URL such + as https://sso.redhat.com + type: string + ssoRealm: + description: SSORealm specifies the SSO realm name + type: string type: object environment: description: Environment specifies the environment such as From c649f682f87cea10d1391d29b02f9ccefcf4c036 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Fri, 12 Jan 2024 09:45:59 +1000 Subject: [PATCH 07/19] replaced toolchain-common --- go.mod | 2 ++ go.sum | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5394c8cc3..5a44b2b74 100644 --- a/go.mod +++ b/go.mod @@ -116,3 +116,5 @@ require ( go 1.20 replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240102042357-82134b76d69e + +replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240107055000-3d9023112235 diff --git a/go.sum b/go.sum index c9f1dfc12..4c32e8158 100644 --- a/go.sum +++ b/go.sum @@ -136,8 +136,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-20231218221155-9d1179b6a349 h1:0xOPCrdPMWZwyyAO/O8U/FAWrp8NR6lvjtkLAXNavG4= -github.com/codeready-toolchain/toolchain-common v0.0.0-20231218221155-9d1179b6a349/go.mod h1:cEkJH2jz88KIZt5W8wSnK3Gz6OfszzXv74OIndbTlRE= 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= @@ -552,6 +550,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sbryzak/api v0.0.0-20240102042357-82134b76d69e h1:1p4jHPdkwSARcFuJw2o2uQgfZExsm84kuzr+fb9wCLg= github.com/sbryzak/api v0.0.0-20240102042357-82134b76d69e/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/sbryzak/toolchain-common v0.0.0-20240107055000-3d9023112235 h1:VRdgqqhAy55aJqzfzonjs+KyPeZuiijcsaRd6VYGIyk= +github.com/sbryzak/toolchain-common v0.0.0-20240107055000-3d9023112235/go.mod h1:s76M4eSzRUx7cL/Mvch2gx0fb5jTW+xYqFlfX+aSuME= 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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= From 3cef1123cd1818fbbaffdaca101f6c28d61d4268 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 23 Jan 2024 20:50:17 +1000 Subject: [PATCH 08/19] fixed tests, removed migration code --- .../usersignup/usersignup_controller.go | 48 ----------------- .../usersignup/usersignup_controller_test.go | 54 ------------------- 2 files changed, 102 deletions(-) diff --git a/controllers/usersignup/usersignup_controller.go b/controllers/usersignup/usersignup_controller.go index 142461020..0e691a08a 100644 --- a/controllers/usersignup/usersignup_controller.go +++ b/controllers/usersignup/usersignup_controller.go @@ -111,20 +111,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl. return reconcile.Result{}, nil } - // TODO remove this section (and the referenced function) after migration has completed - // FROM HERE --------- - migrated, err := r.migrateUserSignupClaimsIfNecessary(ctx, userSignup) - if err != nil { - // Error during migration - requeue the request - return reconcile.Result{}, err - } - - if migrated { - // If migration occurred, then queue the UserSignup for reconciliation again - return reconcile.Result{Requeue: true}, nil - } - // TO HERE ^^^^^^^^^^^^ - if userSignup.GetLabels() == nil { userSignup.Labels = make(map[string]string) } @@ -204,40 +190,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl. return reconcile.Result{}, r.ensureNewMurIfApproved(ctx, config, userSignup) } -// migrateUserSignupClaimsIfNecessary is a temporary function that will set the UserSignup's IdentityClaims based on the -// existing property values -func (r *Reconciler) migrateUserSignupClaimsIfNecessary(ctx context.Context, userSignup *toolchainv1alpha1.UserSignup) (bool, error) { - - if userSignup.Spec.IdentityClaims.Sub == "" { - userSignup.Spec.IdentityClaims.Sub = userSignup.Spec.Userid - userSignup.Spec.IdentityClaims.FamilyName = userSignup.Spec.FamilyName - userSignup.Spec.IdentityClaims.GivenName = userSignup.Spec.GivenName - userSignup.Spec.IdentityClaims.OriginalSub = userSignup.Spec.OriginalSub - userSignup.Spec.IdentityClaims.PreferredUsername = userSignup.Spec.Username - userSignup.Spec.IdentityClaims.Company = userSignup.Spec.Company - - if val, ok := userSignup.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey]; ok { - userSignup.Spec.IdentityClaims.UserID = val - } - - if val, ok := userSignup.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey]; ok { - userSignup.Spec.IdentityClaims.AccountID = val - } - - if val, ok := userSignup.Annotations[toolchainv1alpha1.UserSignupUserEmailAnnotationKey]; ok { - userSignup.Spec.IdentityClaims.Email = val - } - - if err := r.Client.Update(ctx, userSignup); err != nil { - return false, err - } - - return true, nil - } - - return false, nil -} - // handleDeactivatedUserSignup defines the workflow for deactivated users // // If there is no MasterUserRecord created, yet the UserSignup is marked as Deactivated, set the status, diff --git a/controllers/usersignup/usersignup_controller_test.go b/controllers/usersignup/usersignup_controller_test.go index d3fe9f40a..b38f5d361 100644 --- a/controllers/usersignup/usersignup_controller_test.go +++ b/controllers/usersignup/usersignup_controller_test.go @@ -58,60 +58,6 @@ var event = testsocialevent.NewSocialEvent(test.HostOperatorNs, commonsocialeven testsocialevent.WithUserTier(deactivate80Tier.Name), testsocialevent.WithSpaceTier(base2NSTemplateTier.Name)) -func TestUserSignupMigration(t *testing.T) { - member := NewMemberClusterWithTenantRole(t, "member1", corev1.ConditionTrue) - - userSignup := commonsignup.NewUserSignup( - commonsignup.ApprovedManually()) - - // Clear the identity claims - userSignup.Spec.IdentityClaims = toolchainv1alpha1.IdentityClaimsEmbedded{} - - // Set some other properties - userSignup.Spec.GivenName = "John" - userSignup.Spec.FamilyName = "Smith" - userSignup.Spec.Company = "Acme" - userSignup.Spec.OriginalSub = uuid.Must(uuid.NewV4()).String() - - userSignup.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey] = "123456" - userSignup.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey] = "999988" - - // First reconcile so that we can check that an error is returned if the client update fails - r, req, fakeClient := prepareReconcile(t, userSignup.Name, NewGetMemberClusters(member), userSignup, baseNSTemplateTier) - fakeClient.MockUpdate = func(ctx context.Context, obj runtimeclient.Object, opts ...runtimeclient.UpdateOption) error { - return fmt.Errorf("some error") - } - - // Reconcile and confirm we get an error - _, err := r.Reconcile(context.TODO(), req) - require.Error(t, err) - - // Reconcile so that the migration can occur - r, req, _ = prepareReconcile(t, userSignup.Name, NewGetMemberClusters(member), userSignup, baseNSTemplateTier) - res, err := r.Reconcile(context.TODO(), req) - - // then - require.NoError(t, err) - - // Confirm requeue - require.True(t, res.Requeue) - - // Reload the UserSignup - reloaded := &toolchainv1alpha1.UserSignup{} - err = r.Client.Get(context.TODO(), types.NamespacedName{Name: userSignup.Name, Namespace: req.Namespace}, reloaded) - require.NoError(t, err) - - // Confirm the migration - require.Equal(t, userSignup.Spec.Username, reloaded.Spec.IdentityClaims.PreferredUsername) - require.Equal(t, userSignup.Spec.Company, reloaded.Spec.IdentityClaims.Company) - require.Equal(t, userSignup.Spec.FamilyName, reloaded.Spec.IdentityClaims.FamilyName) - require.Equal(t, userSignup.Spec.GivenName, reloaded.Spec.IdentityClaims.GivenName) - require.Equal(t, userSignup.Spec.Userid, reloaded.Spec.IdentityClaims.Sub) - require.Equal(t, userSignup.Spec.OriginalSub, reloaded.Spec.IdentityClaims.OriginalSub) - require.Equal(t, userSignup.Annotations[toolchainv1alpha1.SSOUserIDAnnotationKey], reloaded.Spec.IdentityClaims.UserID) - require.Equal(t, userSignup.Annotations[toolchainv1alpha1.SSOAccountIDAnnotationKey], reloaded.Spec.IdentityClaims.AccountID) -} - func TestUserSignupCreateMUROk(t *testing.T) { member := NewMemberClusterWithTenantRole(t, "member1", corev1.ConditionTrue) logf.SetLogger(zap.New(zap.UseDevMode(true))) From c38a4bd6213bf5d60185a86f32d90f6cf4774aeb Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Sat, 27 Jan 2024 10:16:55 +1000 Subject: [PATCH 09/19] update toolchain-common dependency --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 5a44b2b74..3b613a4cd 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/codeready-toolchain/host-operator require ( - github.com/codeready-toolchain/api v0.0.0-20231217224957-34f7cb3fcbf7 + github.com/codeready-toolchain/api v0.0.0-20240103194050-d5c7803671c1 github.com/codeready-toolchain/toolchain-common v0.0.0-20231218221155-9d1179b6a349 github.com/davecgh/go-spew v1.1.1 // indirect github.com/ghodss/yaml v1.0.0 @@ -115,6 +115,6 @@ require ( go 1.20 -replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240102042357-82134b76d69e +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-20240107055000-3d9023112235 +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 4c32e8158..dbac682f5 100644 --- a/go.sum +++ b/go.sum @@ -548,10 +548,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-20240102042357-82134b76d69e h1:1p4jHPdkwSARcFuJw2o2uQgfZExsm84kuzr+fb9wCLg= -github.com/sbryzak/api v0.0.0-20240102042357-82134b76d69e/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= -github.com/sbryzak/toolchain-common v0.0.0-20240107055000-3d9023112235 h1:VRdgqqhAy55aJqzfzonjs+KyPeZuiijcsaRd6VYGIyk= -github.com/sbryzak/toolchain-common v0.0.0-20240107055000-3d9023112235/go.mod h1:s76M4eSzRUx7cL/Mvch2gx0fb5jTW+xYqFlfX+aSuME= +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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= From 7456cb15394a50a58d40fa0ac4e64df03a78c2a5 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Wed, 31 Jan 2024 15:43:13 +1000 Subject: [PATCH 10/19] dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4423d489d..ed9e4593c 100644 --- a/go.mod +++ b/go.mod @@ -115,6 +115,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-20240129201259-6f21cc1f6f48 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 dbac682f5..8030d268c 100644 --- a/go.sum +++ b/go.sum @@ -548,8 +548,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-20240122043958-5766c6177c5f h1:Yy4DgctB2UhAtKdCTJlNSs0eOlMlrcOFEaGlO7NGY9E= -github.com/sbryzak/api v0.0.0-20240122043958-5766c6177c5f/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/sbryzak/api v0.0.0-20240129201259-6f21cc1f6f48 h1:+rBh367F0wNcfNrp7Z7gGcoRM+nPfjAiu6RkvojvPk0= +github.com/sbryzak/api v0.0.0-20240129201259-6f21cc1f6f48/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= From 0236eda9591687c30bb26c73aa10d0235185030a Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Sun, 4 Feb 2024 14:53:04 +1000 Subject: [PATCH 11/19] updated dependences --- .../manifests/bases/host-operator.clusterserviceversion.yaml | 3 ++- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/manifests/bases/host-operator.clusterserviceversion.yaml b/config/manifests/bases/host-operator.clusterserviceversion.yaml index 1f3c8d6eb..9cc04dbb9 100644 --- a/config/manifests/bases/host-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/host-operator.clusterserviceversion.yaml @@ -96,7 +96,8 @@ spec: kind: SpaceBindingRequest name: spacebindingrequests.toolchain.dev.openshift.com version: v1alpha1 - - description: SpaceProvisionerConfig contains configuration for provisioning spaces to clusters + - description: SpaceProvisionerConfig contains configuration for provisioning + spaces to clusters displayName: SpaceProvisionerConfig kind: SpaceProvisionerConfig name: spaceprovisionerconfigs.toolchain.dev.openshift.com diff --git a/go.mod b/go.mod index ed9e4593c..90700520b 100644 --- a/go.mod +++ b/go.mod @@ -115,6 +115,6 @@ require ( go 1.20 -replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240129201259-6f21cc1f6f48 +replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240131054331-2fd5fe48d69e 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 8030d268c..6d5b40d2a 100644 --- a/go.sum +++ b/go.sum @@ -548,8 +548,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-20240129201259-6f21cc1f6f48 h1:+rBh367F0wNcfNrp7Z7gGcoRM+nPfjAiu6RkvojvPk0= -github.com/sbryzak/api v0.0.0-20240129201259-6f21cc1f6f48/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/sbryzak/api v0.0.0-20240131054331-2fd5fe48d69e h1:KFtfY3vwtRWyJYcpYUXieKtbFB7wepm/cOCpJneI2ew= +github.com/sbryzak/api v0.0.0-20240131054331-2fd5fe48d69e/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= From 13cecd4299396d194271ed951859a69f8d349e81 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Sun, 4 Feb 2024 14:53:56 +1000 Subject: [PATCH 12/19] regenerated api --- .../bases/toolchain.dev.openshift.com_usersignups.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml index f5787cda5..475e6094c 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml @@ -16,18 +16,18 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .spec.username + - jsonPath: .spec.identityClaims.preferredUsername name: Username type: string - - jsonPath: .spec.givenName + - jsonPath: .spec.identityClaims.givenName name: First Name priority: 1 type: string - - jsonPath: .spec.familyName + - jsonPath: .spec.identityClaims.familyName name: Last Name priority: 1 type: string - - jsonPath: .spec.company + - jsonPath: .spec.identityClaims.company name: Company priority: 1 type: string From 96660f84e239cfc9064d0901f1b9be6ce9c5b302 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Wed, 7 Feb 2024 10:08:34 +1000 Subject: [PATCH 13/19] 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 f8dd78f2d..1e6716b6d 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/codeready-toolchain/host-operator require ( - github.com/codeready-toolchain/api v0.0.0-20240116164228-8d18c9262420 - github.com/codeready-toolchain/toolchain-common v0.0.0-20240130202956-94befa4c786c + github.com/codeready-toolchain/api v0.0.0-20240207000013-661b63025269 + github.com/codeready-toolchain/toolchain-common v0.0.0-20240207000544-9cd055b3a18c github.com/davecgh/go-spew v1.1.1 // indirect github.com/ghodss/yaml v1.0.0 github.com/go-bindata/go-bindata v3.1.2+incompatible @@ -114,7 +114,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 14b6db9b6..122e6bb4f 100644 --- a/go.sum +++ b/go.sum @@ -136,6 +136,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= @@ -548,10 +552,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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= From dcd49dc34a2c94ec6c246a8d3dec9da0a1691976 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 27 Feb 2024 08:47:11 +1000 Subject: [PATCH 14/19] regenerated from API - made UserSignup.Spec.IdentityClaims required --- config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml | 2 +- deploy/registration-service/registration-service.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml index 475e6094c..2a3320cf9 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml @@ -56,7 +56,7 @@ spec: - jsonPath: .status.compliantUsername name: CompliantUsername type: string - - jsonPath: .metadata.annotations.toolchain\.dev\.openshift\.com/user-email + - jsonPath: .spec.identityClaims.email name: Email type: string name: v1alpha1 diff --git a/deploy/registration-service/registration-service.yaml b/deploy/registration-service/registration-service.yaml index 16a6869c0..f6cf8c3a8 100644 --- a/deploy/registration-service/registration-service.yaml +++ b/deploy/registration-service/registration-service.yaml @@ -114,7 +114,7 @@ objects: successThreshold: 1 timeoutSeconds: 1 readinessProbe: - failureThreshold: 30 + failureThreshold: 1 httpGet: path: /api/v1/health port: 8080 From f7d1f937fc791232713ca648a5a07caf24ab1abd Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 27 Feb 2024 08:57:05 +1000 Subject: [PATCH 15/19] temp replace toolchain-common --- go.mod | 2 ++ go.sum | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 1e6716b6d..dd6798eb6 100644 --- a/go.mod +++ b/go.mod @@ -114,3 +114,5 @@ require ( ) go 1.20 + +replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46 diff --git a/go.sum b/go.sum index 122e6bb4f..8be4a7bfd 100644 --- a/go.sum +++ b/go.sum @@ -138,8 +138,6 @@ github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoC 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= @@ -552,6 +550,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/toolchain-common v0.0.0-20240226225508-645591b9ca46 h1:+4CMrqx/TKp09e/pBve1Fp726q1ze7z+x23wNuIFG00= +github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46/go.mod h1:3XRWQdAFnbx2VVYIdN8Q7IKfc2C3HCyTIWOtSW5WyNI= 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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= From 694d23c17c5627b44266da5273266c8e162413e2 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 27 Feb 2024 11:43:26 +1000 Subject: [PATCH 16/19] updated dependencies --- go.mod | 2 ++ go.sum | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index dd6798eb6..0c3c0aebb 100644 --- a/go.mod +++ b/go.mod @@ -115,4 +115,6 @@ require ( go 1.20 +replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240226224654-d481e7f73040 + replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46 diff --git a/go.sum b/go.sum index 8be4a7bfd..e33062025 100644 --- a/go.sum +++ b/go.sum @@ -136,8 +136,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-20240207000013-661b63025269 h1:YS5Q6YsTYq9Fo8qA6NQOTWAcVg86VEwulT1UfNWknIQ= -github.com/codeready-toolchain/api v0.0.0-20240207000013-661b63025269/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= 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= @@ -550,6 +548,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-20240226224654-d481e7f73040 h1:elMaPyokrwazrqSN/1ah99S7HQcusWY5fFBwWje/s4k= +github.com/sbryzak/api v0.0.0-20240226224654-d481e7f73040/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46 h1:+4CMrqx/TKp09e/pBve1Fp726q1ze7z+x23wNuIFG00= github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46/go.mod h1:3XRWQdAFnbx2VVYIdN8Q7IKfc2C3HCyTIWOtSW5WyNI= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= From cfec3921b7ad54ac8be632f69c80689fec6433ee Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 27 Feb 2024 11:55:07 +1000 Subject: [PATCH 17/19] regenerated --- config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml index 2a3320cf9..f656976c8 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml @@ -131,6 +131,8 @@ spec: description: The cluster in which the user is provisioned in If not set then the target cluster will be picked automatically type: string + required: + - identityClaims type: object status: description: UserSignupStatus defines the observed state of UserSignup From 68caf077c0db5fae348a63fc21f7f579ecfc43a0 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Tue, 27 Feb 2024 11:59:20 +1000 Subject: [PATCH 18/19] merged --- config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml index 184b8aa1b..f656976c8 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml @@ -131,11 +131,8 @@ spec: description: The cluster in which the user is provisioned in If not set then the target cluster will be picked automatically type: string -<<<<<<< HEAD required: - identityClaims -======= ->>>>>>> origin/master type: object status: description: UserSignupStatus defines the observed state of UserSignup From 625ca366edf17ad8d2b62f4bf908c97646634dd5 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Wed, 28 Feb 2024 07:22:47 +1000 Subject: [PATCH 19/19] remove replaced dependencies, update to latest versions --- go.mod | 8 ++------ go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 7d6ba6fcb..0694a1e8b 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/codeready-toolchain/host-operator require ( - github.com/codeready-toolchain/api v0.0.0-20240207000013-661b63025269 - github.com/codeready-toolchain/toolchain-common v0.0.0-20240216093005-a7f4a3ea7fb9 + github.com/codeready-toolchain/api v0.0.0-20240227210924-371ddb054d87 + github.com/codeready-toolchain/toolchain-common v0.0.0-20240227212148-b32711b41532 github.com/davecgh/go-spew v1.1.1 // indirect github.com/ghodss/yaml v1.0.0 github.com/go-bindata/go-bindata v3.1.2+incompatible @@ -114,7 +114,3 @@ require ( ) go 1.20 - -replace github.com/codeready-toolchain/api => github.com/sbryzak/api v0.0.0-20240226224654-d481e7f73040 - -replace github.com/codeready-toolchain/toolchain-common => github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46 diff --git a/go.sum b/go.sum index e33062025..d02a8fd0d 100644 --- a/go.sum +++ b/go.sum @@ -136,6 +136,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-20240227210924-371ddb054d87 h1:eQLsrMqfjAzGfuO9t6pVxO4K6cUDKOMxEvl0ujQq/2I= +github.com/codeready-toolchain/api v0.0.0-20240227210924-371ddb054d87/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= +github.com/codeready-toolchain/toolchain-common v0.0.0-20240227212148-b32711b41532 h1:mfTiDF9af5hmc23AR1DreoCcyLTeAJKhYbFPyd7f/+Q= +github.com/codeready-toolchain/toolchain-common v0.0.0-20240227212148-b32711b41532/go.mod h1:nA1+TOD7zDS6spCBTaIZ63B/KyysR66fJI3DUT86kKE= 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= @@ -548,10 +552,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-20240226224654-d481e7f73040 h1:elMaPyokrwazrqSN/1ah99S7HQcusWY5fFBwWje/s4k= -github.com/sbryzak/api v0.0.0-20240226224654-d481e7f73040/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc= -github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46 h1:+4CMrqx/TKp09e/pBve1Fp726q1ze7z+x23wNuIFG00= -github.com/sbryzak/toolchain-common v0.0.0-20240226225508-645591b9ca46/go.mod h1:3XRWQdAFnbx2VVYIdN8Q7IKfc2C3HCyTIWOtSW5WyNI= 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/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg=