-
Notifications
You must be signed in to change notification settings - Fork 34
Port: add binding:host field #626
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 all commits
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 |
|---|---|---|
|
|
@@ -6,13 +6,20 @@ resourceRefs: | |
| kind: port | ||
| name: port-update | ||
| ref: port | ||
| - apiVersion: openstack.k-orc.cloud/v1alpha1 | ||
| kind: port | ||
| name: port-update-admin | ||
| ref: portAdmin | ||
| assertAll: | ||
| - celExpr: "port.status.id != ''" | ||
| - celExpr: "port.status.resource.createdAt != ''" | ||
| - celExpr: "port.status.resource.updatedAt != ''" | ||
| - celExpr: "port.status.resource.macAddress != ''" | ||
| - celExpr: "!has(port.status.resource.fixedIPs)" | ||
| - celExpr: "!has(port.status.resource.description)" | ||
| # Following the network API reference, the default value for | ||
| # hostID field is an empty string. | ||
| - celExpr: "portAdmin.status.resource.hostID == ''" | ||
|
Collaborator
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. Funny, I would have expected the binding host_id to be returned always to the admin, but according to what you're saying (and the tests) it's only shown when a binding host_id was set in the request?
Contributor
Author
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. Yeah, that's right. I made a few tests using I believe it is because we explicitly specify which host we want to bind to that port. On the other hand, I think it will be defined when binding to a device (e.g., server or router), or via Port Binding, like we are doing here. Passing hostID: ❯ curl -s -X GET -H "X-Auth-Token: $TOKEN" http://10.5.11.133/networking/v2.0/ports/$(k get port port-create-minimal -ojsonpath='{.status.id}') | jq .
{
"port":{
"mac_address":"fa:16:3e:f4:f8:3c",
"admin_state_up":true,
"status":"DOWN",
"binding:vnic_type":"normal",
"binding:profile":{},
"binding:host_id":"devstack",
"binding:vif_type":"ovs",
"binding:vif_details":{
"port_filter":true,
"connectivity":"l2",
"bridge_name":"br-int",
"datapath_type":"system",
"bound_drivers":{
"0":"ovn"
}
}
}
}Not passing hostID: {
"port": {
"mac_address": "fa:16:3e:44:a0:7d",
"admin_state_up": true,
"status": "DOWN",
"binding:vnic_type": "normal",
"binding:profile": {},
"binding:host_id": "",
"binding:vif_type": "unbound",
"binding:vif_details": {},
"port_security_enabled": true,
"trusted": null,
}
} |
||
| --- | ||
| apiVersion: openstack.k-orc.cloud/v1alpha1 | ||
| kind: Port | ||
|
|
@@ -36,3 +43,26 @@ status: | |
| message: OpenStack resource is up to date | ||
| status: "False" | ||
| reason: Success | ||
| --- | ||
| apiVersion: openstack.k-orc.cloud/v1alpha1 | ||
| kind: Port | ||
| metadata: | ||
| name: port-update-admin | ||
| status: | ||
| resource: | ||
| name: port-update-admin | ||
| adminStateUp: true | ||
| portSecurityEnabled: true | ||
| propagateUplinkStatus: false | ||
| revisionNumber: 1 | ||
| status: DOWN | ||
| vnicType: normal | ||
| conditions: | ||
| - type: Available | ||
| message: OpenStack resource is available | ||
| status: "True" | ||
| reason: Success | ||
| - type: Progressing | ||
| message: OpenStack resource is up to date | ||
| status: "False" | ||
| reason: Success | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 wished there was a way to represent a Host resource in ORC so that we could have a
HostRefrather than aHostID.In that case,
HostIDis an ID that is exposed to a user via the nova API in the server object and that is hashed from the project ID.According to the nova docs:
I don't think there's a way to list all host IDs for a given project as a user.
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.
It would be nice to have a HostRef instead of simply the HostID. The only thing that we have is
os-hypervisorbut it is not project-scoped, so we can't the get the hashed value directly from the API =/.