Skip to content

Commit

Permalink
rename bootstrap sa name and remove 'delete token' cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiwei Yin <[email protected]>
  • Loading branch information
zhiweiyin318 committed Jan 16, 2025
1 parent 4081bde commit c2ef824
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 198 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
open-cluster-management.io/api v0.15.1-0.20250109024121-1a5e25a78a43
open-cluster-management.io/cluster-proxy v0.4.0
open-cluster-management.io/managed-serviceaccount v0.6.0
open-cluster-management.io/ocm v0.15.1-0.20250110031959-11896ccda197
open-cluster-management.io/ocm v0.15.1-0.20250116024415-19fb9243ca2b
open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f
sigs.k8s.io/apiserver-network-proxy v0.29.0
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ open-cluster-management.io/cluster-proxy v0.4.0 h1:rm0UDaDWe3/P3xLzwqdHtqNksKwSz
open-cluster-management.io/cluster-proxy v0.4.0/go.mod h1:gTvfDHAhGezhdg4BD3ECBn6jbg2Y5PbHhV2ceW5nrB0=
open-cluster-management.io/managed-serviceaccount v0.6.0 h1:qIi5T9WQJBuoGqnYGIktXbtqfQoiN2H9XU2P/6lAQiw=
open-cluster-management.io/managed-serviceaccount v0.6.0/go.mod h1:G4LUTbZiyrB8c0+rqi/xnDmGlsg7Rdr4T7MPLCWhyQI=
open-cluster-management.io/ocm v0.15.1-0.20250110031959-11896ccda197 h1:ECwQuYbtUxDbKUKHfnmQYwLG2cV3i7OwsU4dJP/XrDg=
open-cluster-management.io/ocm v0.15.1-0.20250110031959-11896ccda197/go.mod h1:daPkqFxkVqKb4O8UTX+7jCyEcJWarGOG7uDie9rFfck=
open-cluster-management.io/ocm v0.15.1-0.20250116024415-19fb9243ca2b h1:zA4fOnKpgsjImN/Qc1JcwyumwYALmS7EUl9KT0lRUwk=
open-cluster-management.io/ocm v0.15.1-0.20250116024415-19fb9243ca2b/go.mod h1:daPkqFxkVqKb4O8UTX+7jCyEcJWarGOG7uDie9rFfck=
open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f h1:zeC7QrFNarfK2zY6jGtd+mX+yDrQQmnH/J8A7n5Nh38=
open-cluster-management.io/sdk-go v0.15.1-0.20241125015855-1536c3970f8f/go.mod h1:fi5WBsbC5K3txKb8eRLuP0Sim/Oqz/PHX18skAEyjiA=
oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo=
Expand Down
2 changes: 0 additions & 2 deletions pkg/cmd/delete/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericiooptions"
"open-cluster-management.io/clusteradm/pkg/cmd/delete/clusterset"
"open-cluster-management.io/clusteradm/pkg/cmd/delete/token"
"open-cluster-management.io/clusteradm/pkg/cmd/delete/work"
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions"
)
Expand All @@ -17,7 +16,6 @@ func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, stream
Short: "delete a resource",
}

cmd.AddCommand(token.NewCmd(clusteradmFlags, streams))
cmd.AddCommand(work.NewCmd(clusteradmFlags, streams))
cmd.AddCommand(clusterset.NewCmd(clusteradmFlags, streams))

Expand Down
47 changes: 0 additions & 47 deletions pkg/cmd/delete/token/cmd.go

This file was deleted.

91 changes: 0 additions & 91 deletions pkg/cmd/delete/token/exec.go

This file was deleted.

19 changes: 0 additions & 19 deletions pkg/cmd/delete/token/options.go

This file was deleted.

21 changes: 9 additions & 12 deletions pkg/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
package config

const (
OpenClusterManagementNamespace = "open-cluster-management"
BootstrapSAName = "cluster-bootstrap"
BootstrapClusterRoleBindingName = "cluster-bootstrap"
BootstrapClusterRoleBindingSAName = "cluster-bootstrap-sa"
BootstrapClusterRoleName = "system:open-cluster-management:bootstrap"
ClusterManagerName = "cluster-manager"
LabelApp = "app"
BootstrapSecretPrefix = "bootstrap-token-"
HubClusterNamespace = "open-cluster-management-hub"
ManagedClusterNamespace = "open-cluster-management-agent"
ManagedProxyConfigurationName = "cluster-proxy"
ImagePullSecret = "open-cluster-management-image-pull-credentials"
OpenClusterManagementNamespace = "open-cluster-management"
BootstrapSAName = "agent-registration-bootstrap"
ClusterManagerName = "cluster-manager"
LabelApp = "app"
BootstrapSecretPrefix = "bootstrap-token-"
HubClusterNamespace = "open-cluster-management-hub"
ManagedClusterNamespace = "open-cluster-management-agent"
ManagedProxyConfigurationName = "cluster-proxy"
ImagePullSecret = "open-cluster-management-image-pull-credentials"
)
6 changes: 0 additions & 6 deletions test/e2e/clusteradm/joinhubscenario_bootstrsptoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ var _ = ginkgo.Describe("test clusteradm with bootstrap token", func() {

originalToken = e2e.CommandResult().RawCommand()

ginkgo.By("delete token")
err = e2e.Clusteradm().Delete(
"token",
)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm delete token error")

ginkgo.By("get token from hub")
err = e2e.Clusteradm().Get(
"token",
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/clusteradm/joinhubscenario_sa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ var _ = ginkgo.Describe("test clusteradm with service account", func() {

originalToken = e2e.CommandResult().RawCommand()

ginkgo.By("delete token")
err = e2e.Clusteradm().Delete(
"token",
)
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "clusteradm delete token error")

ginkgo.By("get token from hub")
err = e2e.Clusteradm().Get(
"token",
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versio
open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned/scheme
open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned/typed/authentication/v1alpha1
open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned/typed/authentication/v1beta1
# open-cluster-management.io/ocm v0.15.1-0.20250110031959-11896ccda197
# open-cluster-management.io/ocm v0.15.1-0.20250116024415-19fb9243ca2b
## explicit; go 1.22.5
open-cluster-management.io/ocm/deploy/cluster-manager/chart
open-cluster-management.io/ocm/deploy/klusterlet/chart
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c2ef824

Please sign in to comment.