-
Notifications
You must be signed in to change notification settings - Fork 493
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 behaviour of relation-get hook tool when no --app flag passed #16938
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check for invalid unit name. This matches the function to it stated behaviour in the comment. Remove tests that confirmed wrong behavior and add tests of new behaviour.
anvial
reviewed
Feb 16, 2024
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.
I'm OK with code, and waiting simple.canonical.com
to return back for QA.
anvial
approved these changes
Feb 16, 2024
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.
LG2M
/merge |
Merged
jujubot
added a commit
that referenced
this pull request
Feb 20, 2024
#16939 There were no merge conflicts from this, the commits added are: #16844 Support minikube env folder on juju snap. #16876 Pass all the availability zones when discovering subnets in clustered lxd. #16890 Revert dot-minikube on snapcraft until auto-connect is approved. #16567 Add lease manager worker documentation. #16898 Suppress klog log messages. #16905 Ensure we close client. #16915 Merge branch '3.1' of https://github.com/juju/juju into 3.1-into-3.3. #16917 Fix docker cache for github actions. #16922 Fail actions which are interrupted due to an agent restart in the middle. #16930 Fix the HasModelAdmin API to handle non admins properly. #16936 Merge branch '2.9' into merge-2.9-3.1. #16937 Merge branch '3.1' into merge-3.1-3.3. #16938 Add check for relation-get with app arguemnt but no --app flag.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The relation-get hook tool defaults to getting info about the unit relation. It has an
--app
flag to get information about the application relation instead.The documentation for the function that determins which relation to get (
determineUnitOrAppName
) states that if no--app
flag is provided and an app name is passed then an error should be thrown. This is not what happens.I have added in an error that is returned in this case, and an extra check to see if it is a valid unit name or not (i.e. it could be an invalid unit name and application name). I have updated the unit tests to reflect this and removed a test confirming the erroneous behavior.
Checklist
- [ ] Integration tests, with comments saying what you're testing- [ ] doc.go added or updated in changed packagesQA steps
Unit tests
Black box test
Links
Launchpad bug: https://bugs.launchpad.net/juju/+bug/2053282