@@ -42,7 +42,57 @@ type OpenStackNodeImage struct {
4242}
4343
4444// CreateOpts represents options used to create an image.
45- type CreateOpts images.CreateOpts
45+ // TODO: Reimplement logic to import `images.CreateOpts` from Gophercloud with a `Properties` override.
46+ // The current `images.CreateOpts` defines `json:"-"` for the `Properties` field, making it unsuitable
47+ // for proper unmarshalling required for `CreateOpts` used in Kubernetes resources
48+ // and `nodeimagerelease.yaml`.
49+ // One solution is to create a new struct specifically for unmarshalling
50+ // that embeds `images.CreateOpts` and redefines the `Properties` field to allow proper handling.
51+ type CreateOpts struct {
52+ // Name is the name of the new image.
53+ Name string `json:"name" required:"true"`
54+
55+ // Id is the the image ID.
56+ ID string `json:"id,omitempty"`
57+
58+ // Visibility defines who can see/use the image.
59+ Visibility * images.ImageVisibility `json:"visibility,omitempty"`
60+
61+ // Hidden is whether the image is listed in default image list or not.
62+ //nolint:tagliatelle // Allow snake_case JSON tags
63+ Hidden * bool `json:"os_hidden,omitempty"`
64+
65+ // Tags is a set of image tags.
66+ Tags []string `json:"tags,omitempty"`
67+
68+ // ContainerFormat is the format of the
69+ // container. Valid values are ami, ari, aki, bare, and ovf.
70+ //nolint:tagliatelle // Allow snake_case JSON tags
71+ ContainerFormat string `json:"container_format,omitempty"`
72+
73+ // DiskFormat is the format of the disk. If set,
74+ // valid values are ami, ari, aki, vhd, vmdk, raw, qcow2, vdi,
75+ // and iso.
76+ //nolint:tagliatelle // Allow snake_case JSON tags
77+ DiskFormat string `json:"disk_format,omitempty"`
78+
79+ // MinDisk is the amount of disk space in
80+ // GB that is required to boot the image.
81+ //nolint:tagliatelle // Allow snake_case JSON tags
82+ MinDisk int `json:"min_disk,omitempty"`
83+
84+ // MinRAM is the amount of RAM in MB that
85+ // is required to boot the image.
86+ //nolint:tagliatelle // Allow snake_case JSON tags
87+ MinRAM int `json:"min_ram,omitempty"`
88+
89+ // protected is whether the image is not deletable.
90+ Protected * bool `json:"protected,omitempty"`
91+
92+ // properties is a set of properties, if any, that
93+ // are associated with the image.
94+ Properties map [string ]string `json:"properties,omitempty"`
95+ }
4696
4797// OpenStackNodeImageReleaseStatus defines the observed state of OpenStackNodeImageRelease.
4898type OpenStackNodeImageReleaseStatus struct {
0 commit comments