From 12936ac9f37067b499bf3deb40220f0e79e05b5d Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Wed, 15 Jan 2025 12:36:35 +0530 Subject: [PATCH 1/5] remove code resizing partition for the ocp preset the required `growpart` and `xfs_growfs` commands are run as a systemd service which is part of the self-sufficient bundle for microshift preset this is handled by crc like before --- pkg/crc/machine/start.go | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/pkg/crc/machine/start.go b/pkg/crc/machine/start.go index d5f54801da..6441657ddc 100644 --- a/pkg/crc/machine/start.go +++ b/pkg/crc/machine/start.go @@ -38,7 +38,6 @@ import ( libmachinestate "github.com/crc-org/machine/libmachine/state" "github.com/docker/go-units" "github.com/pkg/errors" - "golang.org/x/crypto/ssh" ) const minimumMemoryForMonitoring = strongunits.MiB(14336) @@ -117,35 +116,20 @@ func growRootFileSystem(sshRunner *crcssh.Runner, preset crcPreset.Preset, persi return err } - // with '/dev/[sv]da4' as input, run 'growpart /dev/[sv]da 4' - if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Growing %s partition", rootPart), "/usr/bin/growpart", rootPart[:len("/dev/.da")], rootPart[len("/dev/.da"):]); err != nil { - var exitErr *ssh.ExitError - if !errors.As(err, &exitErr) { + if preset == crcPreset.Microshift { + lvFullName := "rhel/root" + if err := growLVForMicroshift(sshRunner, lvFullName, rootPart, persistentVolumeSize); err != nil { return err } - if exitErr.ExitStatus() != 1 { + logging.Infof("Resizing %s filesystem", rootPart) + rootFS := "/sysroot" + if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Remounting %s read/write", rootFS), "mount -o remount,rw", rootFS); err != nil { return err } - logging.Debugf("No free space after %s, nothing to do", rootPart) - return nil - } - - if preset == crcPreset.Microshift { - lvFullName := "rhel/root" - if err := growLVForMicroshift(sshRunner, lvFullName, rootPart, persistentVolumeSize); err != nil { + if _, _, err = sshRunner.RunPrivileged(fmt.Sprintf("Growing %s filesystem", rootFS), "xfs_growfs", rootFS); err != nil { return err } } - - logging.Infof("Resizing %s filesystem", rootPart) - rootFS := "/sysroot" - if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Remounting %s read/write", rootFS), "mount -o remount,rw", rootFS); err != nil { - return err - } - if _, _, err = sshRunner.RunPrivileged(fmt.Sprintf("Growing %s filesystem", rootFS), "xfs_growfs", rootFS); err != nil { - return err - } - return nil } @@ -429,11 +413,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) return nil, errors.Wrap(err, "Error updating public key") } - // Trigger disk resize, this will be a no-op if no disk size change is needed - if err := growRootFileSystem(sshRunner, startConfig.Preset, startConfig.PersistentVolumeSize); err != nil { - return nil, errors.Wrap(err, "Error updating filesystem size") - } - // Start network time synchronization if `CRC_DEBUG_ENABLE_STOP_NTP` is not set if stopNtp, _ := strconv.ParseBool(os.Getenv("CRC_DEBUG_ENABLE_STOP_NTP")); stopNtp { logging.Info("Stopping network time synchronization in CRC VM") From 30acf83e0239b68eb91d8933deb10848b4497376 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Wed, 15 Jan 2025 12:46:41 +0530 Subject: [PATCH 2/5] remove code creating the dnsmasq config in the crc vm since the dnsmasq config is added by a systemd service in the self-sufficient bundle we can remove the code from crc --- pkg/crc/services/dns/dns.go | 23 ----------- pkg/crc/services/dns/template.go | 65 -------------------------------- 2 files changed, 88 deletions(-) delete mode 100644 pkg/crc/services/dns/template.go diff --git a/pkg/crc/services/dns/dns.go b/pkg/crc/services/dns/dns.go index 91c80db06b..c4f4dc4263 100644 --- a/pkg/crc/services/dns/dns.go +++ b/pkg/crc/services/dns/dns.go @@ -14,8 +14,6 @@ import ( "github.com/crc-org/crc/v2/pkg/crc/network" "github.com/crc-org/crc/v2/pkg/crc/network/httpproxy" "github.com/crc-org/crc/v2/pkg/crc/services" - "github.com/crc-org/crc/v2/pkg/crc/systemd" - "github.com/crc-org/crc/v2/pkg/crc/systemd/states" ) const ( @@ -28,10 +26,6 @@ func init() { } func RunPostStart(serviceConfig services.ServicePostStartConfig) error { - if err := setupDnsmasq(serviceConfig); err != nil { - return err - } - if err := runPostStartForOS(serviceConfig); err != nil { return err } @@ -44,23 +38,6 @@ func RunPostStart(serviceConfig services.ServicePostStartConfig) error { return network.UpdateResolvFileOnInstance(serviceConfig.SSHRunner, resolvFileValues) } -func setupDnsmasq(serviceConfig services.ServicePostStartConfig) error { - if serviceConfig.NetworkMode == network.UserNetworkingMode { - return nil - } - - if err := createDnsmasqDNSConfig(serviceConfig); err != nil { - return err - } - sd := systemd.NewInstanceSystemdCommander(serviceConfig.SSHRunner) - if state, err := sd.Status(dnsmasqService); err != nil || state != states.Running { - if err := sd.Enable(dnsmasqService); err != nil { - return err - } - } - return sd.Start(dnsmasqService) -} - func getResolvFileValues(serviceConfig services.ServicePostStartConfig) (network.ResolvFileValues, error) { dnsServers, err := dnsServers(serviceConfig) if err != nil { diff --git a/pkg/crc/services/dns/template.go b/pkg/crc/services/dns/template.go deleted file mode 100644 index 8db3824fd6..0000000000 --- a/pkg/crc/services/dns/template.go +++ /dev/null @@ -1,65 +0,0 @@ -package dns - -import ( - "bytes" - "text/template" - - "github.com/crc-org/crc/v2/pkg/crc/services" -) - -const ( - dnsmasqConfTemplate = `listen-address={{ .IP }} -expand-hosts -log-queries -local=/{{ .ClusterName}}.{{ .BaseDomain }}/ -domain={{ .ClusterName}}.{{ .BaseDomain }} -address=/{{ .AppsDomain }}/{{ .IP }} -address=/api.{{ .ClusterName}}.{{ .BaseDomain }}/{{ .IP }} -address=/api-int.{{ .ClusterName}}.{{ .BaseDomain }}/{{ .IP }} -address=/{{ .Hostname }}.{{ .ClusterName}}.{{ .BaseDomain }}/{{ .InternalIP }} -` -) - -type dnsmasqConfFileValues struct { - BaseDomain string - Port int - ClusterName string - Hostname string - IP string - AppsDomain string - InternalIP string -} - -func createDnsmasqDNSConfig(serviceConfig services.ServicePostStartConfig) error { - domain := serviceConfig.BundleMetadata.ClusterInfo.BaseDomain - - dnsmasqConfFileValues := dnsmasqConfFileValues{ - BaseDomain: domain, - Hostname: serviceConfig.BundleMetadata.Nodes[0].Hostname, - AppsDomain: serviceConfig.BundleMetadata.ClusterInfo.AppsDomain, - ClusterName: serviceConfig.BundleMetadata.ClusterInfo.ClusterName, - IP: serviceConfig.IP, - InternalIP: serviceConfig.BundleMetadata.Nodes[0].InternalIP, - } - - dnsConfig, err := createDNSConfigFile(dnsmasqConfFileValues, dnsmasqConfTemplate) - if err != nil { - return err - } - - return serviceConfig.SSHRunner.CopyDataPrivileged([]byte(dnsConfig), "/etc/dnsmasq.d/crc-dnsmasq.conf", 0644) -} - -func createDNSConfigFile(values dnsmasqConfFileValues, tmpl string) (string, error) { - var dnsConfigFile bytes.Buffer - - t, err := template.New("dnsConfigFile").Parse(tmpl) - if err != nil { - return "", err - } - err = t.Execute(&dnsConfigFile, values) - if err != nil { - return "", err - } - return dnsConfigFile.String(), nil -} From 885cec85f93a5688cbdc2677660ce334563f63c0 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Wed, 15 Jan 2025 13:08:05 +0530 Subject: [PATCH 3/5] remove helper to start the routes controller pod this is done via a systemd service on the bundle which automatically starts the routes controller pod after the cluster is started --- pkg/crc/machine/start.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/pkg/crc/machine/start.go b/pkg/crc/machine/start.go index 6441657ddc..093ad4d7ee 100644 --- a/pkg/crc/machine/start.go +++ b/pkg/crc/machine/start.go @@ -500,11 +500,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) return nil, err } - if client.useVSock() { - if err := ensureRoutesControllerIsRunning(sshRunner, ocConfig); err != nil { - return nil, err - } - } logging.Info("Adding microshift context to kubeconfig...") if err := mergeKubeConfigFile(constants.KubeconfigFilePath); err != nil { return nil, err @@ -568,12 +563,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) return nil, errors.Wrap(err, "Failed to update cluster ID") } - if client.useVSock() { - if err := ensureRoutesControllerIsRunning(sshRunner, ocConfig); err != nil { - return nil, err - } - } - if client.monitoringEnabled() { logging.Info("Enabling cluster monitoring operator...") if err := cluster.StartMonitoring(ocConfig); err != nil { @@ -810,17 +799,6 @@ func logBundleDate(crcBundleMetadata *bundle.CrcBundleInfo) { } } -func ensureRoutesControllerIsRunning(sshRunner *crcssh.Runner, ocConfig oc.Config) error { - // Check if the bundle have `/opt/crc/routes-controller.yaml` file and if it has - // then use it to create the resource for the routes controller. - _, _, err := sshRunner.Run("ls", "/opt/crc/routes-controller.yaml") - if err != nil { - return err - } - _, _, err = ocConfig.RunOcCommand("apply", "-f", "/opt/crc/routes-controller.yaml") - return err -} - func updateKubeconfig(ctx context.Context, ocConfig oc.Config, sshRunner *crcssh.Runner, kubeconfigFilePath string) error { selfSignedCAKey, selfSignedCACert, err := crctls.GetSelfSignedCA() if err != nil { From aedf6d46fdb8016bbaef84dc185f46afe4048e85 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Wed, 15 Jan 2025 13:12:51 +0530 Subject: [PATCH 4/5] 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 --- pkg/crc/cluster/cluster.go | 27 --------------------------- pkg/crc/machine/start.go | 4 ---- 2 files changed, 31 deletions(-) diff --git a/pkg/crc/cluster/cluster.go b/pkg/crc/cluster/cluster.go index 2d72ac4446..725cdcddd4 100644 --- a/pkg/crc/cluster/cluster.go +++ b/pkg/crc/cluster/cluster.go @@ -26,7 +26,6 @@ import ( crctls "github.com/crc-org/crc/v2/pkg/crc/tls" "github.com/crc-org/crc/v2/pkg/crc/validation" crcstrings "github.com/crc-org/crc/v2/pkg/strings" - "github.com/pborman/uuid" ) // #nosec G101 @@ -324,32 +323,6 @@ func RemoveOldRenderedMachineConfig(ocConfig oc.Config) error { return nil } -func EnsureClusterIDIsNotEmpty(ctx context.Context, ocConfig oc.Config) error { - if err := WaitForOpenshiftResource(ctx, ocConfig, "clusterversion"); err != nil { - return err - } - - stdout, stderr, err := ocConfig.RunOcCommand("get", "clusterversion", "version", "-o", `jsonpath="{['spec']['clusterID']}"`) - if err != nil { - return fmt.Errorf("Failed to get clusterversion %v: %s", err, stderr) - } - if strings.TrimSpace(stdout) != "" { - return nil - } - - logging.Info("Updating cluster ID...") - clusterID := uuid.New() - cmdArgs := []string{"patch", "clusterversion", "version", "-p", - fmt.Sprintf(`'{"spec":{"clusterID":"%s"}}'`, clusterID), "--type", "merge"} - - _, stderr, err = ocConfig.RunOcCommand(cmdArgs...) - if err != nil { - return fmt.Errorf("Failed to update cluster ID %v: %s", err, stderr) - } - - return nil -} - func AddProxyConfigToCluster(ctx context.Context, sshRunner *ssh.Runner, ocConfig oc.Config, proxy *httpproxy.ProxyConfig) error { type trustedCA struct { Name string `json:"name"` diff --git a/pkg/crc/machine/start.go b/pkg/crc/machine/start.go index 093ad4d7ee..b8aa012e0d 100644 --- a/pkg/crc/machine/start.go +++ b/pkg/crc/machine/start.go @@ -559,10 +559,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) return nil, errors.Wrap(err, "Failed to update kubeadmin user password") } - if err := cluster.EnsureClusterIDIsNotEmpty(ctx, ocConfig); err != nil { - return nil, errors.Wrap(err, "Failed to update cluster ID") - } - if client.monitoringEnabled() { logging.Info("Enabling cluster monitoring operator...") if err := cluster.StartMonitoring(ocConfig); err != nil { From a7dfae76023a5fa8116339cdaec4c5b62ba76eae Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Wed, 15 Jan 2025 12:51:06 +0530 Subject: [PATCH 5/5] Copy dependencies of systemd units copy pull secret file into the VM this removes code adding the pull-secret to the cluster using `oc`, instead it copies the pull secret file to /opt/crc/crc-pullsecret which is then used by a systemd service in the bundle to add the pull secret to the cluster for both the openshift and microshift presets Update cluster user passwords via systemd this copies the generated kubeadmin and developer user passwords to `/opt/crc/` which is then used by a systemd service and modifies the needed ocp resources Use systemd to add the root CA for API server access this removes the code patching the configmap admin-kubeconfig-client-ca to use the custom CA, instead it copies the generated CA to '/opt/crc/' which is then used by a systemd service to created the required secret and updates the configmap --- pkg/crc/cluster/cluster.go | 44 ++--------------------- pkg/crc/cluster/kubeadmin_password.go | 33 +++-------------- pkg/crc/machine/start.go | 51 +++++++++++++++++++++------ release-info.json-e | 12 +++++++ 4 files changed, 60 insertions(+), 80 deletions(-) create mode 100644 release-info.json-e diff --git a/pkg/crc/cluster/cluster.go b/pkg/crc/cluster/cluster.go index 725cdcddd4..0f667eb496 100644 --- a/pkg/crc/cluster/cluster.go +++ b/pkg/crc/cluster/cluster.go @@ -3,7 +3,6 @@ package cluster import ( "context" "crypto/x509" - "encoding/base64" "encoding/json" "fmt" "math" @@ -183,40 +182,6 @@ func EnsureSSHKeyPresentInTheCluster(ctx context.Context, ocConfig oc.Config, ss return nil } -func EnsurePullSecretPresentInTheCluster(ctx context.Context, ocConfig oc.Config, pullSec PullSecretLoader) error { - if err := WaitForOpenshiftResource(ctx, ocConfig, "secret"); err != nil { - return err - } - - stdout, stderr, err := ocConfig.RunOcCommandPrivate("get", "secret", "pull-secret", "-n", "openshift-config", "-o", `jsonpath="{['data']['\.dockerconfigjson']}"`) - if err != nil { - return fmt.Errorf("Failed to get pull secret %v: %s", err, stderr) - } - decoded, err := base64.StdEncoding.DecodeString(stdout) - if err != nil { - return err - } - if err := validation.ImagePullSecret(string(decoded)); err == nil { - return nil - } - - logging.Info("Adding user's pull secret to the cluster...") - content, err := pullSec.Value() - if err != nil { - return err - } - base64OfPullSec := base64.StdEncoding.EncodeToString([]byte(content)) - cmdArgs := []string{"patch", "secret", "pull-secret", "-p", - fmt.Sprintf(`'{"data":{".dockerconfigjson":"%s"}}'`, base64OfPullSec), - "-n", "openshift-config", "--type", "merge"} - - _, stderr, err = ocConfig.RunOcCommandPrivate(cmdArgs...) - if err != nil { - return fmt.Errorf("Failed to add Pull secret %v: %s", err, stderr) - } - return nil -} - func EnsureGeneratedClientCAPresentInTheCluster(ctx context.Context, ocConfig oc.Config, sshRunner *ssh.Runner, selfSignedCACert *x509.Certificate, adminCert string) error { selfSignedCAPem := crctls.CertToPem(selfSignedCACert) if err := WaitForOpenshiftResource(ctx, ocConfig, "configmaps"); err != nil { @@ -236,13 +201,10 @@ func EnsureGeneratedClientCAPresentInTheCluster(ctx context.Context, ocConfig oc } logging.Info("Updating root CA cert to admin-kubeconfig-client-ca configmap...") - jsonPath := fmt.Sprintf(`'{"data": {"ca-bundle.crt": %q}}'`, selfSignedCAPem) - cmdArgs := []string{"patch", "configmap", "admin-kubeconfig-client-ca", - "-n", "openshift-config", "--patch", jsonPath} - _, stderr, err = ocConfig.RunOcCommand(cmdArgs...) - if err != nil { - return fmt.Errorf("Failed to patch admin-kubeconfig-client-ca config map with new CA` %v: %s", err, stderr) + if err := sshRunner.CopyDataPrivileged(selfSignedCAPem, "/opt/crc/custom-ca.crt", 0644); err != nil { + return fmt.Errorf("Failed to copy generated CA file to VM: %v", err) } + if err := sshRunner.CopyFile(constants.KubeconfigFilePath, ocConfig.KubeconfigPath, 0644); err != nil { return fmt.Errorf("Failed to copy generated kubeconfig file to VM: %v", err) } diff --git a/pkg/crc/cluster/kubeadmin_password.go b/pkg/crc/cluster/kubeadmin_password.go index f8beb9fb13..1fcf5f79ba 100644 --- a/pkg/crc/cluster/kubeadmin_password.go +++ b/pkg/crc/cluster/kubeadmin_password.go @@ -13,7 +13,7 @@ import ( "github.com/crc-org/crc/v2/pkg/crc/constants" "github.com/crc-org/crc/v2/pkg/crc/logging" - "github.com/crc-org/crc/v2/pkg/crc/oc" + "github.com/crc-org/crc/v2/pkg/crc/ssh" "golang.org/x/crypto/bcrypt" ) @@ -29,7 +29,7 @@ func GenerateKubeAdminUserPassword() error { } // UpdateKubeAdminUserPassword updates the htpasswd secret -func UpdateKubeAdminUserPassword(ctx context.Context, ocConfig oc.Config, newPassword string) error { +func UpdateKubeAdminUserPassword(ctx context.Context, sshRunner *ssh.Runner, newPassword string) error { if newPassword != "" { logging.Infof("Overriding password for kubeadmin user") if err := os.WriteFile(constants.GetKubeAdminPasswordPath(), []byte(strings.TrimSpace(newPassword)), 0600); err != nil { @@ -41,39 +41,14 @@ func UpdateKubeAdminUserPassword(ctx context.Context, ocConfig oc.Config, newPas if err != nil { return fmt.Errorf("Cannot read the kubeadmin user password from file: %w", err) } - credentials := map[string]string{ - "developer": "developer", - "kubeadmin": kubeAdminPassword, - } - if err := WaitForOpenshiftResource(ctx, ocConfig, "secret"); err != nil { + if err := sshRunner.CopyDataPrivileged([]byte(kubeAdminPassword), "/opt/crc/pass_kubeadmin", 0600); err != nil { return err } - given, stderr, err := ocConfig.RunOcCommandPrivate("get", "secret", "htpass-secret", "-n", "openshift-config", "-o", `jsonpath="{.data.htpasswd}"`) - if err != nil { - return fmt.Errorf("%s:%v", stderr, err) - } - ok, externals, err := compareHtpasswd(given, credentials) - if err != nil { + if err := sshRunner.CopyDataPrivileged([]byte("developer"), "/opt/crc/pass_developer", 0600); err != nil { return err } - if ok { - return nil - } - - logging.Infof("Changing the password for the kubeadmin user") - expected, err := getHtpasswd(credentials, externals) - if err != nil { - return err - } - cmdArgs := []string{"patch", "secret", "htpass-secret", "-p", - fmt.Sprintf(`'{"data":{"htpasswd":"%s"}}'`, expected), - "-n", "openshift-config", "--type", "merge"} - _, stderr, err = ocConfig.RunOcCommandPrivate(cmdArgs...) - if err != nil { - return fmt.Errorf("Failed to update kubeadmin password %v: %s", err, stderr) - } return nil } diff --git a/pkg/crc/machine/start.go b/pkg/crc/machine/start.go index b8aa012e0d..afb6603b0a 100644 --- a/pkg/crc/machine/start.go +++ b/pkg/crc/machine/start.go @@ -277,8 +277,10 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) if err := validation.BundleMismatchWithPresetMetadata(startConfig.Preset, crcBundleMetadata); err != nil { return nil, err } + var firstBoot bool if !exists { + firstBoot = true telemetry.SetStartType(ctx, telemetry.CreationStartType) // Ask early for pull secret if it hasn't been requested yet @@ -315,6 +317,7 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) return nil, errors.Wrap(err, "Error creating machine") } } else { + firstBoot = false telemetry.SetStartType(ctx, telemetry.StartStartType) } @@ -426,6 +429,35 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) } } + // setup the env file for units to detect the network-mode either user or systemd + // refactor into a helper `setSystemdEnvFileValues` + if client.useVSock() { + envs := "CRC_NETWORK_MODE_USER=1" + "\n" + + "CRC_DEBUG_TEST=1" + "\n" + + if err := sshRunner.CopyDataPrivileged([]byte(envs), "/etc/systemd/system/crc-env", 0644); err != nil { + return nil, errors.Wrap(err, "Unable to create the env file for CRC") + } + } else { + envs := "CRC_NETWORK_MODE_USER=0" + "\n" + + "CRC_DEBUG_TEST=1" + "\n" + + if err := sshRunner.CopyDataPrivileged([]byte(envs), "/etc/systemd/system/crc-env", 0644); err != nil { + return nil, errors.Wrap(err, "Unable to create the env file for CRC") + } + } + + // copy the pull secret into /opt/crc/pull-secret in the instance + if firstBoot { + pullSecret, err := startConfig.PullSecret.Value() + if err != nil { + return nil, err + } + if err := sshRunner.CopyDataPrivileged([]byte(pullSecret), "/opt/crc/pull-secret", 0600); err != nil { + return nil, errors.Wrap(err, "Unable to send pull-secret to instance") + } + } + // Add nameserver to VM if provided by User if startConfig.NameServer != "" { if err = addNameServerToInstance(sshRunner, startConfig.NameServer); err != nil { @@ -511,6 +543,11 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) }, nil } + // Send the kubeadmin and developer new passwords to the VM + if err := cluster.UpdateKubeAdminUserPassword(ctx, sshRunner, startConfig.KubeAdminPassword); err != nil { + return nil, errors.Wrap(err, "Failed to update kubeadmin user password") + } + // Check the certs validity inside the vm logging.Info("Verifying validity of the kubelet certificates...") certsExpired, err := cluster.CheckCertsValidity(sshRunner) @@ -543,10 +580,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) return nil, err } - if err := cluster.EnsurePullSecretPresentInTheCluster(ctx, ocConfig, startConfig.PullSecret); err != nil { - return nil, errors.Wrap(err, "Failed to update cluster pull secret") - } - if err := cluster.EnsureSSHKeyPresentInTheCluster(ctx, ocConfig, constants.GetPublicKeyPath()); err != nil { return nil, errors.Wrap(err, "Failed to update ssh public key to machine config") } @@ -555,10 +588,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) return nil, errors.Wrap(err, "Failed to update pull secret on the disk") } - if err := cluster.UpdateKubeAdminUserPassword(ctx, ocConfig, startConfig.KubeAdminPassword); err != nil { - return nil, errors.Wrap(err, "Failed to update kubeadmin user password") - } - if client.monitoringEnabled() { logging.Info("Enabling cluster monitoring operator...") if err := cluster.StartMonitoring(ocConfig); err != nil { @@ -566,8 +595,10 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig) } } - if err := updateKubeconfig(ctx, ocConfig, sshRunner, vm.bundle.GetKubeConfigPath()); err != nil { - return nil, errors.Wrap(err, "Failed to update kubeconfig file") + if firstBoot { + if err := updateKubeconfig(ctx, ocConfig, sshRunner, vm.bundle.GetKubeConfigPath()); err != nil { + return nil, errors.Wrap(err, "Failed to update kubeconfig file") + } } logging.Infof("Starting %s instance... [waiting for the cluster to stabilize]", startConfig.Preset) diff --git a/release-info.json-e b/release-info.json-e new file mode 100644 index 0000000000..5f35a35950 --- /dev/null +++ b/release-info.json-e @@ -0,0 +1,12 @@ +{ + "version": { + "crcVersion": "2.45.0", + "gitSha": "7d6313", + "openshiftVersion": "@OPENSHIFT_VERSION@" + }, + "links": { + "linux": "https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.45.0/crc-linux-amd64.tar.xz", + "darwin": "https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.45.0/crc-macos-installer.pkg", + "windows": "https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.45.0/crc-windows-installer.zip" + } +}