Unable to patch initContainer onto inject-policy for OPA Envoy sidecar container #615
bvamshidhar
started this conversation in
Community
Replies: 1 comment 10 replies
-
I think you will need to patch the spec taking into account any existing init containers and including them in the patch if there are any set. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to add an initContainer add it to the spec using patch operation in the inject-policy.yaml. I'm adding this initContainer to fetch the data of the other 2 configmaps opa-isito-config and opa-policy from a files stored in a dir /config.
For example: opa-istio-config.yaml contains
plugins:
envoy_ext_authz_grpc:
addr: :9191
path: istio/authz/allow
decision_logs:
console: true
The main purpose of this is to to deploy these two configmaps in opa-istio namespace instead of default namespace.
patch = [{
"op": "add",
"path": "/spec/initContainers/-",
"value": init_container,
}, {
"op": "add",
"path": "/spec/containers/-",
"value": opa_container,
}, {
"op": "add",
"path": "/spec/volumes/-",
"value": new_volumes,
}]
While adding the initContainer, I get an error:
Error creating: Internal error occurred: add operation does not apply: doc is missing path: "/spec/initContainers/-": missing value
Can you please help me on this issue?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions