Providing namespace metadata additional labels and annotations (#80)

This commit is contained in:
Dario Tranchitella
2020-09-07 15:09:34 +02:00
committed by GitHub
parent a99153cbe7
commit ee0261c069
17 changed files with 236 additions and 67 deletions
+9
View File
@@ -25,9 +25,18 @@ import (
// +kubebuilder:validation:Minimum=1
type NamespaceQuota uint
type NamespaceMetadata struct {
// +nullable
AdditionalLabels map[string]string `json:"additionalLabels"`
// +nullable
AdditionalAnnotations map[string]string `json:"additionalAnnotations"`
}
// TenantSpec defines the desired state of Tenant
type TenantSpec struct {
Owner string `json:"owner"`
// +kubebuilder:validation:Optional
NamespacesMetadata NamespaceMetadata `json:"namespacesMetadata"`
// +kubebuilder:validation:Required
StorageClasses StorageClassList `json:"storageClasses"`
IngressClasses IngressClassList `json:"ingressClasses"`
+30
View File
@@ -64,6 +64,35 @@ func (in NamespaceList) DeepCopy() NamespaceList {
return *out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NamespaceMetadata) DeepCopyInto(out *NamespaceMetadata) {
*out = *in
if in.AdditionalLabels != nil {
in, out := &in.AdditionalLabels, &out.AdditionalLabels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.AdditionalAnnotations != nil {
in, out := &in.AdditionalAnnotations, &out.AdditionalAnnotations
*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 NamespaceMetadata.
func (in *NamespaceMetadata) DeepCopy() *NamespaceMetadata {
if in == nil {
return nil
}
out := new(NamespaceMetadata)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in StorageClassList) DeepCopyInto(out *StorageClassList) {
{
@@ -145,6 +174,7 @@ func (in *TenantList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TenantSpec) DeepCopyInto(out *TenantSpec) {
*out = *in
in.NamespacesMetadata.DeepCopyInto(&out.NamespacesMetadata)
if in.StorageClasses != nil {
in, out := &in.StorageClasses, &out.StorageClasses
*out = make(StorageClassList, len(*in))