Allow users to apply labels and annotations to internal resources (#4400)
This commit is contained in:
@@ -69,6 +69,18 @@ type AutoscalingListenerSpec struct {
|
||||
|
||||
// +optional
|
||||
Template *corev1.PodTemplateSpec `json:"template,omitempty"`
|
||||
|
||||
// +optional
|
||||
ConfigSecretMetadata *ResourceMeta `json:"configSecretMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
ServiceAccountMetadata *ResourceMeta `json:"serviceAccountMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
RoleMetadata *ResourceMeta `json:"roleMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
RoleBindingMetadata *ResourceMeta `json:"roleBindingMetadata,omitempty"`
|
||||
}
|
||||
|
||||
// AutoscalingListenerStatus defines the observed state of AutoscalingListener
|
||||
|
||||
@@ -78,12 +78,36 @@ type AutoscalingRunnerSetSpec struct {
|
||||
// Required
|
||||
Template corev1.PodTemplateSpec `json:"template,omitempty"`
|
||||
|
||||
// +optional
|
||||
AutoscalingListenerMetadata *ResourceMeta `json:"autoscalingListener,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerMetrics *MetricsConfig `json:"listenerMetrics,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerTemplate *corev1.PodTemplateSpec `json:"listenerTemplate,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerServiceAccountMetadata *ResourceMeta `json:"listenerServiceAccountMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerRoleMetadata *ResourceMeta `json:"listenerRoleMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerRoleBindingMetadata *ResourceMeta `json:"listenerRoleBindingMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerConfigSecretMetadata *ResourceMeta `json:"listenerConfigSecretMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
EphemeralRunnerSetMetadata *ResourceMeta `json:"ephemeralRunnerSetMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
EphemeralRunnerMetadata *ResourceMeta `json:"ephemeralRunnerMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
EphemeralRunnerConfigSecretMetadata *ResourceMeta `json:"ephemeralRunnerConfigSecretMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum:=0
|
||||
MaxRunners *int `json:"maxRunners,omitempty"`
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package v1alpha1
|
||||
|
||||
// ResourceMeta carries metadata common to all internal resources
|
||||
type ResourceMeta struct {
|
||||
// +optional
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
}
|
||||
@@ -122,6 +122,9 @@ type EphemeralRunnerSpec struct {
|
||||
// +optional
|
||||
VaultConfig *VaultConfig `json:"vaultConfig,omitempty"`
|
||||
|
||||
// +optional
|
||||
EphemeralRunnerConfigSecretMetadata *ResourceMeta `json:"ephemeralRunnerConfigSecretMetadata,omitempty"`
|
||||
|
||||
corev1.PodTemplateSpec `json:",inline"`
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ type EphemeralRunnerSetSpec struct {
|
||||
PatchID int `json:"patchID"`
|
||||
// EphemeralRunnerSpec is the spec of the ephemeral runner
|
||||
EphemeralRunnerSpec EphemeralRunnerSpec `json:"ephemeralRunnerSpec,omitempty"`
|
||||
// +optional
|
||||
EphemeralRunnerMetadata *ResourceMeta `json:"ephemeralRunnerMetadata,omitempty"`
|
||||
}
|
||||
|
||||
// EphemeralRunnerSetStatus defines the observed state of EphemeralRunnerSet
|
||||
|
||||
@@ -118,6 +118,26 @@ func (in *AutoscalingListenerSpec) DeepCopyInto(out *AutoscalingListenerSpec) {
|
||||
*out = new(v1.PodTemplateSpec)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ConfigSecretMetadata != nil {
|
||||
in, out := &in.ConfigSecretMetadata, &out.ConfigSecretMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ServiceAccountMetadata != nil {
|
||||
in, out := &in.ServiceAccountMetadata, &out.ServiceAccountMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.RoleMetadata != nil {
|
||||
in, out := &in.RoleMetadata, &out.RoleMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.RoleBindingMetadata != nil {
|
||||
in, out := &in.RoleBindingMetadata, &out.RoleBindingMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingListenerSpec.
|
||||
@@ -223,6 +243,11 @@ func (in *AutoscalingRunnerSetSpec) DeepCopyInto(out *AutoscalingRunnerSetSpec)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.Template.DeepCopyInto(&out.Template)
|
||||
if in.AutoscalingListenerMetadata != nil {
|
||||
in, out := &in.AutoscalingListenerMetadata, &out.AutoscalingListenerMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ListenerMetrics != nil {
|
||||
in, out := &in.ListenerMetrics, &out.ListenerMetrics
|
||||
*out = new(MetricsConfig)
|
||||
@@ -233,6 +258,41 @@ func (in *AutoscalingRunnerSetSpec) DeepCopyInto(out *AutoscalingRunnerSetSpec)
|
||||
*out = new(v1.PodTemplateSpec)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ListenerServiceAccountMetadata != nil {
|
||||
in, out := &in.ListenerServiceAccountMetadata, &out.ListenerServiceAccountMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ListenerRoleMetadata != nil {
|
||||
in, out := &in.ListenerRoleMetadata, &out.ListenerRoleMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ListenerRoleBindingMetadata != nil {
|
||||
in, out := &in.ListenerRoleBindingMetadata, &out.ListenerRoleBindingMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ListenerConfigSecretMetadata != nil {
|
||||
in, out := &in.ListenerConfigSecretMetadata, &out.ListenerConfigSecretMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.EphemeralRunnerSetMetadata != nil {
|
||||
in, out := &in.EphemeralRunnerSetMetadata, &out.EphemeralRunnerSetMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.EphemeralRunnerMetadata != nil {
|
||||
in, out := &in.EphemeralRunnerMetadata, &out.EphemeralRunnerMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.EphemeralRunnerConfigSecretMetadata != nil {
|
||||
in, out := &in.EphemeralRunnerConfigSecretMetadata, &out.EphemeralRunnerConfigSecretMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.MaxRunners != nil {
|
||||
in, out := &in.MaxRunners, &out.MaxRunners
|
||||
*out = new(int)
|
||||
@@ -427,6 +487,11 @@ func (in *EphemeralRunnerSetList) DeepCopyObject() runtime.Object {
|
||||
func (in *EphemeralRunnerSetSpec) DeepCopyInto(out *EphemeralRunnerSetSpec) {
|
||||
*out = *in
|
||||
in.EphemeralRunnerSpec.DeepCopyInto(&out.EphemeralRunnerSpec)
|
||||
if in.EphemeralRunnerMetadata != nil {
|
||||
in, out := &in.EphemeralRunnerMetadata, &out.EphemeralRunnerMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralRunnerSetSpec.
|
||||
@@ -472,6 +537,11 @@ func (in *EphemeralRunnerSpec) DeepCopyInto(out *EphemeralRunnerSpec) {
|
||||
*out = new(VaultConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.EphemeralRunnerConfigSecretMetadata != nil {
|
||||
in, out := &in.EphemeralRunnerConfigSecretMetadata, &out.EphemeralRunnerConfigSecretMetadata
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.PodTemplateSpec.DeepCopyInto(&out.PodTemplateSpec)
|
||||
}
|
||||
|
||||
@@ -660,6 +730,35 @@ func (in *ProxyServerConfig) DeepCopy() *ProxyServerConfig {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceMeta) DeepCopyInto(out *ResourceMeta) {
|
||||
*out = *in
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*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 ResourceMeta.
|
||||
func (in *ResourceMeta) DeepCopy() *ResourceMeta {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourceMeta)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TLSCertificateSource) DeepCopyInto(out *TLSCertificateSource) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user