mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
Requeue ssar check if only hubKubeConfigSecret is unauthorized (#1169)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 39s
Post / coverage (push) Failing after 28s
Post / images (amd64, addon-manager) (push) Failing after 27s
Post / images (amd64, placement) (push) Failing after 29s
Post / images (amd64, registration) (push) Failing after 27s
Post / images (amd64, registration-operator) (push) Failing after 33s
Post / images (amd64, work) (push) Failing after 29s
Post / images (arm64, addon-manager) (push) Failing after 27s
Post / images (arm64, placement) (push) Failing after 26s
Post / images (arm64, registration) (push) Failing after 32s
Post / images (arm64, registration-operator) (push) Failing after 31s
Post / images (arm64, work) (push) Failing after 34s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 50s
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 39s
Post / coverage (push) Failing after 28s
Post / images (amd64, addon-manager) (push) Failing after 27s
Post / images (amd64, placement) (push) Failing after 29s
Post / images (amd64, registration) (push) Failing after 27s
Post / images (amd64, registration-operator) (push) Failing after 33s
Post / images (amd64, work) (push) Failing after 29s
Post / images (arm64, addon-manager) (push) Failing after 27s
Post / images (arm64, placement) (push) Failing after 26s
Post / images (arm64, registration) (push) Failing after 32s
Post / images (arm64, registration-operator) (push) Failing after 31s
Post / images (arm64, work) (push) Failing after 34s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 50s
Signed-off-by: Jian Qiu <jqiu@redhat.com>
This commit is contained in:
@@ -91,6 +91,8 @@ func (l *klusterletLocker) deleteSSARChecking(klusterletName string) {
|
||||
}
|
||||
|
||||
func (c *ssarController) sync(ctx context.Context, controllerContext factory.SyncContext) error {
|
||||
logger := klog.FromContext(ctx)
|
||||
|
||||
klusterletName := controllerContext.QueueKey()
|
||||
if klusterletName == "" {
|
||||
return nil
|
||||
@@ -106,7 +108,7 @@ func (c *ssarController) sync(ctx context.Context, controllerContext factory.Syn
|
||||
|
||||
// if the ssar checking is already processing, requeue it after 30s.
|
||||
if c.inSSARChecking(klusterletName) {
|
||||
klog.V(4).Infof("Reconciling Klusterlet %q is already processing now", klusterletName)
|
||||
logger.V(4).Info("Reconciling Klusterlet is already processing now", "name", klusterletName)
|
||||
controllerContext.Queue().AddAfter(klusterletName, SSARReSyncTime)
|
||||
return nil
|
||||
}
|
||||
@@ -117,7 +119,7 @@ func (c *ssarController) sync(ctx context.Context, controllerContext factory.Syn
|
||||
|
||||
newKlusterlet := klusterlet.DeepCopy()
|
||||
|
||||
klog.V(4).Infof("Checking hub kubeconfig for klusterlet %q", klusterletName)
|
||||
logger.V(4).Info("Checking hub kubeconfig for klusterlet", "name", klusterletName)
|
||||
agentNamespace := helpers.AgentNamespace(klusterlet)
|
||||
|
||||
hubConfigDegradedCondition := checkAgentDegradedCondition(
|
||||
@@ -137,7 +139,7 @@ func (c *ssarController) sync(ctx context.Context, controllerContext factory.Syn
|
||||
meta.SetStatusCondition(&newKlusterlet.Status.Conditions, hubConfigDegradedCondition)
|
||||
_, err := c.patcher.PatchStatus(ctx, newKlusterlet, newKlusterlet.Status, klusterlet.Status)
|
||||
if err != nil {
|
||||
klog.Errorf("Update Klusterlet Status Failed: %v", err)
|
||||
logger.Error(err, "Update Klusterlet Status Failed")
|
||||
controllerContext.Queue().AddAfter(klusterletName, SSARReSyncTime)
|
||||
}
|
||||
|
||||
@@ -172,7 +174,14 @@ func (c *ssarController) sync(ctx context.Context, controllerContext factory.Syn
|
||||
})
|
||||
_, err := c.patcher.PatchStatus(ctx, newKlusterlet, newKlusterlet.Status, klusterlet.Status)
|
||||
if err != nil {
|
||||
klog.Errorf("Update Klusterlet Status Failed: %v", err)
|
||||
logger.Error(err, "Update Klusterlet Status Failed")
|
||||
controllerContext.Queue().AddAfter(klusterletName, SSARReSyncTime)
|
||||
}
|
||||
|
||||
// We need to requeue when only hubKubeConfigSecret is not authorized, since we do not know whether managercluster
|
||||
// is accepted or permission is created.
|
||||
if hubConfigDegradedCondition.Reason == operatorapiv1.ReasonHubKubeConfigUnauthorized &&
|
||||
bootstrapDegradedCondition.Reason == "BootstrapSecretFunctional" {
|
||||
controllerContext.Queue().AddAfter(klusterletName, SSARReSyncTime)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user