Skip to content
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

[JUJU-1050] Output life in juju show-unit and juju show-application #14001

Merged
merged 2 commits into from
May 4, 2022

Conversation

jack-w-shaw
Copy link
Member

@jack-w-shaw jack-w-shaw commented May 4, 2022

Juju only inconsistently outputs the life status of entities when running juju show-. This PR is the first step in making this consistent

Checklist

  • [ ] Requires a pylibjuju change
  • Added integration tests for the PR
  • [ ] Added or updated doc.go related to packages changed
  • Comments answer the question of why design decisions were made

QA steps

Deploy something big and complex

$ juju deploy charmed-kubernetes

And wait for it to be fully deployed

Test show-unit with alive unit

$ juju show-unit easyrsa/0
easyrsa/0:
  machine: "0"
  opened-ports: []
  public-address: 18.169.166.26
  charm: cs:~containers/easyrsa-441
  leader: true
  life: alive
...

Test show-application with alive application

$ juju show-application flannel
flannel:
  charm: flannel
  series: focal
  channel: stable
  principal: false
  exposed: false
  remote: false
  life: alive
...

This is not sufficient QA, however, since alive corresponds to the integer 0, so this value could just be uninitialised under the hood

Destroy the model, and quickly whilst units are dying, check show-x

Unit

$ juju destroy-model k8s
$ juju show-unit etcd/1
etcd/1:
  workload-version: 3.4.5
  machine: "2"
  opened-ports:
  - 2379/tcp
  public-address: 13.41.65.66
  charm: cs:~containers/etcd-655
  leader: false
  life: dying
...

and application

$ juju show-application containerd
containerd:
  charm: containerd
  series: focal
  channel: stable
  principal: false
  exposed: false
  remote: false
  life: dying
...

Bug reference

https://bugs.launchpad.net/juju/+bug/1968092

@jack-w-shaw jack-w-shaw changed the title [JUJU-1050] Output unit life in juju show-unit [JUJU-1050] Output life in juju show-unit and juju show-application May 4, 2022
@jack-w-shaw jack-w-shaw force-pushed the JUJU-1050_show_unit_life branch 3 times, most recently from 88c7b8f to bf2574c Compare May 4, 2022 14:24
@hmlanigan
Copy link
Member

hmlanigan commented May 4, 2022

@jack-w-shaw - QA is good for same client/controller. New client with older controller yields

  life: ""

for show-unit, but not for show-application. A usability nit.

Copy link
Member

@hmlanigan hmlanigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, a few tests need fixing, as does the empty string output when client/agents are mismatched.

Copy link
Member

@hmlanigan hmlanigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jack-w-shaw
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit b85ab5c into juju:2.9 May 4, 2022
@jack-w-shaw jack-w-shaw deleted the JUJU-1050_show_unit_life branch May 5, 2022 10:20
jujubot added a commit that referenced this pull request May 16, 2022
#14017

Merge from 2.9 to bring forward:
- #14007 from wallyworld/update-golang-deps
- #14013 from hmlanigan/show-controller-panic
- #14012 from hmlanigan/remove-unit-subordinate
- #13998 from turrisxyz/setup-permissions
- #14011 from ycliuhw/update-ck-overlay
- #14010 from tlm/juju-jenkins-tests
- #14004 from tlm/juju-jenkins-tests
- #14003 from manadart/2.9-close-unit-loggers
- #14001 from jack-w-shaw/JUJU-1050_show_unit_life
- #13890 from juju/dependabot/github_actions/actions/upload-artifact-3
- #14000 from wallyworld/use-go1.18
- #13999 from tlm/juju-jenkins-tests
- #13991 from ycliuhw/fix/lp1968643
- #13997 from tlm/cross-compile
- #13931 from arnodel/juju-885-remove-modelaccess-connection-iface-method
- #13992 from jack-w-shaw/JUJU-1034_reduce_over_verbose_logging_network
- #13993 from hmlanigan/fix-intermittent-fail-testenqueuedoperation
- #13990 from wallyworld/handle-azure-quota-errors
- #13989 from benhoyt/start-worker-if-dead
- #13987 from hpidcock/filter-test-packages

Conflicts:
- cmd/juju/controller/showcontroller.go
- go.mod
- go.sum
- provider/azure/environ_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants