mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-02-14 09:59:57 +00:00
feat: Add additionalMetadataList Support for Conditional Metadata Assignment (#1339)
* feat: Add support for additionalMetadataList Signed-off-by: Deofex <28751252+Deofex@users.noreply.github.com> * docs: change description Signed-off-by: Deofex <28751252+Deofex@users.noreply.github.com> * fix: missing bracket Signed-off-by: Deofex <28751252+Deofex@users.noreply.github.com> * fix: removed duplicated if statement Signed-off-by: Deofex <28751252+Deofex@users.noreply.github.com> * chore: adjustments after review Signed-off-by: Deofex <28751252+Deofex@users.noreply.github.com> * chore: Sync `syncNamespaceMetadata` method Signed-off-by: Deofex <28751252+Deofex@users.noreply.github.com> --------- Signed-off-by: Deofex <28751252+Deofex@users.noreply.github.com> Signed-off-by: Deofex 28751252+Deofex@users.noreply.github.com
This commit is contained in:
@@ -13,6 +13,8 @@ type NamespaceOptions struct {
|
||||
Quota *int32 `json:"quota,omitempty"`
|
||||
// Specifies additional labels and annotations the Capsule operator places on any Namespace resource in the Tenant. Optional.
|
||||
AdditionalMetadata *api.AdditionalMetadataSpec `json:"additionalMetadata,omitempty"`
|
||||
// Specifies additional labels and annotations the Capsule operator places on any Namespace resource in the Tenant via a list. Optional.
|
||||
AdditionalMetadataList []api.AdditionalMetadataSelectorSpec `json:"additionalMetadataList,omitempty"`
|
||||
// Define the labels that a Tenant Owner cannot set for their Namespace resources.
|
||||
ForbiddenLabels api.ForbiddenListSpec `json:"forbiddenLabels,omitempty"`
|
||||
// Define the annotations that a Tenant Owner cannot set for their Namespace resources.
|
||||
|
||||
@@ -293,6 +293,13 @@ func (in *NamespaceOptions) DeepCopyInto(out *NamespaceOptions) {
|
||||
*out = new(api.AdditionalMetadataSpec)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.AdditionalMetadataList != nil {
|
||||
in, out := &in.AdditionalMetadataList, &out.AdditionalMetadataList
|
||||
*out = make([]api.AdditionalMetadataSelectorSpec, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
in.ForbiddenLabels.DeepCopyInto(&out.ForbiddenLabels)
|
||||
in.ForbiddenAnnotations.DeepCopyInto(&out.ForbiddenAnnotations)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user