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

Outdated static pkg/utils/kube/scheme/parser.go causing field not declared in schema errors in ArgoCD #558

Open
r0bobo opened this issue Dec 4, 2023 · 5 comments

Comments

@r0bobo
Copy link

r0bobo commented Dec 4, 2023

I've had two cases of sync errors in ArgoCD:

For CSIDriver:

Failed to compare desired state to live state: failed to perform pre-diff normalization: error building typed results: error creating typedLive: .spec.seLinuxMount: field not declared in schema

For Pod with native sidecar containers and the field .spec.initContainers.restartPolicy:

Failed to compare desired state to live state: failed to perform pre-diff normalization: error building typed results: error creating typedConfig: errors: .spec.template.spec.initContainers[name="helper"].restart: field not declared in schema .spec.template.spec.initContainers[name="podman"].restart: field not declared in schema

After digging around in the code I think the problem might be that the static inlined schema here is outdated and is missing those fields.

Here is a related ArgoCD issue for the CSIDriver problem.

Kubernetes version: v1.28.4 with the SidecarContainers feature gate enabled
ArgoCD version: v2.9.3

@r0bobo r0bobo changed the title Outdated static pkg/utils/kube/scheme/parser.go causing field not declared in schema errors Outdated static pkg/utils/kube/scheme/parser.go causing field not declared in schema errors in ArgoCD Dec 4, 2023
@adberger
Copy link

adberger commented Jan 8, 2024

Any updates on this?

seLinuxMount is in the spec since kubernetes v1.25!

see:

@wpi86
Copy link

wpi86 commented Feb 19, 2024

Hi, have similar issue, but with Jobs
"error building typed results: error creating typedLive: errors: .spec.podReplacementPolicy: field not declared in schema."
JobPodReplacementPolicy featuregate now in beta and enabled by default.
eks 1.29 + argo v2.10.0+2175939

@Typositoire
Copy link

I'm also currently hitting this with Kyverno latest chart and multiple fields, the only way to make the chart compute without having Failed to compare desired state to live state: failed to calculate diff: error calculating structured merge diff: error building typed value from live resource: XYZ: field not declared in schema is to ignore them like so.

ignoreDifferences:
  - group: kyverno.io
    kind: ClusterPolicy
    jqPathExpressions:
      - .status.validatingadmissionpolicy
      - .status.autogen
      - '.spec.rules[].skipBackgroundRequests'
      - .spec.admission

@kamelj
Copy link

kamelj commented May 8, 2024

Hello @wpi86
I have the same issue here, What did you do regarding your error "errors: .spec.podReplacementPolicy: field not declared in schema"?

Hi, have similar issue, but with Jobs "error building typed results: error creating typedLive: errors: .spec.podReplacementPolicy: field not declared in schema." JobPodReplacementPolicy featuregate now in beta and enabled by default. eks 1.29 + argo v2.10.0+2175939

@wpi86
Copy link

wpi86 commented May 9, 2024

Hello @wpi86 I have the same issue here, What did you do regarding your error "errors: .spec.podReplacementPolicy: field not declared in schema"?

Hi, have similar issue, but with Jobs "error building typed results: error creating typedLive: errors: .spec.podReplacementPolicy: field not declared in schema." JobPodReplacementPolicy featuregate now in beta and enabled by default. eks 1.29 + argo v2.10.0+2175939

Hi, currently we keep our jobs as argo hooks, in this case argo doesn't try to validate them on sync and it works

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

No branches or pull requests

5 participants