-
Notifications
You must be signed in to change notification settings - Fork 280
✨ create ports #778
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
✨ create ports #778
Changes from all commits
c59d29e
7f1ef1e
7495c55
ccdd19c
d453ee3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,10 @@ limitations under the License. | |||||
|
||||||
package v1alpha4 | ||||||
|
||||||
import ( | ||||||
"github.com/gophercloud/gophercloud/openstack/networking/v2/ports" | ||||||
) | ||||||
|
||||||
// OpenStackMachineTemplateResource describes the data needed to create a OpenStackMachine from a template. | ||||||
type OpenStackMachineTemplateResource struct { | ||||||
// Spec is the specification of the desired behavior of the machine. | ||||||
|
@@ -116,6 +120,26 @@ type SubnetFilter struct { | |||||
NotTagsAny string `json:"notTagsAny,omitempty"` | ||||||
} | ||||||
|
||||||
type PortOpts struct { | ||||||
NetworkID string `json:"networkID" required:"true"` | ||||||
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. Since |
||||||
NameSuffix string `json:"nameSuffix" required:"true"` | ||||||
Description string `json:"description,omitempty"` | ||||||
AdminStateUp *bool `json:"adminStateUp,omitempty"` | ||||||
MACAddress string `json:"macAddress,omitempty"` | ||||||
FixedIPs []ports.IP `json:"fixedIPs,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. also the values for ports.IP are all underscored, we should probably create our own version and pass it in so we can keep the api camel case 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. Agree |
||||||
TenantID string `json:"tenantID,omitempty"` | ||||||
ProjectID string `json:"projectID,omitempty"` | ||||||
SecurityGroups *[]string `json:"securityGroups,omitempty"` | ||||||
AllowedAddressPairs []ports.AddressPair `json:"allowedAddressPairs,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. ^ same as Fixed IPs :) Sorry I keep hitting you with these so late. I missed these when reviewing and am bumping into them now that I am testing. |
||||||
|
||||||
// The ID of the host where the port is allocated | ||||||
HostID string `json:"binding:hostID,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.
Suggested change
|
||||||
|
||||||
// The virtual network interface card (vNIC) type that is bound to the | ||||||
// neutron port. | ||||||
VNICType string `json:"binding:vnicType,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.
Suggested change
|
||||||
} | ||||||
|
||||||
type Instance struct { | ||||||
ID string `json:"id,omitempty"` | ||||||
Name string `json:"name,omitempty"` | ||||||
|
@@ -124,6 +148,7 @@ type Instance struct { | |||||
SecurityGroups *[]string `json:"securigyGroups,omitempty"` | ||||||
Networks *[]Network `json:"networks,omitempty"` | ||||||
Subnet string `json:"subnet,omitempty"` | ||||||
Ports []PortOpts `json:"ports,omitempty"` | ||||||
Tags []string `json:"tags,omitempty"` | ||||||
Image string `json:"image,omitempty"` | ||||||
Flavor string `json:"flavor,omitempty"` | ||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
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.
We only need VNICType actually. I try to find a light solution.
In my understanding, SR-IOV setting is done per compute node, but real use case is that create network for SR-IOV and create port for it. How about adding VNICType to NetworkParam? At least we can use existing network with SR-IOV.
Uh oh!
There was an error while loading. Please reload this page.
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.
+1 Since Network param and Subnet Param are no longer nested in v1aplha4 api, it would also make sense to be able to set the vnicType in the subnet, in case that is a user's preferred way to add an interface to a compute instance.
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 basically fine with whatever option you get consensus on :)
But just asking. We didn't change NetworkParam and SubnetParam from v1alpha4 and as far as I can see they are still nested. Did I miss something that they are not nested anymore ? :)
Uh oh!
There was an error while loading. Please reload this page.
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 could be misunderstanding, but:
cluster-api-provider-openstack/api/v1alpha4/openstackmachine_types.go
Lines 57 to 62 in e1a1328
It looks like they are their own isolated api entry. Its very possible that I am incorrect though. My frame of reference is from 4 api versions ago.
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.
Ah now I get what lead to this assumption. This Subnet is only for the AccessIPv4 "selection". (it was introduced in #756)
SubnetParam is still nested.
cluster-api-provider-openstack/api/v1alpha4/types.go
Lines 61 to 70 in e1a1328
As mentioned elsewhere we have to rethink our design / CRD sooner or later as it's not that thought out / consistent.
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.
ah ok, that makes sense now. thanks for explaining!