argo-cd: v2.7.4 CMP regression: the plugin isn't called

Checklist:

  • I’ve searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I’ve included steps to reproduce the bug.
  • I’ve pasted the output of argocd version.

Describe the bug

Starting v2.7.4 my CMP plugin is no longer being called.

To Reproduce

I have the following config configuration:

apiVersion: v1
data:
  nix.conf: |
    build-users-group = nixbld
    sandbox = false
    experimental-features = nix-command flakes
    substituters = https://cache.nixos.org https://nixhelm.cachix.org
    trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixhelm.cachix.org-1:esqauAsR4opRF0UsGrA6H3gD21OrzMnBBYvJXeddjtY=
  passwd: |
    nix:x:999:30000:Nix build user 1:/home/nix:/bin/false
    root:x:0:0::/root:/bin/bash
  plugin.yaml: '{"apiVersion":"argoproj.io/v1alpha1","kind":"ConfigManagementPlugin","metadata":{"name":"nix-cmp-plugin"},"spec":{"discover":{"fileName":"flake.nix"},"generate":{"command":["sh","-c","cat
    result"]},"init":{"command":["sh","-c","export OUTPUT=\"${ARGOCD_ENV_NIX_OUTPUT:-kubernetesConfiguration}\"\necho
    -ne \"Building for $OUTPUT\\n\\n\"\nif [ \"$PARAM_VALUES\" != \"\" ]; then\n  echo
    \"$PARAM_VALUES\" > values.json\n  nix-shell -p git --run ''git add values.json''\nfi\nnix
    build \".#${OUTPUT}\"\n"]},"name":"nix-cmp-plugin","version":"v1.0"}}'
kind: ConfigMap
metadata:
  labels:
    argocd.argoproj.io/instance: cloudops-argocd
  name: nix-cmp-config
  namespace: argocd

(pretty-printed that is:)

apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
  name: nix-cmp-plugin
spec:
  discover:
    fileName: flake.nix
  generate:
    command:
      - sh
      - '-c'
      - cat result
  init:
    command:
      - sh
      - '-c'
      - |
        export OUTPUT="${ARGOCD_ENV_NIX_OUTPUT:-kubernetesConfiguration}"
        echo -ne "Building for $OUTPUT\n\n"
        if [ "$PARAM_VALUES" != "" ]; then
          echo "$PARAM_VALUES" > values.json
          nix-shell -p git --run ''git add values.json''
        fi
        nix build ".#${OUTPUT}"
  name: nix-cmp-plugin
  version: v1.0

Starting from 2.7.4 the plugin doesn’t seem to be called at all (I tried to add some verbose logging into init.command to no avail, also it hard refreshes too fast). The pipeline runs without errors but suggests all the resources should be removed.

Expected behavior

Expected the CMP work just as it was working in 2.7.3. Reverting argo to 2.7.3 makes it operational again.

Version

2.7.4 installed via helm.

Logs

No useful logs in repo server.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I beak too many things

It’s a talent to be proud of, imo. 😃

I’ll thank you to stop finding bugs in our pristine software.

I think the e2e test actually covers both the Slack user’s issue and yours pretty well. I’ll move out of draft and try to get a review.

Hopefully that came off tongue-in-cheek as intended. Your bug-finding is always deeply appreciated. 😃

You’re good! It’s just that you’re far from being the first one to tell me I break too many things.

Filed #13950 for the env issue.

Heh, I’m actually trying to build with that one reverted right now 😄