[k8s][2.9.5]juju run always execute on charm container regardless of --operator option

Bug #1934046 reported by Joe Guo
10
This bug affects 2 people
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.

Joe Guo (guoqiao)
description: updated
Joe Guo (guoqiao)
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
Revision history for this message
Ian Booth (wallyworld) wrote :

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.

Changed in juju:
milestone: none → 2.9-next
status: New → Triaged
importance: Undecided → High
Harry Pidcock (hpidcock)
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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.