argocd-operator icon indicating copy to clipboard operation
argocd-operator copied to clipboard

fix: verify DeploymentConfig API when installing keycloak using Template

Open chetan-rns opened this issue 9 months ago • 2 comments

What type of PR is this?

/kind bug

What does this PR do / why we need it:

Users have the option to disable DeploymentConfig API on their OCP clusters. In such cases, the operator shouldn't watch the DeploymentConfig APIs and shouldn't install Keycloak using Template.

https://docs.openshift.com/container-platform/4.14/installing/cluster-capabilities.html#deployment-config-capability_cluster-capabilities

Have you updated the necessary documentation?

  • [ ] Documentation update is required by this PR.
  • [ ] Documentation has been updated.

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/GITOPS-4489

How to test changes / Special notes to the reviewer:

chetan-rns avatar May 02 '24 06:05 chetan-rns

@jgwest That's a valid concern. I agree that the Operator should prefer the official image for Keycloak on OCP clusters. I've updated the PR to log and return an error if the user selects Keycloak but the DeploymentConfig API is absent. I also had to check if the Template API is present to ensure it is an OCP cluster. This should prevent new users from installing the unofficial image.

As a long-term solution, we should update the Template to use Deployment instead.

chetan-rns avatar May 07 '24 11:05 chetan-rns

@jgwest @iam-veeramalla This PR might be redundant if we plan to move away from Templates. Until then we can accept this as a temporary solution so users don't see errors when the DeploymentConfig is disabled. WDYT?

chetan-rns avatar May 09 '24 07:05 chetan-rns

Merging as no objections were raised.

jgwest avatar May 21 '24 06:05 jgwest