From 7c8d7677e4333690bd1fb039969b48afad947960 Mon Sep 17 00:00:00 2001 From: David van der Spek Date: Fri, 14 Jul 2023 11:55:42 +0200 Subject: [PATCH] fix: add more input types for backend Signed-off-by: David van der Spek --- .../v1alpha1/loki_limit_types.go | 41 +- api/observability/v1alpha1/prom_types.go | 96 +++- .../v1alpha1/tempo_limit_types.go | 106 +++- .../v1alpha1/zz_generated.deepcopy.go | 498 +++++++++++++++++- .../observability.traceshield.io_tenants.yaml | 4 - 5 files changed, 718 insertions(+), 27 deletions(-) diff --git a/api/observability/v1alpha1/loki_limit_types.go b/api/observability/v1alpha1/loki_limit_types.go index 05af5ed..8e92de8 100644 --- a/api/observability/v1alpha1/loki_limit_types.go +++ b/api/observability/v1alpha1/loki_limit_types.go @@ -180,11 +180,16 @@ type LokiLimits struct { type LokiLimitsInput LokiLimits type StreamRetention struct { - Period metav1.Duration `yaml:"period" json:"period"` - Priority *int `yaml:"priority" json:"priority"` - Selector *string `yaml:"selector" json:"selector"` + // +kubebuilder:validation:Optional + Period *metav1.Duration `yaml:"period,omitempty" json:"period,omitempty"` + // +kubebuilder:validation:Optional + Priority *int `yaml:"priority,omitempty" json:"priority,omitempty"` + // +kubebuilder:validation:Optional + Selector *string `yaml:"selector,omitempty" json:"selector,omitempty"` } +type StreamRetentionInput StreamRetention + type ShardstreamsConfig struct { // +kubebuilder:validation:Optional Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"` @@ -197,6 +202,8 @@ type ShardstreamsConfig struct { DesiredRate *uint64 `yaml:"desired_rate,omitempty" json:"desired_rate,omitempty"` } +type ShardstreamsConfigInput ShardstreamsConfig + type BlockedQuery struct { // +kubebuilder:validation:Optional Pattern *string `yaml:"pattern,omitempty" json:"pattern,omitempty"` @@ -209,6 +216,8 @@ type BlockedQuery struct { Types *string `yaml:"types,omitempty" json:"types,omitempty"` // TODO: add validation that the string is a comma separated list of the types metric, filter and limited } +type BlockedQueryInput BlockedQuery + type RulerAlertManagerConfig struct { // URL of the Alertmanager to send notifications to. AlertmanagerURL string `yaml:"alertmanager_url,omitempty" json:"alertmanager_url,omitempty"` @@ -222,13 +231,13 @@ type RulerAlertManagerConfig struct { AlertmanagerRefreshInterval *metav1.Duration `yaml:"alertmanager_refresh_interval,omitempty" json:"alertmanager_refresh_interval,omitempty"` // Enables the ruler notifier to use the Alertmananger V2 API. // +kubebuilder:validation:Optional - AlertmanangerEnableV2API bool `yaml:"enable_alertmanager_v2,omitempty" json:"enable_alertmanager_v2,omitempty"` + AlertmanangerEnableV2API *bool `yaml:"enable_alertmanager_v2,omitempty" json:"enable_alertmanager_v2,omitempty"` // Configuration for alert relabeling. // +kubebuilder:validation:Optional // TODO: remove all references to this to our own type since the yaml tags will be different AlertRelabelConfigs []*RelabelConfig `yaml:"alert_relabel_configs,omitempty" json:"alert_relabel_configs,omitempty" doc:"description=List of alert relabel configs."` // Capacity of the queue for notifications to be sent to the Alertmanager. // +kubebuilder:validation:Optional - NotificationQueueCapacity int `yaml:"notification_queue_capacity,omitempty" json:"notification_queue_capacity,omitempty"` + NotificationQueueCapacity *int `yaml:"notification_queue_capacity,omitempty" json:"notification_queue_capacity,omitempty"` // HTTP timeout duration when sending notifications to the Alertmanager. // +kubebuilder:validation:Optional // +kubebuilder:validation:Type=string @@ -236,9 +245,11 @@ type RulerAlertManagerConfig struct { NotificationTimeout *metav1.Duration `yaml:"notification_timeout,omitempty" json:"notification_timeout,omitempty"` // Client configs for interacting with the Alertmanager // +kubebuilder:validation:Optional - Notifier NotifierConfig `yaml:"alertmanager_client,omitempty" json:"alertmanager_client,omitempty"` + Notifier *NotifierConfig `yaml:"alertmanager_client,omitempty" json:"alertmanager_client,omitempty"` } +type RulerAlertManagerConfigInput RulerAlertManagerConfig + type NotifierConfig struct { // +kubebuilder:validation:Optional TLS *NotifierTLSClientConfig `yaml:",inline,omitempty" json:",inline,omitempty"` @@ -248,24 +259,30 @@ type NotifierConfig struct { HeaderAuth *NotifierHeaderAuth `yaml:",inline,omitempty" json:",inline,omitempty"` } +type NotifierConfigInput NotifierConfig + // NotifBasicAuth configures basic authentication for HTTP clients. type NotifierBasicAuth struct { // +kubebuilder:validation:Optional - Username string `yaml:"basic_auth_username,omitempty" json:"basic_auth_username,omitempty"` + Username *string `yaml:"basic_auth_username,omitempty" json:"basic_auth_username,omitempty"` // +kubebuilder:validation:Optional - Password string `yaml:"basic_auth_password,omitempty" json:"basic_auth_password,omitempty"` + Password *string `yaml:"basic_auth_password,omitempty" json:"basic_auth_password,omitempty"` } +type NotifierBasicAuthInput NotifierBasicAuth + // HeaderAuth condigures header based authorization for HTTP clients. type NotifierHeaderAuth struct { // +kubebuilder:validation:Optional - Type string `yaml:"type,omitempty" json:"type,omitempty"` + Type *string `yaml:"type,omitempty" json:"type,omitempty"` // +kubebuilder:validation:Optional - Credentials string `yaml:"credentials,omitempty" json:"credentials,omitempty"` + Credentials *string `yaml:"credentials,omitempty" json:"credentials,omitempty"` // +kubebuilder:validation:Optional - CredentialsFile string `yaml:"credentials_file,omitempty" json:"credentials_file,omitempty"` + CredentialsFile *string `yaml:"credentials_file,omitempty" json:"credentials_file,omitempty"` } +type NotifierHeaderAuthInput NotifierHeaderAuth + // ClientConfig is the config for client TLS. type NotifierTLSClientConfig struct { // +kubebuilder:validation:Optional @@ -283,3 +300,5 @@ type NotifierTLSClientConfig struct { // +kubebuilder:validation:Optional MinVersion *string `yaml:"tls_min_version,omitempty" json:"tls_min_version,omitempty" category:"advanced"` } + +type NotifierTLSClientConfigInput NotifierTLSClientConfig diff --git a/api/observability/v1alpha1/prom_types.go b/api/observability/v1alpha1/prom_types.go index 9aa85f2..1f671e3 100644 --- a/api/observability/v1alpha1/prom_types.go +++ b/api/observability/v1alpha1/prom_types.go @@ -1,7 +1,10 @@ package v1alpha1 import ( - prom_v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + "fmt" + "io" + "strconv" + prom_config "github.com/prometheus/common/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -174,11 +177,15 @@ type ProxyConfig struct { ProxyConnectHeader prom_config.Header `yaml:"proxy_connect_header,omitempty" json:"proxy_connect_header,omitempty"` } +// LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores. +// +kubebuilder:validation:Pattern:="^[a-zA-Z_][a-zA-Z0-9_]*$" +type LabelName string + type RelabelConfig struct { // A list of labels from which values are taken and concatenated // with the configured separator in order. // +kubebuilder:validation:Optional - SourceLabels []*prom_v1.LabelName `yaml:"source_labels,omitempty" json:"source_labels,omitempty"` + SourceLabels []*LabelName `yaml:"source_labels,omitempty" json:"source_labels,omitempty"` // Separator is the string between concatenated values from the source labels. // +kubebuilder:validation:Optional Separator *string `yaml:"separator,omitempty" json:"separator,omitempty"` @@ -199,5 +206,88 @@ type RelabelConfig struct { // +kubebuilder:validation:Optional // +kubebuilder:validation:Enum=replace;Replace;keep;Keep;drop;Drop;hashmod;HashMod;labelmap;LabelMap;labeldrop;LabelDrop;labelkeep;LabelKeep;lowercase;Lowercase;uppercase;Uppercase;keepequal;KeepEqual;dropequal;DropEqual // +kubebuilder:default=replace - Action *string `yaml:"action,omitempty" json:"action,omitempty"` + Action *RelabelAction `yaml:"action,omitempty" json:"action,omitempty"` +} + +type RelabelConfigInput RelabelConfig + +type RelabelAction string + +const ( + RelabelActionReplace RelabelAction = "replace" + RelabelActionReplace0 RelabelAction = "Replace" + RelabelActionKeep RelabelAction = "keep" + RelabelActionKeep0 RelabelAction = "Keep" + RelabelActionDrop RelabelAction = "drop" + RelabelActionDrop0 RelabelAction = "Drop" + RelabelActionHashmod RelabelAction = "hashmod" + RelabelActionHashMod RelabelAction = "HashMod" + RelabelActionLabelmap RelabelAction = "labelmap" + RelabelActionLabelMap RelabelAction = "LabelMap" + RelabelActionLabeldrop RelabelAction = "labeldrop" + RelabelActionLabelDrop RelabelAction = "LabelDrop" + RelabelActionLabelkeep RelabelAction = "labelkeep" + RelabelActionLabelKeep RelabelAction = "LabelKeep" + RelabelActionLowercase RelabelAction = "lowercase" + RelabelActionLowercase0 RelabelAction = "Lowercase" + RelabelActionUppercase RelabelAction = "uppercase" + RelabelActionUppercase0 RelabelAction = "Uppercase" + RelabelActionKeepequal RelabelAction = "keepequal" + RelabelActionKeepEqual RelabelAction = "KeepEqual" + RelabelActionDropequal RelabelAction = "dropequal" + RelabelActionDropEqual RelabelAction = "DropEqual" +) + +var AllRelabelAction = []RelabelAction{ + RelabelActionReplace, + RelabelActionReplace0, + RelabelActionKeep, + RelabelActionKeep0, + RelabelActionDrop, + RelabelActionDrop0, + RelabelActionHashmod, + RelabelActionHashMod, + RelabelActionLabelmap, + RelabelActionLabelMap, + RelabelActionLabeldrop, + RelabelActionLabelDrop, + RelabelActionLabelkeep, + RelabelActionLabelKeep, + RelabelActionLowercase, + RelabelActionLowercase0, + RelabelActionUppercase, + RelabelActionUppercase0, + RelabelActionKeepequal, + RelabelActionKeepEqual, + RelabelActionDropequal, + RelabelActionDropEqual, +} + +func (e RelabelAction) IsValid() bool { + switch e { + case RelabelActionReplace, RelabelActionReplace0, RelabelActionKeep, RelabelActionKeep0, RelabelActionDrop, RelabelActionDrop0, RelabelActionHashmod, RelabelActionHashMod, RelabelActionLabelmap, RelabelActionLabelMap, RelabelActionLabeldrop, RelabelActionLabelDrop, RelabelActionLabelkeep, RelabelActionLabelKeep, RelabelActionLowercase, RelabelActionLowercase0, RelabelActionUppercase, RelabelActionUppercase0, RelabelActionKeepequal, RelabelActionKeepEqual, RelabelActionDropequal, RelabelActionDropEqual: + return true + } + return false +} + +func (e RelabelAction) String() string { + return string(e) +} + +func (e *RelabelAction) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = RelabelAction(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid RelabelAction", str) + } + return nil +} + +func (e RelabelAction) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) } diff --git a/api/observability/v1alpha1/tempo_limit_types.go b/api/observability/v1alpha1/tempo_limit_types.go index adcd5f0..eb06abf 100644 --- a/api/observability/v1alpha1/tempo_limit_types.go +++ b/api/observability/v1alpha1/tempo_limit_types.go @@ -1,6 +1,11 @@ package v1alpha1 import ( + "encoding/json" + "fmt" + "io" + "strconv" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -116,6 +121,8 @@ type FilterPolicy struct { Exclude *PolicyMatch `yaml:"exclude,omitempty" json:"exclude,omitempty"` } +type FilterPolicyInput FilterPolicy + type MatchType string const ( @@ -123,6 +130,40 @@ const ( Regex MatchType = "regex" ) +var AllMatchType = []MatchType{ + Strict, + Regex, +} + +func (e MatchType) IsValid() bool { + switch e { + case Strict, Regex: + return true + } + return false +} + +func (e MatchType) String() string { + return string(e) +} + +func (e *MatchType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = MatchType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid MatchType", str) + } + return nil +} + +func (e MatchType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type PolicyMatch struct { // +kubebuilder:validation:Optional // +kubebuilder:validation:Enum=strict;regex @@ -131,11 +172,72 @@ type PolicyMatch struct { Attributes []MatchPolicyAttribute `yaml:"attributes,omitempty" json:"attributes,omitempty"` } +type PolicyMatchInput PolicyMatch + type MatchPolicyAttribute struct { // +kubebuilder:validation:Optional Key *string `yaml:"key,omitempty" json:"key,omitempty"` + // +kubebuilder:validation:Optional - Value runtime.RawExtension `yaml:"value,omitempty" json:"value,omitempty"` + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + // +kubebuilder:validation:Type=object + Value WrappedMap `yaml:"value,omitempty" json:"value,omitempty"` +} + +type MatchPolicyAttributeInput MatchPolicyAttribute + +type WrappedMap struct { + Object map[string]interface{} `yaml:",inline" json:",inline"` +} + +// MarshalJSON defers JSON encoding to the wrapped map +func (w *WrappedMap) MarshalJSON() ([]byte, error) { + return json.Marshal(w.Object) +} + +// UnmarshalJSON implements the Unmarshaler interface. +func (w *WrappedMap) UnmarshalJSON(data []byte) error { + var out map[string]interface{} + err := json.Unmarshal(data, &out) + if err != nil { + return err + } + w.Object = out + return nil +} + +func (w *WrappedMap) DeepCopy() *WrappedMap { + if w != nil && w.Object != nil { + return &WrappedMap{ + Object: runtime.DeepCopyJSON(w.Object), + } + } + c := NewWrappedMap() + return &c +} + +// DeepCopyInto is an ~autogenerated~ deepcopy function, copying the receiver, writing into out. in must be non-nil. +// Works around https://github.com/kubernetes/code-generator/issues/50 +func (w *WrappedMap) DeepCopyInto(out *WrappedMap) { + bytes, err := json.Marshal(w.Object) + if err != nil { + // we assume that it marshals cleanly because otherwise the resource would not have been + // created in the API server + panic(err) + } + var clone map[string]interface{} + err = json.Unmarshal(bytes, &clone) + if err != nil { + // we assume again optimistically because we just marshalled that the round trip works as well + panic(err) + } + out.Object = clone +} + +// NewWrappedMap returns an empty WrappedMap +func NewWrappedMap() WrappedMap { + return WrappedMap{Object: map[string]interface{}{}} } type DimensionMappings struct { @@ -146,3 +248,5 @@ type DimensionMappings struct { // +kubebuilder:validation:Optional Join *string `yaml:"join,omitempty" json:"join,omitempty"` } + +type DimensionMappingsInput DimensionMappings diff --git a/api/observability/v1alpha1/zz_generated.deepcopy.go b/api/observability/v1alpha1/zz_generated.deepcopy.go index c44296c..a1a2544 100644 --- a/api/observability/v1alpha1/zz_generated.deepcopy.go +++ b/api/observability/v1alpha1/zz_generated.deepcopy.go @@ -23,7 +23,6 @@ package v1alpha1 import ( "github.com/pluralsh/controller-reconcile-helper/pkg/types" - monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/prometheus/common/config" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -64,6 +63,41 @@ func (in *BlockedQuery) DeepCopy() *BlockedQuery { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BlockedQueryInput) DeepCopyInto(out *BlockedQueryInput) { + *out = *in + if in.Pattern != nil { + in, out := &in.Pattern, &out.Pattern + *out = new(string) + **out = **in + } + if in.Regex != nil { + in, out := &in.Regex, &out.Regex + *out = new(bool) + **out = **in + } + if in.Hash != nil { + in, out := &in.Hash, &out.Hash + *out = new(uint32) + **out = **in + } + if in.Types != nil { + in, out := &in.Types, &out.Types + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockedQueryInput. +func (in *BlockedQueryInput) DeepCopy() *BlockedQueryInput { + if in == nil { + return nil + } + out := new(BlockedQueryInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Config) DeepCopyInto(out *Config) { *out = *in @@ -213,6 +247,36 @@ func (in *DimensionMappings) DeepCopy() *DimensionMappings { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DimensionMappingsInput) DeepCopyInto(out *DimensionMappingsInput) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.SourceLabel != nil { + in, out := &in.SourceLabel, &out.SourceLabel + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Join != nil { + in, out := &in.Join, &out.Join + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DimensionMappingsInput. +func (in *DimensionMappingsInput) DeepCopy() *DimensionMappingsInput { + if in == nil { + return nil + } + out := new(DimensionMappingsInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FilterPolicy) DeepCopyInto(out *FilterPolicy) { *out = *in @@ -238,6 +302,31 @@ func (in *FilterPolicy) DeepCopy() *FilterPolicy { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FilterPolicyInput) DeepCopyInto(out *FilterPolicyInput) { + *out = *in + if in.Include != nil { + in, out := &in.Include, &out.Include + *out = new(PolicyMatch) + (*in).DeepCopyInto(*out) + } + if in.Exclude != nil { + in, out := &in.Exclude, &out.Exclude + *out = new(PolicyMatch) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterPolicyInput. +func (in *FilterPolicyInput) DeepCopy() *FilterPolicyInput { + if in == nil { + return nil + } + out := new(FilterPolicyInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HTTPClientConfig) DeepCopyInto(out *HTTPClientConfig) { *out = *in @@ -1056,6 +1145,27 @@ func (in *MatchPolicyAttribute) DeepCopy() *MatchPolicyAttribute { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MatchPolicyAttributeInput) DeepCopyInto(out *MatchPolicyAttributeInput) { + *out = *in + if in.Key != nil { + in, out := &in.Key, &out.Key + *out = new(string) + **out = **in + } + in.Value.DeepCopyInto(&out.Value) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchPolicyAttributeInput. +func (in *MatchPolicyAttributeInput) DeepCopy() *MatchPolicyAttributeInput { + if in == nil { + return nil + } + out := new(MatchPolicyAttributeInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetadataConfig) DeepCopyInto(out *MetadataConfig) { *out = *in @@ -2069,6 +2179,16 @@ func (in *MultiRuntimeConfig) DeepCopy() *MultiRuntimeConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NotifierBasicAuth) DeepCopyInto(out *NotifierBasicAuth) { *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierBasicAuth. @@ -2081,6 +2201,31 @@ func (in *NotifierBasicAuth) DeepCopy() *NotifierBasicAuth { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NotifierBasicAuthInput) DeepCopyInto(out *NotifierBasicAuthInput) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierBasicAuthInput. +func (in *NotifierBasicAuthInput) DeepCopy() *NotifierBasicAuthInput { + if in == nil { + return nil + } + out := new(NotifierBasicAuthInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NotifierConfig) DeepCopyInto(out *NotifierConfig) { *out = *in @@ -2092,12 +2237,12 @@ func (in *NotifierConfig) DeepCopyInto(out *NotifierConfig) { if in.BasicAuth != nil { in, out := &in.BasicAuth, &out.BasicAuth *out = new(NotifierBasicAuth) - **out = **in + (*in).DeepCopyInto(*out) } if in.HeaderAuth != nil { in, out := &in.HeaderAuth, &out.HeaderAuth *out = new(NotifierHeaderAuth) - **out = **in + (*in).DeepCopyInto(*out) } } @@ -2111,9 +2256,54 @@ func (in *NotifierConfig) DeepCopy() *NotifierConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NotifierConfigInput) DeepCopyInto(out *NotifierConfigInput) { + *out = *in + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(NotifierTLSClientConfig) + (*in).DeepCopyInto(*out) + } + if in.BasicAuth != nil { + in, out := &in.BasicAuth, &out.BasicAuth + *out = new(NotifierBasicAuth) + (*in).DeepCopyInto(*out) + } + if in.HeaderAuth != nil { + in, out := &in.HeaderAuth, &out.HeaderAuth + *out = new(NotifierHeaderAuth) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierConfigInput. +func (in *NotifierConfigInput) DeepCopy() *NotifierConfigInput { + if in == nil { + return nil + } + out := new(NotifierConfigInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NotifierHeaderAuth) DeepCopyInto(out *NotifierHeaderAuth) { *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Credentials != nil { + in, out := &in.Credentials, &out.Credentials + *out = new(string) + **out = **in + } + if in.CredentialsFile != nil { + in, out := &in.CredentialsFile, &out.CredentialsFile + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierHeaderAuth. @@ -2126,6 +2316,36 @@ func (in *NotifierHeaderAuth) DeepCopy() *NotifierHeaderAuth { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NotifierHeaderAuthInput) DeepCopyInto(out *NotifierHeaderAuthInput) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Credentials != nil { + in, out := &in.Credentials, &out.Credentials + *out = new(string) + **out = **in + } + if in.CredentialsFile != nil { + in, out := &in.CredentialsFile, &out.CredentialsFile + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierHeaderAuthInput. +func (in *NotifierHeaderAuthInput) DeepCopy() *NotifierHeaderAuthInput { + if in == nil { + return nil + } + out := new(NotifierHeaderAuthInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NotifierTLSClientConfig) DeepCopyInto(out *NotifierTLSClientConfig) { *out = *in @@ -2176,6 +2396,56 @@ func (in *NotifierTLSClientConfig) DeepCopy() *NotifierTLSClientConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NotifierTLSClientConfigInput) DeepCopyInto(out *NotifierTLSClientConfigInput) { + *out = *in + if in.CertPath != nil { + in, out := &in.CertPath, &out.CertPath + *out = new(string) + **out = **in + } + if in.KeyPath != nil { + in, out := &in.KeyPath, &out.KeyPath + *out = new(string) + **out = **in + } + if in.CAPath != nil { + in, out := &in.CAPath, &out.CAPath + *out = new(string) + **out = **in + } + if in.ServerName != nil { + in, out := &in.ServerName, &out.ServerName + *out = new(string) + **out = **in + } + if in.InsecureSkipVerify != nil { + in, out := &in.InsecureSkipVerify, &out.InsecureSkipVerify + *out = new(bool) + **out = **in + } + if in.CipherSuites != nil { + in, out := &in.CipherSuites, &out.CipherSuites + *out = new(string) + **out = **in + } + if in.MinVersion != nil { + in, out := &in.MinVersion, &out.MinVersion + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierTLSClientConfigInput. +func (in *NotifierTLSClientConfigInput) DeepCopy() *NotifierTLSClientConfigInput { + if in == nil { + return nil + } + out := new(NotifierTLSClientConfigInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OAuth2) DeepCopyInto(out *OAuth2) { *out = *in @@ -2252,6 +2522,28 @@ func (in *PolicyMatch) DeepCopy() *PolicyMatch { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyMatchInput) DeepCopyInto(out *PolicyMatchInput) { + *out = *in + if in.Attributes != nil { + in, out := &in.Attributes, &out.Attributes + *out = make([]MatchPolicyAttribute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyMatchInput. +func (in *PolicyMatchInput) DeepCopy() *PolicyMatchInput { + if in == nil { + return nil + } + out := new(PolicyMatchInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig) { *out = *in @@ -2357,11 +2649,11 @@ func (in *RelabelConfig) DeepCopyInto(out *RelabelConfig) { *out = *in if in.SourceLabels != nil { in, out := &in.SourceLabels, &out.SourceLabels - *out = make([]*monitoringv1.LabelName, len(*in)) + *out = make([]*LabelName, len(*in)) for i := range *in { if (*in)[i] != nil { in, out := &(*in)[i], &(*out)[i] - *out = new(monitoringv1.LabelName) + *out = new(LabelName) **out = **in } } @@ -2393,7 +2685,7 @@ func (in *RelabelConfig) DeepCopyInto(out *RelabelConfig) { } if in.Action != nil { in, out := &in.Action, &out.Action - *out = new(string) + *out = new(RelabelAction) **out = **in } } @@ -2408,6 +2700,62 @@ func (in *RelabelConfig) DeepCopy() *RelabelConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RelabelConfigInput) DeepCopyInto(out *RelabelConfigInput) { + *out = *in + if in.SourceLabels != nil { + in, out := &in.SourceLabels, &out.SourceLabels + *out = make([]*LabelName, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(LabelName) + **out = **in + } + } + } + if in.Separator != nil { + in, out := &in.Separator, &out.Separator + *out = new(string) + **out = **in + } + if in.Regex != nil { + in, out := &in.Regex, &out.Regex + *out = new(string) + **out = **in + } + if in.Modulus != nil { + in, out := &in.Modulus, &out.Modulus + *out = new(uint64) + **out = **in + } + if in.TargetLabel != nil { + in, out := &in.TargetLabel, &out.TargetLabel + *out = new(string) + **out = **in + } + if in.Replacement != nil { + in, out := &in.Replacement, &out.Replacement + *out = new(string) + **out = **in + } + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(RelabelAction) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RelabelConfigInput. +func (in *RelabelConfigInput) DeepCopy() *RelabelConfigInput { + if in == nil { + return nil + } + out := new(RelabelConfigInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RemoteWriteSpec) DeepCopyInto(out *RemoteWriteSpec) { *out = *in @@ -2494,6 +2842,11 @@ func (in *RulerAlertManagerConfig) DeepCopyInto(out *RulerAlertManagerConfig) { *out = new(v1.Duration) **out = **in } + if in.AlertmanangerEnableV2API != nil { + in, out := &in.AlertmanangerEnableV2API, &out.AlertmanangerEnableV2API + *out = new(bool) + **out = **in + } if in.AlertRelabelConfigs != nil { in, out := &in.AlertRelabelConfigs, &out.AlertRelabelConfigs *out = make([]*RelabelConfig, len(*in)) @@ -2505,12 +2858,21 @@ func (in *RulerAlertManagerConfig) DeepCopyInto(out *RulerAlertManagerConfig) { } } } + if in.NotificationQueueCapacity != nil { + in, out := &in.NotificationQueueCapacity, &out.NotificationQueueCapacity + *out = new(int) + **out = **in + } if in.NotificationTimeout != nil { in, out := &in.NotificationTimeout, &out.NotificationTimeout *out = new(v1.Duration) **out = **in } - in.Notifier.DeepCopyInto(&out.Notifier) + if in.Notifier != nil { + in, out := &in.Notifier, &out.Notifier + *out = new(NotifierConfig) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RulerAlertManagerConfig. @@ -2523,6 +2885,62 @@ func (in *RulerAlertManagerConfig) DeepCopy() *RulerAlertManagerConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RulerAlertManagerConfigInput) DeepCopyInto(out *RulerAlertManagerConfigInput) { + *out = *in + if in.AlertmanagerDiscovery != nil { + in, out := &in.AlertmanagerDiscovery, &out.AlertmanagerDiscovery + *out = new(bool) + **out = **in + } + if in.AlertmanagerRefreshInterval != nil { + in, out := &in.AlertmanagerRefreshInterval, &out.AlertmanagerRefreshInterval + *out = new(v1.Duration) + **out = **in + } + if in.AlertmanangerEnableV2API != nil { + in, out := &in.AlertmanangerEnableV2API, &out.AlertmanangerEnableV2API + *out = new(bool) + **out = **in + } + if in.AlertRelabelConfigs != nil { + in, out := &in.AlertRelabelConfigs, &out.AlertRelabelConfigs + *out = make([]*RelabelConfig, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(RelabelConfig) + (*in).DeepCopyInto(*out) + } + } + } + if in.NotificationQueueCapacity != nil { + in, out := &in.NotificationQueueCapacity, &out.NotificationQueueCapacity + *out = new(int) + **out = **in + } + if in.NotificationTimeout != nil { + in, out := &in.NotificationTimeout, &out.NotificationTimeout + *out = new(v1.Duration) + **out = **in + } + if in.Notifier != nil { + in, out := &in.Notifier, &out.Notifier + *out = new(NotifierConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RulerAlertManagerConfigInput. +func (in *RulerAlertManagerConfigInput) DeepCopy() *RulerAlertManagerConfigInput { + if in == nil { + return nil + } + out := new(RulerAlertManagerConfigInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ShardstreamsConfig) DeepCopyInto(out *ShardstreamsConfig) { *out = *in @@ -2553,6 +2971,36 @@ func (in *ShardstreamsConfig) DeepCopy() *ShardstreamsConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShardstreamsConfigInput) DeepCopyInto(out *ShardstreamsConfigInput) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.LoggingEnabled != nil { + in, out := &in.LoggingEnabled, &out.LoggingEnabled + *out = new(bool) + **out = **in + } + if in.DesiredRate != nil { + in, out := &in.DesiredRate, &out.DesiredRate + *out = new(uint64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardstreamsConfigInput. +func (in *ShardstreamsConfigInput) DeepCopy() *ShardstreamsConfigInput { + if in == nil { + return nil + } + out := new(ShardstreamsConfigInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SigV4Config) DeepCopyInto(out *SigV4Config) { *out = *in @@ -2596,7 +3044,11 @@ func (in *SigV4Config) DeepCopy() *SigV4Config { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StreamRetention) DeepCopyInto(out *StreamRetention) { *out = *in - out.Period = in.Period + if in.Period != nil { + in, out := &in.Period, &out.Period + *out = new(v1.Duration) + **out = **in + } if in.Priority != nil { in, out := &in.Priority, &out.Priority *out = new(int) @@ -2619,6 +3071,36 @@ func (in *StreamRetention) DeepCopy() *StreamRetention { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StreamRetentionInput) DeepCopyInto(out *StreamRetentionInput) { + *out = *in + if in.Period != nil { + in, out := &in.Period, &out.Period + *out = new(v1.Duration) + **out = **in + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int) + **out = **in + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StreamRetentionInput. +func (in *StreamRetentionInput) DeepCopy() *StreamRetentionInput { + if in == nil { + return nil + } + out := new(StreamRetentionInput) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TempoLimits) DeepCopyInto(out *TempoLimits) { *out = *in diff --git a/config/crd/bases/observability.traceshield.io_tenants.yaml b/config/crd/bases/observability.traceshield.io_tenants.yaml index 546ee41..9da243c 100644 --- a/config/crd/bases/observability.traceshield.io_tenants.yaml +++ b/config/crd/bases/observability.traceshield.io_tenants.yaml @@ -167,10 +167,6 @@ spec: type: integer selector: type: string - required: - - period - - priority - - selector type: object type: array ruler_alertmanager_config: