Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 80e13fb

Browse files
NotTheEvilOnematofeder
authored andcommitted
Reuse existing "images.CreateOpts" for node image releases
This ensures that all parameters and descriptions used by `gophercloud` in the release referenced are up-to-date. Signed-off-by: Tobias Wolf <[email protected]>
1 parent 7731919 commit 80e13fb

File tree

3 files changed

+3
-75
lines changed

3 files changed

+3
-75
lines changed

api/v1alpha1/openstacknodeimagerelease_types.go

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,42 +40,12 @@ type OpenStackNodeImageReleaseSpec struct {
4040
type OpenStackNodeImage struct {
4141
URL string `json:"url" yaml:"url"`
4242
// CreateOpts represents options used to create an image.
43-
CreateOpts *CreateOpts `json:"createOpts" yaml:"createOpts"`
43+
CreateOpts *images.CreateOpts `json:"createOpts" yaml:"createOpts"`
4444
}
4545

4646
// CreateOpts represents options used to create an image.
4747
// CreateOpts attributes are taken from github.com/gophercloud/gophercloud/openstack/imageservice/v2/images.
4848
// Consider.
49-
type CreateOpts struct {
50-
// Name is the name of the new image.
51-
Name string `json:"name" yaml:"name" required:"true"`
52-
// Id is the the image ID.
53-
ID string `json:"id,omitempty" yaml:"id,omitempty"`
54-
// Visibility defines who can see/use the image.
55-
Visibility *images.ImageVisibility `json:"visibility,omitempty" yaml:"visibility,omitempty"`
56-
// Hidden is whether the image is listed in default image list or not.
57-
Hidden *bool `json:"os_hidden,omitempty" yaml:"os_hidden,omitempty"` //nolint:tagliatelle // OS API expects snake case query attrs
58-
// Tags is a set of image tags.
59-
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
60-
// ContainerFormat is the format of the
61-
// container. Valid values are ami, ari, aki, bare, and ovf.
62-
ContainerFormat string `json:"container_format,omitempty" yaml:"container_format,omitempty"` //nolint:tagliatelle // OS API expects snake case query attrs
63-
// DiskFormat is the format of the disk. If set,
64-
// valid values are ami, ari, aki, vhd, vmdk, raw, qcow2, vdi,
65-
// and iso.
66-
DiskFormat string `json:"disk_format,omitempty" yaml:"disk_format,omitempty"` //nolint:tagliatelle // OS API expects snake case query attrs
67-
// MinDisk is the amount of disk space in
68-
// GB that is required to boot the image.
69-
MinDisk int `json:"min_disk,omitempty" yaml:"min_disk,omitempty"` //nolint:tagliatelle // OS API expects snake case query attrs
70-
// MinRAM is the amount of RAM in MB that
71-
// is required to boot the image.
72-
MinRAM int `json:"min_ram,omitempty" yaml:"min_ram,omitempty"` //nolint:tagliatelle // OS API expects snake case query attrs
73-
// protected is whether the image is not deletable.
74-
Protected *bool `json:"protected,omitempty" yaml:"protected,omitempty"`
75-
// properties is a set of properties, if any, that
76-
// are associated with the image.
77-
Properties map[string]string `json:"-" yaml:"-"`
78-
}
7949

8050
// OpenStackNodeImageReleaseStatus defines the observed state of OpenStackNodeImageRelease.
8151
type OpenStackNodeImageReleaseStatus struct {

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/controller/openstacknodeimagerelease_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (r *OpenStackNodeImageReleaseReconciler) Reconcile(ctx context.Context, req
143143
conditions.MarkFalse(openstacknodeimagerelease, apiv1alpha1.OpenStackImageReadyCondition, apiv1alpha1.OpenStackImageNotCreatedYetReason, clusterv1beta1.ConditionSeverityInfo, "image is not created yet")
144144
openstacknodeimagerelease.Status.Ready = false
145145

146-
imageCreateOpts := (*images.CreateOpts)(openstacknodeimagerelease.Spec.Image.CreateOpts)
146+
imageCreateOpts := openstacknodeimagerelease.Spec.Image.CreateOpts
147147
imageCreated, err := createImage(imageClient, imageCreateOpts)
148148
if err != nil {
149149
conditions.MarkFalse(openstacknodeimagerelease,

0 commit comments

Comments
 (0)