@@ -42,7 +42,59 @@ 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+ //
50+ // One solution is to create a new struct specifically for unmarshalling
51+ // that embeds `images.CreateOpts` and redefines the `Properties` field to allow proper handling.
52+ type CreateOpts struct {
53+ // Name is the name of the new image.
54+ Name string `json:"name" required:"true"`
55+
56+ // Id is the the image ID.
57+ ID string `json:"id,omitempty"`
58+
59+ // Visibility defines who can see/use the image.
60+ Visibility * images.ImageVisibility `json:"visibility,omitempty"`
61+
62+ // Hidden is whether the image is listed in default image list or not.
63+ //nolint:tagliatelle
64+ Hidden * bool `json:"os_hidden,omitempty"`
65+
66+ // Tags is a set of image tags.
67+ Tags []string `json:"tags,omitempty"`
68+
69+ // ContainerFormat is the format of the
70+ // container. Valid values are ami, ari, aki, bare, and ovf.
71+ //nolint:tagliatelle
72+ ContainerFormat string `json:"container_format,omitempty"`
73+
74+ // DiskFormat is the format of the disk. If set,
75+ // valid values are ami, ari, aki, vhd, vmdk, raw, qcow2, vdi,
76+ // and iso.
77+ //nolint:tagliatelle
78+ DiskFormat string `json:"disk_format,omitempty"`
79+
80+ // MinDisk is the amount of disk space in
81+ // GB that is required to boot the image.
82+ //nolint:tagliatelle
83+ MinDisk int `json:"min_disk,omitempty"`
84+
85+ // MinRAM is the amount of RAM in MB that
86+ // is required to boot the image.
87+ //nolint:tagliatelle
88+ MinRAM int `json:"min_ram,omitempty"`
89+
90+ // protected is whether the image is not deletable.
91+ Protected * bool `json:"protected,omitempty"`
92+
93+ // properties is a set of properties, if any, that
94+ // are associated with the image.
95+ Properties map [string ]string `json:"properties,omitempty"`
96+ }
97+
4698
4799// OpenStackNodeImageReleaseStatus defines the observed state of OpenStackNodeImageRelease.
48100type OpenStackNodeImageReleaseStatus struct {
0 commit comments