Skip to content

Manilla: Share Type Controller#681

Open
dlaw4608 wants to merge 2 commits into
k-orc:mainfrom
dlaw4608:manilla_share_types
Open

Manilla: Share Type Controller#681
dlaw4608 wants to merge 2 commits into
k-orc:mainfrom
dlaw4608:manilla_share_types

Conversation

@dlaw4608

@dlaw4608 dlaw4608 commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Closes this issue: #680

@github-actions github-actions Bot added the semver:major Breaking change label Feb 9, 2026
…ntroller

go run ./cmd/scaffold-controller -interactive=false  \
   -kind=ShareType  \
   -gophercloud-client=NewSharedFilesystemV2  \
   -gophercloud-module=github.com/gophercloud/gophercloud/v2/openstack/sharedfilesystems/v2/sharetypes  \
   -gophercloud-type=ShareType  \
   -openstack-json-object=share_type

Signed-off-by: Daniel Lawton <dlawton@redhat.com>
@dlaw4608 dlaw4608 force-pushed the manilla_share_types branch from 8316dcd to 8bfbe95 Compare June 9, 2026 13:48
@dlaw4608 dlaw4608 marked this pull request as ready for review June 9, 2026 13:48
@dlaw4608 dlaw4608 force-pushed the manilla_share_types branch from 8bfbe95 to fc60408 Compare June 9, 2026 13:56
- E2E tests included
- API configured

Signed-off-by: Daniel Lawton <dlawton@redhat.com>
@dlaw4608 dlaw4608 force-pushed the manilla_share_types branch from fc60408 to 4d72a18 Compare June 9, 2026 14:16

@winiciusallan winiciusallan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dlaw4608, hanks for adding this controller! I've done a round of review through your changes and added some comments inline. Haven't took a look at the tests yet.

Although things are working, I have a feeling that would be better to address some things on gophercloud's side, but I would like to hear from you and @mandre. How does that sound to you?

package v1alpha1

// ShareTypeResourceSpec contains the desired state of the resource.
// All fields are immutable after creation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because Gophercloud currently does not implement the update operation for Share types, right? If this is the case, +1 for keeping it as immutable.

// driverHandlesShareServers defines the driver mode for share server, or storage, life cycle management.
// This is a required extra specification for share types.
// +kubebuilder:default:=true
// +optional

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the API documentation, this field should be required.

When creating a new share type, required extra-specifications must be provided. driver_handles_share_servers is a required extra-specification [...]

Also, considering this field as required, I think we may want to remove the default value and let the user pass it.

apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: AddressScope is the Schema for an ORC resource.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to generate the bundle 😅 for the AddressScope controller. This was added in ee7e2a3. A rebase may sync things.


# Optional: determines if the storage backend manages share servers (default: true)
# true = driver handles share server lifecycle
# false = driver does not handle share servers (admin must configure)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are changing driverHandlesShareServers to be required, remember to update those :)

Comment on lines +97 to +104
// TODO(scaffolding): Add more resource-specific validation tests.
// Some common things to test:
// - Immutability of fields with `self == oldSelf` validation
// - Enum validation (valid and invalid values)
// - Numeric range validation (min/max bounds)
// - Tag uniqueness (if the resource has tags with listType=set)
// - Format validation (CIDR, UUID, etc.)
// - Cross-field validation rules

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scaffolding controller leftovers. Let's remove them.

Since we're here, what do you think of adding a validation to check the spec immutability?

}

func (actuator sharetypeActuator) GetOSResourceByID(ctx context.Context, id string) (*osResourceT, progress.ReconcileStatus) {
// ShareTypes don't have a Get by ID API, so we list and filter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is something that we could have in Gophercloud before merging this PR. Implementing a new GET operation might be straightforward and we avoid filtering on client's side to fetch just one resource.

wdyt? @mandre @dlaw4608

Comment on lines +133 to +134
// Build extra specs manually because gophercloud's ExtraSpecsOpts doesn't handle
// boolean false values correctly with the required:"true" tag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... We need to change the DriverHandlesShareServers type to be a pointer so we can accept false as a valid value.

This would be a breaking change, so I'm okay using this approach, but it would be good to add a TODO comment so we don't forget to change it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:major Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants