-
Notifications
You must be signed in to change notification settings - Fork 278
✨ AccessSubnetUUID: we can specify source subnet for access IP address #756
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,10 @@ type OpenStackMachineSpec struct { | |
// A networks object. Required parameter when there are multiple networks defined for the tenant. | ||
// When you do not specify the networks parameter, the server attaches to the only network created for the current tenant. | ||
Networks []NetworkParam `json:"networks,omitempty"` | ||
|
||
// IP address of a port from this subnet will be marked as AccessIPv4 on the created compute instance | ||
AccessSubnetUUID string `json:"accessSubnetUuid,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other variables does not start with Access. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renamed AccessSubnetUUID to Subnet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsen- Thanks updating. |
||
|
||
// The floatingIP which will be associated to the machine, only used for master. | ||
// The floatingIP should have been created and haven't been associated. | ||
FloatingIP string `json:"floatingIP,omitempty"` | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -132,6 +132,7 @@ type Instance struct { | |||||||||||||||||||||||||||||||||
FailureDomain string `json:"failureDomain,omitempty"` | ||||||||||||||||||||||||||||||||||
SecurityGroups *[]string `json:"securigyGroups,omitempty"` | ||||||||||||||||||||||||||||||||||
Networks *[]Network `json:"networks,omitempty"` | ||||||||||||||||||||||||||||||||||
AccessSubnet string `json:"accessSubnet,omitempty"` | ||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm does it make sense to call the property in instance differently than the one in the spec? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm maybe I missed something / or read it incorrectly. Could it be that this adds the Subnet property to the OpenStackMachine and the AccessSubnet to the Instance struct which seems to be only used for the status of the Bastion host? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
func createInstance(is *Service, clusterName string, i *infrav1.Instance) (*infrav1.Instance, error) Adding Just let me know, I can add another commit and forward the subnet UUID in an additional argument. It also might make sense to keep it as it is and add the same possibility to specify subnet UUID for bastion host as well (adding similar cluster-api-provider-openstack/api/v1alpha3/types.go Lines 251 to 266 in 437e82f
Then having this property in Bastion status starts making sense. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||||||||||||||||||||||||||||||||||
Tags []string `json:"tags,omitempty"` | ||||||||||||||||||||||||||||||||||
Image string `json:"image,omitempty"` | ||||||||||||||||||||||||||||||||||
Flavor string `json:"flavor,omitempty"` | ||||||||||||||||||||||||||||||||||
|
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 wonder what happens if networks and subnet which is not part of networks are given.
If we do not accept the case comment it here. Or add the check logic.
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 guess below discussion covered this? maybe need some comments update?
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.
Ok, got it.
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 added f5ff1bf.
The instance creation will fail if no ports with fixed IP are found in the specified subnet. This also covers the case when this subnet does not exist or is not in
.Networks
.I didn't notice the ...
... until now, so please let me know if you'd like to keep this change. I can drop this commit if not 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.
@jsen- Thanks for adding checking logic which is better to be added. Keep the commit, please.