[k8s][2.9.5]juju run always execute on charm container regardless of --operator option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
High
|
Unassigned |
Bug Description
juju version: 2.9.5-ubuntu-amd64
For k8s charm, a unit is a pod, which normally has charm(operator) container + app container.
For juju ssh, new --container option is added to route to each and is working well:
juju ssh --container charm $APP/0
juju ssh --container $APP $APP/0
For juju run, a new --operator option is added for same purpose:
--operator (= false)
Run the commands on the operator (k8s-only)
(off topic: isn't this inconsistent ?)
Expected:
when I run `juju run --unit $APP/0 -- <cmd>`, it should execute in the app container.
when I run `juju run --unit $APP/0 --operator -- <cmd>`, it should execute in the charm/operator container.
Actual:
The cmd always runs in charm container. It seems --operator is always enabled.
description: | updated |
summary: |
- [k8s][2.9.5]juju ssh always goes to charm container regardless of + [k8s][2.9.5]juju run always execute on charm container regardless of --operator option |
Changed in juju: | |
milestone: | 2.9-next → 3.1-beta1 |
Changed in juju: | |
milestone: | 3.1-beta1 → 3.2-beta1 |
Changed in juju: | |
milestone: | 3.2-beta1 → 3.2-rc1 |
Changed in juju: | |
milestone: | 3.2-rc1 → 3.2.0 |
Changed in juju: | |
milestone: | 3.2.0 → 3.2.1 |
Changed in juju: | |
milestone: | 3.2.1 → 3.2.2 |
Changed in juju: | |
milestone: | 3.2.2 → 3.2.3 |
Changed in juju: | |
milestone: | 3.2.3 → 3.2.4 |
Is this for a sidecar style charm? The --operator option was initially added for the original style of k8s charm where the charm runs in a totally separate pod to that of the workload.
For sidecar charms where the workload and the charm run as containers in a single pod, the --container option is used to specify the target, as seen with ssh, scp etc. Support for --container with juju exec (exec is the preferred name in 2.9 onwards) is yet to be added.