Replies: 2 comments 10 replies
-
Just to confirm, you're trying to take the commands from the incoming version of the container and apply them to args while at the same time overwriting the |
Beta Was this translation helpful? Give feedback.
10 replies
-
Chart Version: 3.2.6 Policy is:
Error seems related to the command[] being and failing to be interpreted by JMESPath expression {
"gvk": "/v1, Kind=Pod",
"gvr": { "group": "", "version": "v1", "resource": "pods" },
"namespace": "argocd",
"name": "",
"operation": "CREATE",
"uid": "08d08d37-cc8d-41ac-b828-2454aed6e611",
"user": {
"username": "system:serviceaccount:kube-system:replicaset-controller",
"uid": "bf226687-7c79-4823-8f5f-2e83af0806b2",
"groups": [
"system:serviceaccounts",
"system:serviceaccounts:kube-system",
"system:authenticated"
],
"extra": {
"authentication.kubernetes.io/credential-id": [
"JTI=26ae5dbe-2698-4589-b3a7-ea132fd096e7"
]
}
},
"roles": [],
"clusterroles": [
"system:basic-user",
"system:controller:replicaset-controller",
"system:discovery",
"system:public-info-viewer",
"system:service-account-issuer-discovery"
],
"resource.gvk": "/v1, Kind=Pod",
"kind": "Pod",
"URLParams": "",
"error": "mutation policy call-aws-env-script error: failed to apply policy call-aws-env-script rules [inject-aws-env-vars: failed to mutate elements: failed to evaluate mutate.foreach[1].preconditions: failed to substitute variables in condition key: failed to resolve element.command[] | length(@) at path : JMESPath query failed: Invalid type for: <nil>, expected: []jmespath.JpType{\"string\", \"array\", \"object\"}]"
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I have been struggling to find the appropriate way to introduce a mutation policy which would allow me, given an annotation, to call a script.sh before any command and args provided in the manifests. It cannot be run as a init container as the need is to export ENV variables which are sensitive the the $HOME of the User running the container.
So far my Policy looks like this
I am struggling to get the args part right...
I am a total beginner on Kyverno and JMESPath and can't seem to find documentation or examples to help achieve it.
I have highlighted the problematic section in Bold as the rest of the policy is behaving as expected.
Thanks for your help !
Beta Was this translation helpful? Give feedback.
All reactions