-
Notifications
You must be signed in to change notification settings - Fork 261
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
✨ Add ephemeral storage support to the AdditionalBlockDevices #1696
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
4081b9f
to
ef93718
Compare
I'll help on this PR as we'd like to get that merge relatively soon. For now, this is just a simple rebase to resolve the conflicts, it obviously needs more work, and I suspect I broke the tests in the process 😅 |
fe50028
to
13db8c9
Compare
38b304d
to
080fa93
Compare
/test pull-cluster-api-provider-openstack-e2e-test |
26f74c3
to
d425b01
Compare
d425b01
to
a6335e2
Compare
I've removed CEL validations from the PR into a separate commit, see commit message for details, please. |
/test pull-cluster-api-provider-openstack-e2e-test |
@@ -89,7 +89,6 @@ type OpenStackMachineSpec struct { | |||
// + --- | |||
// + While it's possible to have unlimited number of block devices attached to a server instance, the number is | |||
// + limited to 255 to avoid rule cost exceeded error in CRD validation. | |||
// +kubebuilder:validation:MaxItems=255 |
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.
#1736 is an issue that I created so at some point we can re-add CEL.
e44d4fa
to
5523e52
Compare
The offline CEL discussion was with me, btw. For the record I'm very much in favour of CEL and I'd like to replace all webhook validations that can be implemented with it. My concern is that we should not add CEL without tests because it will inevitably be broken, and this will break folks using a cluster where it's enabled. If we're going to add CEL we need to test it. If we can't test it, we shouldn't add it yet. But we will add 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.
Nothing major from me. This is nearly ready to go.
// contains additional storage options. | ||
// +union | ||
// | ||
//nolint:godot |
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.
What was godot complaining about?
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 can help with this. It is complaining about missing dot in the comment above. And this is also the directive that no-unused
was complaining about.
// AvailabilityZone is the volume availability zone to create the volume in. | ||
// blockDeviceStorage is the storage type of a block device to create and | ||
// contains additional storage options. | ||
// +union |
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.
Does +union do anything here?
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.
Joel asked me to put it, I don't think it hurts but I also don't think it's functionally useful now in the way things work.
|
||
// volume contains additional storage options for a volume block device. | ||
// +optional | ||
// +unionMember,optional |
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.
Ditto.
5523e52
to
ff4a773
Compare
ff4a773
to
3279ca0
Compare
423e91d
to
c757f37
Compare
@@ -62,6 +62,14 @@ func (r *OpenStackMachine) ValidateCreate() (admission.Warnings, error) { | |||
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "identityRef", "kind"), "must be a Secret")) | |||
} | |||
|
|||
if r.Spec.RootVolume != nil && r.Spec.AdditionalBlockDevices != nil { |
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.
this file has no unit tests, but I started to write it and i'll publish via another PR if reviewers don't mind.
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.
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.
Ideally these would be envtests, btw. We could then re-use them to validate CEL.
type BlockDeviceStorage struct { | ||
// type is the type of block device to create. | ||
// This can be either "Volume" or "Local". | ||
// +unionDiscriminator |
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 this. These stay at least for now.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: EmilienM, mdbooth The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Not sure if I missed it before or if it was changed, but the doc strings should be matching the code also for capitalization. I get that this will then make the yaml description not match the yaml fields but this is the system we currently follow.
Co-authored-by: Emilien Macchi <[email protected]> Co-authored-by: Martin André <[email protected]>
Hitting golangci/golangci-lint#3228 when adding nolint. So allow to ignore unused nolints.
I've put that into a separate commit so we can re-add it later. It also serves as documentation for the work we have done to add CEL. However and unfortunately, we don't have CEL tests in place now so we decided to not have CEL validations for now; add them later and then we'll be able to revert this commit.
c757f37
to
71fa48f
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.
/lgtm
/test pull-cluster-api-provider-openstack-e2e-full-test |
Add ephemeral storage support to the
AdditionalBlockDevices
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1692
Special notes for your reviewer:
guestFormat
) so the user can handle the filesystem themselves. Note that we initially added it and tested swap but it didn't work in CAPO CI. The field can be added later.TODOs: