-
Notifications
You must be signed in to change notification settings - Fork 253
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
✨ New CRD + controller for OpenStackServer (v1alpha1) #2067
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
721f487
to
8c090fe
Compare
ccbf0b6
to
f081701
Compare
/uncc dulek |
96a46fa
to
075ef3d
Compare
/test pull-cluster-api-provider-openstack-e2e-test |
b80f256
to
c608240
Compare
b5c3f50
to
cd77e8a
Compare
/test pull-cluster-api-provider-openstack-e2e-full-test |
// UserData is the user data to be injected into the server instance. | ||
// +optional | ||
UserData optional.String `json:"userData"` |
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 discussed leaving this as a reference as it can be pretty big.
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 you want to put the clusterv1.Bootstrap
from the Machine directly, as a type? Or do like the floating IP ref using *corev1.TypedLocalObjectReference
?
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.
offline, we agreed that we would create a new struct in OpenStackServer.Spec
for UserData
with just a name
as reference for now; so later we can decide what to do with it but for now it'll reference to the bootstrap secret handled by CAPI.
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.
Basically just a fork of the machine controller with some bits removed.
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.
but smarter 🧠 .
// AdoptPorts looks for ports in desiredPorts which were previously created, and adds them to resources.Ports. | ||
// AdoptPortsMachine looks for ports in desiredPorts which were previously created, and adds them to resources.Ports. | ||
// A port matches if it has the same name and network ID as the desired port. | ||
func (s *Service) AdoptPortsMachine(scope *scope.WithLogger, desiredPorts []infrav1.ResolvedPortSpec, resources *infrav1.MachineResources) 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.
Same as above. Worth having just one of these? Or perhaps we delete one later in the series and it doesn't matter...
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.
Since we'll stop populating the OpenStackMachine status at some point, we won't need these things.
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 there any validation we can't do with CEL? If not, lets delete this.
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.
the only validation we make here is to ensure immutability. I don't know enough CEL to know if it can check that. However I'll investigate. However I'm not sure if CEL recognize TopologyDryRunAnnotation
(link).
I checked other providers and they do that via the webhook.
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.
Lets put all of these in the apivalidations suite instead. That way they will still work when we implement them with CEL.
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'll put that into a separate commit for now as I'm not sure whether we want to keep the same validations in OpenStackMachine
(?).
43305cc
to
c559561
Compare
6bda600
to
bdd57f2
Compare
/test pull-cluster-api-provider-openstack-e2e-full-test |
@EmilienM: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
When creating a server, Nova can return an error immediately after the call was made to create it or later. If it's returned immediately, we would like to restore the error event that we used to have and that we actually test in our e2e when providing a wrong availability zone. (cherry picked from commit e8a0e06)
What this PR does / why we need it:
A new CRD and controller which will manage the OpenStack servers in the cluster.
#2020
#2021
TODOs:
OpenStackServer
API &&make generate
Future work that can happen outside this PR:
OpenStackCluster
annotations and watch for changes in Bastion spec, where any change would trigger abastionDelete
.UserData
as a refOpenStackCluster
andOpenStackMachine
objects, since they now live inOpenStackServer
. The fields will be removed for a potentialv1
.