argocd-operator
argocd-operator copied to clipboard
fix: verify DeploymentConfig API when installing keycloak using Template
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:
@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.
@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?
Merging as no objections were raised.