From f2ede049576c214b2281c71fc954da566c82729d Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Wed, 22 Nov 2023 22:50:25 +0530 Subject: [PATCH] Dropping the unused parameters (#925) * Dropping the unused parameters Signed-off-by: Feny Mehta * Removing the unrelated changes in CRD Signed-off-by: Feny Mehta * Update the api version and mur controller Signed-off-by: Feny Mehta * Removing the replace Signed-off-by: Feny Mehta * Updating the APi and toolchain-common dependencies Signed-off-by: Feny Mehta --------- Signed-off-by: Feny Mehta Co-authored-by: Francisc Munteanu Co-authored-by: Matous Jobanek --- ...n.dev.openshift.com_masteruserrecords.yaml | 12 ----------- controllers/masteruserrecord/sync.go | 6 ------ controllers/masteruserrecord/sync_test.go | 20 ++++--------------- go.mod | 4 ++-- go.sum | 8 ++++---- 5 files changed, 10 insertions(+), 40 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml index baf13616d..eb00b64af 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml @@ -176,23 +176,11 @@ spec: cluster: description: Cluster is the cluster in which the user exists properties: - apiEndpoint: - description: APIEndpoint is the API Endpoint of the cluster - type: string - cheDashboardURL: - description: CheDashboardURL is the Che Dashboard URL of - the cluster if Che is installed - type: string - consoleURL: - description: ConsoleURL is the web console URL of the cluster - type: string name: description: Name is the name of the corresponding ToolchainCluster resource type: string required: - - apiEndpoint - - consoleURL - name type: object conditions: diff --git a/controllers/masteruserrecord/sync.go b/controllers/masteruserrecord/sync.go index 8b267e119..52067daf0 100644 --- a/controllers/masteruserrecord/sync.go +++ b/controllers/masteruserrecord/sync.go @@ -151,10 +151,6 @@ func (s *Synchronizer) withClusterDetails(ctx context.Context, status toolchainv return status, errs.Wrapf(err, "unable to read ToolchainStatus resource") } - if status.Cluster.APIEndpoint == "" { - status.Cluster.APIEndpoint = s.memberCluster.APIEndpoint - } - for _, memberStatus := range toolchainStatus.Status.Members { if memberStatus.ClusterName == status.Cluster.Name { if memberStatus.MemberStatus.Routes == nil { @@ -164,8 +160,6 @@ func (s *Synchronizer) withClusterDetails(ctx context.Context, status toolchainv ready, _ := condition.FindConditionByType(memberStatus.MemberStatus.Routes.Conditions, toolchainv1alpha1.ConditionReady) return status, fmt.Errorf("routes are not properly set in ToolchainStatus - the reason is: `%s` with message: `%s`", ready.Reason, ready.Message) } - status.Cluster.ConsoleURL = memberStatus.MemberStatus.Routes.ConsoleURL - status.Cluster.CheDashboardURL = memberStatus.MemberStatus.Routes.CheDashboardURL return status, nil } } diff --git a/controllers/masteruserrecord/sync_test.go b/controllers/masteruserrecord/sync_test.go index 2a85bed4a..2b6bb4e34 100644 --- a/controllers/masteruserrecord/sync_test.go +++ b/controllers/masteruserrecord/sync_test.go @@ -928,10 +928,7 @@ func TestRoutes(t *testing.T) { HasConditions(condition) murtest.AssertThatMasterUserRecord(t, "john", hostClient). AllUserAccountsHaveCluster(toolchainv1alpha1.Cluster{ - Name: test.MemberClusterName, - APIEndpoint: "https://api.member-cluster:6433", - ConsoleURL: "https://console.member-cluster/", - CheDashboardURL: "https://che-toolchain-che.member-cluster/", + Name: test.MemberClusterName, }). AllUserAccountsHaveCondition(condition) }) @@ -962,10 +959,7 @@ func TestRoutes(t *testing.T) { HasConditions(condition) murtest.AssertThatMasterUserRecord(t, "john", hostClient). AllUserAccountsHaveCluster(toolchainv1alpha1.Cluster{ - Name: test.MemberClusterName, - APIEndpoint: "https://api.member-cluster:6433", - ConsoleURL: "https://console.member-cluster/", - CheDashboardURL: "", + Name: test.MemberClusterName, }). AllUserAccountsHaveCondition(condition) }) @@ -996,10 +990,7 @@ func TestRoutes(t *testing.T) { HasConditions(condition) murtest.AssertThatMasterUserRecord(t, "john", hostClient). AllUserAccountsHaveCluster(toolchainv1alpha1.Cluster{ - Name: test.MemberClusterName, - APIEndpoint: "https://api.member-cluster:6433", - ConsoleURL: "", - CheDashboardURL: "", + Name: test.MemberClusterName, }). AllUserAccountsHaveCondition(condition) }) @@ -1033,10 +1024,7 @@ func verifySyncMurStatusWithUserAccountStatus(t *testing.T, memberClient, hostCl HasConditions(expMurCon...). HasStatusUserAccounts(test.MemberClusterName). AllUserAccountsHaveCluster(toolchainv1alpha1.Cluster{ - Name: test.MemberClusterName, - APIEndpoint: "https://api.member-cluster:6433", - ConsoleURL: "https://console.member-cluster/", - CheDashboardURL: "http://che-toolchain-che.member-cluster/", + Name: test.MemberClusterName, }). AllUserAccountsHaveCondition(userAccountCondition) } diff --git a/go.mod b/go.mod index cd1c35644..4b9836063 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-20231107202930-b028ae440a26 - github.com/codeready-toolchain/toolchain-common v0.0.0-20231117145902-3e7430ae48bb + github.com/codeready-toolchain/api v0.0.0-20231122125952-9e6527f5e746 + github.com/codeready-toolchain/toolchain-common v0.0.0-20231122135421-3933b292cbb6 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 diff --git a/go.sum b/go.sum index 43f42a34a..ac70f14ef 100644 --- a/go.sum +++ b/go.sum @@ -136,10 +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-20231107202930-b028ae440a26 h1:7l/9jcykzh/Qq93EnPYQYpaejPkWaaHB6BLCwTKngJE= -github.com/codeready-toolchain/api v0.0.0-20231107202930-b028ae440a26/go.mod h1:bImSKnxrpNmCmW/YEGiiZnZqJm3kAmfP5hW4YndK0hE= -github.com/codeready-toolchain/toolchain-common v0.0.0-20231117145902-3e7430ae48bb h1:TVgy4tO2oy2YwWTZXXYytY9soshylURDzmdkY6ch1+o= -github.com/codeready-toolchain/toolchain-common v0.0.0-20231117145902-3e7430ae48bb/go.mod h1:fmMAvkwt/OfANx8l/BDbuaHkjInlRJ3uYmIjjVmjd9w= +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= 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=