Skip to content

Commit

Permalink
remove add-cluster references (#82)
Browse files Browse the repository at this point in the history
* remove add-cluster references
---------
Co-authored-by: Alexey Kazakov <[email protected]>
  • Loading branch information
mfrancisc authored Sep 25, 2024
1 parent a120896 commit 520d4a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 2 additions & 3 deletions pkg/cmd/adm/register_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func NewRegisterMemberCmd() *cobra.Command {
commandArgs := registerMemberArgs{}
cmd := &cobra.Command{
Use: "register-member",
Short: "Executes add-cluster.sh script",
Long: `Downloads the 'add-cluster.sh' script from the 'toolchain-cicd' repo and calls it twice: once to register the Host cluster in the Member cluster and once to register the Member cluster in the host cluster.`,
Short: "Registers a member cluster in the host cluster and vice versa.",
Long: `Registers the Host cluster in the Member cluster and then registers the Member cluster in the host cluster by creating toolchaincluster resources in the host and member namespaces.`,
RunE: func(cmd *cobra.Command, args []string) error {
term := ioutils.NewTerminal(cmd.InOrStdin, cmd.OutOrStdout)
ctx := newExtendedCommandContext(term, client.DefaultNewClientFromRestConfig)
Expand Down Expand Up @@ -408,7 +408,6 @@ func validateArgs(ctx *extendedCommandContext, args registerMemberArgs) (*regist
}

// figure out the name that will be given to our new ToolchainCluster representing the member in the host cluster.
// This is the same name that the add-cluster.sh script will deduce and use.
membersInHost, err := getToolchainClustersWithHostname(ctx, hostClusterClient, memberApiEndpoint, args.hostNamespace)
if err != nil {
return nil, err
Expand Down
5 changes: 0 additions & 5 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ func Contains(slice []string, value string) bool {
// The `suffix` must be non-empty if there are multiple ToolchainCluster objects pointing to the same cluster. This
// needs to be determined by the caller prior to calling this method.
func GetToolchainClusterName(clusterType, serverAPIEndpoint, suffix string) (string, error) {
// NOTE: this function is ported from the original add-cluster.sh script to produce the same names during the transition
// period to the new operator-based approach to the member registration.
// Since add-cluster.sh was a bash script with a long history, the logic is a bit convoluted at places (especially in
// handling the numerical suffix).

// we need to make sure that:
// 1) the name is at most 63 characters long
// 2) the variable part is (a part of) the cluster hostname
Expand Down

0 comments on commit 520d4a3

Please sign in to comment.