-
Notifications
You must be signed in to change notification settings - Fork 491
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-2847] Open port per unit4sidecar #15225
Conversation
ab387dd
to
14c9dbd
Compare
01ba750
to
86dd3f8
Compare
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 think we can discuss naming things in the state layer. The methods and entities used can be confusing - eg we are modelling ports opened by a unit but referring to application ports. We have an application ports doc but we can have methods on it that real just with units right? I'm also confused about the additions to the all watcher.
735adc3
to
1df2780
Compare
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.
Thank you for all great changes. One issue though - I think we are missing the uniter facade bump since we are replacing a method.
} | ||
|
||
// OpenedPortRangesByEndpoint returns the port ranges opened by the unit. | ||
func (u *UniterAPI) OpenedPortRangesByEndpoint() (params.OpenPortRangesByEndpointResults, error) { |
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.
Don't we need to bump the facade version?
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 method is new and we keep the existing method OpenedApplicationPortRangesByEndpoint
.
So it should be ok without a facade version bump?
Results: make([]params.OpenPortRangesByEndpointResult, 1), | ||
} | ||
|
||
authTag := u.auth.GetAuthTag() |
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.
Aren't we missing a permission check like accessUnit() here?
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 facade method does not have an arg, we are using the authTag to access its own unit.
So I think we are ok here.
peers: | ||
ring: | ||
interface: cockroachdb |
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.
Is this needed?
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.
Yes, we do. This was added for the new sidecar test.#15225 (comment)
With the changes, would be worth testing again:
|
d5d2924
to
6c0aa8f
Compare
/build |
be1d5bd
to
9b813e9
Compare
…gesForUnit to unitPortRanges;
9b813e9
to
06e8c21
Compare
06e8c21
to
10de1fe
Compare
Works fine to upgrade from 3.1.0 to 3.1.1. |
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 think we should move the app ports to each unit, not copy.
Every unit will typically open the same port in say a start hook. This will be how it works till we add --app later.
Id: doc.DocID, | ||
Update: bson.D{ | ||
{Name: "$set", Value: bson.D{ | ||
{Name: "port-ranges", Value: doc.PortRanges}, |
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.
Do we need "port-ranges"? We are just treating the ports as being the same for all units right?
So we copy the ports to all units and leave any application ports empty till next cycle.
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.
doc.PortRanges has already set to nil.
ff24f25
to
37e9de9
Compare
37e9de9
to
d79bab1
Compare
/merge |
#15263 Merge 3.1 #15220 [from manadart/2.9-revert-omit-match](4c1503b) #15201 [from toabctl/develop-aws-new-regions](125496e) #15196 [from hmlanigan/fix-refresh-resource-no-char…](344de3f) #15224 [from wallyworld/handle-terminated-hooks](c1618b5) #15238 [from hmlanigan/fix-local-refresh-with-resou…](7b871e7) #15247 [from hmlanigan/new-merge-from-2.9](7587d44) #15246 [from nvinuesa/juju-2951](3272e11) #15248 [from manadart/2.9-into-3.0](91165d3) #15241 [from hmlanigan/update-refresh-help](f0e4b1b) #15252 [from hmlanigan/merge-from-2.9](992f040) #15253 [from hpidcock/fix-install-step](95c2db7) #15254 [from wallyworld/merge-3.0-20230303](ce6a255) #15225 [from ycliuhw/open-port-per-unit4sidecar](7dfbd61) #15256 [from jack-w-shaw/JUJU-2899_fix_bug_in_ec2_t…](1b2c08f) #15257 [from jack-w-shaw/2.9-into-3.0](bfaa9ed) #15228 [from jack-w-shaw/JUJU-2897_back_ssh_allowli…](18349be) #15261 [from wallyworld/secret-consumer-watcher-fix](1837f71) #15262 [from wallyworld/merge-3.0-20230307](4451c9c) Conflicts were for deleted code or code that needed to be removed. ``` # Conflicts: # api/client/firewallrules/client_test.go # api/client/firewallrules/package_test.go # state/upgrades.go # state/upgrades_test.go # upgrades/backend.go # upgrades/steps_311.go # upgrades/steps_311_test.go ```
This PR changes the application (vs machine) level opened ports to be grouped per unit for sidecar applications:
3.1.0
) to unit scope.Checklist
Integration tests, with comments saying what you're testingdoc.go added or updated in changed packagesQA steps
Documentation changes
Now, sidecar and machine applications are same for open[/close]-port
Bug reference
https://bugs.launchpad.net/juju/+bug/2007334