Fix harbor SSO test in case of upgrade
What does this MR do and why?
Multiple issues were noticed during Harbor SSO tests (see: #4211 (closed)) within our upgrade pipeline scenarios. I attempted to replicate these behaviors locally and identified several key problems:
- Incorrect resource IDs in ClientScopes/ClientDefaultScopes
These resources do not reference the correct client ID. Instead, they attempt to use outdated ID that have already been deleted. This issue appears from a race condition between the deletion of legacy resources and the recreation of clients managed via Crossplane or because we are using same name for cliendId.
- lastTransitionTime: "2026-06-08T10:37:28Z"
message: 'create failed: async create failed: failed to create the resource: [{0
validation error: client with id 87f5bc69-fb01-4ba1-bf50-931b4589a9b6 does not
exist []}]'
observedGeneration: 3
reason: ReconcileError
status: "False"
type: SyncedapiVersion: legacy.k8s.keycloak.org/v1alpha1
kind: KeycloakClient
metadata:
creationTimestamp: "2026-06-08T09:00:49Z"
finalizers:
- client.cleanup
generation: 2
labels:
kustomize.toolkit.fluxcd.io/name: keycloak-resources
kustomize.toolkit.fluxcd.io/namespace: sylva-system
realm1: sylva
name: harbor-client
namespace: keycloak
resourceVersion: "38741"
uid: fc452801-d7c7-4954-97d7-9e39ae007d29
spec:
client:
clientId: harbor
id: 87f5bc69-fb01-4ba1-bf50-931b4589a9b6<= old id- ClientSecret atribute is empty or not updated
The clientSecret field is often empty or not propagated correctly. Although we manage this via an external secret operator, there are cases where the field remains empty or isn't updated during transitions from legacy to Crossplane solutions.
"oidc_client_id": "harbor",
"oidc_client_secret": "", <= empty
"oidc_scope": "openid,email,profile,offline_access",- After updating the client and obtaining a new token, the application does not automatically reload the updated configuration. Currently, there is no mechanism in place to trigger a reload, which results in outdated settings being used.
The scope of this MR is to provide a solution for each problem presented above:
- Change clientId name to
harbor-clientand in the same time renamed resources related to harbor sso integration in order to avoid misconfiguration. On the other part, similar to the strategy implemented in !7715 (merged), we should enable policy for all crospplane resources. - Reduce the
refreshIntervalin the ExternalSecret configuration to15m. This shorter interval will help to fill the gap between client creation and secret update. - Move creation of external secret under
harbor-oidcunit and keep all the resources related to oidc integration in one place and add addional healthchecks.
Closes #4211 (closed).
Related reference(s)
Test coverage
Upgrade: https://gitlab.com/sylva-projects/sylva-core/-/jobs/14976765791#L137
Fresh install: https://gitlab.com/sylva-projects/sylva-core/-/jobs/14972879263
CI configuration
Below you can choose test deployment variants to run in this MR's CI.
Click to open to CI configuration
Legend:
| Icon | Meaning | Available values |
|---|---|---|
| Infra Provider | capd, capo, capm3 |
|
| Bootstrap Provider | kubeadm (alias kadm), rke2, okd, ck8s |
|
| Node OS | ubuntu, suse, na, leapmicro |
|
| Deployment Options | Deployment option list and description | |
| Pipeline Scenarios | Available scenario list and description | |
| Enabled units | Any available units name, by default apply to management and workload cluster. Can be prefixed by mgmt: or wkld: to be applied only to a specific cluster type |
|
| Disabled units | Any available units name, by default apply to management and workload cluster. Can be prefixed by mgmt: or wkld: to be applied only to a specific cluster type |
|
| Target platform | Can be used to select specific deployment environment Available platform list and description | |
| Pipeline control | autorun, manual or blocking. Can be used to override global config and start a deployment pipeline the required way |
-
🎬 preview☁️ capd🚀 kadm🐧 ubuntu -
🎬 preview☁️ capo🚀 rke2🐧 suse -
🎬 preview☁️ capm3🚀 rke2🐧 ubuntu -
☁️ capd🚀 kadm🛠️ light-deploy🐧 ubuntu -
☁️ capd🚀 rke2🛠️ light-deploy🐧 suse -
☁️ capo🚀 rke2🐧 suse -
☁️ capo🚀 rke2🐧 leapmicro -
☁️ capo🚀 kadm🐧 ubuntu -
☁️ capo🚀 kadm🐧 ubuntu🟢 neuvector,mgmt:harbor -
☁️ capo🚀 rke2🎬 rolling-update🛠️ ha🐧 ubuntu -
☁️ capo🚀 kadm🎬 wkld-k8s-upgrade🐧 ubuntu -
☁️ capo🚀 rke2🎬 rolling-update-no-wkld🛠️ ha🐧 suse -
☁️ capo🚀 rke2🎬 sylva-upgrade🛠️ ha🐧 ubuntu -
☁️ capo🚀 rke2🎬 sylva-upgrade-from-1.6.x🛠️ ha🐧 ubuntu -
☁️ capo🚀 rke2🛠️ ha,misc🐧 ubuntu -
☁️ capo🚀 rke2🛠️ misc🐧 ubuntu🟢 mgmt:harbor🔴 neuvector -
☁️ capo🚀 rke2🛠️ ha,misc,openbao🐧 suse -
☁️ capo🚀 rke2🐧 suse🎬 upgrade-from-prev-tag -
☁️ capm3🚀 rke2🐧 suse -
☁️ capm3🚀 kadm🐧 ubuntu -
☁️ capm3🚀 ck8s🐧 ubuntu -
☁️ capm3🚀 kadm🎬 rolling-update-no-wkld🛠️ ha,misc🐧 ubuntu -
☁️ capm3🚀 rke2🎬 wkld-k8s-upgrade🛠️ ha🐧 suse -
☁️ capm3🚀 kadm🎬 rolling-update🛠️ ha🐧 ubuntu -
☁️ capm3🚀 rke2🎬 upgrade-from-prev-release-branch🛠️ ha🐧 suse -
☁️ capm3🚀 rke2🛠️ misc,ha🐧 suse -
☁️ capm3🚀 rke2🎬 sylva-upgrade🛠️ ha,misc🐧 suse -
☁️ capm3🚀 kadm🎬 rolling-update🛠️ ha🐧 suse -
☁️ capm3🚀 ck8s🎬 rolling-update🛠️ ha🐧 ubuntu -
☁️ capm3🚀 rke2|okd🎬 no-update🐧 ubuntu|na -
☁️ capm3🚀 rke2🐧 suse🎬 upgrade-from-release-1.5 -
☁️ capm3🚀 rke2🐧 suse🎬 upgrade-to-main
Global config for deployment pipelines
- autorun pipelines
- allow failure on pipelines
- record sylvactl events
Notes:
- Enabling
autorunwill make deployment pipelines to be run automatically without human interaction - Disabling
allow failurewill make deployment pipelines mandatory for pipeline success. - if both
autorunandallow failureare disabled, deployment pipelines will need manual triggering but will be blocking the pipeline
Be aware: after configuration change, pipeline is not triggered automatically.
Please run it manually (by clicking the run pipeline button in Pipelines tab) or push new code.