-
Notifications
You must be signed in to change notification settings - Fork 109
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
How to investigate what field keeps changing for yaml_body in kubectl_manifests #175
Comments
We would also occasionally get these errors that are difficult to debug even though we have yaml_incluster added as an ignored_field
resource definition:
|
I dug into this a little bit in our app and noticed that there's no actual difference in the content. For example, you can use Using kubectl provider 1.14.0 with terraform 1.2.2. {
"address": "module.argocd_mgmt_app.kubectl_manifest.this[\"manifests/app.yaml\"]",
"module_address": "module.argocd_mgmt_app",
"mode": "managed",
"type": "kubectl_manifest",
"name": "this",
"index": "manifests/app.yaml",
"provider_name": "registry.terraform.io/gavinbunney/kubectl",
"change": {
"actions": [
"update"
],
"before": {
"api_version": "argoproj.io/v1alpha1",
"apply_only": false,
"force_conflicts": false,
"force_new": false,
"id": "/apis/argoproj.io/v1alpha1/namespaces/argocd/applications/argocd-admin-mgmt",
"ignore_fields": null,
"kind": "Application",
"live_manifest_incluster": "e63585903c76061b8f50e2ffde57457f67d623f118a1bb3fe3ce43faba212597",
"live_uid": "bc9eca54-50bd-499a-844b-aa7eb75da9b9",
"name": "argocd-admin-mgmt",
"namespace": "argocd",
"override_namespace": null,
"sensitive_fields": null,
"server_side_apply": false,
"timeouts": null,
"uid": "bc9eca54-50bd-499a-844b-aa7eb75da9b9",
"validate_schema": true,
"wait": null,
"wait_for_rollout": true,
"yaml_body": "apiVersion: argoproj.io/v1alpha1\nkind: Application\nmetadata:\n name: argocd-admin-mgmt\n namespace: argocd\n finalizers:\n - resources-finalizer.argocd.argoproj.io\nspec:\n project: argocd-admin-mgmt\n\n destination:\n server: https://kubernetes.default.svc\n namespace: argocd\n\n source:\n repoURL: [email protected]:foo/argocd-admin-mgmt.git\n targetRevision: HEAD\n path: argocd\n\n directory:\n recurse: true\n\n syncPolicy:\n automated:\n prune: false\n selfHeal: true\n",
"yaml_body_parsed": "apiVersion: argoproj.io/v1alpha1\nkind: Application\nmetadata:\n finalizers:\n - resources-finalizer.argocd.argoproj.io\n name: argocd-admin-mgmt\n namespace: argocd\nspec:\n destination:\n namespace: argocd\n server: https://kubernetes.default.svc\n project: argocd-admin-mgmt\n source:\n directory:\n recurse: true\n path: argocd\n repoURL: [email protected]:foo/argocd-admin-mgmt.git\n targetRevision: HEAD\n syncPolicy:\n automated:\n prune: false\n selfHeal: true\n",
"yaml_incluster": "cb0fb112cfe72c51446e34f53b6f89b9d81f8838bb2832b34873e3749537e043"
},
"after": {
"api_version": "argoproj.io/v1alpha1",
"apply_only": false,
"force_conflicts": false,
"force_new": false,
"id": "/apis/argoproj.io/v1alpha1/namespaces/argocd/applications/argocd-admin-mgmt",
"ignore_fields": null,
"kind": "Application",
"live_manifest_incluster": "e63585903c76061b8f50e2ffde57457f67d623f118a1bb3fe3ce43faba212597",
"live_uid": "bc9eca54-50bd-499a-844b-aa7eb75da9b9",
"name": "argocd-admin-mgmt",
"namespace": "argocd",
"override_namespace": null,
"sensitive_fields": null,
"server_side_apply": false,
"timeouts": null,
"uid": "bc9eca54-50bd-499a-844b-aa7eb75da9b9",
"validate_schema": true,
"wait": null,
"wait_for_rollout": true,
"yaml_body": "apiVersion: argoproj.io/v1alpha1\nkind: Application\nmetadata:\n name: argocd-admin-mgmt\n namespace: argocd\n finalizers:\n - resources-finalizer.argocd.argoproj.io\nspec:\n project: argocd-admin-mgmt\n\n destination:\n server: https://kubernetes.default.svc\n namespace: argocd\n\n source:\n repoURL: [email protected]:foo/argocd-admin-mgmt.git\n targetRevision: HEAD\n path: argocd\n\n directory:\n recurse: true\n\n syncPolicy:\n automated:\n prune: false\n selfHeal: true\n",
"yaml_body_parsed": "apiVersion: argoproj.io/v1alpha1\nkind: Application\nmetadata:\n finalizers:\n - resources-finalizer.argocd.argoproj.io\n name: argocd-admin-mgmt\n namespace: argocd\nspec:\n destination:\n namespace: argocd\n server: https://kubernetes.default.svc\n project: argocd-admin-mgmt\n source:\n directory:\n recurse: true\n path: argocd\n repoURL: [email protected]:foo/argocd-admin-mgmt.git\n targetRevision: HEAD\n syncPolicy:\n automated:\n prune: false\n selfHeal: true\n"
},
"after_unknown": {
"yaml_incluster": true
},
"before_sensitive": {
"live_manifest_incluster": true,
"yaml_body": true,
"yaml_incluster": true
},
"after_sensitive": {
"live_manifest_incluster": true,
"yaml_body": true,
"yaml_incluster": true
}
}
} |
I am experiencing the same behaviour when I try to run my scripts on another machine. All of the manifest resources have these in-place changes to their Since its moving machine-to-machine that has prompted it, I was going to investigate whether it's a file metadata thing and git that is causing the problem. |
Has anyone been able to fins a solution to this. Still happening for me? |
Issue is still there |
Same here , Issue is still there |
Same here |
Same as well! |
So, there is a broader discussion in the fork alekc/terraform-provider-kubectl#54 Long story short, you need to set TF_LOG=TRACE in order to see what's causing the issue. Most of the time its going to be a difference where
|
Hi!
We are using kubectl_manifest to directly apply manifests generated by
istioctl manifest generate
. It seems there is always some yaml_body drifts. How do I see what fields are causing the yaml body drifts? Can I either make yaml_body not a sensitive field or output the diff?Currently we are getting ~70 resource changed each time a dependent resource changes, and at apply nothing actually gets applied.
Thanks!
Example output which is less than helpful:
The text was updated successfully, but these errors were encountered: