@@ -41,8 +41,57 @@ type OpenStackNodeImage struct {
4141 CreateOpts * CreateOpts `json:"createOpts" yaml:"createOpts"`
4242}
4343
44+ // TODO: Reimplement logic to import `images.CreateOpts` from Gophercloud with a `Properties` override.
45+ // The current `images.CreateOpts` defines `json:"-"` for the `Properties` field, making it unsuitable
46+ // for proper serialization/deserialization required for `CreateOpts` used in Kubernetes resources
47+ // and `nodeimagerelease.yaml`.
48+ //
49+ // One solution is to create a new struct specifically for serialization/deserialization
50+ // that embeds `images.CreateOpts` and redefines the `Properties` field to allow proper handling.
51+ // Alternatively, consider overriding the default marshalling/unmarshalling functions to achieve the desired behavior.
52+ //
4453// CreateOpts represents options used to create an image.
45- type CreateOpts images.CreateOpts
54+ type CreateOpts struct {
55+ // Name is the name of the new image.
56+ Name string `json:"name" required:"true"`
57+
58+ // Id is the the image ID.
59+ ID string `json:"id,omitempty"`
60+
61+ // Visibility defines who can see/use the image.
62+ Visibility * images.ImageVisibility `json:"visibility,omitempty"`
63+
64+ // Hidden is whether the image is listed in default image list or not.
65+ Hidden * bool `json:"os_hidden,omitempty"`
66+
67+ // Tags is a set of image tags.
68+ Tags []string `json:"tags,omitempty"`
69+
70+ // ContainerFormat is the format of the
71+ // container. Valid values are ami, ari, aki, bare, and ovf.
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+ 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+ MinDisk int `json:"min_disk,omitempty"`
82+
83+ // MinRAM is the amount of RAM in MB that
84+ // is required to boot the image.
85+ MinRAM int `json:"min_ram,omitempty"`
86+
87+ // protected is whether the image is not deletable.
88+ Protected * bool `json:"protected,omitempty"`
89+
90+ // properties is a set of properties, if any, that
91+ // are associated with the image.
92+ Properties map [string ]string `json:"properties,omitempty"`
93+ }
94+
4695
4796// OpenStackNodeImageReleaseStatus defines the observed state of OpenStackNodeImageRelease.
4897type OpenStackNodeImageReleaseStatus struct {
0 commit comments