Skip to content

Commit beca62f

Browse files
committed
start: Remove workaround to delete apiserver pod in case of aggregator-client-ca regenerated
This workaround was required during OCP-4.3 timeframe and that bug is also fixed so better to remove that workaround also. - https://bugzilla.redhat.com/show_bug.cgi?id=1795163
1 parent e3d5e47 commit beca62f

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

pkg/crc/cluster/cluster.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -432,20 +432,6 @@ func WaitForPullSecretPresentOnInstanceDisk(ctx context.Context, sshRunner *ssh.
432432
return errors.Retry(ctx, 7*time.Minute, pullSecretPresentFunc, 2*time.Second)
433433
}
434434

435-
func WaitForRequestHeaderClientCaFile(ctx context.Context, sshRunner *ssh.Runner) error {
436-
lookupRequestHeaderClientCa := func() error {
437-
expired, err := checkCertValidity(sshRunner, AggregatorClientCert)
438-
if err != nil {
439-
return fmt.Errorf("Failed to the expiry date: %v", err)
440-
}
441-
if expired {
442-
return &errors.RetriableError{Err: fmt.Errorf("certificate still expired")}
443-
}
444-
return nil
445-
}
446-
return errors.Retry(ctx, 8*time.Minute, lookupRequestHeaderClientCa, 2*time.Second)
447-
}
448-
449435
func WaitForAPIServer(ctx context.Context, ocConfig oc.Config) error {
450436
logging.Info("Waiting for kube-apiserver availability... [takes around 2min]")
451437
waitForAPIServer := func() error {
@@ -460,23 +446,6 @@ func WaitForAPIServer(ctx context.Context, ocConfig oc.Config) error {
460446
return errors.Retry(ctx, 4*time.Minute, waitForAPIServer, time.Second)
461447
}
462448

463-
func DeleteOpenshiftAPIServerPods(ctx context.Context, ocConfig oc.Config) error {
464-
if err := WaitForOpenshiftResource(ctx, ocConfig, "pod"); err != nil {
465-
return err
466-
}
467-
468-
deleteOpenshiftAPIServerPods := func() error {
469-
cmdArgs := []string{"delete", "pod", "--all", "--force", "-n", "openshift-apiserver"}
470-
_, stderr, err := ocConfig.WithFailFast().RunOcCommand(cmdArgs...)
471-
if err != nil {
472-
return &errors.RetriableError{Err: fmt.Errorf("Failed to delete pod from openshift-apiserver namespace %v: %s", err, stderr)}
473-
}
474-
return nil
475-
}
476-
477-
return errors.Retry(ctx, 60*time.Second, deleteOpenshiftAPIServerPods, time.Second)
478-
}
479-
480449
func CheckProxySettingsForOperator(ocConfig oc.Config, proxy *httpproxy.ProxyConfig, deployment, namespace string) (bool, error) {
481450
if !proxy.IsEnabled() {
482451
logging.Debugf("No proxy in use")

pkg/crc/machine/start.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -602,29 +602,6 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
602602
}
603603
}
604604

605-
// In Openshift 4.3, when cluster comes up, the following happens
606-
// 1. After the openshift-apiserver pod is started, its log contains multiple occurrences of `certificate has expired or is not yet valid`
607-
// 2. Initially there is no request-header's client-ca crt available to `extension-apiserver-authentication` configmap
608-
// 3. In the pod logs `missing content for CA bundle "client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file"`
609-
// 4. After ~1 min /etc/kubernetes/static-pod-resources/kube-apiserver-certs/configmaps/aggregator-client-ca/ca-bundle.crt is regenerated
610-
// 5. It is now also appear to `extension-apiserver-authentication` configmap as part of request-header's client-ca content
611-
// 6. Openshift-apiserver is able to load the CA which was regenerated
612-
// 7. Now apiserver pod log contains multiple occurrences of `error x509: certificate signed by unknown authority`
613-
// When the openshift-apiserver is in this state, the cluster is non functional.
614-
// A restart of the openshift-apiserver pod is enough to clear that error and get a working cluster.
615-
// This is a work-around while the root cause is being identified.
616-
// More info: https://bugzilla.redhat.com/show_bug.cgi?id=1795163
617-
if certsExpired[cluster.AggregatorClientCert] {
618-
logging.Debug("Waiting for the renewal of the request header client ca...")
619-
if err := cluster.WaitForRequestHeaderClientCaFile(ctx, sshRunner); err != nil {
620-
return nil, errors.Wrap(err, "Failed to wait for aggregator client ca renewal")
621-
}
622-
623-
if err := cluster.DeleteOpenshiftAPIServerPods(ctx, ocConfig); err != nil {
624-
return nil, errors.Wrap(err, "Cannot delete OpenShift API Server pods")
625-
}
626-
}
627-
628605
if err := updateKubeconfig(ctx, ocConfig, sshRunner, vm.bundle.GetKubeConfigPath()); err != nil {
629606
return nil, errors.Wrap(err, "Failed to update kubeconfig file")
630607
}

0 commit comments

Comments
 (0)