Add ability to provide annotations to the jobs.

This commit is contained in:
2024-09-11 13:09:54 +01:00
parent bbb41681df
commit fffbae11d8
33 changed files with 143 additions and 85 deletions
+9 -8
View File
@@ -28,14 +28,15 @@ import (
// +kubebuilder:printcolumn:name="Path",type="string",JSONPath=".spec.exportPath"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
type ClusterImageSpec struct {
Image string `json:"image,omitempty"`
Tag string `json:"tag,omitempty"`
Sha string `json:"sha,omitempty"`
FullName string `json:"fullName,omitempty"` // Because I'm lazy and it's easier to pull that way
Storage string `json:"storage,omitempty"`
ExportName string `json:"exportName"`
ExportPath string `json:"exportPath,omitempty"`
ImageNamespace string `json:"imageNamespace,omitempty"`
Image string `json:"image,omitempty"`
Tag string `json:"tag,omitempty"`
Sha string `json:"sha,omitempty"`
FullName string `json:"fullName,omitempty"` // Because I'm lazy and it's easier to pull that way
Storage string `json:"storage,omitempty"`
ExportName string `json:"exportName"`
ExportPath string `json:"exportPath,omitempty"`
ImageNamespace string `json:"imageNamespace,omitempty"`
JobAnnotations map[string]string `json:"jobAnnotations,omitempty"`
}
// ClusterImageStatus defines the observed state of ClusterImage
@@ -60,8 +60,9 @@ type ClusterImageExportSpec struct {
// Base path for the export - both file and S3
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=255
BasePath string `json:"basePath"`
Storage ClusterImageStorageSpec `json:"storage"`
BasePath string `json:"basePath"`
Storage ClusterImageStorageSpec `json:"storage"`
JobAnnotations map[string]string `json:"jobAnnotations,omitempty"`
// +kubebuilder:validation.Minimum=1
// +kubebuilder:validation.Maximum=100
MaxConcurrentJobs int `json:"maxConcurrentJobs"`
+15 -1
View File
@@ -29,7 +29,7 @@ func (in *ClusterImage) DeepCopyInto(out *ClusterImage) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
}
@@ -135,6 +135,13 @@ func (in *ClusterImageExportSpec) DeepCopyInto(out *ClusterImageExportSpec) {
copy(*out, *in)
}
out.Storage = in.Storage
if in.JobAnnotations != nil {
in, out := &in.JobAnnotations, &out.JobAnnotations
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterImageExportSpec.
@@ -197,6 +204,13 @@ func (in *ClusterImageList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterImageSpec) DeepCopyInto(out *ClusterImageSpec) {
*out = *in
if in.JobAnnotations != nil {
in, out := &in.JobAnnotations, &out.JobAnnotations
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterImageSpec.