Fix flux SSO test in upgrade scenario

What does this MR do and why?

We have observed recurring issue during Flux SSO tests (see #4210 (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:25:27Z"
    message: 'create failed: async create failed: failed to create the resource: [{0
      validation error: client with id 37a53106-16ea-401c-9cba-bd059d253f84 does not
      exist  []}]'
    observedGeneration: 3
    reason: ReconcileError
    status: "False"
    type: Synced
apiVersion: 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: flux-webui-client
  namespace: keycloak
  resourceVersion: "38729"
  uid: 597d67b4-cfdb-4c0b-9096-11069b29f9c7
spec:
  client:
    clientId: flux-webui
    id: 37a53106-16ea-401c-9cba-bd059d253f84 <= 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.

apiVersion: v1
data:
  clientSecret: "" <=empty
  issuerURL: aHR0cHM6Ly9rZXljbG9hay5zeWx2YS9yZWFsbXMvc3lsdmE=
  redirectURL: aHR0cHM6Ly9mbHV4LnN5bHZhL29hdXRoMi9jYWxsYmFjaw==
kind: Secret
metadata:
  name: oidc-auth
  namespace: flux-system
  • 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 flux-webui-client in order to avoid misconfiguration. On the other part, similar to the strategy implemented in !7715 (merged) (merged), we should enable policy for all crospplane resources.
  • Reduce the refreshInterval in the ExternalSecret configuration to 15m. This shorter interval will help to fill the gap between client creation and secret update.
  • Add additional values (annotations) into flux-webui chart, in this way we could be sure that the pods will be recreated and reload the secrets related to sso integration.

Closes #4210 (closed).

Test coverage

SSO test results:

Fresh install: https://gitlab.com/sylva-projects/sylva-core/-/jobs/15000598706

Upgrade: https://gitlab.com/sylva-projects/sylva-core/-/jobs/15000598765

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 autorun will make deployment pipelines to be run automatically without human interaction
  • Disabling allow failure will make deployment pipelines mandatory for pipeline success.
  • if both autorun and allow failure are 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.

Edited by Thomas Morin

Merge request reports

Loading