-
Notifications
You must be signed in to change notification settings - Fork 494
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
Fix parsing of watch flag on status command #16445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check that -w=1s
still works?
@SimonRichardson has the |
I'm not aware of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
break | ||
} | ||
} | ||
|
||
if !c.noColor { | ||
jujuStatusArgsWithoutWatchFlag = append(jujuStatusArgsWithoutWatchFlag, "--color") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a side effect. I'm guessing the reason we have this here is to ensure we pass --color
to ensure color is explict for viddy to avoid bugs? The fact it isn't obvious is a smell
Perhaps we should rename the function to statusCommandForViddy
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
We definitely do support single character shortcut, so that also needs fixing |
@SimonRichardson we do support single char shortcut but only for some of the flags:
and watch is not one of them |
On the status command, when passing the --watch flag, we pass the entire command line arguments (including 'juju status') along with all the flags except --watch to viddy, which will run the command indefinitely with an interval. To do this, we must remove the --watch flag along with its value from the list of OS arguments to be passed to viddy. This was incorrectly done because it only accepted unix-style flags. The fix is to remove both unix and gnu style when passing the watch flag.
/merge |
#16462 Forward ports: - #16426 - #16435 - #16445 - #16452 - #16451 - #16453 - #16455 - #16456 - #16457 - #16460 - #16461 Conflicts: - apiserver/facades/agent/provisioner/imagemetadata_test.go - environs/bootstrap/bootstrap.go - environs/simplestreams/datasource.go - environs/simplestreams/datasource_test.go - go.sum - worker/dbaccessor/package_test.go - worker/firewaller/firewaller_test.go - worker/modelcache/worker_test.go - worker/uniter/charm/bundles_test.go - worker/uniter/uniter_test.go - worker/uniter/util_test.go - cmd/juju/status/status_internal_test.go
#16470 Merge branch `3.3` into `main`: - #16426 - #16435 - #16445 - #16452 - #16451 - #16453 - #16455 - #16456 - #16457 - #16460 - #16461 - #16454 - #16394 - #16469 ``` # Conflicts: # apiserver/common/secrets/access.go # apiserver/common/secrets/access_test.go # apiserver/common/secrets/drain.go # apiserver/common/secrets/drain_test.go # apiserver/common/secrets/mocks/commonsecrets_mock.go # apiserver/common/secrets/watcher.go # apiserver/common/secrets/watcher_test.go # apiserver/facades/agent/provisioner/imagemetadata_test.go # apiserver/facades/agent/secretsdrain/mocks/modelstate.go # apiserver/facades/agent/secretsdrain/mocks/secretsprovider.go # apiserver/facades/agent/secretsdrain/package_test.go # apiserver/facades/agent/secretsdrain/register.go # apiserver/facades/agent/secretsdrain/state.go # cmd/jujud/agent/caasoperator/manifolds.go # environs/bootstrap/bootstrap.go # environs/simplestreams/datasource.go # environs/simplestreams/datasource_test.go # go.sum # worker/dbaccessor/package_test.go # worker/firewaller/firewaller_test.go # worker/modelcache/worker_test.go # worker/secretsdrainworker/manifold.go # worker/secretsdrainworker/manifold_test.go # worker/secretsdrainworker/package_test.go # worker/uniter/charm/bundles_test.go # worker/uniter/uniter_test.go # worker/uniter/util_test.go ```
On the status command, when passing the --watch flag, we pass the entire command line arguments (including 'juju status') along with all the flags except --watch to viddy, which will run the command indefinitely with an interval.
To do this, we must remove the --watch flag along with its value from the list of OS arguments to be passed to viddy. This was incorrectly done because it only accepted unix-style flags.
The fix is to remove both unix and gnu style when passing the watch flag.
Checklist
Integration tests, with comments saying what you're testingdoc.go added or updated in changed packagesQA steps
After bootstrapping and adding a model, get the status with --watch on two different styles:
also,
Links
Launchpad bug: https://bugs.launchpad.net/juju/+bug/2037914
Jira card: JUJU-4782