argo-helm icon indicating copy to clipboard operation
argo-helm copied to clipboard

Argo Workflows: CRDs do not preserve unknown fields anymore

Open chrko opened this issue 1 year ago • 3 comments

Describe the bug

The update of argo workflows here to v3.6.0 (https://github.com/argoproj/argo-helm/pull/3037) also updated the CRDs. Unfortunately this causes issues, e.g. for values in the wfeb.spec.submit.metadata section (https://github.com/argoproj/argo-helm/blob/27ef4ecd7dd30dbccea61180ff529d3102b9c30e/charts/argo-workflows/templates/crds/argoproj.io_workfloweventbindings.yaml#L669-L670). Previous to the update no validation has been performed (https://github.com/argoproj/argo-helm/blob/5a57de40a8e0a3f22ab084ee18224cf4e9e0e667/charts/argo-workflows/templates/crds/argoproj.io_workfloweventbindings.yaml#L37)

"Upstream" this has been fixed a few days ago by adding the missing fields in the CRDs: https://github.com/argoproj/argo-workflows/pull/14044

Instead of awaiting the next release, I'd like to propose to only update the CRDs to the fixed versions. In case noone objects, I'll prepare a PR tomorrow (CET).

Related helm chart

argo-workflows

Helm chart version

0.45.x

To Reproduce

Apply the following manifest:

apiVersion: argoproj.io/v1alpha1
kind: WorkflowEventBinding
metadata:
  name: pipeline-svc-workflow-webhook-server-change
spec:
  event:
    selector: not payload.deleted
  submit:
    arguments:
      parameters:
        - name: name
          valueFrom:
            event: payload.repository.name
        - name: url
          valueFrom:
            event: payload.repository.ssh_url
        - name: ref
          valueFrom:
            event: payload.ref
        - name: refName
          valueFrom:
            event: payload.ref | split("/") | last()
        - name: eventType
          valueFrom:
            event: (payload.ref|split("/"))[1]
        - name: checkoutSha
          valueFrom:
            event: payload.after
    metadata:
      labels:
        app.ci.project: payload.repository.name
        app.ci.ref: payload.ref | split("/") | last()
        app.ci.sha: payload.after
      name: >-
        "ci-" + payload.repository.name + "-" + (payload.ref | split("/") |
        last()) + "-" + (now().Unix() | string())
    workflowTemplateRef:
      name: pipeline-svc-workflow-ci

Let k8s complain:

The request is invalid: patch: Invalid value: […]: strict decoding error: unknown field "spec.submit.metadata.labels", unknown field "spec.submit.metadata.name"

Expected behavior

WorkflowEventBinding is accepted by k8s api.

Screenshots

No response

Additional context

No response

chrko avatar Jan 20 '25 11:01 chrko

Hi @chrko , thank you for opening the issue.

"Upstream" this has been fixed a few days ago by adding the missing fields in the CRDs: https://github.com/argoproj/argo-workflows/pull/14044

Instead of awaiting the next release, I'd like to propose to only update the CRDs to the fixed versions. In case noone objects, I'll prepare a PR tomorrow (CET).

Our policy is to follow upstream's version. Once upstream releases the fixed code with version tag, we will follow it.

yu-croco avatar Jan 20 '25 14:01 yu-croco

It would be nice to have this though, my workflows configuration are out of sync because this fails since the upgrade to 2.6.2... Has anyone an idea about the timing for the new release?

azazel75 avatar Feb 06 '25 00:02 azazel75

Follow up on this. Can't add labels or annotations in WorkflowEventBinding.

jameshwc avatar May 07 '25 14:05 jameshwc