Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.8.0 update will no longer support wild card health checks #998

Open
andreabjork opened this issue Sep 14, 2023 · 1 comment
Open

v0.8.0 update will no longer support wild card health checks #998

andreabjork opened this issue Sep 14, 2023 · 1 comment

Comments

@andreabjork
Copy link

andreabjork commented Sep 14, 2023

Is your feature request related to a problem? Please describe.
In ArgoCD 2.6.0 release, support for wildcard health checks was added under the resource.customization config map field:
argoproj/argo-cd#10885
https://github.com/argoproj/argo-cd/releases/tag/v2.6.0

The config map section in question looks as follows:

  resource.customizations: |
    "*.aws.crossplane.io/*":
      health.lua: | 
        ...

Your documentation states:

resourceCustomizations is being deprecated, and support will be removed in Argo CD Operator v0.8.0. Please use the new formats resourceHealthChecks, resourceIgnoreDifferences, and resourceActions.

In order to use resourceHealthChecks to try to achieve the wild card match, we would need to do something like

  resourceHealthChecks:
    - group: "*.aws.crossplane.io"
      kind: "*"
      check: |

However, the resourceHealthChecks field maps group and kind as follows:

resource.customizations.health.<group>_<kind>

so attempting wild card matches in this way will naturally result in reconciler error:

Reconciler error	{"reconciler group": "argoproj.io", "reconciler kind": "ArgoCD", "name": "argocd", "namespace": "argocd", "error": "ConfigMap \"argocd-cm\" is invalid: [data[resource.customizations.health.*.aws.crossplane.io_*]: Invalid value: \"resource.customizations.health.*.aws.crossplane.io_*\": a valid config key must consist of alphanumeric characters, '-', '_' or '.' (e.g. 'key.name',  or 'KEY_NAME',  or 'key-name', regex used for validation is '[-._a-zA-Z0-9]+')]"}

Describe the solution you'd like
I would expect one of two solutions to be taken:

  1. Either abandon the deprication of resourceCustomization field in ArgoCD CRD, or
  2. Configure the mapping from resourceHealthChecks to resource.customizations.health differently such that wildcard can still be used in the manner of group: *.aws.crossplane.io, kind: *.

This should be easy to achieve, by avoiding snake_case mapping and quoting the input instead, such that any input with "*" is still YAML compliant.

Describe alternatives you've considered
An alternative would be to add customized key for defining wild card health checks, such as allowing the spec:

resourceHealthChecks:
  - allMatching: "*.aws.crossplane.io/*"
    check: | 
@svghadi
Copy link
Collaborator

svghadi commented Oct 4, 2023

Hi @andreabjork, thanks for bringing this to attention.

resource.customizations configmap field in ArgoCD has been deprecated(argoproj/argo-cd#11055) in favor of new keys. Therefore, we decided to remove it in argocd-operator v0.8.0.

If the new keys don't support your use-case, you can workaround it in the operator by adding old customizations into .spec.extraConfig field in ArgoCD CR. This field maps its content to argocd-cm configmap, which is used by ArgoCD.

spec:
  extraConfig:
    resource.customizations: |
      "*.aws.crossplane.io/*":
        health.lua: | 
          ...

As for your feature request, what you've highlighted regarding lack of support for wildcards in new keys is true. However, it has to be supported in ArgoCD first before operator can use it. Can you create an issue in https://github.com/argoproj/argo-cd to discuss about wildcard support for new resource keys added in argoproj/argo-cd#6060?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants