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
[dev] Augment application model with expose parameters #11963
[dev] Augment application model with expose parameters #11963
Conversation
The new version includes the bits for exporting the expose-related parameters that will be introduced in the following commits.
40b271e
to
d86c94e
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.
Looks good.
d86c94e
to
c3f08ba
Compare
|
1 similar comment
|
c3f08ba
to
eef923b
Compare
@manadart I just realized that I forgot the |
|
eef923b
to
ea254f7
Compare
// application that should be reachable once the application is exposed. An | ||
// empty returned list means that all endpoints should be reachable. | ||
func (a *Application) ExposedEndpoints() []string { | ||
if len(a.doc.ExposedEndpoints) == 0 { |
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.
@manadart I have also added these guard blocks to avoid breaking errors that check for a nil []string
and not for a []string(nil)
. As an alternative, I could patch setExposed
to check for nil args and generate $unset
commands but I think it's better if we see the fields in the application docs even if they are empty.
|
|
ea254f7
to
930bce0
Compare
// The default space entry has an empty string as its | ||
// key but is not a valid endpoint. | ||
if _, found := bindings[endpoint]; !found || endpoint == "" { |
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.
Yet another thing that I missed and fixed via force-pushing. The ""
endpoint represents the default space binding but it is not a valid endpoint name ;-)
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.
Oof. I should have seen that.
|
…pose-parameters #11973 # Description of change Due to a change in the approach for modeling expose parameters, this PR revises the changes from #11963 so that we can specify a list of spaces and/or CIDRs that can access exposed application ports on a **per endpoint** basis. ## QA steps None needed. The `exposed` flag is still being set as usual and that's the only thing that the firewall worker considers when generating ingress rules.
Description of change
This PR is part of the work for enhancing the
juju expose
command to target endpoints and/or allow operators to specify the spaces/CIDRs that should be able to access the application once exposed.The PR augments the application model with the following new fields:
As part of this set of changes, the
SetExposed
method of the application model has been modified to accept (and validate) the above new set of fields.The CLI updates and related API changes for actually populating/querying the new fields will be tacked via a separate PR.
QA steps
Just check that
juju expose X
works. The new fields are not used for now so there are no visible functional changes introduced by this PR.