Skip to content

Commit 386aa3a

Browse files
committed
remove code to reassign new cluster id
this is done by a systemd service in the bundle so the code on crc can be removed
1 parent ea59159 commit 386aa3a

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

pkg/crc/cluster/cluster.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
crctls "github.com/crc-org/crc/v2/pkg/crc/tls"
2323
"github.com/crc-org/crc/v2/pkg/crc/validation"
2424
crcstrings "github.com/crc-org/crc/v2/pkg/strings"
25-
"github.com/pborman/uuid"
2625
)
2726

2827
// #nosec G101
@@ -320,32 +319,6 @@ func RemoveOldRenderedMachineConfig(ocConfig oc.Config) error {
320319
return nil
321320
}
322321

323-
func EnsureClusterIDIsNotEmpty(ctx context.Context, ocConfig oc.Config) error {
324-
if err := WaitForOpenshiftResource(ctx, ocConfig, "clusterversion"); err != nil {
325-
return err
326-
}
327-
328-
stdout, stderr, err := ocConfig.RunOcCommand("get", "clusterversion", "version", "-o", `jsonpath="{['spec']['clusterID']}"`)
329-
if err != nil {
330-
return fmt.Errorf("Failed to get clusterversion %v: %s", err, stderr)
331-
}
332-
if strings.TrimSpace(stdout) != "" {
333-
return nil
334-
}
335-
336-
logging.Info("Updating cluster ID...")
337-
clusterID := uuid.New()
338-
cmdArgs := []string{"patch", "clusterversion", "version", "-p",
339-
fmt.Sprintf(`'{"spec":{"clusterID":"%s"}}'`, clusterID), "--type", "merge"}
340-
341-
_, stderr, err = ocConfig.RunOcCommand(cmdArgs...)
342-
if err != nil {
343-
return fmt.Errorf("Failed to update cluster ID %v: %s", err, stderr)
344-
}
345-
346-
return nil
347-
}
348-
349322
func AddProxyConfigToCluster(ctx context.Context, sshRunner *ssh.Runner, ocConfig oc.Config, proxy *httpproxy.ProxyConfig) error {
350323
type trustedCA struct {
351324
Name string `json:"name"`

pkg/crc/machine/start.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
557557
return nil, errors.Wrap(err, "Failed to update kubeadmin user password")
558558
}
559559

560-
if err := cluster.EnsureClusterIDIsNotEmpty(ctx, ocConfig); err != nil {
561-
return nil, errors.Wrap(err, "Failed to update cluster ID")
562-
}
563-
564560
if client.monitoringEnabled() {
565561
logging.Info("Enabling cluster monitoring operator...")
566562
if err := cluster.StartMonitoring(ocConfig); err != nil {

0 commit comments

Comments
 (0)