diff --git a/Makefile b/Makefile index 7a22f28e6..0bbf4fb30 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ API_DOC_GEN_BINARY=$(TOOLS_BIN_DIR)/gen-crd-api-reference-docs TOOLING=$(CONTROLLER_GEN_BINARY) $(GOBINDATA_BINARY) $(JB_BINARY) $(GOJSONTOYAML_BINARY) $(JSONNET_BINARY) $(JSONNETFMT_BINARY) $(SHELLCHECK_BINARY) $(PROMLINTER_BINARY) $(GOLANGCILINTER_BINARY) $(MDOX_BINARY) $(API_DOC_GEN_BINARY) -K8S_GEN_BINARIES:=informer-gen lister-gen client-gen +K8S_GEN_BINARIES:=informer-gen lister-gen client-gen applyconfiguration-gen K8S_GEN_ARGS:=--go-header-file $(shell pwd)/.header --v=1 --logtostderr K8S_GEN_DEPS:=.header @@ -124,15 +124,23 @@ $(DEEPCOPY_TARGETS): $(CONTROLLER_GEN_BINARY) .PHONY: k8s-client-gen k8s-client-gen: $(K8S_GEN_DEPS) - rm -rf pkg/client/{versioned,informers,listers} + rm -rf pkg/client/{versioned,informers,listers,applyconfiguration} + @echo ">> generating pkg/client/applyconfiguration..." + $(APPLYCONFIGURATION_GEN_BINARY) \ + $(K8S_GEN_ARGS) \ + --input-dirs "$(GO_PKG)/pkg/apis/monitoring/v1,$(GO_PKG)/pkg/apis/monitoring/v1alpha1,$(GO_PKG)/pkg/apis/monitoring/v1beta1" \ + --output-package "$(GO_PKG)/pkg/client/applyconfiguration" \ + --output-base "." + mv $(GO_PKG)/pkg/client/applyconfiguration pkg/client @echo ">> generating pkg/client/versioned..." $(CLIENT_GEN_BINARY) \ $(K8S_GEN_ARGS) \ - --input-base "" \ - --clientset-name "versioned" \ - --input "$(GO_PKG)/pkg/apis/monitoring/v1,$(GO_PKG)/pkg/apis/monitoring/v1alpha1,$(GO_PKG)/pkg/apis/monitoring/v1beta1" \ - --output-package "$(GO_PKG)/pkg/client" \ - --output-base "." + --input-base "" \ + --apply-configuration-package "$(GO_PKG)/pkg/client/applyconfiguration" \ + --clientset-name "versioned" \ + --input "$(GO_PKG)/pkg/apis/monitoring/v1,$(GO_PKG)/pkg/apis/monitoring/v1alpha1,$(GO_PKG)/pkg/apis/monitoring/v1beta1" \ + --output-package "$(GO_PKG)/pkg/client" \ + --output-base "." @echo ">> generating pkg/client/listers..." $(LISTER_GEN_BINARY) \ $(K8S_GEN_ARGS) \ diff --git a/pkg/client/applyconfiguration/internal/internal.go b/pkg/client/applyconfiguration/internal/internal.go new file mode 100644 index 000000000..9b36014dc --- /dev/null +++ b/pkg/client/applyconfiguration/internal/internal.go @@ -0,0 +1,60 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertingspec.go b/pkg/client/applyconfiguration/monitoring/v1/alertingspec.go new file mode 100644 index 000000000..a35f80e0f --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertingspec.go @@ -0,0 +1,42 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AlertingSpecApplyConfiguration represents an declarative configuration of the AlertingSpec type for use +// with apply. +type AlertingSpecApplyConfiguration struct { + Alertmanagers []AlertmanagerEndpointsApplyConfiguration `json:"alertmanagers,omitempty"` +} + +// AlertingSpecApplyConfiguration constructs an declarative configuration of the AlertingSpec type for use with +// apply. +func AlertingSpec() *AlertingSpecApplyConfiguration { + return &AlertingSpecApplyConfiguration{} +} + +// WithAlertmanagers adds the given value to the Alertmanagers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Alertmanagers field. +func (b *AlertingSpecApplyConfiguration) WithAlertmanagers(values ...*AlertmanagerEndpointsApplyConfiguration) *AlertingSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAlertmanagers") + } + b.Alertmanagers = append(b.Alertmanagers, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanager.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanager.go new file mode 100644 index 000000000..5df19c3b3 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanager.go @@ -0,0 +1,217 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// AlertmanagerApplyConfiguration represents an declarative configuration of the Alertmanager type for use +// with apply. +type AlertmanagerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *AlertmanagerSpecApplyConfiguration `json:"spec,omitempty"` + Status *AlertmanagerStatusApplyConfiguration `json:"status,omitempty"` +} + +// Alertmanager constructs an declarative configuration of the Alertmanager type for use with +// apply. +func Alertmanager(name, namespace string) *AlertmanagerApplyConfiguration { + b := &AlertmanagerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Alertmanager") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithKind(value string) *AlertmanagerApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithAPIVersion(value string) *AlertmanagerApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithName(value string) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithGenerateName(value string) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithNamespace(value string) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithUID(value types.UID) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithResourceVersion(value string) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithGeneration(value int64) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *AlertmanagerApplyConfiguration) WithLabels(entries map[string]string) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *AlertmanagerApplyConfiguration) WithAnnotations(entries map[string]string) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *AlertmanagerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *AlertmanagerApplyConfiguration) WithFinalizers(values ...string) *AlertmanagerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *AlertmanagerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithSpec(value *AlertmanagerSpecApplyConfiguration) *AlertmanagerApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *AlertmanagerApplyConfiguration) WithStatus(value *AlertmanagerStatusApplyConfiguration) *AlertmanagerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanagerconfigmatcherstrategy.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerconfigmatcherstrategy.go new file mode 100644 index 000000000..5aa4c55bf --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerconfigmatcherstrategy.go @@ -0,0 +1,37 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AlertmanagerConfigMatcherStrategyApplyConfiguration represents an declarative configuration of the AlertmanagerConfigMatcherStrategy type for use +// with apply. +type AlertmanagerConfigMatcherStrategyApplyConfiguration struct { + Type *string `json:"type,omitempty"` +} + +// AlertmanagerConfigMatcherStrategyApplyConfiguration constructs an declarative configuration of the AlertmanagerConfigMatcherStrategy type for use with +// apply. +func AlertmanagerConfigMatcherStrategy() *AlertmanagerConfigMatcherStrategyApplyConfiguration { + return &AlertmanagerConfigMatcherStrategyApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *AlertmanagerConfigMatcherStrategyApplyConfiguration) WithType(value string) *AlertmanagerConfigMatcherStrategyApplyConfiguration { + b.Type = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanagerconfiguration.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerconfiguration.go new file mode 100644 index 000000000..42c3e39ad --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerconfiguration.go @@ -0,0 +1,60 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AlertmanagerConfigurationApplyConfiguration represents an declarative configuration of the AlertmanagerConfiguration type for use +// with apply. +type AlertmanagerConfigurationApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Global *AlertmanagerGlobalConfigApplyConfiguration `json:"global,omitempty"` + Templates []SecretOrConfigMapApplyConfiguration `json:"templates,omitempty"` +} + +// AlertmanagerConfigurationApplyConfiguration constructs an declarative configuration of the AlertmanagerConfiguration type for use with +// apply. +func AlertmanagerConfiguration() *AlertmanagerConfigurationApplyConfiguration { + return &AlertmanagerConfigurationApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AlertmanagerConfigurationApplyConfiguration) WithName(value string) *AlertmanagerConfigurationApplyConfiguration { + b.Name = &value + return b +} + +// WithGlobal sets the Global field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Global field is set to the value of the last call. +func (b *AlertmanagerConfigurationApplyConfiguration) WithGlobal(value *AlertmanagerGlobalConfigApplyConfiguration) *AlertmanagerConfigurationApplyConfiguration { + b.Global = value + return b +} + +// WithTemplates adds the given value to the Templates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Templates field. +func (b *AlertmanagerConfigurationApplyConfiguration) WithTemplates(values ...*SecretOrConfigMapApplyConfiguration) *AlertmanagerConfigurationApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTemplates") + } + b.Templates = append(b.Templates, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanagerendpoints.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerendpoints.go new file mode 100644 index 000000000..f995a6504 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerendpoints.go @@ -0,0 +1,141 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// AlertmanagerEndpointsApplyConfiguration represents an declarative configuration of the AlertmanagerEndpoints type for use +// with apply. +type AlertmanagerEndpointsApplyConfiguration struct { + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` + Port *intstr.IntOrString `json:"port,omitempty"` + Scheme *string `json:"scheme,omitempty"` + PathPrefix *string `json:"pathPrefix,omitempty"` + TLSConfig *TLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + BearerTokenFile *string `json:"bearerTokenFile,omitempty"` + Authorization *SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` + Timeout *monitoringv1.Duration `json:"timeout,omitempty"` + EnableHttp2 *bool `json:"enableHttp2,omitempty"` +} + +// AlertmanagerEndpointsApplyConfiguration constructs an declarative configuration of the AlertmanagerEndpoints type for use with +// apply. +func AlertmanagerEndpoints() *AlertmanagerEndpointsApplyConfiguration { + return &AlertmanagerEndpointsApplyConfiguration{} +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithNamespace(value string) *AlertmanagerEndpointsApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithName(value string) *AlertmanagerEndpointsApplyConfiguration { + b.Name = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithPort(value intstr.IntOrString) *AlertmanagerEndpointsApplyConfiguration { + b.Port = &value + return b +} + +// WithScheme sets the Scheme field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheme field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithScheme(value string) *AlertmanagerEndpointsApplyConfiguration { + b.Scheme = &value + return b +} + +// WithPathPrefix sets the PathPrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PathPrefix field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithPathPrefix(value string) *AlertmanagerEndpointsApplyConfiguration { + b.PathPrefix = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithTLSConfig(value *TLSConfigApplyConfiguration) *AlertmanagerEndpointsApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *AlertmanagerEndpointsApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithBearerTokenFile sets the BearerTokenFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenFile field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithBearerTokenFile(value string) *AlertmanagerEndpointsApplyConfiguration { + b.BearerTokenFile = &value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithAuthorization(value *SafeAuthorizationApplyConfiguration) *AlertmanagerEndpointsApplyConfiguration { + b.Authorization = value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithAPIVersion(value string) *AlertmanagerEndpointsApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithTimeout sets the Timeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Timeout field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithTimeout(value monitoringv1.Duration) *AlertmanagerEndpointsApplyConfiguration { + b.Timeout = &value + return b +} + +// WithEnableHttp2 sets the EnableHttp2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableHttp2 field is set to the value of the last call. +func (b *AlertmanagerEndpointsApplyConfiguration) WithEnableHttp2(value bool) *AlertmanagerEndpointsApplyConfiguration { + b.EnableHttp2 = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanagerglobalconfig.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerglobalconfig.go new file mode 100644 index 000000000..71668fb43 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerglobalconfig.go @@ -0,0 +1,50 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// AlertmanagerGlobalConfigApplyConfiguration represents an declarative configuration of the AlertmanagerGlobalConfig type for use +// with apply. +type AlertmanagerGlobalConfigApplyConfiguration struct { + ResolveTimeout *v1.Duration `json:"resolveTimeout,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// AlertmanagerGlobalConfigApplyConfiguration constructs an declarative configuration of the AlertmanagerGlobalConfig type for use with +// apply. +func AlertmanagerGlobalConfig() *AlertmanagerGlobalConfigApplyConfiguration { + return &AlertmanagerGlobalConfigApplyConfiguration{} +} + +// WithResolveTimeout sets the ResolveTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResolveTimeout field is set to the value of the last call. +func (b *AlertmanagerGlobalConfigApplyConfiguration) WithResolveTimeout(value v1.Duration) *AlertmanagerGlobalConfigApplyConfiguration { + b.ResolveTimeout = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *AlertmanagerGlobalConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *AlertmanagerGlobalConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanagerspec.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerspec.go new file mode 100644 index 000000000..2e7b524e0 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerspec.go @@ -0,0 +1,479 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AlertmanagerSpecApplyConfiguration represents an declarative configuration of the AlertmanagerSpec type for use +// with apply. +type AlertmanagerSpecApplyConfiguration struct { + PodMetadata *EmbeddedObjectMetadataApplyConfiguration `json:"podMetadata,omitempty"` + Image *string `json:"image,omitempty"` + ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + Version *string `json:"version,omitempty"` + Tag *string `json:"tag,omitempty"` + SHA *string `json:"sha,omitempty"` + BaseImage *string `json:"baseImage,omitempty"` + ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` + Secrets []string `json:"secrets,omitempty"` + ConfigMaps []string `json:"configMaps,omitempty"` + ConfigSecret *string `json:"configSecret,omitempty"` + LogLevel *string `json:"logLevel,omitempty"` + LogFormat *string `json:"logFormat,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Retention *monitoringv1.GoDuration `json:"retention,omitempty"` + Storage *StorageSpecApplyConfiguration `json:"storage,omitempty"` + Volumes []corev1.Volume `json:"volumes,omitempty"` + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` + ExternalURL *string `json:"externalUrl,omitempty"` + RoutePrefix *string `json:"routePrefix,omitempty"` + Paused *bool `json:"paused,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` + Affinity *corev1.Affinity `json:"affinity,omitempty"` + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` + SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` + ServiceAccountName *string `json:"serviceAccountName,omitempty"` + ListenLocal *bool `json:"listenLocal,omitempty"` + Containers []corev1.Container `json:"containers,omitempty"` + InitContainers []corev1.Container `json:"initContainers,omitempty"` + PriorityClassName *string `json:"priorityClassName,omitempty"` + AdditionalPeers []string `json:"additionalPeers,omitempty"` + ClusterAdvertiseAddress *string `json:"clusterAdvertiseAddress,omitempty"` + ClusterGossipInterval *monitoringv1.GoDuration `json:"clusterGossipInterval,omitempty"` + ClusterPushpullInterval *monitoringv1.GoDuration `json:"clusterPushpullInterval,omitempty"` + ClusterPeerTimeout *monitoringv1.GoDuration `json:"clusterPeerTimeout,omitempty"` + PortName *string `json:"portName,omitempty"` + ForceEnableClusterMode *bool `json:"forceEnableClusterMode,omitempty"` + AlertmanagerConfigSelector *metav1.LabelSelector `json:"alertmanagerConfigSelector,omitempty"` + AlertmanagerConfigMatcherStrategy *AlertmanagerConfigMatcherStrategyApplyConfiguration `json:"alertmanagerConfigMatcherStrategy,omitempty"` + AlertmanagerConfigNamespaceSelector *metav1.LabelSelector `json:"alertmanagerConfigNamespaceSelector,omitempty"` + MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"` + HostAliases []HostAliasApplyConfiguration `json:"hostAliases,omitempty"` + Web *AlertmanagerWebSpecApplyConfiguration `json:"web,omitempty"` + AlertmanagerConfiguration *AlertmanagerConfigurationApplyConfiguration `json:"alertmanagerConfiguration,omitempty"` +} + +// AlertmanagerSpecApplyConfiguration constructs an declarative configuration of the AlertmanagerSpec type for use with +// apply. +func AlertmanagerSpec() *AlertmanagerSpecApplyConfiguration { + return &AlertmanagerSpecApplyConfiguration{} +} + +// WithPodMetadata sets the PodMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMetadata field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithPodMetadata(value *EmbeddedObjectMetadataApplyConfiguration) *AlertmanagerSpecApplyConfiguration { + b.PodMetadata = value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithImage(value string) *AlertmanagerSpecApplyConfiguration { + b.Image = &value + return b +} + +// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImagePullPolicy field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *AlertmanagerSpecApplyConfiguration { + b.ImagePullPolicy = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithVersion(value string) *AlertmanagerSpecApplyConfiguration { + b.Version = &value + return b +} + +// WithTag sets the Tag field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Tag field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithTag(value string) *AlertmanagerSpecApplyConfiguration { + b.Tag = &value + return b +} + +// WithSHA sets the SHA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SHA field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithSHA(value string) *AlertmanagerSpecApplyConfiguration { + b.SHA = &value + return b +} + +// WithBaseImage sets the BaseImage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BaseImage field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithBaseImage(value string) *AlertmanagerSpecApplyConfiguration { + b.BaseImage = &value + return b +} + +// WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. +func (b *AlertmanagerSpecApplyConfiguration) WithImagePullSecrets(values ...corev1.LocalObjectReference) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.ImagePullSecrets = append(b.ImagePullSecrets, values[i]) + } + return b +} + +// WithSecrets adds the given value to the Secrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Secrets field. +func (b *AlertmanagerSpecApplyConfiguration) WithSecrets(values ...string) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.Secrets = append(b.Secrets, values[i]) + } + return b +} + +// WithConfigMaps adds the given value to the ConfigMaps field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ConfigMaps field. +func (b *AlertmanagerSpecApplyConfiguration) WithConfigMaps(values ...string) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.ConfigMaps = append(b.ConfigMaps, values[i]) + } + return b +} + +// WithConfigSecret sets the ConfigSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigSecret field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithConfigSecret(value string) *AlertmanagerSpecApplyConfiguration { + b.ConfigSecret = &value + return b +} + +// WithLogLevel sets the LogLevel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogLevel field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithLogLevel(value string) *AlertmanagerSpecApplyConfiguration { + b.LogLevel = &value + return b +} + +// WithLogFormat sets the LogFormat field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogFormat field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithLogFormat(value string) *AlertmanagerSpecApplyConfiguration { + b.LogFormat = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithReplicas(value int32) *AlertmanagerSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithRetention sets the Retention field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Retention field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithRetention(value monitoringv1.GoDuration) *AlertmanagerSpecApplyConfiguration { + b.Retention = &value + return b +} + +// WithStorage sets the Storage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Storage field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithStorage(value *StorageSpecApplyConfiguration) *AlertmanagerSpecApplyConfiguration { + b.Storage = value + return b +} + +// WithVolumes adds the given value to the Volumes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Volumes field. +func (b *AlertmanagerSpecApplyConfiguration) WithVolumes(values ...corev1.Volume) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.Volumes = append(b.Volumes, values[i]) + } + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *AlertmanagerSpecApplyConfiguration) WithVolumeMounts(values ...corev1.VolumeMount) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.VolumeMounts = append(b.VolumeMounts, values[i]) + } + return b +} + +// WithExternalURL sets the ExternalURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExternalURL field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithExternalURL(value string) *AlertmanagerSpecApplyConfiguration { + b.ExternalURL = &value + return b +} + +// WithRoutePrefix sets the RoutePrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutePrefix field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithRoutePrefix(value string) *AlertmanagerSpecApplyConfiguration { + b.RoutePrefix = &value + return b +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithPaused(value bool) *AlertmanagerSpecApplyConfiguration { + b.Paused = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *AlertmanagerSpecApplyConfiguration) WithNodeSelector(entries map[string]string) *AlertmanagerSpecApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithResources(value corev1.ResourceRequirements) *AlertmanagerSpecApplyConfiguration { + b.Resources = &value + return b +} + +// WithAffinity sets the Affinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Affinity field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithAffinity(value corev1.Affinity) *AlertmanagerSpecApplyConfiguration { + b.Affinity = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *AlertmanagerSpecApplyConfiguration) WithTolerations(values ...corev1.Toleration) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.Tolerations = append(b.Tolerations, values[i]) + } + return b +} + +// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. +func (b *AlertmanagerSpecApplyConfiguration) WithTopologySpreadConstraints(values ...corev1.TopologySpreadConstraint) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, values[i]) + } + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithSecurityContext(value corev1.PodSecurityContext) *AlertmanagerSpecApplyConfiguration { + b.SecurityContext = &value + return b +} + +// WithServiceAccountName sets the ServiceAccountName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountName field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithServiceAccountName(value string) *AlertmanagerSpecApplyConfiguration { + b.ServiceAccountName = &value + return b +} + +// WithListenLocal sets the ListenLocal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ListenLocal field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithListenLocal(value bool) *AlertmanagerSpecApplyConfiguration { + b.ListenLocal = &value + return b +} + +// WithContainers adds the given value to the Containers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Containers field. +func (b *AlertmanagerSpecApplyConfiguration) WithContainers(values ...corev1.Container) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.Containers = append(b.Containers, values[i]) + } + return b +} + +// WithInitContainers adds the given value to the InitContainers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InitContainers field. +func (b *AlertmanagerSpecApplyConfiguration) WithInitContainers(values ...corev1.Container) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.InitContainers = append(b.InitContainers, values[i]) + } + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithPriorityClassName(value string) *AlertmanagerSpecApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithAdditionalPeers adds the given value to the AdditionalPeers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AdditionalPeers field. +func (b *AlertmanagerSpecApplyConfiguration) WithAdditionalPeers(values ...string) *AlertmanagerSpecApplyConfiguration { + for i := range values { + b.AdditionalPeers = append(b.AdditionalPeers, values[i]) + } + return b +} + +// WithClusterAdvertiseAddress sets the ClusterAdvertiseAddress field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterAdvertiseAddress field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithClusterAdvertiseAddress(value string) *AlertmanagerSpecApplyConfiguration { + b.ClusterAdvertiseAddress = &value + return b +} + +// WithClusterGossipInterval sets the ClusterGossipInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterGossipInterval field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithClusterGossipInterval(value monitoringv1.GoDuration) *AlertmanagerSpecApplyConfiguration { + b.ClusterGossipInterval = &value + return b +} + +// WithClusterPushpullInterval sets the ClusterPushpullInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterPushpullInterval field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithClusterPushpullInterval(value monitoringv1.GoDuration) *AlertmanagerSpecApplyConfiguration { + b.ClusterPushpullInterval = &value + return b +} + +// WithClusterPeerTimeout sets the ClusterPeerTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterPeerTimeout field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithClusterPeerTimeout(value monitoringv1.GoDuration) *AlertmanagerSpecApplyConfiguration { + b.ClusterPeerTimeout = &value + return b +} + +// WithPortName sets the PortName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortName field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithPortName(value string) *AlertmanagerSpecApplyConfiguration { + b.PortName = &value + return b +} + +// WithForceEnableClusterMode sets the ForceEnableClusterMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ForceEnableClusterMode field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithForceEnableClusterMode(value bool) *AlertmanagerSpecApplyConfiguration { + b.ForceEnableClusterMode = &value + return b +} + +// WithAlertmanagerConfigSelector sets the AlertmanagerConfigSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertmanagerConfigSelector field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithAlertmanagerConfigSelector(value metav1.LabelSelector) *AlertmanagerSpecApplyConfiguration { + b.AlertmanagerConfigSelector = &value + return b +} + +// WithAlertmanagerConfigMatcherStrategy sets the AlertmanagerConfigMatcherStrategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertmanagerConfigMatcherStrategy field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithAlertmanagerConfigMatcherStrategy(value *AlertmanagerConfigMatcherStrategyApplyConfiguration) *AlertmanagerSpecApplyConfiguration { + b.AlertmanagerConfigMatcherStrategy = value + return b +} + +// WithAlertmanagerConfigNamespaceSelector sets the AlertmanagerConfigNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertmanagerConfigNamespaceSelector field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithAlertmanagerConfigNamespaceSelector(value metav1.LabelSelector) *AlertmanagerSpecApplyConfiguration { + b.AlertmanagerConfigNamespaceSelector = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithMinReadySeconds(value uint32) *AlertmanagerSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithHostAliases adds the given value to the HostAliases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HostAliases field. +func (b *AlertmanagerSpecApplyConfiguration) WithHostAliases(values ...*HostAliasApplyConfiguration) *AlertmanagerSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHostAliases") + } + b.HostAliases = append(b.HostAliases, *values[i]) + } + return b +} + +// WithWeb sets the Web field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Web field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithWeb(value *AlertmanagerWebSpecApplyConfiguration) *AlertmanagerSpecApplyConfiguration { + b.Web = value + return b +} + +// WithAlertmanagerConfiguration sets the AlertmanagerConfiguration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertmanagerConfiguration field is set to the value of the last call. +func (b *AlertmanagerSpecApplyConfiguration) WithAlertmanagerConfiguration(value *AlertmanagerConfigurationApplyConfiguration) *AlertmanagerSpecApplyConfiguration { + b.AlertmanagerConfiguration = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanagerstatus.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerstatus.go new file mode 100644 index 000000000..98c6cb148 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerstatus.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AlertmanagerStatusApplyConfiguration represents an declarative configuration of the AlertmanagerStatus type for use +// with apply. +type AlertmanagerStatusApplyConfiguration struct { + Paused *bool `json:"paused,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` +} + +// AlertmanagerStatusApplyConfiguration constructs an declarative configuration of the AlertmanagerStatus type for use with +// apply. +func AlertmanagerStatus() *AlertmanagerStatusApplyConfiguration { + return &AlertmanagerStatusApplyConfiguration{} +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *AlertmanagerStatusApplyConfiguration) WithPaused(value bool) *AlertmanagerStatusApplyConfiguration { + b.Paused = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *AlertmanagerStatusApplyConfiguration) WithReplicas(value int32) *AlertmanagerStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdatedReplicas field is set to the value of the last call. +func (b *AlertmanagerStatusApplyConfiguration) WithUpdatedReplicas(value int32) *AlertmanagerStatusApplyConfiguration { + b.UpdatedReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *AlertmanagerStatusApplyConfiguration) WithAvailableReplicas(value int32) *AlertmanagerStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *AlertmanagerStatusApplyConfiguration) WithUnavailableReplicas(value int32) *AlertmanagerStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/alertmanagerwebspec.go b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerwebspec.go new file mode 100644 index 000000000..1423da51f --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/alertmanagerwebspec.go @@ -0,0 +1,45 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AlertmanagerWebSpecApplyConfiguration represents an declarative configuration of the AlertmanagerWebSpec type for use +// with apply. +type AlertmanagerWebSpecApplyConfiguration struct { + WebConfigFileFieldsApplyConfiguration `json:",inline"` +} + +// AlertmanagerWebSpecApplyConfiguration constructs an declarative configuration of the AlertmanagerWebSpec type for use with +// apply. +func AlertmanagerWebSpec() *AlertmanagerWebSpecApplyConfiguration { + return &AlertmanagerWebSpecApplyConfiguration{} +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *AlertmanagerWebSpecApplyConfiguration) WithTLSConfig(value *WebTLSConfigApplyConfiguration) *AlertmanagerWebSpecApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *AlertmanagerWebSpecApplyConfiguration) WithHTTPConfig(value *WebHTTPConfigApplyConfiguration) *AlertmanagerWebSpecApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/apiserverconfig.go b/pkg/client/applyconfiguration/monitoring/v1/apiserverconfig.go new file mode 100644 index 000000000..9618d20b5 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/apiserverconfig.go @@ -0,0 +1,82 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// APIServerConfigApplyConfiguration represents an declarative configuration of the APIServerConfig type for use +// with apply. +type APIServerConfigApplyConfiguration struct { + Host *string `json:"host,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + BearerToken *string `json:"bearerToken,omitempty"` + BearerTokenFile *string `json:"bearerTokenFile,omitempty"` + TLSConfig *TLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + Authorization *AuthorizationApplyConfiguration `json:"authorization,omitempty"` +} + +// APIServerConfigApplyConfiguration constructs an declarative configuration of the APIServerConfig type for use with +// apply. +func APIServerConfig() *APIServerConfigApplyConfiguration { + return &APIServerConfigApplyConfiguration{} +} + +// WithHost sets the Host field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Host field is set to the value of the last call. +func (b *APIServerConfigApplyConfiguration) WithHost(value string) *APIServerConfigApplyConfiguration { + b.Host = &value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *APIServerConfigApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *APIServerConfigApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithBearerToken sets the BearerToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerToken field is set to the value of the last call. +func (b *APIServerConfigApplyConfiguration) WithBearerToken(value string) *APIServerConfigApplyConfiguration { + b.BearerToken = &value + return b +} + +// WithBearerTokenFile sets the BearerTokenFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenFile field is set to the value of the last call. +func (b *APIServerConfigApplyConfiguration) WithBearerTokenFile(value string) *APIServerConfigApplyConfiguration { + b.BearerTokenFile = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *APIServerConfigApplyConfiguration) WithTLSConfig(value *TLSConfigApplyConfiguration) *APIServerConfigApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *APIServerConfigApplyConfiguration) WithAuthorization(value *AuthorizationApplyConfiguration) *APIServerConfigApplyConfiguration { + b.Authorization = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/arbitraryfsaccessthroughsmsconfig.go b/pkg/client/applyconfiguration/monitoring/v1/arbitraryfsaccessthroughsmsconfig.go new file mode 100644 index 000000000..c1e61bb1e --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/arbitraryfsaccessthroughsmsconfig.go @@ -0,0 +1,37 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ArbitraryFSAccessThroughSMsConfigApplyConfiguration represents an declarative configuration of the ArbitraryFSAccessThroughSMsConfig type for use +// with apply. +type ArbitraryFSAccessThroughSMsConfigApplyConfiguration struct { + Deny *bool `json:"deny,omitempty"` +} + +// ArbitraryFSAccessThroughSMsConfigApplyConfiguration constructs an declarative configuration of the ArbitraryFSAccessThroughSMsConfig type for use with +// apply. +func ArbitraryFSAccessThroughSMsConfig() *ArbitraryFSAccessThroughSMsConfigApplyConfiguration { + return &ArbitraryFSAccessThroughSMsConfigApplyConfiguration{} +} + +// WithDeny sets the Deny field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deny field is set to the value of the last call. +func (b *ArbitraryFSAccessThroughSMsConfigApplyConfiguration) WithDeny(value bool) *ArbitraryFSAccessThroughSMsConfigApplyConfiguration { + b.Deny = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/argument.go b/pkg/client/applyconfiguration/monitoring/v1/argument.go new file mode 100644 index 000000000..06dd31d42 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/argument.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ArgumentApplyConfiguration represents an declarative configuration of the Argument type for use +// with apply. +type ArgumentApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// ArgumentApplyConfiguration constructs an declarative configuration of the Argument type for use with +// apply. +func Argument() *ArgumentApplyConfiguration { + return &ArgumentApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ArgumentApplyConfiguration) WithName(value string) *ArgumentApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *ArgumentApplyConfiguration) WithValue(value string) *ArgumentApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/attachmetadata.go b/pkg/client/applyconfiguration/monitoring/v1/attachmetadata.go new file mode 100644 index 000000000..293aa9d5e --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/attachmetadata.go @@ -0,0 +1,37 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AttachMetadataApplyConfiguration represents an declarative configuration of the AttachMetadata type for use +// with apply. +type AttachMetadataApplyConfiguration struct { + Node *bool `json:"node,omitempty"` +} + +// AttachMetadataApplyConfiguration constructs an declarative configuration of the AttachMetadata type for use with +// apply. +func AttachMetadata() *AttachMetadataApplyConfiguration { + return &AttachMetadataApplyConfiguration{} +} + +// WithNode sets the Node field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Node field is set to the value of the last call. +func (b *AttachMetadataApplyConfiguration) WithNode(value bool) *AttachMetadataApplyConfiguration { + b.Node = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/authorization.go b/pkg/client/applyconfiguration/monitoring/v1/authorization.go new file mode 100644 index 000000000..0b274055e --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/authorization.go @@ -0,0 +1,58 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// AuthorizationApplyConfiguration represents an declarative configuration of the Authorization type for use +// with apply. +type AuthorizationApplyConfiguration struct { + SafeAuthorizationApplyConfiguration `json:",inline"` + CredentialsFile *string `json:"credentialsFile,omitempty"` +} + +// AuthorizationApplyConfiguration constructs an declarative configuration of the Authorization type for use with +// apply. +func Authorization() *AuthorizationApplyConfiguration { + return &AuthorizationApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *AuthorizationApplyConfiguration) WithType(value string) *AuthorizationApplyConfiguration { + b.Type = &value + return b +} + +// WithCredentials sets the Credentials field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Credentials field is set to the value of the last call. +func (b *AuthorizationApplyConfiguration) WithCredentials(value corev1.SecretKeySelector) *AuthorizationApplyConfiguration { + b.Credentials = &value + return b +} + +// WithCredentialsFile sets the CredentialsFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CredentialsFile field is set to the value of the last call. +func (b *AuthorizationApplyConfiguration) WithCredentialsFile(value string) *AuthorizationApplyConfiguration { + b.CredentialsFile = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/basicauth.go b/pkg/client/applyconfiguration/monitoring/v1/basicauth.go new file mode 100644 index 000000000..b00f14f85 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/basicauth.go @@ -0,0 +1,50 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// BasicAuthApplyConfiguration represents an declarative configuration of the BasicAuth type for use +// with apply. +type BasicAuthApplyConfiguration struct { + Username *v1.SecretKeySelector `json:"username,omitempty"` + Password *v1.SecretKeySelector `json:"password,omitempty"` +} + +// BasicAuthApplyConfiguration constructs an declarative configuration of the BasicAuth type for use with +// apply. +func BasicAuth() *BasicAuthApplyConfiguration { + return &BasicAuthApplyConfiguration{} +} + +// WithUsername sets the Username field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Username field is set to the value of the last call. +func (b *BasicAuthApplyConfiguration) WithUsername(value v1.SecretKeySelector) *BasicAuthApplyConfiguration { + b.Username = &value + return b +} + +// WithPassword sets the Password field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Password field is set to the value of the last call. +func (b *BasicAuthApplyConfiguration) WithPassword(value v1.SecretKeySelector) *BasicAuthApplyConfiguration { + b.Password = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go b/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go new file mode 100644 index 000000000..ea71103f4 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/commonprometheusfields.go @@ -0,0 +1,653 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CommonPrometheusFieldsApplyConfiguration represents an declarative configuration of the CommonPrometheusFields type for use +// with apply. +type CommonPrometheusFieldsApplyConfiguration struct { + PodMetadata *EmbeddedObjectMetadataApplyConfiguration `json:"podMetadata,omitempty"` + ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"` + ServiceMonitorNamespaceSelector *metav1.LabelSelector `json:"serviceMonitorNamespaceSelector,omitempty"` + PodMonitorSelector *metav1.LabelSelector `json:"podMonitorSelector,omitempty"` + PodMonitorNamespaceSelector *metav1.LabelSelector `json:"podMonitorNamespaceSelector,omitempty"` + ProbeSelector *metav1.LabelSelector `json:"probeSelector,omitempty"` + ProbeNamespaceSelector *metav1.LabelSelector `json:"probeNamespaceSelector,omitempty"` + Version *string `json:"version,omitempty"` + Paused *bool `json:"paused,omitempty"` + Image *string `json:"image,omitempty"` + ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Shards *int32 `json:"shards,omitempty"` + ReplicaExternalLabelName *string `json:"replicaExternalLabelName,omitempty"` + PrometheusExternalLabelName *string `json:"prometheusExternalLabelName,omitempty"` + LogLevel *string `json:"logLevel,omitempty"` + LogFormat *string `json:"logFormat,omitempty"` + ScrapeInterval *monitoringv1.Duration `json:"scrapeInterval,omitempty"` + ScrapeTimeout *monitoringv1.Duration `json:"scrapeTimeout,omitempty"` + ExternalLabels map[string]string `json:"externalLabels,omitempty"` + EnableRemoteWriteReceiver *bool `json:"enableRemoteWriteReceiver,omitempty"` + EnableFeatures []string `json:"enableFeatures,omitempty"` + ExternalURL *string `json:"externalUrl,omitempty"` + RoutePrefix *string `json:"routePrefix,omitempty"` + Storage *StorageSpecApplyConfiguration `json:"storage,omitempty"` + Volumes []corev1.Volume `json:"volumes,omitempty"` + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` + Web *PrometheusWebSpecApplyConfiguration `json:"web,omitempty"` + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + ServiceAccountName *string `json:"serviceAccountName,omitempty"` + Secrets []string `json:"secrets,omitempty"` + ConfigMaps []string `json:"configMaps,omitempty"` + Affinity *corev1.Affinity `json:"affinity,omitempty"` + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` + RemoteWrite []RemoteWriteSpecApplyConfiguration `json:"remoteWrite,omitempty"` + SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` + ListenLocal *bool `json:"listenLocal,omitempty"` + Containers []corev1.Container `json:"containers,omitempty"` + InitContainers []corev1.Container `json:"initContainers,omitempty"` + AdditionalScrapeConfigs *corev1.SecretKeySelector `json:"additionalScrapeConfigs,omitempty"` + APIServerConfig *APIServerConfigApplyConfiguration `json:"apiserverConfig,omitempty"` + PriorityClassName *string `json:"priorityClassName,omitempty"` + PortName *string `json:"portName,omitempty"` + ArbitraryFSAccessThroughSMs *ArbitraryFSAccessThroughSMsConfigApplyConfiguration `json:"arbitraryFSAccessThroughSMs,omitempty"` + OverrideHonorLabels *bool `json:"overrideHonorLabels,omitempty"` + OverrideHonorTimestamps *bool `json:"overrideHonorTimestamps,omitempty"` + IgnoreNamespaceSelectors *bool `json:"ignoreNamespaceSelectors,omitempty"` + EnforcedNamespaceLabel *string `json:"enforcedNamespaceLabel,omitempty"` + EnforcedSampleLimit *uint64 `json:"enforcedSampleLimit,omitempty"` + EnforcedTargetLimit *uint64 `json:"enforcedTargetLimit,omitempty"` + EnforcedLabelLimit *uint64 `json:"enforcedLabelLimit,omitempty"` + EnforcedLabelNameLengthLimit *uint64 `json:"enforcedLabelNameLengthLimit,omitempty"` + EnforcedLabelValueLengthLimit *uint64 `json:"enforcedLabelValueLengthLimit,omitempty"` + EnforcedBodySizeLimit *monitoringv1.ByteSize `json:"enforcedBodySizeLimit,omitempty"` + MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"` + HostAliases []HostAliasApplyConfiguration `json:"hostAliases,omitempty"` + AdditionalArgs []ArgumentApplyConfiguration `json:"additionalArgs,omitempty"` + WALCompression *bool `json:"walCompression,omitempty"` + ExcludedFromEnforcement []ObjectReferenceApplyConfiguration `json:"excludedFromEnforcement,omitempty"` + HostNetwork *bool `json:"hostNetwork,omitempty"` +} + +// CommonPrometheusFieldsApplyConfiguration constructs an declarative configuration of the CommonPrometheusFields type for use with +// apply. +func CommonPrometheusFields() *CommonPrometheusFieldsApplyConfiguration { + return &CommonPrometheusFieldsApplyConfiguration{} +} + +// WithPodMetadata sets the PodMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMetadata field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithPodMetadata(value *EmbeddedObjectMetadataApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + b.PodMetadata = value + return b +} + +// WithServiceMonitorSelector sets the ServiceMonitorSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceMonitorSelector field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithServiceMonitorSelector(value metav1.LabelSelector) *CommonPrometheusFieldsApplyConfiguration { + b.ServiceMonitorSelector = &value + return b +} + +// WithServiceMonitorNamespaceSelector sets the ServiceMonitorNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceMonitorNamespaceSelector field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithServiceMonitorNamespaceSelector(value metav1.LabelSelector) *CommonPrometheusFieldsApplyConfiguration { + b.ServiceMonitorNamespaceSelector = &value + return b +} + +// WithPodMonitorSelector sets the PodMonitorSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMonitorSelector field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithPodMonitorSelector(value metav1.LabelSelector) *CommonPrometheusFieldsApplyConfiguration { + b.PodMonitorSelector = &value + return b +} + +// WithPodMonitorNamespaceSelector sets the PodMonitorNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMonitorNamespaceSelector field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithPodMonitorNamespaceSelector(value metav1.LabelSelector) *CommonPrometheusFieldsApplyConfiguration { + b.PodMonitorNamespaceSelector = &value + return b +} + +// WithProbeSelector sets the ProbeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProbeSelector field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithProbeSelector(value metav1.LabelSelector) *CommonPrometheusFieldsApplyConfiguration { + b.ProbeSelector = &value + return b +} + +// WithProbeNamespaceSelector sets the ProbeNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProbeNamespaceSelector field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithProbeNamespaceSelector(value metav1.LabelSelector) *CommonPrometheusFieldsApplyConfiguration { + b.ProbeNamespaceSelector = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithVersion(value string) *CommonPrometheusFieldsApplyConfiguration { + b.Version = &value + return b +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithPaused(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.Paused = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithImage(value string) *CommonPrometheusFieldsApplyConfiguration { + b.Image = &value + return b +} + +// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImagePullPolicy field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *CommonPrometheusFieldsApplyConfiguration { + b.ImagePullPolicy = &value + return b +} + +// WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithImagePullSecrets(values ...corev1.LocalObjectReference) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.ImagePullSecrets = append(b.ImagePullSecrets, values[i]) + } + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithReplicas(value int32) *CommonPrometheusFieldsApplyConfiguration { + b.Replicas = &value + return b +} + +// WithShards sets the Shards field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Shards field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithShards(value int32) *CommonPrometheusFieldsApplyConfiguration { + b.Shards = &value + return b +} + +// WithReplicaExternalLabelName sets the ReplicaExternalLabelName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReplicaExternalLabelName field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithReplicaExternalLabelName(value string) *CommonPrometheusFieldsApplyConfiguration { + b.ReplicaExternalLabelName = &value + return b +} + +// WithPrometheusExternalLabelName sets the PrometheusExternalLabelName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PrometheusExternalLabelName field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithPrometheusExternalLabelName(value string) *CommonPrometheusFieldsApplyConfiguration { + b.PrometheusExternalLabelName = &value + return b +} + +// WithLogLevel sets the LogLevel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogLevel field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithLogLevel(value string) *CommonPrometheusFieldsApplyConfiguration { + b.LogLevel = &value + return b +} + +// WithLogFormat sets the LogFormat field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogFormat field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithLogFormat(value string) *CommonPrometheusFieldsApplyConfiguration { + b.LogFormat = &value + return b +} + +// WithScrapeInterval sets the ScrapeInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScrapeInterval field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithScrapeInterval(value monitoringv1.Duration) *CommonPrometheusFieldsApplyConfiguration { + b.ScrapeInterval = &value + return b +} + +// WithScrapeTimeout sets the ScrapeTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScrapeTimeout field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithScrapeTimeout(value monitoringv1.Duration) *CommonPrometheusFieldsApplyConfiguration { + b.ScrapeTimeout = &value + return b +} + +// WithExternalLabels puts the entries into the ExternalLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the ExternalLabels field, +// overwriting an existing map entries in ExternalLabels field with the same key. +func (b *CommonPrometheusFieldsApplyConfiguration) WithExternalLabels(entries map[string]string) *CommonPrometheusFieldsApplyConfiguration { + if b.ExternalLabels == nil && len(entries) > 0 { + b.ExternalLabels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ExternalLabels[k] = v + } + return b +} + +// WithEnableRemoteWriteReceiver sets the EnableRemoteWriteReceiver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableRemoteWriteReceiver field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnableRemoteWriteReceiver(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.EnableRemoteWriteReceiver = &value + return b +} + +// WithEnableFeatures adds the given value to the EnableFeatures field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EnableFeatures field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnableFeatures(values ...string) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.EnableFeatures = append(b.EnableFeatures, values[i]) + } + return b +} + +// WithExternalURL sets the ExternalURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExternalURL field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithExternalURL(value string) *CommonPrometheusFieldsApplyConfiguration { + b.ExternalURL = &value + return b +} + +// WithRoutePrefix sets the RoutePrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutePrefix field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithRoutePrefix(value string) *CommonPrometheusFieldsApplyConfiguration { + b.RoutePrefix = &value + return b +} + +// WithStorage sets the Storage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Storage field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithStorage(value *StorageSpecApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + b.Storage = value + return b +} + +// WithVolumes adds the given value to the Volumes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Volumes field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithVolumes(values ...corev1.Volume) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.Volumes = append(b.Volumes, values[i]) + } + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithVolumeMounts(values ...corev1.VolumeMount) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.VolumeMounts = append(b.VolumeMounts, values[i]) + } + return b +} + +// WithWeb sets the Web field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Web field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithWeb(value *PrometheusWebSpecApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + b.Web = value + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithResources(value corev1.ResourceRequirements) *CommonPrometheusFieldsApplyConfiguration { + b.Resources = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *CommonPrometheusFieldsApplyConfiguration) WithNodeSelector(entries map[string]string) *CommonPrometheusFieldsApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithServiceAccountName sets the ServiceAccountName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountName field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithServiceAccountName(value string) *CommonPrometheusFieldsApplyConfiguration { + b.ServiceAccountName = &value + return b +} + +// WithSecrets adds the given value to the Secrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Secrets field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithSecrets(values ...string) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.Secrets = append(b.Secrets, values[i]) + } + return b +} + +// WithConfigMaps adds the given value to the ConfigMaps field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ConfigMaps field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithConfigMaps(values ...string) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.ConfigMaps = append(b.ConfigMaps, values[i]) + } + return b +} + +// WithAffinity sets the Affinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Affinity field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithAffinity(value corev1.Affinity) *CommonPrometheusFieldsApplyConfiguration { + b.Affinity = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithTolerations(values ...corev1.Toleration) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.Tolerations = append(b.Tolerations, values[i]) + } + return b +} + +// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithTopologySpreadConstraints(values ...corev1.TopologySpreadConstraint) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, values[i]) + } + return b +} + +// WithRemoteWrite adds the given value to the RemoteWrite field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RemoteWrite field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithRemoteWrite(values ...*RemoteWriteSpecApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRemoteWrite") + } + b.RemoteWrite = append(b.RemoteWrite, *values[i]) + } + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithSecurityContext(value corev1.PodSecurityContext) *CommonPrometheusFieldsApplyConfiguration { + b.SecurityContext = &value + return b +} + +// WithListenLocal sets the ListenLocal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ListenLocal field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithListenLocal(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.ListenLocal = &value + return b +} + +// WithContainers adds the given value to the Containers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Containers field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithContainers(values ...corev1.Container) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.Containers = append(b.Containers, values[i]) + } + return b +} + +// WithInitContainers adds the given value to the InitContainers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InitContainers field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithInitContainers(values ...corev1.Container) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + b.InitContainers = append(b.InitContainers, values[i]) + } + return b +} + +// WithAdditionalScrapeConfigs sets the AdditionalScrapeConfigs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdditionalScrapeConfigs field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithAdditionalScrapeConfigs(value corev1.SecretKeySelector) *CommonPrometheusFieldsApplyConfiguration { + b.AdditionalScrapeConfigs = &value + return b +} + +// WithAPIServerConfig sets the APIServerConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIServerConfig field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithAPIServerConfig(value *APIServerConfigApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + b.APIServerConfig = value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithPriorityClassName(value string) *CommonPrometheusFieldsApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPortName sets the PortName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortName field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithPortName(value string) *CommonPrometheusFieldsApplyConfiguration { + b.PortName = &value + return b +} + +// WithArbitraryFSAccessThroughSMs sets the ArbitraryFSAccessThroughSMs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ArbitraryFSAccessThroughSMs field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithArbitraryFSAccessThroughSMs(value *ArbitraryFSAccessThroughSMsConfigApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + b.ArbitraryFSAccessThroughSMs = value + return b +} + +// WithOverrideHonorLabels sets the OverrideHonorLabels field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OverrideHonorLabels field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithOverrideHonorLabels(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.OverrideHonorLabels = &value + return b +} + +// WithOverrideHonorTimestamps sets the OverrideHonorTimestamps field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OverrideHonorTimestamps field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithOverrideHonorTimestamps(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.OverrideHonorTimestamps = &value + return b +} + +// WithIgnoreNamespaceSelectors sets the IgnoreNamespaceSelectors field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IgnoreNamespaceSelectors field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithIgnoreNamespaceSelectors(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.IgnoreNamespaceSelectors = &value + return b +} + +// WithEnforcedNamespaceLabel sets the EnforcedNamespaceLabel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedNamespaceLabel field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnforcedNamespaceLabel(value string) *CommonPrometheusFieldsApplyConfiguration { + b.EnforcedNamespaceLabel = &value + return b +} + +// WithEnforcedSampleLimit sets the EnforcedSampleLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedSampleLimit field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnforcedSampleLimit(value uint64) *CommonPrometheusFieldsApplyConfiguration { + b.EnforcedSampleLimit = &value + return b +} + +// WithEnforcedTargetLimit sets the EnforcedTargetLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedTargetLimit field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnforcedTargetLimit(value uint64) *CommonPrometheusFieldsApplyConfiguration { + b.EnforcedTargetLimit = &value + return b +} + +// WithEnforcedLabelLimit sets the EnforcedLabelLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedLabelLimit field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnforcedLabelLimit(value uint64) *CommonPrometheusFieldsApplyConfiguration { + b.EnforcedLabelLimit = &value + return b +} + +// WithEnforcedLabelNameLengthLimit sets the EnforcedLabelNameLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedLabelNameLengthLimit field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnforcedLabelNameLengthLimit(value uint64) *CommonPrometheusFieldsApplyConfiguration { + b.EnforcedLabelNameLengthLimit = &value + return b +} + +// WithEnforcedLabelValueLengthLimit sets the EnforcedLabelValueLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedLabelValueLengthLimit field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnforcedLabelValueLengthLimit(value uint64) *CommonPrometheusFieldsApplyConfiguration { + b.EnforcedLabelValueLengthLimit = &value + return b +} + +// WithEnforcedBodySizeLimit sets the EnforcedBodySizeLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedBodySizeLimit field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithEnforcedBodySizeLimit(value monitoringv1.ByteSize) *CommonPrometheusFieldsApplyConfiguration { + b.EnforcedBodySizeLimit = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithMinReadySeconds(value uint32) *CommonPrometheusFieldsApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithHostAliases adds the given value to the HostAliases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HostAliases field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithHostAliases(values ...*HostAliasApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHostAliases") + } + b.HostAliases = append(b.HostAliases, *values[i]) + } + return b +} + +// WithAdditionalArgs adds the given value to the AdditionalArgs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AdditionalArgs field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithAdditionalArgs(values ...*ArgumentApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAdditionalArgs") + } + b.AdditionalArgs = append(b.AdditionalArgs, *values[i]) + } + return b +} + +// WithWALCompression sets the WALCompression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WALCompression field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithWALCompression(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.WALCompression = &value + return b +} + +// WithExcludedFromEnforcement adds the given value to the ExcludedFromEnforcement field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ExcludedFromEnforcement field. +func (b *CommonPrometheusFieldsApplyConfiguration) WithExcludedFromEnforcement(values ...*ObjectReferenceApplyConfiguration) *CommonPrometheusFieldsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExcludedFromEnforcement") + } + b.ExcludedFromEnforcement = append(b.ExcludedFromEnforcement, *values[i]) + } + return b +} + +// WithHostNetwork sets the HostNetwork field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostNetwork field is set to the value of the last call. +func (b *CommonPrometheusFieldsApplyConfiguration) WithHostNetwork(value bool) *CommonPrometheusFieldsApplyConfiguration { + b.HostNetwork = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/embeddedobjectmetadata.go b/pkg/client/applyconfiguration/monitoring/v1/embeddedobjectmetadata.go new file mode 100644 index 000000000..9005ab36c --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/embeddedobjectmetadata.go @@ -0,0 +1,67 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EmbeddedObjectMetadataApplyConfiguration represents an declarative configuration of the EmbeddedObjectMetadata type for use +// with apply. +type EmbeddedObjectMetadataApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` +} + +// EmbeddedObjectMetadataApplyConfiguration constructs an declarative configuration of the EmbeddedObjectMetadata type for use with +// apply. +func EmbeddedObjectMetadata() *EmbeddedObjectMetadataApplyConfiguration { + return &EmbeddedObjectMetadataApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EmbeddedObjectMetadataApplyConfiguration) WithName(value string) *EmbeddedObjectMetadataApplyConfiguration { + b.Name = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *EmbeddedObjectMetadataApplyConfiguration) WithLabels(entries map[string]string) *EmbeddedObjectMetadataApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *EmbeddedObjectMetadataApplyConfiguration) WithAnnotations(entries map[string]string) *EmbeddedObjectMetadataApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/embeddedpersistentvolumeclaim.go b/pkg/client/applyconfiguration/monitoring/v1/embeddedpersistentvolumeclaim.go new file mode 100644 index 000000000..ff6883a20 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/embeddedpersistentvolumeclaim.go @@ -0,0 +1,117 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// EmbeddedPersistentVolumeClaimApplyConfiguration represents an declarative configuration of the EmbeddedPersistentVolumeClaim type for use +// with apply. +type EmbeddedPersistentVolumeClaimApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *EmbeddedObjectMetadataApplyConfiguration `json:"metadata,omitempty"` + Spec *corev1.PersistentVolumeClaimSpec `json:"spec,omitempty"` + Status *corev1.PersistentVolumeClaimStatus `json:"status,omitempty"` +} + +// EmbeddedPersistentVolumeClaimApplyConfiguration constructs an declarative configuration of the EmbeddedPersistentVolumeClaim type for use with +// apply. +func EmbeddedPersistentVolumeClaim() *EmbeddedPersistentVolumeClaimApplyConfiguration { + b := &EmbeddedPersistentVolumeClaimApplyConfiguration{} + b.WithKind("EmbeddedPersistentVolumeClaim") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithKind(value string) *EmbeddedPersistentVolumeClaimApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithAPIVersion(value string) *EmbeddedPersistentVolumeClaimApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithName(value string) *EmbeddedPersistentVolumeClaimApplyConfiguration { + b.ensureEmbeddedObjectMetadataApplyConfigurationExists() + b.Name = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithLabels(entries map[string]string) *EmbeddedPersistentVolumeClaimApplyConfiguration { + b.ensureEmbeddedObjectMetadataApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithAnnotations(entries map[string]string) *EmbeddedPersistentVolumeClaimApplyConfiguration { + b.ensureEmbeddedObjectMetadataApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) ensureEmbeddedObjectMetadataApplyConfigurationExists() { + if b.EmbeddedObjectMetadataApplyConfiguration == nil { + b.EmbeddedObjectMetadataApplyConfiguration = &EmbeddedObjectMetadataApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithSpec(value corev1.PersistentVolumeClaimSpec) *EmbeddedPersistentVolumeClaimApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *EmbeddedPersistentVolumeClaimApplyConfiguration) WithStatus(value corev1.PersistentVolumeClaimStatus) *EmbeddedPersistentVolumeClaimApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/endpoint.go b/pkg/client/applyconfiguration/monitoring/v1/endpoint.go new file mode 100644 index 000000000..8cb80ac99 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/endpoint.go @@ -0,0 +1,239 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// EndpointApplyConfiguration represents an declarative configuration of the Endpoint type for use +// with apply. +type EndpointApplyConfiguration struct { + Port *string `json:"port,omitempty"` + TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` + Path *string `json:"path,omitempty"` + Scheme *string `json:"scheme,omitempty"` + Params map[string][]string `json:"params,omitempty"` + Interval *v1.Duration `json:"interval,omitempty"` + ScrapeTimeout *v1.Duration `json:"scrapeTimeout,omitempty"` + TLSConfig *TLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + BearerTokenFile *string `json:"bearerTokenFile,omitempty"` + BearerTokenSecret *corev1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` + Authorization *SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` + HonorLabels *bool `json:"honorLabels,omitempty"` + HonorTimestamps *bool `json:"honorTimestamps,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + OAuth2 *OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + MetricRelabelConfigs []*v1.RelabelConfig `json:"metricRelabelings,omitempty"` + RelabelConfigs []*v1.RelabelConfig `json:"relabelings,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` + FollowRedirects *bool `json:"followRedirects,omitempty"` + EnableHttp2 *bool `json:"enableHttp2,omitempty"` + FilterRunning *bool `json:"filterRunning,omitempty"` +} + +// EndpointApplyConfiguration constructs an declarative configuration of the Endpoint type for use with +// apply. +func Endpoint() *EndpointApplyConfiguration { + return &EndpointApplyConfiguration{} +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithPort(value string) *EndpointApplyConfiguration { + b.Port = &value + return b +} + +// WithTargetPort sets the TargetPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetPort field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithTargetPort(value intstr.IntOrString) *EndpointApplyConfiguration { + b.TargetPort = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithPath(value string) *EndpointApplyConfiguration { + b.Path = &value + return b +} + +// WithScheme sets the Scheme field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheme field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithScheme(value string) *EndpointApplyConfiguration { + b.Scheme = &value + return b +} + +// WithParams puts the entries into the Params field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Params field, +// overwriting an existing map entries in Params field with the same key. +func (b *EndpointApplyConfiguration) WithParams(entries map[string][]string) *EndpointApplyConfiguration { + if b.Params == nil && len(entries) > 0 { + b.Params = make(map[string][]string, len(entries)) + } + for k, v := range entries { + b.Params[k] = v + } + return b +} + +// WithInterval sets the Interval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Interval field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithInterval(value v1.Duration) *EndpointApplyConfiguration { + b.Interval = &value + return b +} + +// WithScrapeTimeout sets the ScrapeTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScrapeTimeout field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithScrapeTimeout(value v1.Duration) *EndpointApplyConfiguration { + b.ScrapeTimeout = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithTLSConfig(value *TLSConfigApplyConfiguration) *EndpointApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithBearerTokenFile sets the BearerTokenFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenFile field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithBearerTokenFile(value string) *EndpointApplyConfiguration { + b.BearerTokenFile = &value + return b +} + +// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenSecret field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithBearerTokenSecret(value corev1.SecretKeySelector) *EndpointApplyConfiguration { + b.BearerTokenSecret = &value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithAuthorization(value *SafeAuthorizationApplyConfiguration) *EndpointApplyConfiguration { + b.Authorization = value + return b +} + +// WithHonorLabels sets the HonorLabels field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HonorLabels field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithHonorLabels(value bool) *EndpointApplyConfiguration { + b.HonorLabels = &value + return b +} + +// WithHonorTimestamps sets the HonorTimestamps field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HonorTimestamps field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithHonorTimestamps(value bool) *EndpointApplyConfiguration { + b.HonorTimestamps = &value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *EndpointApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *EndpointApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithMetricRelabelConfigs adds the given value to the MetricRelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MetricRelabelConfigs field. +func (b *EndpointApplyConfiguration) WithMetricRelabelConfigs(values ...**v1.RelabelConfig) *EndpointApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMetricRelabelConfigs") + } + b.MetricRelabelConfigs = append(b.MetricRelabelConfigs, *values[i]) + } + return b +} + +// WithRelabelConfigs adds the given value to the RelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RelabelConfigs field. +func (b *EndpointApplyConfiguration) WithRelabelConfigs(values ...**v1.RelabelConfig) *EndpointApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRelabelConfigs") + } + b.RelabelConfigs = append(b.RelabelConfigs, *values[i]) + } + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithProxyURL(value string) *EndpointApplyConfiguration { + b.ProxyURL = &value + return b +} + +// WithFollowRedirects sets the FollowRedirects field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FollowRedirects field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithFollowRedirects(value bool) *EndpointApplyConfiguration { + b.FollowRedirects = &value + return b +} + +// WithEnableHttp2 sets the EnableHttp2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableHttp2 field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithEnableHttp2(value bool) *EndpointApplyConfiguration { + b.EnableHttp2 = &value + return b +} + +// WithFilterRunning sets the FilterRunning field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FilterRunning field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithFilterRunning(value bool) *EndpointApplyConfiguration { + b.FilterRunning = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/exemplars.go b/pkg/client/applyconfiguration/monitoring/v1/exemplars.go new file mode 100644 index 000000000..9d59e7615 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/exemplars.go @@ -0,0 +1,37 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ExemplarsApplyConfiguration represents an declarative configuration of the Exemplars type for use +// with apply. +type ExemplarsApplyConfiguration struct { + MaxSize *int64 `json:"maxSize,omitempty"` +} + +// ExemplarsApplyConfiguration constructs an declarative configuration of the Exemplars type for use with +// apply. +func Exemplars() *ExemplarsApplyConfiguration { + return &ExemplarsApplyConfiguration{} +} + +// WithMaxSize sets the MaxSize field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSize field is set to the value of the last call. +func (b *ExemplarsApplyConfiguration) WithMaxSize(value int64) *ExemplarsApplyConfiguration { + b.MaxSize = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/hostalias.go b/pkg/client/applyconfiguration/monitoring/v1/hostalias.go new file mode 100644 index 000000000..d432e6be3 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/hostalias.go @@ -0,0 +1,48 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HostAliasApplyConfiguration represents an declarative configuration of the HostAlias type for use +// with apply. +type HostAliasApplyConfiguration struct { + IP *string `json:"ip,omitempty"` + Hostnames []string `json:"hostnames,omitempty"` +} + +// HostAliasApplyConfiguration constructs an declarative configuration of the HostAlias type for use with +// apply. +func HostAlias() *HostAliasApplyConfiguration { + return &HostAliasApplyConfiguration{} +} + +// WithIP sets the IP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IP field is set to the value of the last call. +func (b *HostAliasApplyConfiguration) WithIP(value string) *HostAliasApplyConfiguration { + b.IP = &value + return b +} + +// WithHostnames adds the given value to the Hostnames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Hostnames field. +func (b *HostAliasApplyConfiguration) WithHostnames(values ...string) *HostAliasApplyConfiguration { + for i := range values { + b.Hostnames = append(b.Hostnames, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/httpconfig.go b/pkg/client/applyconfiguration/monitoring/v1/httpconfig.go new file mode 100644 index 000000000..0a9c80376 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/httpconfig.go @@ -0,0 +1,95 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// HTTPConfigApplyConfiguration represents an declarative configuration of the HTTPConfig type for use +// with apply. +type HTTPConfigApplyConfiguration struct { + Authorization *SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + OAuth2 *OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + BearerTokenSecret *corev1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` + TLSConfig *SafeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + ProxyURL *string `json:"proxyURL,omitempty"` + FollowRedirects *bool `json:"followRedirects,omitempty"` +} + +// HTTPConfigApplyConfiguration constructs an declarative configuration of the HTTPConfig type for use with +// apply. +func HTTPConfig() *HTTPConfigApplyConfiguration { + return &HTTPConfigApplyConfiguration{} +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithAuthorization(value *SafeAuthorizationApplyConfiguration) *HTTPConfigApplyConfiguration { + b.Authorization = value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *HTTPConfigApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *HTTPConfigApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenSecret field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithBearerTokenSecret(value corev1.SecretKeySelector) *HTTPConfigApplyConfiguration { + b.BearerTokenSecret = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithTLSConfig(value *SafeTLSConfigApplyConfiguration) *HTTPConfigApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithProxyURL(value string) *HTTPConfigApplyConfiguration { + b.ProxyURL = &value + return b +} + +// WithFollowRedirects sets the FollowRedirects field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FollowRedirects field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithFollowRedirects(value bool) *HTTPConfigApplyConfiguration { + b.FollowRedirects = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/metadataconfig.go b/pkg/client/applyconfiguration/monitoring/v1/metadataconfig.go new file mode 100644 index 000000000..c9ec12704 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/metadataconfig.go @@ -0,0 +1,50 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// MetadataConfigApplyConfiguration represents an declarative configuration of the MetadataConfig type for use +// with apply. +type MetadataConfigApplyConfiguration struct { + Send *bool `json:"send,omitempty"` + SendInterval *v1.Duration `json:"sendInterval,omitempty"` +} + +// MetadataConfigApplyConfiguration constructs an declarative configuration of the MetadataConfig type for use with +// apply. +func MetadataConfig() *MetadataConfigApplyConfiguration { + return &MetadataConfigApplyConfiguration{} +} + +// WithSend sets the Send field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Send field is set to the value of the last call. +func (b *MetadataConfigApplyConfiguration) WithSend(value bool) *MetadataConfigApplyConfiguration { + b.Send = &value + return b +} + +// WithSendInterval sets the SendInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendInterval field is set to the value of the last call. +func (b *MetadataConfigApplyConfiguration) WithSendInterval(value v1.Duration) *MetadataConfigApplyConfiguration { + b.SendInterval = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/namespaceselector.go b/pkg/client/applyconfiguration/monitoring/v1/namespaceselector.go new file mode 100644 index 000000000..2bea8f600 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/namespaceselector.go @@ -0,0 +1,48 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NamespaceSelectorApplyConfiguration represents an declarative configuration of the NamespaceSelector type for use +// with apply. +type NamespaceSelectorApplyConfiguration struct { + Any *bool `json:"any,omitempty"` + MatchNames []string `json:"matchNames,omitempty"` +} + +// NamespaceSelectorApplyConfiguration constructs an declarative configuration of the NamespaceSelector type for use with +// apply. +func NamespaceSelector() *NamespaceSelectorApplyConfiguration { + return &NamespaceSelectorApplyConfiguration{} +} + +// WithAny sets the Any field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Any field is set to the value of the last call. +func (b *NamespaceSelectorApplyConfiguration) WithAny(value bool) *NamespaceSelectorApplyConfiguration { + b.Any = &value + return b +} + +// WithMatchNames adds the given value to the MatchNames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MatchNames field. +func (b *NamespaceSelectorApplyConfiguration) WithMatchNames(values ...string) *NamespaceSelectorApplyConfiguration { + for i := range values { + b.MatchNames = append(b.MatchNames, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/oauth2.go b/pkg/client/applyconfiguration/monitoring/v1/oauth2.go new file mode 100644 index 000000000..a2a92da9b --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/oauth2.go @@ -0,0 +1,85 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// OAuth2ApplyConfiguration represents an declarative configuration of the OAuth2 type for use +// with apply. +type OAuth2ApplyConfiguration struct { + ClientID *SecretOrConfigMapApplyConfiguration `json:"clientId,omitempty"` + ClientSecret *corev1.SecretKeySelector `json:"clientSecret,omitempty"` + TokenURL *string `json:"tokenUrl,omitempty"` + Scopes []string `json:"scopes,omitempty"` + EndpointParams map[string]string `json:"endpointParams,omitempty"` +} + +// OAuth2ApplyConfiguration constructs an declarative configuration of the OAuth2 type for use with +// apply. +func OAuth2() *OAuth2ApplyConfiguration { + return &OAuth2ApplyConfiguration{} +} + +// WithClientID sets the ClientID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientID field is set to the value of the last call. +func (b *OAuth2ApplyConfiguration) WithClientID(value *SecretOrConfigMapApplyConfiguration) *OAuth2ApplyConfiguration { + b.ClientID = value + return b +} + +// WithClientSecret sets the ClientSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientSecret field is set to the value of the last call. +func (b *OAuth2ApplyConfiguration) WithClientSecret(value corev1.SecretKeySelector) *OAuth2ApplyConfiguration { + b.ClientSecret = &value + return b +} + +// WithTokenURL sets the TokenURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TokenURL field is set to the value of the last call. +func (b *OAuth2ApplyConfiguration) WithTokenURL(value string) *OAuth2ApplyConfiguration { + b.TokenURL = &value + return b +} + +// WithScopes adds the given value to the Scopes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Scopes field. +func (b *OAuth2ApplyConfiguration) WithScopes(values ...string) *OAuth2ApplyConfiguration { + for i := range values { + b.Scopes = append(b.Scopes, values[i]) + } + return b +} + +// WithEndpointParams puts the entries into the EndpointParams field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the EndpointParams field, +// overwriting an existing map entries in EndpointParams field with the same key. +func (b *OAuth2ApplyConfiguration) WithEndpointParams(entries map[string]string) *OAuth2ApplyConfiguration { + if b.EndpointParams == nil && len(entries) > 0 { + b.EndpointParams = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.EndpointParams[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/objectreference.go b/pkg/client/applyconfiguration/monitoring/v1/objectreference.go new file mode 100644 index 000000000..8dc343338 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/objectreference.go @@ -0,0 +1,64 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ObjectReferenceApplyConfiguration represents an declarative configuration of the ObjectReference type for use +// with apply. +type ObjectReferenceApplyConfiguration struct { + Group *string `json:"group,omitempty"` + Resource *string `json:"resource,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` +} + +// ObjectReferenceApplyConfiguration constructs an declarative configuration of the ObjectReference type for use with +// apply. +func ObjectReference() *ObjectReferenceApplyConfiguration { + return &ObjectReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithGroup(value string) *ObjectReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithResource sets the Resource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resource field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithResource(value string) *ObjectReferenceApplyConfiguration { + b.Resource = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithNamespace(value string) *ObjectReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithName(value string) *ObjectReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpoint.go b/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpoint.go new file mode 100644 index 000000000..1e57161e6 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpoint.go @@ -0,0 +1,230 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// PodMetricsEndpointApplyConfiguration represents an declarative configuration of the PodMetricsEndpoint type for use +// with apply. +type PodMetricsEndpointApplyConfiguration struct { + Port *string `json:"port,omitempty"` + TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` + Path *string `json:"path,omitempty"` + Scheme *string `json:"scheme,omitempty"` + Params map[string][]string `json:"params,omitempty"` + Interval *v1.Duration `json:"interval,omitempty"` + ScrapeTimeout *v1.Duration `json:"scrapeTimeout,omitempty"` + TLSConfig *PodMetricsEndpointTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + BearerTokenSecret *corev1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` + HonorLabels *bool `json:"honorLabels,omitempty"` + HonorTimestamps *bool `json:"honorTimestamps,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + OAuth2 *OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + Authorization *SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` + MetricRelabelConfigs []*v1.RelabelConfig `json:"metricRelabelings,omitempty"` + RelabelConfigs []*v1.RelabelConfig `json:"relabelings,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` + FollowRedirects *bool `json:"followRedirects,omitempty"` + EnableHttp2 *bool `json:"enableHttp2,omitempty"` + FilterRunning *bool `json:"filterRunning,omitempty"` +} + +// PodMetricsEndpointApplyConfiguration constructs an declarative configuration of the PodMetricsEndpoint type for use with +// apply. +func PodMetricsEndpoint() *PodMetricsEndpointApplyConfiguration { + return &PodMetricsEndpointApplyConfiguration{} +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithPort(value string) *PodMetricsEndpointApplyConfiguration { + b.Port = &value + return b +} + +// WithTargetPort sets the TargetPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetPort field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithTargetPort(value intstr.IntOrString) *PodMetricsEndpointApplyConfiguration { + b.TargetPort = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithPath(value string) *PodMetricsEndpointApplyConfiguration { + b.Path = &value + return b +} + +// WithScheme sets the Scheme field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheme field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithScheme(value string) *PodMetricsEndpointApplyConfiguration { + b.Scheme = &value + return b +} + +// WithParams puts the entries into the Params field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Params field, +// overwriting an existing map entries in Params field with the same key. +func (b *PodMetricsEndpointApplyConfiguration) WithParams(entries map[string][]string) *PodMetricsEndpointApplyConfiguration { + if b.Params == nil && len(entries) > 0 { + b.Params = make(map[string][]string, len(entries)) + } + for k, v := range entries { + b.Params[k] = v + } + return b +} + +// WithInterval sets the Interval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Interval field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithInterval(value v1.Duration) *PodMetricsEndpointApplyConfiguration { + b.Interval = &value + return b +} + +// WithScrapeTimeout sets the ScrapeTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScrapeTimeout field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithScrapeTimeout(value v1.Duration) *PodMetricsEndpointApplyConfiguration { + b.ScrapeTimeout = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithTLSConfig(value *PodMetricsEndpointTLSConfigApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenSecret field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithBearerTokenSecret(value corev1.SecretKeySelector) *PodMetricsEndpointApplyConfiguration { + b.BearerTokenSecret = &value + return b +} + +// WithHonorLabels sets the HonorLabels field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HonorLabels field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithHonorLabels(value bool) *PodMetricsEndpointApplyConfiguration { + b.HonorLabels = &value + return b +} + +// WithHonorTimestamps sets the HonorTimestamps field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HonorTimestamps field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithHonorTimestamps(value bool) *PodMetricsEndpointApplyConfiguration { + b.HonorTimestamps = &value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithAuthorization(value *SafeAuthorizationApplyConfiguration) *PodMetricsEndpointApplyConfiguration { + b.Authorization = value + return b +} + +// WithMetricRelabelConfigs adds the given value to the MetricRelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MetricRelabelConfigs field. +func (b *PodMetricsEndpointApplyConfiguration) WithMetricRelabelConfigs(values ...**v1.RelabelConfig) *PodMetricsEndpointApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMetricRelabelConfigs") + } + b.MetricRelabelConfigs = append(b.MetricRelabelConfigs, *values[i]) + } + return b +} + +// WithRelabelConfigs adds the given value to the RelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RelabelConfigs field. +func (b *PodMetricsEndpointApplyConfiguration) WithRelabelConfigs(values ...**v1.RelabelConfig) *PodMetricsEndpointApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRelabelConfigs") + } + b.RelabelConfigs = append(b.RelabelConfigs, *values[i]) + } + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithProxyURL(value string) *PodMetricsEndpointApplyConfiguration { + b.ProxyURL = &value + return b +} + +// WithFollowRedirects sets the FollowRedirects field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FollowRedirects field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithFollowRedirects(value bool) *PodMetricsEndpointApplyConfiguration { + b.FollowRedirects = &value + return b +} + +// WithEnableHttp2 sets the EnableHttp2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableHttp2 field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithEnableHttp2(value bool) *PodMetricsEndpointApplyConfiguration { + b.EnableHttp2 = &value + return b +} + +// WithFilterRunning sets the FilterRunning field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FilterRunning field is set to the value of the last call. +func (b *PodMetricsEndpointApplyConfiguration) WithFilterRunning(value bool) *PodMetricsEndpointApplyConfiguration { + b.FilterRunning = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpointtlsconfig.go b/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpointtlsconfig.go new file mode 100644 index 000000000..8800bbd59 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/podmetricsendpointtlsconfig.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// PodMetricsEndpointTLSConfigApplyConfiguration represents an declarative configuration of the PodMetricsEndpointTLSConfig type for use +// with apply. +type PodMetricsEndpointTLSConfigApplyConfiguration struct { + SafeTLSConfigApplyConfiguration `json:",inline"` +} + +// PodMetricsEndpointTLSConfigApplyConfiguration constructs an declarative configuration of the PodMetricsEndpointTLSConfig type for use with +// apply. +func PodMetricsEndpointTLSConfig() *PodMetricsEndpointTLSConfigApplyConfiguration { + return &PodMetricsEndpointTLSConfigApplyConfiguration{} +} + +// WithCA sets the CA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CA field is set to the value of the last call. +func (b *PodMetricsEndpointTLSConfigApplyConfiguration) WithCA(value *SecretOrConfigMapApplyConfiguration) *PodMetricsEndpointTLSConfigApplyConfiguration { + b.CA = value + return b +} + +// WithCert sets the Cert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cert field is set to the value of the last call. +func (b *PodMetricsEndpointTLSConfigApplyConfiguration) WithCert(value *SecretOrConfigMapApplyConfiguration) *PodMetricsEndpointTLSConfigApplyConfiguration { + b.Cert = value + return b +} + +// WithKeySecret sets the KeySecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KeySecret field is set to the value of the last call. +func (b *PodMetricsEndpointTLSConfigApplyConfiguration) WithKeySecret(value corev1.SecretKeySelector) *PodMetricsEndpointTLSConfigApplyConfiguration { + b.KeySecret = &value + return b +} + +// WithServerName sets the ServerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServerName field is set to the value of the last call. +func (b *PodMetricsEndpointTLSConfigApplyConfiguration) WithServerName(value string) *PodMetricsEndpointTLSConfigApplyConfiguration { + b.ServerName = &value + return b +} + +// WithInsecureSkipVerify sets the InsecureSkipVerify field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InsecureSkipVerify field is set to the value of the last call. +func (b *PodMetricsEndpointTLSConfigApplyConfiguration) WithInsecureSkipVerify(value bool) *PodMetricsEndpointTLSConfigApplyConfiguration { + b.InsecureSkipVerify = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/podmonitor.go b/pkg/client/applyconfiguration/monitoring/v1/podmonitor.go new file mode 100644 index 000000000..debd1415a --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/podmonitor.go @@ -0,0 +1,208 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodMonitorApplyConfiguration represents an declarative configuration of the PodMonitor type for use +// with apply. +type PodMonitorApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PodMonitorSpecApplyConfiguration `json:"spec,omitempty"` +} + +// PodMonitor constructs an declarative configuration of the PodMonitor type for use with +// apply. +func PodMonitor(name, namespace string) *PodMonitorApplyConfiguration { + b := &PodMonitorApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("PodMonitor") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithKind(value string) *PodMonitorApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithAPIVersion(value string) *PodMonitorApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithName(value string) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithGenerateName(value string) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithNamespace(value string) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithUID(value types.UID) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithResourceVersion(value string) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithGeneration(value int64) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PodMonitorApplyConfiguration) WithLabels(entries map[string]string) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PodMonitorApplyConfiguration) WithAnnotations(entries map[string]string) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PodMonitorApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PodMonitorApplyConfiguration) WithFinalizers(values ...string) *PodMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PodMonitorApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PodMonitorApplyConfiguration) WithSpec(value *PodMonitorSpecApplyConfiguration) *PodMonitorApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/podmonitorspec.go b/pkg/client/applyconfiguration/monitoring/v1/podmonitorspec.go new file mode 100644 index 000000000..6b2c6a890 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/podmonitorspec.go @@ -0,0 +1,138 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PodMonitorSpecApplyConfiguration represents an declarative configuration of the PodMonitorSpec type for use +// with apply. +type PodMonitorSpecApplyConfiguration struct { + JobLabel *string `json:"jobLabel,omitempty"` + PodTargetLabels []string `json:"podTargetLabels,omitempty"` + PodMetricsEndpoints []PodMetricsEndpointApplyConfiguration `json:"podMetricsEndpoints,omitempty"` + Selector *metav1.LabelSelector `json:"selector,omitempty"` + NamespaceSelector *NamespaceSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` + SampleLimit *uint64 `json:"sampleLimit,omitempty"` + TargetLimit *uint64 `json:"targetLimit,omitempty"` + LabelLimit *uint64 `json:"labelLimit,omitempty"` + LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` + LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` + AttachMetadata *AttachMetadataApplyConfiguration `json:"attachMetadata,omitempty"` +} + +// PodMonitorSpecApplyConfiguration constructs an declarative configuration of the PodMonitorSpec type for use with +// apply. +func PodMonitorSpec() *PodMonitorSpecApplyConfiguration { + return &PodMonitorSpecApplyConfiguration{} +} + +// WithJobLabel sets the JobLabel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the JobLabel field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithJobLabel(value string) *PodMonitorSpecApplyConfiguration { + b.JobLabel = &value + return b +} + +// WithPodTargetLabels adds the given value to the PodTargetLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodTargetLabels field. +func (b *PodMonitorSpecApplyConfiguration) WithPodTargetLabels(values ...string) *PodMonitorSpecApplyConfiguration { + for i := range values { + b.PodTargetLabels = append(b.PodTargetLabels, values[i]) + } + return b +} + +// WithPodMetricsEndpoints adds the given value to the PodMetricsEndpoints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodMetricsEndpoints field. +func (b *PodMonitorSpecApplyConfiguration) WithPodMetricsEndpoints(values ...*PodMetricsEndpointApplyConfiguration) *PodMonitorSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPodMetricsEndpoints") + } + b.PodMetricsEndpoints = append(b.PodMetricsEndpoints, *values[i]) + } + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithSelector(value metav1.LabelSelector) *PodMonitorSpecApplyConfiguration { + b.Selector = &value + return b +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithNamespaceSelector(value *NamespaceSelectorApplyConfiguration) *PodMonitorSpecApplyConfiguration { + b.NamespaceSelector = value + return b +} + +// WithSampleLimit sets the SampleLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SampleLimit field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithSampleLimit(value uint64) *PodMonitorSpecApplyConfiguration { + b.SampleLimit = &value + return b +} + +// WithTargetLimit sets the TargetLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetLimit field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithTargetLimit(value uint64) *PodMonitorSpecApplyConfiguration { + b.TargetLimit = &value + return b +} + +// WithLabelLimit sets the LabelLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelLimit field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithLabelLimit(value uint64) *PodMonitorSpecApplyConfiguration { + b.LabelLimit = &value + return b +} + +// WithLabelNameLengthLimit sets the LabelNameLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelNameLengthLimit field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithLabelNameLengthLimit(value uint64) *PodMonitorSpecApplyConfiguration { + b.LabelNameLengthLimit = &value + return b +} + +// WithLabelValueLengthLimit sets the LabelValueLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelValueLengthLimit field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithLabelValueLengthLimit(value uint64) *PodMonitorSpecApplyConfiguration { + b.LabelValueLengthLimit = &value + return b +} + +// WithAttachMetadata sets the AttachMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AttachMetadata field is set to the value of the last call. +func (b *PodMonitorSpecApplyConfiguration) WithAttachMetadata(value *AttachMetadataApplyConfiguration) *PodMonitorSpecApplyConfiguration { + b.AttachMetadata = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/probe.go b/pkg/client/applyconfiguration/monitoring/v1/probe.go new file mode 100644 index 000000000..464ab9485 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/probe.go @@ -0,0 +1,208 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ProbeApplyConfiguration represents an declarative configuration of the Probe type for use +// with apply. +type ProbeApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ProbeSpecApplyConfiguration `json:"spec,omitempty"` +} + +// Probe constructs an declarative configuration of the Probe type for use with +// apply. +func Probe(name, namespace string) *ProbeApplyConfiguration { + b := &ProbeApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Probe") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithKind(value string) *ProbeApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithAPIVersion(value string) *ProbeApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithName(value string) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithGenerateName(value string) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithNamespace(value string) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithUID(value types.UID) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithResourceVersion(value string) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithGeneration(value int64) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ProbeApplyConfiguration) WithLabels(entries map[string]string) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ProbeApplyConfiguration) WithAnnotations(entries map[string]string) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ProbeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ProbeApplyConfiguration) WithFinalizers(values ...string) *ProbeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ProbeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithSpec(value *ProbeSpecApplyConfiguration) *ProbeApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/proberspec.go b/pkg/client/applyconfiguration/monitoring/v1/proberspec.go new file mode 100644 index 000000000..a9f85fa68 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/proberspec.go @@ -0,0 +1,64 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ProberSpecApplyConfiguration represents an declarative configuration of the ProberSpec type for use +// with apply. +type ProberSpecApplyConfiguration struct { + URL *string `json:"url,omitempty"` + Scheme *string `json:"scheme,omitempty"` + Path *string `json:"path,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` +} + +// ProberSpecApplyConfiguration constructs an declarative configuration of the ProberSpec type for use with +// apply. +func ProberSpec() *ProberSpecApplyConfiguration { + return &ProberSpecApplyConfiguration{} +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *ProberSpecApplyConfiguration) WithURL(value string) *ProberSpecApplyConfiguration { + b.URL = &value + return b +} + +// WithScheme sets the Scheme field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheme field is set to the value of the last call. +func (b *ProberSpecApplyConfiguration) WithScheme(value string) *ProberSpecApplyConfiguration { + b.Scheme = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *ProberSpecApplyConfiguration) WithPath(value string) *ProberSpecApplyConfiguration { + b.Path = &value + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *ProberSpecApplyConfiguration) WithProxyURL(value string) *ProberSpecApplyConfiguration { + b.ProxyURL = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/probespec.go b/pkg/client/applyconfiguration/monitoring/v1/probespec.go new file mode 100644 index 000000000..b9ab5fd02 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/probespec.go @@ -0,0 +1,191 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" +) + +// ProbeSpecApplyConfiguration represents an declarative configuration of the ProbeSpec type for use +// with apply. +type ProbeSpecApplyConfiguration struct { + JobName *string `json:"jobName,omitempty"` + ProberSpec *ProberSpecApplyConfiguration `json:"prober,omitempty"` + Module *string `json:"module,omitempty"` + Targets *ProbeTargetsApplyConfiguration `json:"targets,omitempty"` + Interval *monitoringv1.Duration `json:"interval,omitempty"` + ScrapeTimeout *monitoringv1.Duration `json:"scrapeTimeout,omitempty"` + TLSConfig *ProbeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + BearerTokenSecret *corev1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + OAuth2 *OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + MetricRelabelConfigs []*monitoringv1.RelabelConfig `json:"metricRelabelings,omitempty"` + Authorization *SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` + SampleLimit *uint64 `json:"sampleLimit,omitempty"` + TargetLimit *uint64 `json:"targetLimit,omitempty"` + LabelLimit *uint64 `json:"labelLimit,omitempty"` + LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` + LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` +} + +// ProbeSpecApplyConfiguration constructs an declarative configuration of the ProbeSpec type for use with +// apply. +func ProbeSpec() *ProbeSpecApplyConfiguration { + return &ProbeSpecApplyConfiguration{} +} + +// WithJobName sets the JobName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the JobName field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithJobName(value string) *ProbeSpecApplyConfiguration { + b.JobName = &value + return b +} + +// WithProberSpec sets the ProberSpec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProberSpec field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithProberSpec(value *ProberSpecApplyConfiguration) *ProbeSpecApplyConfiguration { + b.ProberSpec = value + return b +} + +// WithModule sets the Module field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Module field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithModule(value string) *ProbeSpecApplyConfiguration { + b.Module = &value + return b +} + +// WithTargets sets the Targets field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Targets field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithTargets(value *ProbeTargetsApplyConfiguration) *ProbeSpecApplyConfiguration { + b.Targets = value + return b +} + +// WithInterval sets the Interval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Interval field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithInterval(value monitoringv1.Duration) *ProbeSpecApplyConfiguration { + b.Interval = &value + return b +} + +// WithScrapeTimeout sets the ScrapeTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScrapeTimeout field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithScrapeTimeout(value monitoringv1.Duration) *ProbeSpecApplyConfiguration { + b.ScrapeTimeout = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithTLSConfig(value *ProbeTLSConfigApplyConfiguration) *ProbeSpecApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenSecret field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithBearerTokenSecret(value corev1.SecretKeySelector) *ProbeSpecApplyConfiguration { + b.BearerTokenSecret = &value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *ProbeSpecApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *ProbeSpecApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithMetricRelabelConfigs adds the given value to the MetricRelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MetricRelabelConfigs field. +func (b *ProbeSpecApplyConfiguration) WithMetricRelabelConfigs(values ...**monitoringv1.RelabelConfig) *ProbeSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMetricRelabelConfigs") + } + b.MetricRelabelConfigs = append(b.MetricRelabelConfigs, *values[i]) + } + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithAuthorization(value *SafeAuthorizationApplyConfiguration) *ProbeSpecApplyConfiguration { + b.Authorization = value + return b +} + +// WithSampleLimit sets the SampleLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SampleLimit field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithSampleLimit(value uint64) *ProbeSpecApplyConfiguration { + b.SampleLimit = &value + return b +} + +// WithTargetLimit sets the TargetLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetLimit field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithTargetLimit(value uint64) *ProbeSpecApplyConfiguration { + b.TargetLimit = &value + return b +} + +// WithLabelLimit sets the LabelLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelLimit field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithLabelLimit(value uint64) *ProbeSpecApplyConfiguration { + b.LabelLimit = &value + return b +} + +// WithLabelNameLengthLimit sets the LabelNameLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelNameLengthLimit field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithLabelNameLengthLimit(value uint64) *ProbeSpecApplyConfiguration { + b.LabelNameLengthLimit = &value + return b +} + +// WithLabelValueLengthLimit sets the LabelValueLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelValueLengthLimit field is set to the value of the last call. +func (b *ProbeSpecApplyConfiguration) WithLabelValueLengthLimit(value uint64) *ProbeSpecApplyConfiguration { + b.LabelValueLengthLimit = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/probetargetingress.go b/pkg/client/applyconfiguration/monitoring/v1/probetargetingress.go new file mode 100644 index 000000000..a239b330c --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/probetargetingress.go @@ -0,0 +1,65 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apismonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ProbeTargetIngressApplyConfiguration represents an declarative configuration of the ProbeTargetIngress type for use +// with apply. +type ProbeTargetIngressApplyConfiguration struct { + Selector *v1.LabelSelector `json:"selector,omitempty"` + NamespaceSelector *NamespaceSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` + RelabelConfigs []*apismonitoringv1.RelabelConfig `json:"relabelingConfigs,omitempty"` +} + +// ProbeTargetIngressApplyConfiguration constructs an declarative configuration of the ProbeTargetIngress type for use with +// apply. +func ProbeTargetIngress() *ProbeTargetIngressApplyConfiguration { + return &ProbeTargetIngressApplyConfiguration{} +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *ProbeTargetIngressApplyConfiguration) WithSelector(value v1.LabelSelector) *ProbeTargetIngressApplyConfiguration { + b.Selector = &value + return b +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *ProbeTargetIngressApplyConfiguration) WithNamespaceSelector(value *NamespaceSelectorApplyConfiguration) *ProbeTargetIngressApplyConfiguration { + b.NamespaceSelector = value + return b +} + +// WithRelabelConfigs adds the given value to the RelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RelabelConfigs field. +func (b *ProbeTargetIngressApplyConfiguration) WithRelabelConfigs(values ...**apismonitoringv1.RelabelConfig) *ProbeTargetIngressApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRelabelConfigs") + } + b.RelabelConfigs = append(b.RelabelConfigs, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/probetargets.go b/pkg/client/applyconfiguration/monitoring/v1/probetargets.go new file mode 100644 index 000000000..a1a2e1fdf --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/probetargets.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ProbeTargetsApplyConfiguration represents an declarative configuration of the ProbeTargets type for use +// with apply. +type ProbeTargetsApplyConfiguration struct { + StaticConfig *ProbeTargetStaticConfigApplyConfiguration `json:"staticConfig,omitempty"` + Ingress *ProbeTargetIngressApplyConfiguration `json:"ingress,omitempty"` +} + +// ProbeTargetsApplyConfiguration constructs an declarative configuration of the ProbeTargets type for use with +// apply. +func ProbeTargets() *ProbeTargetsApplyConfiguration { + return &ProbeTargetsApplyConfiguration{} +} + +// WithStaticConfig sets the StaticConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StaticConfig field is set to the value of the last call. +func (b *ProbeTargetsApplyConfiguration) WithStaticConfig(value *ProbeTargetStaticConfigApplyConfiguration) *ProbeTargetsApplyConfiguration { + b.StaticConfig = value + return b +} + +// WithIngress sets the Ingress field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ingress field is set to the value of the last call. +func (b *ProbeTargetsApplyConfiguration) WithIngress(value *ProbeTargetIngressApplyConfiguration) *ProbeTargetsApplyConfiguration { + b.Ingress = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/probetargetstaticconfig.go b/pkg/client/applyconfiguration/monitoring/v1/probetargetstaticconfig.go new file mode 100644 index 000000000..2d29beb8d --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/probetargetstaticconfig.go @@ -0,0 +1,72 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// ProbeTargetStaticConfigApplyConfiguration represents an declarative configuration of the ProbeTargetStaticConfig type for use +// with apply. +type ProbeTargetStaticConfigApplyConfiguration struct { + Targets []string `json:"static,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + RelabelConfigs []*v1.RelabelConfig `json:"relabelingConfigs,omitempty"` +} + +// ProbeTargetStaticConfigApplyConfiguration constructs an declarative configuration of the ProbeTargetStaticConfig type for use with +// apply. +func ProbeTargetStaticConfig() *ProbeTargetStaticConfigApplyConfiguration { + return &ProbeTargetStaticConfigApplyConfiguration{} +} + +// WithTargets adds the given value to the Targets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Targets field. +func (b *ProbeTargetStaticConfigApplyConfiguration) WithTargets(values ...string) *ProbeTargetStaticConfigApplyConfiguration { + for i := range values { + b.Targets = append(b.Targets, values[i]) + } + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ProbeTargetStaticConfigApplyConfiguration) WithLabels(entries map[string]string) *ProbeTargetStaticConfigApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithRelabelConfigs adds the given value to the RelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RelabelConfigs field. +func (b *ProbeTargetStaticConfigApplyConfiguration) WithRelabelConfigs(values ...**v1.RelabelConfig) *ProbeTargetStaticConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRelabelConfigs") + } + b.RelabelConfigs = append(b.RelabelConfigs, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/probetlsconfig.go b/pkg/client/applyconfiguration/monitoring/v1/probetlsconfig.go new file mode 100644 index 000000000..39cd361c0 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/probetlsconfig.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// ProbeTLSConfigApplyConfiguration represents an declarative configuration of the ProbeTLSConfig type for use +// with apply. +type ProbeTLSConfigApplyConfiguration struct { + SafeTLSConfigApplyConfiguration `json:",inline"` +} + +// ProbeTLSConfigApplyConfiguration constructs an declarative configuration of the ProbeTLSConfig type for use with +// apply. +func ProbeTLSConfig() *ProbeTLSConfigApplyConfiguration { + return &ProbeTLSConfigApplyConfiguration{} +} + +// WithCA sets the CA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CA field is set to the value of the last call. +func (b *ProbeTLSConfigApplyConfiguration) WithCA(value *SecretOrConfigMapApplyConfiguration) *ProbeTLSConfigApplyConfiguration { + b.CA = value + return b +} + +// WithCert sets the Cert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cert field is set to the value of the last call. +func (b *ProbeTLSConfigApplyConfiguration) WithCert(value *SecretOrConfigMapApplyConfiguration) *ProbeTLSConfigApplyConfiguration { + b.Cert = value + return b +} + +// WithKeySecret sets the KeySecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KeySecret field is set to the value of the last call. +func (b *ProbeTLSConfigApplyConfiguration) WithKeySecret(value corev1.SecretKeySelector) *ProbeTLSConfigApplyConfiguration { + b.KeySecret = &value + return b +} + +// WithServerName sets the ServerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServerName field is set to the value of the last call. +func (b *ProbeTLSConfigApplyConfiguration) WithServerName(value string) *ProbeTLSConfigApplyConfiguration { + b.ServerName = &value + return b +} + +// WithInsecureSkipVerify sets the InsecureSkipVerify field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InsecureSkipVerify field is set to the value of the last call. +func (b *ProbeTLSConfigApplyConfiguration) WithInsecureSkipVerify(value bool) *ProbeTLSConfigApplyConfiguration { + b.InsecureSkipVerify = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheus.go b/pkg/client/applyconfiguration/monitoring/v1/prometheus.go new file mode 100644 index 000000000..28a7b0df7 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheus.go @@ -0,0 +1,217 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PrometheusApplyConfiguration represents an declarative configuration of the Prometheus type for use +// with apply. +type PrometheusApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PrometheusSpecApplyConfiguration `json:"spec,omitempty"` + Status *PrometheusStatusApplyConfiguration `json:"status,omitempty"` +} + +// Prometheus constructs an declarative configuration of the Prometheus type for use with +// apply. +func Prometheus(name, namespace string) *PrometheusApplyConfiguration { + b := &PrometheusApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Prometheus") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithKind(value string) *PrometheusApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithAPIVersion(value string) *PrometheusApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithName(value string) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithGenerateName(value string) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithNamespace(value string) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithUID(value types.UID) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithResourceVersion(value string) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithGeneration(value int64) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PrometheusApplyConfiguration) WithLabels(entries map[string]string) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PrometheusApplyConfiguration) WithAnnotations(entries map[string]string) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PrometheusApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PrometheusApplyConfiguration) WithFinalizers(values ...string) *PrometheusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PrometheusApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithSpec(value *PrometheusSpecApplyConfiguration) *PrometheusApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PrometheusApplyConfiguration) WithStatus(value *PrometheusStatusApplyConfiguration) *PrometheusApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheuscondition.go b/pkg/client/applyconfiguration/monitoring/v1/prometheuscondition.go new file mode 100644 index 000000000..34bef4813 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheuscondition.go @@ -0,0 +1,87 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PrometheusConditionApplyConfiguration represents an declarative configuration of the PrometheusCondition type for use +// with apply. +type PrometheusConditionApplyConfiguration struct { + Type *v1.PrometheusConditionType `json:"type,omitempty"` + Status *v1.PrometheusConditionStatus `json:"status,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` +} + +// PrometheusConditionApplyConfiguration constructs an declarative configuration of the PrometheusCondition type for use with +// apply. +func PrometheusCondition() *PrometheusConditionApplyConfiguration { + return &PrometheusConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *PrometheusConditionApplyConfiguration) WithType(value v1.PrometheusConditionType) *PrometheusConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PrometheusConditionApplyConfiguration) WithStatus(value v1.PrometheusConditionStatus) *PrometheusConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *PrometheusConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PrometheusConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *PrometheusConditionApplyConfiguration) WithReason(value string) *PrometheusConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PrometheusConditionApplyConfiguration) WithMessage(value string) *PrometheusConditionApplyConfiguration { + b.Message = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *PrometheusConditionApplyConfiguration) WithObservedGeneration(value int64) *PrometheusConditionApplyConfiguration { + b.ObservedGeneration = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheusrule.go b/pkg/client/applyconfiguration/monitoring/v1/prometheusrule.go new file mode 100644 index 000000000..9b6567f2b --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheusrule.go @@ -0,0 +1,208 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PrometheusRuleApplyConfiguration represents an declarative configuration of the PrometheusRule type for use +// with apply. +type PrometheusRuleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PrometheusRuleSpecApplyConfiguration `json:"spec,omitempty"` +} + +// PrometheusRule constructs an declarative configuration of the PrometheusRule type for use with +// apply. +func PrometheusRule(name, namespace string) *PrometheusRuleApplyConfiguration { + b := &PrometheusRuleApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("PrometheusRule") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithKind(value string) *PrometheusRuleApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithAPIVersion(value string) *PrometheusRuleApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithName(value string) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithGenerateName(value string) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithNamespace(value string) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithUID(value types.UID) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithResourceVersion(value string) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithGeneration(value int64) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PrometheusRuleApplyConfiguration) WithLabels(entries map[string]string) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PrometheusRuleApplyConfiguration) WithAnnotations(entries map[string]string) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PrometheusRuleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PrometheusRuleApplyConfiguration) WithFinalizers(values ...string) *PrometheusRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PrometheusRuleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithSpec(value *PrometheusRuleSpecApplyConfiguration) *PrometheusRuleApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheusruleexcludeconfig.go b/pkg/client/applyconfiguration/monitoring/v1/prometheusruleexcludeconfig.go new file mode 100644 index 000000000..a179af9c1 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheusruleexcludeconfig.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PrometheusRuleExcludeConfigApplyConfiguration represents an declarative configuration of the PrometheusRuleExcludeConfig type for use +// with apply. +type PrometheusRuleExcludeConfigApplyConfiguration struct { + RuleNamespace *string `json:"ruleNamespace,omitempty"` + RuleName *string `json:"ruleName,omitempty"` +} + +// PrometheusRuleExcludeConfigApplyConfiguration constructs an declarative configuration of the PrometheusRuleExcludeConfig type for use with +// apply. +func PrometheusRuleExcludeConfig() *PrometheusRuleExcludeConfigApplyConfiguration { + return &PrometheusRuleExcludeConfigApplyConfiguration{} +} + +// WithRuleNamespace sets the RuleNamespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuleNamespace field is set to the value of the last call. +func (b *PrometheusRuleExcludeConfigApplyConfiguration) WithRuleNamespace(value string) *PrometheusRuleExcludeConfigApplyConfiguration { + b.RuleNamespace = &value + return b +} + +// WithRuleName sets the RuleName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuleName field is set to the value of the last call. +func (b *PrometheusRuleExcludeConfigApplyConfiguration) WithRuleName(value string) *PrometheusRuleExcludeConfigApplyConfiguration { + b.RuleName = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheusrulespec.go b/pkg/client/applyconfiguration/monitoring/v1/prometheusrulespec.go new file mode 100644 index 000000000..b5387dd4a --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheusrulespec.go @@ -0,0 +1,42 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PrometheusRuleSpecApplyConfiguration represents an declarative configuration of the PrometheusRuleSpec type for use +// with apply. +type PrometheusRuleSpecApplyConfiguration struct { + Groups []RuleGroupApplyConfiguration `json:"groups,omitempty"` +} + +// PrometheusRuleSpecApplyConfiguration constructs an declarative configuration of the PrometheusRuleSpec type for use with +// apply. +func PrometheusRuleSpec() *PrometheusRuleSpecApplyConfiguration { + return &PrometheusRuleSpecApplyConfiguration{} +} + +// WithGroups adds the given value to the Groups field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Groups field. +func (b *PrometheusRuleSpecApplyConfiguration) WithGroups(values ...*RuleGroupApplyConfiguration) *PrometheusRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithGroups") + } + b.Groups = append(b.Groups, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheusspec.go b/pkg/client/applyconfiguration/monitoring/v1/prometheusspec.go new file mode 100644 index 000000000..01e6c2329 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheusspec.go @@ -0,0 +1,799 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PrometheusSpecApplyConfiguration represents an declarative configuration of the PrometheusSpec type for use +// with apply. +type PrometheusSpecApplyConfiguration struct { + CommonPrometheusFieldsApplyConfiguration `json:",inline"` + BaseImage *string `json:"baseImage,omitempty"` + Tag *string `json:"tag,omitempty"` + SHA *string `json:"sha,omitempty"` + Retention *monitoringv1.Duration `json:"retention,omitempty"` + RetentionSize *monitoringv1.ByteSize `json:"retentionSize,omitempty"` + DisableCompaction *bool `json:"disableCompaction,omitempty"` + Rules *RulesApplyConfiguration `json:"rules,omitempty"` + PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfigApplyConfiguration `json:"prometheusRulesExcludedFromEnforce,omitempty"` + Query *QuerySpecApplyConfiguration `json:"query,omitempty"` + RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"` + RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"` + Alerting *AlertingSpecApplyConfiguration `json:"alerting,omitempty"` + RemoteRead []RemoteReadSpecApplyConfiguration `json:"remoteRead,omitempty"` + AdditionalAlertRelabelConfigs *corev1.SecretKeySelector `json:"additionalAlertRelabelConfigs,omitempty"` + AdditionalAlertManagerConfigs *corev1.SecretKeySelector `json:"additionalAlertManagerConfigs,omitempty"` + Thanos *ThanosSpecApplyConfiguration `json:"thanos,omitempty"` + QueryLogFile *string `json:"queryLogFile,omitempty"` + AllowOverlappingBlocks *bool `json:"allowOverlappingBlocks,omitempty"` + Exemplars *ExemplarsApplyConfiguration `json:"exemplars,omitempty"` + EvaluationInterval *monitoringv1.Duration `json:"evaluationInterval,omitempty"` + EnableAdminAPI *bool `json:"enableAdminAPI,omitempty"` + TSDB *TSDBSpecApplyConfiguration `json:"tsdb,omitempty"` +} + +// PrometheusSpecApplyConfiguration constructs an declarative configuration of the PrometheusSpec type for use with +// apply. +func PrometheusSpec() *PrometheusSpecApplyConfiguration { + return &PrometheusSpecApplyConfiguration{} +} + +// WithPodMetadata sets the PodMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMetadata field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithPodMetadata(value *EmbeddedObjectMetadataApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.PodMetadata = value + return b +} + +// WithServiceMonitorSelector sets the ServiceMonitorSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceMonitorSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithServiceMonitorSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.ServiceMonitorSelector = &value + return b +} + +// WithServiceMonitorNamespaceSelector sets the ServiceMonitorNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceMonitorNamespaceSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithServiceMonitorNamespaceSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.ServiceMonitorNamespaceSelector = &value + return b +} + +// WithPodMonitorSelector sets the PodMonitorSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMonitorSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithPodMonitorSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.PodMonitorSelector = &value + return b +} + +// WithPodMonitorNamespaceSelector sets the PodMonitorNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMonitorNamespaceSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithPodMonitorNamespaceSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.PodMonitorNamespaceSelector = &value + return b +} + +// WithProbeSelector sets the ProbeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProbeSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithProbeSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.ProbeSelector = &value + return b +} + +// WithProbeNamespaceSelector sets the ProbeNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProbeNamespaceSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithProbeNamespaceSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.ProbeNamespaceSelector = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithVersion(value string) *PrometheusSpecApplyConfiguration { + b.Version = &value + return b +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithPaused(value bool) *PrometheusSpecApplyConfiguration { + b.Paused = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithImage(value string) *PrometheusSpecApplyConfiguration { + b.Image = &value + return b +} + +// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImagePullPolicy field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *PrometheusSpecApplyConfiguration { + b.ImagePullPolicy = &value + return b +} + +// WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. +func (b *PrometheusSpecApplyConfiguration) WithImagePullSecrets(values ...corev1.LocalObjectReference) *PrometheusSpecApplyConfiguration { + for i := range values { + b.ImagePullSecrets = append(b.ImagePullSecrets, values[i]) + } + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithReplicas(value int32) *PrometheusSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithShards sets the Shards field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Shards field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithShards(value int32) *PrometheusSpecApplyConfiguration { + b.Shards = &value + return b +} + +// WithReplicaExternalLabelName sets the ReplicaExternalLabelName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReplicaExternalLabelName field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithReplicaExternalLabelName(value string) *PrometheusSpecApplyConfiguration { + b.ReplicaExternalLabelName = &value + return b +} + +// WithPrometheusExternalLabelName sets the PrometheusExternalLabelName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PrometheusExternalLabelName field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithPrometheusExternalLabelName(value string) *PrometheusSpecApplyConfiguration { + b.PrometheusExternalLabelName = &value + return b +} + +// WithLogLevel sets the LogLevel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogLevel field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithLogLevel(value string) *PrometheusSpecApplyConfiguration { + b.LogLevel = &value + return b +} + +// WithLogFormat sets the LogFormat field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogFormat field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithLogFormat(value string) *PrometheusSpecApplyConfiguration { + b.LogFormat = &value + return b +} + +// WithScrapeInterval sets the ScrapeInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScrapeInterval field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithScrapeInterval(value monitoringv1.Duration) *PrometheusSpecApplyConfiguration { + b.ScrapeInterval = &value + return b +} + +// WithScrapeTimeout sets the ScrapeTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScrapeTimeout field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithScrapeTimeout(value monitoringv1.Duration) *PrometheusSpecApplyConfiguration { + b.ScrapeTimeout = &value + return b +} + +// WithExternalLabels puts the entries into the ExternalLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the ExternalLabels field, +// overwriting an existing map entries in ExternalLabels field with the same key. +func (b *PrometheusSpecApplyConfiguration) WithExternalLabels(entries map[string]string) *PrometheusSpecApplyConfiguration { + if b.ExternalLabels == nil && len(entries) > 0 { + b.ExternalLabels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ExternalLabels[k] = v + } + return b +} + +// WithEnableRemoteWriteReceiver sets the EnableRemoteWriteReceiver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableRemoteWriteReceiver field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnableRemoteWriteReceiver(value bool) *PrometheusSpecApplyConfiguration { + b.EnableRemoteWriteReceiver = &value + return b +} + +// WithEnableFeatures adds the given value to the EnableFeatures field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EnableFeatures field. +func (b *PrometheusSpecApplyConfiguration) WithEnableFeatures(values ...string) *PrometheusSpecApplyConfiguration { + for i := range values { + b.EnableFeatures = append(b.EnableFeatures, values[i]) + } + return b +} + +// WithExternalURL sets the ExternalURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExternalURL field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithExternalURL(value string) *PrometheusSpecApplyConfiguration { + b.ExternalURL = &value + return b +} + +// WithRoutePrefix sets the RoutePrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutePrefix field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithRoutePrefix(value string) *PrometheusSpecApplyConfiguration { + b.RoutePrefix = &value + return b +} + +// WithStorage sets the Storage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Storage field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithStorage(value *StorageSpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.Storage = value + return b +} + +// WithVolumes adds the given value to the Volumes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Volumes field. +func (b *PrometheusSpecApplyConfiguration) WithVolumes(values ...corev1.Volume) *PrometheusSpecApplyConfiguration { + for i := range values { + b.Volumes = append(b.Volumes, values[i]) + } + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *PrometheusSpecApplyConfiguration) WithVolumeMounts(values ...corev1.VolumeMount) *PrometheusSpecApplyConfiguration { + for i := range values { + b.VolumeMounts = append(b.VolumeMounts, values[i]) + } + return b +} + +// WithWeb sets the Web field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Web field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithWeb(value *PrometheusWebSpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.Web = value + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithResources(value corev1.ResourceRequirements) *PrometheusSpecApplyConfiguration { + b.Resources = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *PrometheusSpecApplyConfiguration) WithNodeSelector(entries map[string]string) *PrometheusSpecApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithServiceAccountName sets the ServiceAccountName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountName field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithServiceAccountName(value string) *PrometheusSpecApplyConfiguration { + b.ServiceAccountName = &value + return b +} + +// WithSecrets adds the given value to the Secrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Secrets field. +func (b *PrometheusSpecApplyConfiguration) WithSecrets(values ...string) *PrometheusSpecApplyConfiguration { + for i := range values { + b.Secrets = append(b.Secrets, values[i]) + } + return b +} + +// WithConfigMaps adds the given value to the ConfigMaps field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ConfigMaps field. +func (b *PrometheusSpecApplyConfiguration) WithConfigMaps(values ...string) *PrometheusSpecApplyConfiguration { + for i := range values { + b.ConfigMaps = append(b.ConfigMaps, values[i]) + } + return b +} + +// WithAffinity sets the Affinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Affinity field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithAffinity(value corev1.Affinity) *PrometheusSpecApplyConfiguration { + b.Affinity = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *PrometheusSpecApplyConfiguration) WithTolerations(values ...corev1.Toleration) *PrometheusSpecApplyConfiguration { + for i := range values { + b.Tolerations = append(b.Tolerations, values[i]) + } + return b +} + +// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. +func (b *PrometheusSpecApplyConfiguration) WithTopologySpreadConstraints(values ...corev1.TopologySpreadConstraint) *PrometheusSpecApplyConfiguration { + for i := range values { + b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, values[i]) + } + return b +} + +// WithRemoteWrite adds the given value to the RemoteWrite field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RemoteWrite field. +func (b *PrometheusSpecApplyConfiguration) WithRemoteWrite(values ...*RemoteWriteSpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRemoteWrite") + } + b.RemoteWrite = append(b.RemoteWrite, *values[i]) + } + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithSecurityContext(value corev1.PodSecurityContext) *PrometheusSpecApplyConfiguration { + b.SecurityContext = &value + return b +} + +// WithListenLocal sets the ListenLocal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ListenLocal field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithListenLocal(value bool) *PrometheusSpecApplyConfiguration { + b.ListenLocal = &value + return b +} + +// WithContainers adds the given value to the Containers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Containers field. +func (b *PrometheusSpecApplyConfiguration) WithContainers(values ...corev1.Container) *PrometheusSpecApplyConfiguration { + for i := range values { + b.Containers = append(b.Containers, values[i]) + } + return b +} + +// WithInitContainers adds the given value to the InitContainers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InitContainers field. +func (b *PrometheusSpecApplyConfiguration) WithInitContainers(values ...corev1.Container) *PrometheusSpecApplyConfiguration { + for i := range values { + b.InitContainers = append(b.InitContainers, values[i]) + } + return b +} + +// WithAdditionalScrapeConfigs sets the AdditionalScrapeConfigs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdditionalScrapeConfigs field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithAdditionalScrapeConfigs(value corev1.SecretKeySelector) *PrometheusSpecApplyConfiguration { + b.AdditionalScrapeConfigs = &value + return b +} + +// WithAPIServerConfig sets the APIServerConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIServerConfig field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithAPIServerConfig(value *APIServerConfigApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.APIServerConfig = value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithPriorityClassName(value string) *PrometheusSpecApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPortName sets the PortName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortName field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithPortName(value string) *PrometheusSpecApplyConfiguration { + b.PortName = &value + return b +} + +// WithArbitraryFSAccessThroughSMs sets the ArbitraryFSAccessThroughSMs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ArbitraryFSAccessThroughSMs field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithArbitraryFSAccessThroughSMs(value *ArbitraryFSAccessThroughSMsConfigApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.ArbitraryFSAccessThroughSMs = value + return b +} + +// WithOverrideHonorLabels sets the OverrideHonorLabels field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OverrideHonorLabels field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithOverrideHonorLabels(value bool) *PrometheusSpecApplyConfiguration { + b.OverrideHonorLabels = &value + return b +} + +// WithOverrideHonorTimestamps sets the OverrideHonorTimestamps field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OverrideHonorTimestamps field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithOverrideHonorTimestamps(value bool) *PrometheusSpecApplyConfiguration { + b.OverrideHonorTimestamps = &value + return b +} + +// WithIgnoreNamespaceSelectors sets the IgnoreNamespaceSelectors field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IgnoreNamespaceSelectors field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithIgnoreNamespaceSelectors(value bool) *PrometheusSpecApplyConfiguration { + b.IgnoreNamespaceSelectors = &value + return b +} + +// WithEnforcedNamespaceLabel sets the EnforcedNamespaceLabel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedNamespaceLabel field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnforcedNamespaceLabel(value string) *PrometheusSpecApplyConfiguration { + b.EnforcedNamespaceLabel = &value + return b +} + +// WithEnforcedSampleLimit sets the EnforcedSampleLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedSampleLimit field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnforcedSampleLimit(value uint64) *PrometheusSpecApplyConfiguration { + b.EnforcedSampleLimit = &value + return b +} + +// WithEnforcedTargetLimit sets the EnforcedTargetLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedTargetLimit field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnforcedTargetLimit(value uint64) *PrometheusSpecApplyConfiguration { + b.EnforcedTargetLimit = &value + return b +} + +// WithEnforcedLabelLimit sets the EnforcedLabelLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedLabelLimit field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnforcedLabelLimit(value uint64) *PrometheusSpecApplyConfiguration { + b.EnforcedLabelLimit = &value + return b +} + +// WithEnforcedLabelNameLengthLimit sets the EnforcedLabelNameLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedLabelNameLengthLimit field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnforcedLabelNameLengthLimit(value uint64) *PrometheusSpecApplyConfiguration { + b.EnforcedLabelNameLengthLimit = &value + return b +} + +// WithEnforcedLabelValueLengthLimit sets the EnforcedLabelValueLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedLabelValueLengthLimit field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnforcedLabelValueLengthLimit(value uint64) *PrometheusSpecApplyConfiguration { + b.EnforcedLabelValueLengthLimit = &value + return b +} + +// WithEnforcedBodySizeLimit sets the EnforcedBodySizeLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedBodySizeLimit field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnforcedBodySizeLimit(value monitoringv1.ByteSize) *PrometheusSpecApplyConfiguration { + b.EnforcedBodySizeLimit = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithMinReadySeconds(value uint32) *PrometheusSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithHostAliases adds the given value to the HostAliases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HostAliases field. +func (b *PrometheusSpecApplyConfiguration) WithHostAliases(values ...*HostAliasApplyConfiguration) *PrometheusSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHostAliases") + } + b.HostAliases = append(b.HostAliases, *values[i]) + } + return b +} + +// WithAdditionalArgs adds the given value to the AdditionalArgs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AdditionalArgs field. +func (b *PrometheusSpecApplyConfiguration) WithAdditionalArgs(values ...*ArgumentApplyConfiguration) *PrometheusSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAdditionalArgs") + } + b.AdditionalArgs = append(b.AdditionalArgs, *values[i]) + } + return b +} + +// WithWALCompression sets the WALCompression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WALCompression field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithWALCompression(value bool) *PrometheusSpecApplyConfiguration { + b.WALCompression = &value + return b +} + +// WithExcludedFromEnforcement adds the given value to the ExcludedFromEnforcement field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ExcludedFromEnforcement field. +func (b *PrometheusSpecApplyConfiguration) WithExcludedFromEnforcement(values ...*ObjectReferenceApplyConfiguration) *PrometheusSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExcludedFromEnforcement") + } + b.ExcludedFromEnforcement = append(b.ExcludedFromEnforcement, *values[i]) + } + return b +} + +// WithHostNetwork sets the HostNetwork field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostNetwork field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithHostNetwork(value bool) *PrometheusSpecApplyConfiguration { + b.HostNetwork = &value + return b +} + +// WithBaseImage sets the BaseImage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BaseImage field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithBaseImage(value string) *PrometheusSpecApplyConfiguration { + b.BaseImage = &value + return b +} + +// WithTag sets the Tag field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Tag field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithTag(value string) *PrometheusSpecApplyConfiguration { + b.Tag = &value + return b +} + +// WithSHA sets the SHA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SHA field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithSHA(value string) *PrometheusSpecApplyConfiguration { + b.SHA = &value + return b +} + +// WithRetention sets the Retention field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Retention field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithRetention(value monitoringv1.Duration) *PrometheusSpecApplyConfiguration { + b.Retention = &value + return b +} + +// WithRetentionSize sets the RetentionSize field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RetentionSize field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithRetentionSize(value monitoringv1.ByteSize) *PrometheusSpecApplyConfiguration { + b.RetentionSize = &value + return b +} + +// WithDisableCompaction sets the DisableCompaction field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisableCompaction field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithDisableCompaction(value bool) *PrometheusSpecApplyConfiguration { + b.DisableCompaction = &value + return b +} + +// WithRules sets the Rules field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rules field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithRules(value *RulesApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.Rules = value + return b +} + +// WithPrometheusRulesExcludedFromEnforce adds the given value to the PrometheusRulesExcludedFromEnforce field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PrometheusRulesExcludedFromEnforce field. +func (b *PrometheusSpecApplyConfiguration) WithPrometheusRulesExcludedFromEnforce(values ...*PrometheusRuleExcludeConfigApplyConfiguration) *PrometheusSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPrometheusRulesExcludedFromEnforce") + } + b.PrometheusRulesExcludedFromEnforce = append(b.PrometheusRulesExcludedFromEnforce, *values[i]) + } + return b +} + +// WithQuery sets the Query field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Query field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithQuery(value *QuerySpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.Query = value + return b +} + +// WithRuleSelector sets the RuleSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuleSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithRuleSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.RuleSelector = &value + return b +} + +// WithRuleNamespaceSelector sets the RuleNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuleNamespaceSelector field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithRuleNamespaceSelector(value metav1.LabelSelector) *PrometheusSpecApplyConfiguration { + b.RuleNamespaceSelector = &value + return b +} + +// WithAlerting sets the Alerting field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Alerting field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithAlerting(value *AlertingSpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.Alerting = value + return b +} + +// WithRemoteRead adds the given value to the RemoteRead field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RemoteRead field. +func (b *PrometheusSpecApplyConfiguration) WithRemoteRead(values ...*RemoteReadSpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRemoteRead") + } + b.RemoteRead = append(b.RemoteRead, *values[i]) + } + return b +} + +// WithAdditionalAlertRelabelConfigs sets the AdditionalAlertRelabelConfigs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdditionalAlertRelabelConfigs field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithAdditionalAlertRelabelConfigs(value corev1.SecretKeySelector) *PrometheusSpecApplyConfiguration { + b.AdditionalAlertRelabelConfigs = &value + return b +} + +// WithAdditionalAlertManagerConfigs sets the AdditionalAlertManagerConfigs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdditionalAlertManagerConfigs field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithAdditionalAlertManagerConfigs(value corev1.SecretKeySelector) *PrometheusSpecApplyConfiguration { + b.AdditionalAlertManagerConfigs = &value + return b +} + +// WithThanos sets the Thanos field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Thanos field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithThanos(value *ThanosSpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.Thanos = value + return b +} + +// WithQueryLogFile sets the QueryLogFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the QueryLogFile field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithQueryLogFile(value string) *PrometheusSpecApplyConfiguration { + b.QueryLogFile = &value + return b +} + +// WithAllowOverlappingBlocks sets the AllowOverlappingBlocks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllowOverlappingBlocks field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithAllowOverlappingBlocks(value bool) *PrometheusSpecApplyConfiguration { + b.AllowOverlappingBlocks = &value + return b +} + +// WithExemplars sets the Exemplars field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Exemplars field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithExemplars(value *ExemplarsApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.Exemplars = value + return b +} + +// WithEvaluationInterval sets the EvaluationInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EvaluationInterval field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEvaluationInterval(value monitoringv1.Duration) *PrometheusSpecApplyConfiguration { + b.EvaluationInterval = &value + return b +} + +// WithEnableAdminAPI sets the EnableAdminAPI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableAdminAPI field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithEnableAdminAPI(value bool) *PrometheusSpecApplyConfiguration { + b.EnableAdminAPI = &value + return b +} + +// WithTSDB sets the TSDB field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TSDB field is set to the value of the last call. +func (b *PrometheusSpecApplyConfiguration) WithTSDB(value *TSDBSpecApplyConfiguration) *PrometheusSpecApplyConfiguration { + b.TSDB = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheusstatus.go b/pkg/client/applyconfiguration/monitoring/v1/prometheusstatus.go new file mode 100644 index 000000000..06e7745db --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheusstatus.go @@ -0,0 +1,101 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PrometheusStatusApplyConfiguration represents an declarative configuration of the PrometheusStatus type for use +// with apply. +type PrometheusStatusApplyConfiguration struct { + Paused *bool `json:"paused,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` + Conditions []PrometheusConditionApplyConfiguration `json:"conditions,omitempty"` + ShardStatuses []ShardStatusApplyConfiguration `json:"shardStatuses,omitempty"` +} + +// PrometheusStatusApplyConfiguration constructs an declarative configuration of the PrometheusStatus type for use with +// apply. +func PrometheusStatus() *PrometheusStatusApplyConfiguration { + return &PrometheusStatusApplyConfiguration{} +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *PrometheusStatusApplyConfiguration) WithPaused(value bool) *PrometheusStatusApplyConfiguration { + b.Paused = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *PrometheusStatusApplyConfiguration) WithReplicas(value int32) *PrometheusStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdatedReplicas field is set to the value of the last call. +func (b *PrometheusStatusApplyConfiguration) WithUpdatedReplicas(value int32) *PrometheusStatusApplyConfiguration { + b.UpdatedReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *PrometheusStatusApplyConfiguration) WithAvailableReplicas(value int32) *PrometheusStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *PrometheusStatusApplyConfiguration) WithUnavailableReplicas(value int32) *PrometheusStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PrometheusStatusApplyConfiguration) WithConditions(values ...*PrometheusConditionApplyConfiguration) *PrometheusStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithShardStatuses adds the given value to the ShardStatuses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ShardStatuses field. +func (b *PrometheusStatusApplyConfiguration) WithShardStatuses(values ...*ShardStatusApplyConfiguration) *PrometheusStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithShardStatuses") + } + b.ShardStatuses = append(b.ShardStatuses, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/prometheuswebspec.go b/pkg/client/applyconfiguration/monitoring/v1/prometheuswebspec.go new file mode 100644 index 000000000..cccacb6df --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/prometheuswebspec.go @@ -0,0 +1,54 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PrometheusWebSpecApplyConfiguration represents an declarative configuration of the PrometheusWebSpec type for use +// with apply. +type PrometheusWebSpecApplyConfiguration struct { + WebConfigFileFieldsApplyConfiguration `json:",inline"` + PageTitle *string `json:"pageTitle,omitempty"` +} + +// PrometheusWebSpecApplyConfiguration constructs an declarative configuration of the PrometheusWebSpec type for use with +// apply. +func PrometheusWebSpec() *PrometheusWebSpecApplyConfiguration { + return &PrometheusWebSpecApplyConfiguration{} +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *PrometheusWebSpecApplyConfiguration) WithTLSConfig(value *WebTLSConfigApplyConfiguration) *PrometheusWebSpecApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *PrometheusWebSpecApplyConfiguration) WithHTTPConfig(value *WebHTTPConfigApplyConfiguration) *PrometheusWebSpecApplyConfiguration { + b.HTTPConfig = value + return b +} + +// WithPageTitle sets the PageTitle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PageTitle field is set to the value of the last call. +func (b *PrometheusWebSpecApplyConfiguration) WithPageTitle(value string) *PrometheusWebSpecApplyConfiguration { + b.PageTitle = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/queryspec.go b/pkg/client/applyconfiguration/monitoring/v1/queryspec.go new file mode 100644 index 000000000..f3cef0728 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/queryspec.go @@ -0,0 +1,68 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// QuerySpecApplyConfiguration represents an declarative configuration of the QuerySpec type for use +// with apply. +type QuerySpecApplyConfiguration struct { + LookbackDelta *string `json:"lookbackDelta,omitempty"` + MaxConcurrency *int32 `json:"maxConcurrency,omitempty"` + MaxSamples *int32 `json:"maxSamples,omitempty"` + Timeout *v1.Duration `json:"timeout,omitempty"` +} + +// QuerySpecApplyConfiguration constructs an declarative configuration of the QuerySpec type for use with +// apply. +func QuerySpec() *QuerySpecApplyConfiguration { + return &QuerySpecApplyConfiguration{} +} + +// WithLookbackDelta sets the LookbackDelta field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LookbackDelta field is set to the value of the last call. +func (b *QuerySpecApplyConfiguration) WithLookbackDelta(value string) *QuerySpecApplyConfiguration { + b.LookbackDelta = &value + return b +} + +// WithMaxConcurrency sets the MaxConcurrency field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxConcurrency field is set to the value of the last call. +func (b *QuerySpecApplyConfiguration) WithMaxConcurrency(value int32) *QuerySpecApplyConfiguration { + b.MaxConcurrency = &value + return b +} + +// WithMaxSamples sets the MaxSamples field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSamples field is set to the value of the last call. +func (b *QuerySpecApplyConfiguration) WithMaxSamples(value int32) *QuerySpecApplyConfiguration { + b.MaxSamples = &value + return b +} + +// WithTimeout sets the Timeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Timeout field is set to the value of the last call. +func (b *QuerySpecApplyConfiguration) WithTimeout(value v1.Duration) *QuerySpecApplyConfiguration { + b.Timeout = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/queueconfig.go b/pkg/client/applyconfiguration/monitoring/v1/queueconfig.go new file mode 100644 index 000000000..660e19447 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/queueconfig.go @@ -0,0 +1,109 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// QueueConfigApplyConfiguration represents an declarative configuration of the QueueConfig type for use +// with apply. +type QueueConfigApplyConfiguration struct { + Capacity *int `json:"capacity,omitempty"` + MinShards *int `json:"minShards,omitempty"` + MaxShards *int `json:"maxShards,omitempty"` + MaxSamplesPerSend *int `json:"maxSamplesPerSend,omitempty"` + BatchSendDeadline *string `json:"batchSendDeadline,omitempty"` + MaxRetries *int `json:"maxRetries,omitempty"` + MinBackoff *string `json:"minBackoff,omitempty"` + MaxBackoff *string `json:"maxBackoff,omitempty"` + RetryOnRateLimit *bool `json:"retryOnRateLimit,omitempty"` +} + +// QueueConfigApplyConfiguration constructs an declarative configuration of the QueueConfig type for use with +// apply. +func QueueConfig() *QueueConfigApplyConfiguration { + return &QueueConfigApplyConfiguration{} +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithCapacity(value int) *QueueConfigApplyConfiguration { + b.Capacity = &value + return b +} + +// WithMinShards sets the MinShards field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinShards field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithMinShards(value int) *QueueConfigApplyConfiguration { + b.MinShards = &value + return b +} + +// WithMaxShards sets the MaxShards field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxShards field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithMaxShards(value int) *QueueConfigApplyConfiguration { + b.MaxShards = &value + return b +} + +// WithMaxSamplesPerSend sets the MaxSamplesPerSend field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSamplesPerSend field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithMaxSamplesPerSend(value int) *QueueConfigApplyConfiguration { + b.MaxSamplesPerSend = &value + return b +} + +// WithBatchSendDeadline sets the BatchSendDeadline field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BatchSendDeadline field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithBatchSendDeadline(value string) *QueueConfigApplyConfiguration { + b.BatchSendDeadline = &value + return b +} + +// WithMaxRetries sets the MaxRetries field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxRetries field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithMaxRetries(value int) *QueueConfigApplyConfiguration { + b.MaxRetries = &value + return b +} + +// WithMinBackoff sets the MinBackoff field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinBackoff field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithMinBackoff(value string) *QueueConfigApplyConfiguration { + b.MinBackoff = &value + return b +} + +// WithMaxBackoff sets the MaxBackoff field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxBackoff field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithMaxBackoff(value string) *QueueConfigApplyConfiguration { + b.MaxBackoff = &value + return b +} + +// WithRetryOnRateLimit sets the RetryOnRateLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RetryOnRateLimit field is set to the value of the last call. +func (b *QueueConfigApplyConfiguration) WithRetryOnRateLimit(value bool) *QueueConfigApplyConfiguration { + b.RetryOnRateLimit = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/relabelconfig.go b/pkg/client/applyconfiguration/monitoring/v1/relabelconfig.go new file mode 100644 index 000000000..f52f4a316 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/relabelconfig.go @@ -0,0 +1,97 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// RelabelConfigApplyConfiguration represents an declarative configuration of the RelabelConfig type for use +// with apply. +type RelabelConfigApplyConfiguration struct { + SourceLabels []v1.LabelName `json:"sourceLabels,omitempty"` + Separator *string `json:"separator,omitempty"` + TargetLabel *string `json:"targetLabel,omitempty"` + Regex *string `json:"regex,omitempty"` + Modulus *uint64 `json:"modulus,omitempty"` + Replacement *string `json:"replacement,omitempty"` + Action *string `json:"action,omitempty"` +} + +// RelabelConfigApplyConfiguration constructs an declarative configuration of the RelabelConfig type for use with +// apply. +func RelabelConfig() *RelabelConfigApplyConfiguration { + return &RelabelConfigApplyConfiguration{} +} + +// WithSourceLabels adds the given value to the SourceLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SourceLabels field. +func (b *RelabelConfigApplyConfiguration) WithSourceLabels(values ...v1.LabelName) *RelabelConfigApplyConfiguration { + for i := range values { + b.SourceLabels = append(b.SourceLabels, values[i]) + } + return b +} + +// WithSeparator sets the Separator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Separator field is set to the value of the last call. +func (b *RelabelConfigApplyConfiguration) WithSeparator(value string) *RelabelConfigApplyConfiguration { + b.Separator = &value + return b +} + +// WithTargetLabel sets the TargetLabel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetLabel field is set to the value of the last call. +func (b *RelabelConfigApplyConfiguration) WithTargetLabel(value string) *RelabelConfigApplyConfiguration { + b.TargetLabel = &value + return b +} + +// WithRegex sets the Regex field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Regex field is set to the value of the last call. +func (b *RelabelConfigApplyConfiguration) WithRegex(value string) *RelabelConfigApplyConfiguration { + b.Regex = &value + return b +} + +// WithModulus sets the Modulus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Modulus field is set to the value of the last call. +func (b *RelabelConfigApplyConfiguration) WithModulus(value uint64) *RelabelConfigApplyConfiguration { + b.Modulus = &value + return b +} + +// WithReplacement sets the Replacement field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replacement field is set to the value of the last call. +func (b *RelabelConfigApplyConfiguration) WithReplacement(value string) *RelabelConfigApplyConfiguration { + b.Replacement = &value + return b +} + +// WithAction sets the Action field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Action field is set to the value of the last call. +func (b *RelabelConfigApplyConfiguration) WithAction(value string) *RelabelConfigApplyConfiguration { + b.Action = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/remotereadspec.go b/pkg/client/applyconfiguration/monitoring/v1/remotereadspec.go new file mode 100644 index 000000000..a332606c6 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/remotereadspec.go @@ -0,0 +1,170 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// RemoteReadSpecApplyConfiguration represents an declarative configuration of the RemoteReadSpec type for use +// with apply. +type RemoteReadSpecApplyConfiguration struct { + URL *string `json:"url,omitempty"` + Name *string `json:"name,omitempty"` + RequiredMatchers map[string]string `json:"requiredMatchers,omitempty"` + RemoteTimeout *v1.Duration `json:"remoteTimeout,omitempty"` + Headers map[string]string `json:"headers,omitempty"` + ReadRecent *bool `json:"readRecent,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + OAuth2 *OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + BearerToken *string `json:"bearerToken,omitempty"` + BearerTokenFile *string `json:"bearerTokenFile,omitempty"` + Authorization *AuthorizationApplyConfiguration `json:"authorization,omitempty"` + TLSConfig *TLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` + FilterExternalLabels *bool `json:"filterExternalLabels,omitempty"` +} + +// RemoteReadSpecApplyConfiguration constructs an declarative configuration of the RemoteReadSpec type for use with +// apply. +func RemoteReadSpec() *RemoteReadSpecApplyConfiguration { + return &RemoteReadSpecApplyConfiguration{} +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithURL(value string) *RemoteReadSpecApplyConfiguration { + b.URL = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithName(value string) *RemoteReadSpecApplyConfiguration { + b.Name = &value + return b +} + +// WithRequiredMatchers puts the entries into the RequiredMatchers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the RequiredMatchers field, +// overwriting an existing map entries in RequiredMatchers field with the same key. +func (b *RemoteReadSpecApplyConfiguration) WithRequiredMatchers(entries map[string]string) *RemoteReadSpecApplyConfiguration { + if b.RequiredMatchers == nil && len(entries) > 0 { + b.RequiredMatchers = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.RequiredMatchers[k] = v + } + return b +} + +// WithRemoteTimeout sets the RemoteTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RemoteTimeout field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithRemoteTimeout(value v1.Duration) *RemoteReadSpecApplyConfiguration { + b.RemoteTimeout = &value + return b +} + +// WithHeaders puts the entries into the Headers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Headers field, +// overwriting an existing map entries in Headers field with the same key. +func (b *RemoteReadSpecApplyConfiguration) WithHeaders(entries map[string]string) *RemoteReadSpecApplyConfiguration { + if b.Headers == nil && len(entries) > 0 { + b.Headers = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Headers[k] = v + } + return b +} + +// WithReadRecent sets the ReadRecent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadRecent field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithReadRecent(value bool) *RemoteReadSpecApplyConfiguration { + b.ReadRecent = &value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *RemoteReadSpecApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *RemoteReadSpecApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithBearerToken sets the BearerToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerToken field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithBearerToken(value string) *RemoteReadSpecApplyConfiguration { + b.BearerToken = &value + return b +} + +// WithBearerTokenFile sets the BearerTokenFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenFile field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithBearerTokenFile(value string) *RemoteReadSpecApplyConfiguration { + b.BearerTokenFile = &value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithAuthorization(value *AuthorizationApplyConfiguration) *RemoteReadSpecApplyConfiguration { + b.Authorization = value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithTLSConfig(value *TLSConfigApplyConfiguration) *RemoteReadSpecApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithProxyURL(value string) *RemoteReadSpecApplyConfiguration { + b.ProxyURL = &value + return b +} + +// WithFilterExternalLabels sets the FilterExternalLabels field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FilterExternalLabels field is set to the value of the last call. +func (b *RemoteReadSpecApplyConfiguration) WithFilterExternalLabels(value bool) *RemoteReadSpecApplyConfiguration { + b.FilterExternalLabels = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/remotewritespec.go b/pkg/client/applyconfiguration/monitoring/v1/remotewritespec.go new file mode 100644 index 000000000..f4eb9fb67 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/remotewritespec.go @@ -0,0 +1,187 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// RemoteWriteSpecApplyConfiguration represents an declarative configuration of the RemoteWriteSpec type for use +// with apply. +type RemoteWriteSpecApplyConfiguration struct { + URL *string `json:"url,omitempty"` + Name *string `json:"name,omitempty"` + SendExemplars *bool `json:"sendExemplars,omitempty"` + RemoteTimeout *v1.Duration `json:"remoteTimeout,omitempty"` + Headers map[string]string `json:"headers,omitempty"` + WriteRelabelConfigs []RelabelConfigApplyConfiguration `json:"writeRelabelConfigs,omitempty"` + OAuth2 *OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + BasicAuth *BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + BearerToken *string `json:"bearerToken,omitempty"` + BearerTokenFile *string `json:"bearerTokenFile,omitempty"` + Authorization *AuthorizationApplyConfiguration `json:"authorization,omitempty"` + Sigv4 *Sigv4ApplyConfiguration `json:"sigv4,omitempty"` + TLSConfig *TLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` + QueueConfig *QueueConfigApplyConfiguration `json:"queueConfig,omitempty"` + MetadataConfig *MetadataConfigApplyConfiguration `json:"metadataConfig,omitempty"` +} + +// RemoteWriteSpecApplyConfiguration constructs an declarative configuration of the RemoteWriteSpec type for use with +// apply. +func RemoteWriteSpec() *RemoteWriteSpecApplyConfiguration { + return &RemoteWriteSpecApplyConfiguration{} +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithURL(value string) *RemoteWriteSpecApplyConfiguration { + b.URL = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithName(value string) *RemoteWriteSpecApplyConfiguration { + b.Name = &value + return b +} + +// WithSendExemplars sets the SendExemplars field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendExemplars field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithSendExemplars(value bool) *RemoteWriteSpecApplyConfiguration { + b.SendExemplars = &value + return b +} + +// WithRemoteTimeout sets the RemoteTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RemoteTimeout field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithRemoteTimeout(value v1.Duration) *RemoteWriteSpecApplyConfiguration { + b.RemoteTimeout = &value + return b +} + +// WithHeaders puts the entries into the Headers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Headers field, +// overwriting an existing map entries in Headers field with the same key. +func (b *RemoteWriteSpecApplyConfiguration) WithHeaders(entries map[string]string) *RemoteWriteSpecApplyConfiguration { + if b.Headers == nil && len(entries) > 0 { + b.Headers = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Headers[k] = v + } + return b +} + +// WithWriteRelabelConfigs adds the given value to the WriteRelabelConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the WriteRelabelConfigs field. +func (b *RemoteWriteSpecApplyConfiguration) WithWriteRelabelConfigs(values ...*RelabelConfigApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithWriteRelabelConfigs") + } + b.WriteRelabelConfigs = append(b.WriteRelabelConfigs, *values[i]) + } + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithOAuth2(value *OAuth2ApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithBasicAuth(value *BasicAuthApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithBearerToken sets the BearerToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerToken field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithBearerToken(value string) *RemoteWriteSpecApplyConfiguration { + b.BearerToken = &value + return b +} + +// WithBearerTokenFile sets the BearerTokenFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenFile field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithBearerTokenFile(value string) *RemoteWriteSpecApplyConfiguration { + b.BearerTokenFile = &value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithAuthorization(value *AuthorizationApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + b.Authorization = value + return b +} + +// WithSigv4 sets the Sigv4 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sigv4 field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithSigv4(value *Sigv4ApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + b.Sigv4 = value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithTLSConfig(value *TLSConfigApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithProxyURL(value string) *RemoteWriteSpecApplyConfiguration { + b.ProxyURL = &value + return b +} + +// WithQueueConfig sets the QueueConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the QueueConfig field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithQueueConfig(value *QueueConfigApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + b.QueueConfig = value + return b +} + +// WithMetadataConfig sets the MetadataConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MetadataConfig field is set to the value of the last call. +func (b *RemoteWriteSpecApplyConfiguration) WithMetadataConfig(value *MetadataConfigApplyConfiguration) *RemoteWriteSpecApplyConfiguration { + b.MetadataConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/rule.go b/pkg/client/applyconfiguration/monitoring/v1/rule.go new file mode 100644 index 000000000..9acfafd4a --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/rule.go @@ -0,0 +1,99 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// RuleApplyConfiguration represents an declarative configuration of the Rule type for use +// with apply. +type RuleApplyConfiguration struct { + Record *string `json:"record,omitempty"` + Alert *string `json:"alert,omitempty"` + Expr *intstr.IntOrString `json:"expr,omitempty"` + For *v1.Duration `json:"for,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` +} + +// RuleApplyConfiguration constructs an declarative configuration of the Rule type for use with +// apply. +func Rule() *RuleApplyConfiguration { + return &RuleApplyConfiguration{} +} + +// WithRecord sets the Record field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Record field is set to the value of the last call. +func (b *RuleApplyConfiguration) WithRecord(value string) *RuleApplyConfiguration { + b.Record = &value + return b +} + +// WithAlert sets the Alert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Alert field is set to the value of the last call. +func (b *RuleApplyConfiguration) WithAlert(value string) *RuleApplyConfiguration { + b.Alert = &value + return b +} + +// WithExpr sets the Expr field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expr field is set to the value of the last call. +func (b *RuleApplyConfiguration) WithExpr(value intstr.IntOrString) *RuleApplyConfiguration { + b.Expr = &value + return b +} + +// WithFor sets the For field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the For field is set to the value of the last call. +func (b *RuleApplyConfiguration) WithFor(value v1.Duration) *RuleApplyConfiguration { + b.For = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *RuleApplyConfiguration) WithLabels(entries map[string]string) *RuleApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *RuleApplyConfiguration) WithAnnotations(entries map[string]string) *RuleApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/rulegroup.go b/pkg/client/applyconfiguration/monitoring/v1/rulegroup.go new file mode 100644 index 000000000..312459451 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/rulegroup.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// RuleGroupApplyConfiguration represents an declarative configuration of the RuleGroup type for use +// with apply. +type RuleGroupApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Interval *v1.Duration `json:"interval,omitempty"` + Rules []RuleApplyConfiguration `json:"rules,omitempty"` + PartialResponseStrategy *string `json:"partial_response_strategy,omitempty"` +} + +// RuleGroupApplyConfiguration constructs an declarative configuration of the RuleGroup type for use with +// apply. +func RuleGroup() *RuleGroupApplyConfiguration { + return &RuleGroupApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *RuleGroupApplyConfiguration) WithName(value string) *RuleGroupApplyConfiguration { + b.Name = &value + return b +} + +// WithInterval sets the Interval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Interval field is set to the value of the last call. +func (b *RuleGroupApplyConfiguration) WithInterval(value v1.Duration) *RuleGroupApplyConfiguration { + b.Interval = &value + return b +} + +// WithRules adds the given value to the Rules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Rules field. +func (b *RuleGroupApplyConfiguration) WithRules(values ...*RuleApplyConfiguration) *RuleGroupApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} + +// WithPartialResponseStrategy sets the PartialResponseStrategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PartialResponseStrategy field is set to the value of the last call. +func (b *RuleGroupApplyConfiguration) WithPartialResponseStrategy(value string) *RuleGroupApplyConfiguration { + b.PartialResponseStrategy = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/rules.go b/pkg/client/applyconfiguration/monitoring/v1/rules.go new file mode 100644 index 000000000..a9dcf982a --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/rules.go @@ -0,0 +1,37 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// RulesApplyConfiguration represents an declarative configuration of the Rules type for use +// with apply. +type RulesApplyConfiguration struct { + Alert *RulesAlertApplyConfiguration `json:"alert,omitempty"` +} + +// RulesApplyConfiguration constructs an declarative configuration of the Rules type for use with +// apply. +func Rules() *RulesApplyConfiguration { + return &RulesApplyConfiguration{} +} + +// WithAlert sets the Alert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Alert field is set to the value of the last call. +func (b *RulesApplyConfiguration) WithAlert(value *RulesAlertApplyConfiguration) *RulesApplyConfiguration { + b.Alert = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/rulesalert.go b/pkg/client/applyconfiguration/monitoring/v1/rulesalert.go new file mode 100644 index 000000000..8ad9ddbdd --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/rulesalert.go @@ -0,0 +1,55 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// RulesAlertApplyConfiguration represents an declarative configuration of the RulesAlert type for use +// with apply. +type RulesAlertApplyConfiguration struct { + ForOutageTolerance *string `json:"forOutageTolerance,omitempty"` + ForGracePeriod *string `json:"forGracePeriod,omitempty"` + ResendDelay *string `json:"resendDelay,omitempty"` +} + +// RulesAlertApplyConfiguration constructs an declarative configuration of the RulesAlert type for use with +// apply. +func RulesAlert() *RulesAlertApplyConfiguration { + return &RulesAlertApplyConfiguration{} +} + +// WithForOutageTolerance sets the ForOutageTolerance field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ForOutageTolerance field is set to the value of the last call. +func (b *RulesAlertApplyConfiguration) WithForOutageTolerance(value string) *RulesAlertApplyConfiguration { + b.ForOutageTolerance = &value + return b +} + +// WithForGracePeriod sets the ForGracePeriod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ForGracePeriod field is set to the value of the last call. +func (b *RulesAlertApplyConfiguration) WithForGracePeriod(value string) *RulesAlertApplyConfiguration { + b.ForGracePeriod = &value + return b +} + +// WithResendDelay sets the ResendDelay field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResendDelay field is set to the value of the last call. +func (b *RulesAlertApplyConfiguration) WithResendDelay(value string) *RulesAlertApplyConfiguration { + b.ResendDelay = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/safeauthorization.go b/pkg/client/applyconfiguration/monitoring/v1/safeauthorization.go new file mode 100644 index 000000000..9a7967ee2 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/safeauthorization.go @@ -0,0 +1,50 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// SafeAuthorizationApplyConfiguration represents an declarative configuration of the SafeAuthorization type for use +// with apply. +type SafeAuthorizationApplyConfiguration struct { + Type *string `json:"type,omitempty"` + Credentials *v1.SecretKeySelector `json:"credentials,omitempty"` +} + +// SafeAuthorizationApplyConfiguration constructs an declarative configuration of the SafeAuthorization type for use with +// apply. +func SafeAuthorization() *SafeAuthorizationApplyConfiguration { + return &SafeAuthorizationApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SafeAuthorizationApplyConfiguration) WithType(value string) *SafeAuthorizationApplyConfiguration { + b.Type = &value + return b +} + +// WithCredentials sets the Credentials field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Credentials field is set to the value of the last call. +func (b *SafeAuthorizationApplyConfiguration) WithCredentials(value v1.SecretKeySelector) *SafeAuthorizationApplyConfiguration { + b.Credentials = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/safetlsconfig.go b/pkg/client/applyconfiguration/monitoring/v1/safetlsconfig.go new file mode 100644 index 000000000..9b5bde7d0 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/safetlsconfig.go @@ -0,0 +1,77 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// SafeTLSConfigApplyConfiguration represents an declarative configuration of the SafeTLSConfig type for use +// with apply. +type SafeTLSConfigApplyConfiguration struct { + CA *SecretOrConfigMapApplyConfiguration `json:"ca,omitempty"` + Cert *SecretOrConfigMapApplyConfiguration `json:"cert,omitempty"` + KeySecret *corev1.SecretKeySelector `json:"keySecret,omitempty"` + ServerName *string `json:"serverName,omitempty"` + InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` +} + +// SafeTLSConfigApplyConfiguration constructs an declarative configuration of the SafeTLSConfig type for use with +// apply. +func SafeTLSConfig() *SafeTLSConfigApplyConfiguration { + return &SafeTLSConfigApplyConfiguration{} +} + +// WithCA sets the CA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CA field is set to the value of the last call. +func (b *SafeTLSConfigApplyConfiguration) WithCA(value *SecretOrConfigMapApplyConfiguration) *SafeTLSConfigApplyConfiguration { + b.CA = value + return b +} + +// WithCert sets the Cert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cert field is set to the value of the last call. +func (b *SafeTLSConfigApplyConfiguration) WithCert(value *SecretOrConfigMapApplyConfiguration) *SafeTLSConfigApplyConfiguration { + b.Cert = value + return b +} + +// WithKeySecret sets the KeySecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KeySecret field is set to the value of the last call. +func (b *SafeTLSConfigApplyConfiguration) WithKeySecret(value corev1.SecretKeySelector) *SafeTLSConfigApplyConfiguration { + b.KeySecret = &value + return b +} + +// WithServerName sets the ServerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServerName field is set to the value of the last call. +func (b *SafeTLSConfigApplyConfiguration) WithServerName(value string) *SafeTLSConfigApplyConfiguration { + b.ServerName = &value + return b +} + +// WithInsecureSkipVerify sets the InsecureSkipVerify field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InsecureSkipVerify field is set to the value of the last call. +func (b *SafeTLSConfigApplyConfiguration) WithInsecureSkipVerify(value bool) *SafeTLSConfigApplyConfiguration { + b.InsecureSkipVerify = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/secretorconfigmap.go b/pkg/client/applyconfiguration/monitoring/v1/secretorconfigmap.go new file mode 100644 index 000000000..4e633187d --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/secretorconfigmap.go @@ -0,0 +1,50 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// SecretOrConfigMapApplyConfiguration represents an declarative configuration of the SecretOrConfigMap type for use +// with apply. +type SecretOrConfigMapApplyConfiguration struct { + Secret *v1.SecretKeySelector `json:"secret,omitempty"` + ConfigMap *v1.ConfigMapKeySelector `json:"configMap,omitempty"` +} + +// SecretOrConfigMapApplyConfiguration constructs an declarative configuration of the SecretOrConfigMap type for use with +// apply. +func SecretOrConfigMap() *SecretOrConfigMapApplyConfiguration { + return &SecretOrConfigMapApplyConfiguration{} +} + +// WithSecret sets the Secret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Secret field is set to the value of the last call. +func (b *SecretOrConfigMapApplyConfiguration) WithSecret(value v1.SecretKeySelector) *SecretOrConfigMapApplyConfiguration { + b.Secret = &value + return b +} + +// WithConfigMap sets the ConfigMap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMap field is set to the value of the last call. +func (b *SecretOrConfigMapApplyConfiguration) WithConfigMap(value v1.ConfigMapKeySelector) *SecretOrConfigMapApplyConfiguration { + b.ConfigMap = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/servicemonitor.go b/pkg/client/applyconfiguration/monitoring/v1/servicemonitor.go new file mode 100644 index 000000000..6b87ef476 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/servicemonitor.go @@ -0,0 +1,208 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ServiceMonitorApplyConfiguration represents an declarative configuration of the ServiceMonitor type for use +// with apply. +type ServiceMonitorApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ServiceMonitorSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ServiceMonitor constructs an declarative configuration of the ServiceMonitor type for use with +// apply. +func ServiceMonitor(name, namespace string) *ServiceMonitorApplyConfiguration { + b := &ServiceMonitorApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ServiceMonitor") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithKind(value string) *ServiceMonitorApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithAPIVersion(value string) *ServiceMonitorApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithName(value string) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithGenerateName(value string) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithNamespace(value string) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithUID(value types.UID) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithResourceVersion(value string) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithGeneration(value int64) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ServiceMonitorApplyConfiguration) WithLabels(entries map[string]string) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ServiceMonitorApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ServiceMonitorApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ServiceMonitorApplyConfiguration) WithFinalizers(values ...string) *ServiceMonitorApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ServiceMonitorApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ServiceMonitorApplyConfiguration) WithSpec(value *ServiceMonitorSpecApplyConfiguration) *ServiceMonitorApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/servicemonitorspec.go b/pkg/client/applyconfiguration/monitoring/v1/servicemonitorspec.go new file mode 100644 index 000000000..c6c76554a --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/servicemonitorspec.go @@ -0,0 +1,149 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ServiceMonitorSpecApplyConfiguration represents an declarative configuration of the ServiceMonitorSpec type for use +// with apply. +type ServiceMonitorSpecApplyConfiguration struct { + JobLabel *string `json:"jobLabel,omitempty"` + TargetLabels []string `json:"targetLabels,omitempty"` + PodTargetLabels []string `json:"podTargetLabels,omitempty"` + Endpoints []EndpointApplyConfiguration `json:"endpoints,omitempty"` + Selector *metav1.LabelSelector `json:"selector,omitempty"` + NamespaceSelector *NamespaceSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` + SampleLimit *uint64 `json:"sampleLimit,omitempty"` + TargetLimit *uint64 `json:"targetLimit,omitempty"` + LabelLimit *uint64 `json:"labelLimit,omitempty"` + LabelNameLengthLimit *uint64 `json:"labelNameLengthLimit,omitempty"` + LabelValueLengthLimit *uint64 `json:"labelValueLengthLimit,omitempty"` + AttachMetadata *AttachMetadataApplyConfiguration `json:"attachMetadata,omitempty"` +} + +// ServiceMonitorSpecApplyConfiguration constructs an declarative configuration of the ServiceMonitorSpec type for use with +// apply. +func ServiceMonitorSpec() *ServiceMonitorSpecApplyConfiguration { + return &ServiceMonitorSpecApplyConfiguration{} +} + +// WithJobLabel sets the JobLabel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the JobLabel field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithJobLabel(value string) *ServiceMonitorSpecApplyConfiguration { + b.JobLabel = &value + return b +} + +// WithTargetLabels adds the given value to the TargetLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetLabels field. +func (b *ServiceMonitorSpecApplyConfiguration) WithTargetLabels(values ...string) *ServiceMonitorSpecApplyConfiguration { + for i := range values { + b.TargetLabels = append(b.TargetLabels, values[i]) + } + return b +} + +// WithPodTargetLabels adds the given value to the PodTargetLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodTargetLabels field. +func (b *ServiceMonitorSpecApplyConfiguration) WithPodTargetLabels(values ...string) *ServiceMonitorSpecApplyConfiguration { + for i := range values { + b.PodTargetLabels = append(b.PodTargetLabels, values[i]) + } + return b +} + +// WithEndpoints adds the given value to the Endpoints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Endpoints field. +func (b *ServiceMonitorSpecApplyConfiguration) WithEndpoints(values ...*EndpointApplyConfiguration) *ServiceMonitorSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEndpoints") + } + b.Endpoints = append(b.Endpoints, *values[i]) + } + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithSelector(value metav1.LabelSelector) *ServiceMonitorSpecApplyConfiguration { + b.Selector = &value + return b +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithNamespaceSelector(value *NamespaceSelectorApplyConfiguration) *ServiceMonitorSpecApplyConfiguration { + b.NamespaceSelector = value + return b +} + +// WithSampleLimit sets the SampleLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SampleLimit field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithSampleLimit(value uint64) *ServiceMonitorSpecApplyConfiguration { + b.SampleLimit = &value + return b +} + +// WithTargetLimit sets the TargetLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetLimit field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithTargetLimit(value uint64) *ServiceMonitorSpecApplyConfiguration { + b.TargetLimit = &value + return b +} + +// WithLabelLimit sets the LabelLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelLimit field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithLabelLimit(value uint64) *ServiceMonitorSpecApplyConfiguration { + b.LabelLimit = &value + return b +} + +// WithLabelNameLengthLimit sets the LabelNameLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelNameLengthLimit field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithLabelNameLengthLimit(value uint64) *ServiceMonitorSpecApplyConfiguration { + b.LabelNameLengthLimit = &value + return b +} + +// WithLabelValueLengthLimit sets the LabelValueLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelValueLengthLimit field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithLabelValueLengthLimit(value uint64) *ServiceMonitorSpecApplyConfiguration { + b.LabelValueLengthLimit = &value + return b +} + +// WithAttachMetadata sets the AttachMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AttachMetadata field is set to the value of the last call. +func (b *ServiceMonitorSpecApplyConfiguration) WithAttachMetadata(value *AttachMetadataApplyConfiguration) *ServiceMonitorSpecApplyConfiguration { + b.AttachMetadata = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/shardstatus.go b/pkg/client/applyconfiguration/monitoring/v1/shardstatus.go new file mode 100644 index 000000000..f595bac2b --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/shardstatus.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ShardStatusApplyConfiguration represents an declarative configuration of the ShardStatus type for use +// with apply. +type ShardStatusApplyConfiguration struct { + ShardID *string `json:"shardID,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` +} + +// ShardStatusApplyConfiguration constructs an declarative configuration of the ShardStatus type for use with +// apply. +func ShardStatus() *ShardStatusApplyConfiguration { + return &ShardStatusApplyConfiguration{} +} + +// WithShardID sets the ShardID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShardID field is set to the value of the last call. +func (b *ShardStatusApplyConfiguration) WithShardID(value string) *ShardStatusApplyConfiguration { + b.ShardID = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ShardStatusApplyConfiguration) WithReplicas(value int32) *ShardStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdatedReplicas field is set to the value of the last call. +func (b *ShardStatusApplyConfiguration) WithUpdatedReplicas(value int32) *ShardStatusApplyConfiguration { + b.UpdatedReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *ShardStatusApplyConfiguration) WithAvailableReplicas(value int32) *ShardStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *ShardStatusApplyConfiguration) WithUnavailableReplicas(value int32) *ShardStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/sigv4.go b/pkg/client/applyconfiguration/monitoring/v1/sigv4.go new file mode 100644 index 000000000..65c294086 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/sigv4.go @@ -0,0 +1,77 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// Sigv4ApplyConfiguration represents an declarative configuration of the Sigv4 type for use +// with apply. +type Sigv4ApplyConfiguration struct { + Region *string `json:"region,omitempty"` + AccessKey *v1.SecretKeySelector `json:"accessKey,omitempty"` + SecretKey *v1.SecretKeySelector `json:"secretKey,omitempty"` + Profile *string `json:"profile,omitempty"` + RoleArn *string `json:"roleArn,omitempty"` +} + +// Sigv4ApplyConfiguration constructs an declarative configuration of the Sigv4 type for use with +// apply. +func Sigv4() *Sigv4ApplyConfiguration { + return &Sigv4ApplyConfiguration{} +} + +// WithRegion sets the Region field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Region field is set to the value of the last call. +func (b *Sigv4ApplyConfiguration) WithRegion(value string) *Sigv4ApplyConfiguration { + b.Region = &value + return b +} + +// WithAccessKey sets the AccessKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AccessKey field is set to the value of the last call. +func (b *Sigv4ApplyConfiguration) WithAccessKey(value v1.SecretKeySelector) *Sigv4ApplyConfiguration { + b.AccessKey = &value + return b +} + +// WithSecretKey sets the SecretKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretKey field is set to the value of the last call. +func (b *Sigv4ApplyConfiguration) WithSecretKey(value v1.SecretKeySelector) *Sigv4ApplyConfiguration { + b.SecretKey = &value + return b +} + +// WithProfile sets the Profile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Profile field is set to the value of the last call. +func (b *Sigv4ApplyConfiguration) WithProfile(value string) *Sigv4ApplyConfiguration { + b.Profile = &value + return b +} + +// WithRoleArn sets the RoleArn field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoleArn field is set to the value of the last call. +func (b *Sigv4ApplyConfiguration) WithRoleArn(value string) *Sigv4ApplyConfiguration { + b.RoleArn = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/storagespec.go b/pkg/client/applyconfiguration/monitoring/v1/storagespec.go new file mode 100644 index 000000000..7817f8011 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/storagespec.go @@ -0,0 +1,68 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// StorageSpecApplyConfiguration represents an declarative configuration of the StorageSpec type for use +// with apply. +type StorageSpecApplyConfiguration struct { + DisableMountSubPath *bool `json:"disableMountSubPath,omitempty"` + EmptyDir *v1.EmptyDirVolumeSource `json:"emptyDir,omitempty"` + Ephemeral *v1.EphemeralVolumeSource `json:"ephemeral,omitempty"` + VolumeClaimTemplate *EmbeddedPersistentVolumeClaimApplyConfiguration `json:"volumeClaimTemplate,omitempty"` +} + +// StorageSpecApplyConfiguration constructs an declarative configuration of the StorageSpec type for use with +// apply. +func StorageSpec() *StorageSpecApplyConfiguration { + return &StorageSpecApplyConfiguration{} +} + +// WithDisableMountSubPath sets the DisableMountSubPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisableMountSubPath field is set to the value of the last call. +func (b *StorageSpecApplyConfiguration) WithDisableMountSubPath(value bool) *StorageSpecApplyConfiguration { + b.DisableMountSubPath = &value + return b +} + +// WithEmptyDir sets the EmptyDir field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EmptyDir field is set to the value of the last call. +func (b *StorageSpecApplyConfiguration) WithEmptyDir(value v1.EmptyDirVolumeSource) *StorageSpecApplyConfiguration { + b.EmptyDir = &value + return b +} + +// WithEphemeral sets the Ephemeral field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ephemeral field is set to the value of the last call. +func (b *StorageSpecApplyConfiguration) WithEphemeral(value v1.EphemeralVolumeSource) *StorageSpecApplyConfiguration { + b.Ephemeral = &value + return b +} + +// WithVolumeClaimTemplate sets the VolumeClaimTemplate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeClaimTemplate field is set to the value of the last call. +func (b *StorageSpecApplyConfiguration) WithVolumeClaimTemplate(value *EmbeddedPersistentVolumeClaimApplyConfiguration) *StorageSpecApplyConfiguration { + b.VolumeClaimTemplate = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/thanosruler.go b/pkg/client/applyconfiguration/monitoring/v1/thanosruler.go new file mode 100644 index 000000000..fd80ebd74 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/thanosruler.go @@ -0,0 +1,217 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ThanosRulerApplyConfiguration represents an declarative configuration of the ThanosRuler type for use +// with apply. +type ThanosRulerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ThanosRulerSpecApplyConfiguration `json:"spec,omitempty"` + Status *ThanosRulerStatusApplyConfiguration `json:"status,omitempty"` +} + +// ThanosRuler constructs an declarative configuration of the ThanosRuler type for use with +// apply. +func ThanosRuler(name, namespace string) *ThanosRulerApplyConfiguration { + b := &ThanosRulerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ThanosRuler") + b.WithAPIVersion("monitoring.coreos.com/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithKind(value string) *ThanosRulerApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithAPIVersion(value string) *ThanosRulerApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithName(value string) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithGenerateName(value string) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithNamespace(value string) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithUID(value types.UID) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithResourceVersion(value string) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithGeneration(value int64) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ThanosRulerApplyConfiguration) WithLabels(entries map[string]string) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ThanosRulerApplyConfiguration) WithAnnotations(entries map[string]string) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ThanosRulerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ThanosRulerApplyConfiguration) WithFinalizers(values ...string) *ThanosRulerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ThanosRulerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithSpec(value *ThanosRulerSpecApplyConfiguration) *ThanosRulerApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ThanosRulerApplyConfiguration) WithStatus(value *ThanosRulerStatusApplyConfiguration) *ThanosRulerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/thanosrulerspec.go b/pkg/client/applyconfiguration/monitoring/v1/thanosrulerspec.go new file mode 100644 index 000000000..d8df36b33 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/thanosrulerspec.go @@ -0,0 +1,511 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ThanosRulerSpecApplyConfiguration represents an declarative configuration of the ThanosRulerSpec type for use +// with apply. +type ThanosRulerSpecApplyConfiguration struct { + Version *string `json:"version,omitempty"` + PodMetadata *EmbeddedObjectMetadataApplyConfiguration `json:"podMetadata,omitempty"` + Image *string `json:"image,omitempty"` + ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` + Paused *bool `json:"paused,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` + Affinity *corev1.Affinity `json:"affinity,omitempty"` + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` + SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` + PriorityClassName *string `json:"priorityClassName,omitempty"` + ServiceAccountName *string `json:"serviceAccountName,omitempty"` + Storage *StorageSpecApplyConfiguration `json:"storage,omitempty"` + Volumes []corev1.Volume `json:"volumes,omitempty"` + ObjectStorageConfig *corev1.SecretKeySelector `json:"objectStorageConfig,omitempty"` + ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"` + ListenLocal *bool `json:"listenLocal,omitempty"` + QueryEndpoints []string `json:"queryEndpoints,omitempty"` + QueryConfig *corev1.SecretKeySelector `json:"queryConfig,omitempty"` + AlertManagersURL []string `json:"alertmanagersUrl,omitempty"` + AlertManagersConfig *corev1.SecretKeySelector `json:"alertmanagersConfig,omitempty"` + RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"` + RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"` + EnforcedNamespaceLabel *string `json:"enforcedNamespaceLabel,omitempty"` + ExcludedFromEnforcement []ObjectReferenceApplyConfiguration `json:"excludedFromEnforcement,omitempty"` + PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfigApplyConfiguration `json:"prometheusRulesExcludedFromEnforce,omitempty"` + LogLevel *string `json:"logLevel,omitempty"` + LogFormat *string `json:"logFormat,omitempty"` + PortName *string `json:"portName,omitempty"` + EvaluationInterval *monitoringv1.Duration `json:"evaluationInterval,omitempty"` + Retention *monitoringv1.Duration `json:"retention,omitempty"` + Containers []corev1.Container `json:"containers,omitempty"` + InitContainers []corev1.Container `json:"initContainers,omitempty"` + TracingConfig *corev1.SecretKeySelector `json:"tracingConfig,omitempty"` + TracingConfigFile *string `json:"tracingConfigFile,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + AlertDropLabels []string `json:"alertDropLabels,omitempty"` + ExternalPrefix *string `json:"externalPrefix,omitempty"` + RoutePrefix *string `json:"routePrefix,omitempty"` + GRPCServerTLSConfig *TLSConfigApplyConfiguration `json:"grpcServerTlsConfig,omitempty"` + AlertQueryURL *string `json:"alertQueryUrl,omitempty"` + MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"` + AlertRelabelConfigs *corev1.SecretKeySelector `json:"alertRelabelConfigs,omitempty"` + AlertRelabelConfigFile *string `json:"alertRelabelConfigFile,omitempty"` + HostAliases []HostAliasApplyConfiguration `json:"hostAliases,omitempty"` +} + +// ThanosRulerSpecApplyConfiguration constructs an declarative configuration of the ThanosRulerSpec type for use with +// apply. +func ThanosRulerSpec() *ThanosRulerSpecApplyConfiguration { + return &ThanosRulerSpecApplyConfiguration{} +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithVersion(value string) *ThanosRulerSpecApplyConfiguration { + b.Version = &value + return b +} + +// WithPodMetadata sets the PodMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodMetadata field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithPodMetadata(value *EmbeddedObjectMetadataApplyConfiguration) *ThanosRulerSpecApplyConfiguration { + b.PodMetadata = value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithImage(value string) *ThanosRulerSpecApplyConfiguration { + b.Image = &value + return b +} + +// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImagePullPolicy field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *ThanosRulerSpecApplyConfiguration { + b.ImagePullPolicy = &value + return b +} + +// WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. +func (b *ThanosRulerSpecApplyConfiguration) WithImagePullSecrets(values ...corev1.LocalObjectReference) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.ImagePullSecrets = append(b.ImagePullSecrets, values[i]) + } + return b +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithPaused(value bool) *ThanosRulerSpecApplyConfiguration { + b.Paused = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithReplicas(value int32) *ThanosRulerSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *ThanosRulerSpecApplyConfiguration) WithNodeSelector(entries map[string]string) *ThanosRulerSpecApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithResources(value corev1.ResourceRequirements) *ThanosRulerSpecApplyConfiguration { + b.Resources = &value + return b +} + +// WithAffinity sets the Affinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Affinity field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithAffinity(value corev1.Affinity) *ThanosRulerSpecApplyConfiguration { + b.Affinity = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *ThanosRulerSpecApplyConfiguration) WithTolerations(values ...corev1.Toleration) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.Tolerations = append(b.Tolerations, values[i]) + } + return b +} + +// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. +func (b *ThanosRulerSpecApplyConfiguration) WithTopologySpreadConstraints(values ...corev1.TopologySpreadConstraint) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, values[i]) + } + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithSecurityContext(value corev1.PodSecurityContext) *ThanosRulerSpecApplyConfiguration { + b.SecurityContext = &value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithPriorityClassName(value string) *ThanosRulerSpecApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithServiceAccountName sets the ServiceAccountName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountName field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithServiceAccountName(value string) *ThanosRulerSpecApplyConfiguration { + b.ServiceAccountName = &value + return b +} + +// WithStorage sets the Storage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Storage field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithStorage(value *StorageSpecApplyConfiguration) *ThanosRulerSpecApplyConfiguration { + b.Storage = value + return b +} + +// WithVolumes adds the given value to the Volumes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Volumes field. +func (b *ThanosRulerSpecApplyConfiguration) WithVolumes(values ...corev1.Volume) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.Volumes = append(b.Volumes, values[i]) + } + return b +} + +// WithObjectStorageConfig sets the ObjectStorageConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObjectStorageConfig field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithObjectStorageConfig(value corev1.SecretKeySelector) *ThanosRulerSpecApplyConfiguration { + b.ObjectStorageConfig = &value + return b +} + +// WithObjectStorageConfigFile sets the ObjectStorageConfigFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObjectStorageConfigFile field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithObjectStorageConfigFile(value string) *ThanosRulerSpecApplyConfiguration { + b.ObjectStorageConfigFile = &value + return b +} + +// WithListenLocal sets the ListenLocal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ListenLocal field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithListenLocal(value bool) *ThanosRulerSpecApplyConfiguration { + b.ListenLocal = &value + return b +} + +// WithQueryEndpoints adds the given value to the QueryEndpoints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the QueryEndpoints field. +func (b *ThanosRulerSpecApplyConfiguration) WithQueryEndpoints(values ...string) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.QueryEndpoints = append(b.QueryEndpoints, values[i]) + } + return b +} + +// WithQueryConfig sets the QueryConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the QueryConfig field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithQueryConfig(value corev1.SecretKeySelector) *ThanosRulerSpecApplyConfiguration { + b.QueryConfig = &value + return b +} + +// WithAlertManagersURL adds the given value to the AlertManagersURL field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AlertManagersURL field. +func (b *ThanosRulerSpecApplyConfiguration) WithAlertManagersURL(values ...string) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.AlertManagersURL = append(b.AlertManagersURL, values[i]) + } + return b +} + +// WithAlertManagersConfig sets the AlertManagersConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertManagersConfig field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithAlertManagersConfig(value corev1.SecretKeySelector) *ThanosRulerSpecApplyConfiguration { + b.AlertManagersConfig = &value + return b +} + +// WithRuleSelector sets the RuleSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuleSelector field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithRuleSelector(value metav1.LabelSelector) *ThanosRulerSpecApplyConfiguration { + b.RuleSelector = &value + return b +} + +// WithRuleNamespaceSelector sets the RuleNamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuleNamespaceSelector field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithRuleNamespaceSelector(value metav1.LabelSelector) *ThanosRulerSpecApplyConfiguration { + b.RuleNamespaceSelector = &value + return b +} + +// WithEnforcedNamespaceLabel sets the EnforcedNamespaceLabel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnforcedNamespaceLabel field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithEnforcedNamespaceLabel(value string) *ThanosRulerSpecApplyConfiguration { + b.EnforcedNamespaceLabel = &value + return b +} + +// WithExcludedFromEnforcement adds the given value to the ExcludedFromEnforcement field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ExcludedFromEnforcement field. +func (b *ThanosRulerSpecApplyConfiguration) WithExcludedFromEnforcement(values ...*ObjectReferenceApplyConfiguration) *ThanosRulerSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExcludedFromEnforcement") + } + b.ExcludedFromEnforcement = append(b.ExcludedFromEnforcement, *values[i]) + } + return b +} + +// WithPrometheusRulesExcludedFromEnforce adds the given value to the PrometheusRulesExcludedFromEnforce field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PrometheusRulesExcludedFromEnforce field. +func (b *ThanosRulerSpecApplyConfiguration) WithPrometheusRulesExcludedFromEnforce(values ...*PrometheusRuleExcludeConfigApplyConfiguration) *ThanosRulerSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPrometheusRulesExcludedFromEnforce") + } + b.PrometheusRulesExcludedFromEnforce = append(b.PrometheusRulesExcludedFromEnforce, *values[i]) + } + return b +} + +// WithLogLevel sets the LogLevel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogLevel field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithLogLevel(value string) *ThanosRulerSpecApplyConfiguration { + b.LogLevel = &value + return b +} + +// WithLogFormat sets the LogFormat field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogFormat field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithLogFormat(value string) *ThanosRulerSpecApplyConfiguration { + b.LogFormat = &value + return b +} + +// WithPortName sets the PortName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortName field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithPortName(value string) *ThanosRulerSpecApplyConfiguration { + b.PortName = &value + return b +} + +// WithEvaluationInterval sets the EvaluationInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EvaluationInterval field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithEvaluationInterval(value monitoringv1.Duration) *ThanosRulerSpecApplyConfiguration { + b.EvaluationInterval = &value + return b +} + +// WithRetention sets the Retention field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Retention field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithRetention(value monitoringv1.Duration) *ThanosRulerSpecApplyConfiguration { + b.Retention = &value + return b +} + +// WithContainers adds the given value to the Containers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Containers field. +func (b *ThanosRulerSpecApplyConfiguration) WithContainers(values ...corev1.Container) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.Containers = append(b.Containers, values[i]) + } + return b +} + +// WithInitContainers adds the given value to the InitContainers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InitContainers field. +func (b *ThanosRulerSpecApplyConfiguration) WithInitContainers(values ...corev1.Container) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.InitContainers = append(b.InitContainers, values[i]) + } + return b +} + +// WithTracingConfig sets the TracingConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TracingConfig field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithTracingConfig(value corev1.SecretKeySelector) *ThanosRulerSpecApplyConfiguration { + b.TracingConfig = &value + return b +} + +// WithTracingConfigFile sets the TracingConfigFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TracingConfigFile field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithTracingConfigFile(value string) *ThanosRulerSpecApplyConfiguration { + b.TracingConfigFile = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ThanosRulerSpecApplyConfiguration) WithLabels(entries map[string]string) *ThanosRulerSpecApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAlertDropLabels adds the given value to the AlertDropLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AlertDropLabels field. +func (b *ThanosRulerSpecApplyConfiguration) WithAlertDropLabels(values ...string) *ThanosRulerSpecApplyConfiguration { + for i := range values { + b.AlertDropLabels = append(b.AlertDropLabels, values[i]) + } + return b +} + +// WithExternalPrefix sets the ExternalPrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExternalPrefix field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithExternalPrefix(value string) *ThanosRulerSpecApplyConfiguration { + b.ExternalPrefix = &value + return b +} + +// WithRoutePrefix sets the RoutePrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutePrefix field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithRoutePrefix(value string) *ThanosRulerSpecApplyConfiguration { + b.RoutePrefix = &value + return b +} + +// WithGRPCServerTLSConfig sets the GRPCServerTLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GRPCServerTLSConfig field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithGRPCServerTLSConfig(value *TLSConfigApplyConfiguration) *ThanosRulerSpecApplyConfiguration { + b.GRPCServerTLSConfig = value + return b +} + +// WithAlertQueryURL sets the AlertQueryURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertQueryURL field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithAlertQueryURL(value string) *ThanosRulerSpecApplyConfiguration { + b.AlertQueryURL = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithMinReadySeconds(value uint32) *ThanosRulerSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithAlertRelabelConfigs sets the AlertRelabelConfigs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertRelabelConfigs field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithAlertRelabelConfigs(value corev1.SecretKeySelector) *ThanosRulerSpecApplyConfiguration { + b.AlertRelabelConfigs = &value + return b +} + +// WithAlertRelabelConfigFile sets the AlertRelabelConfigFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AlertRelabelConfigFile field is set to the value of the last call. +func (b *ThanosRulerSpecApplyConfiguration) WithAlertRelabelConfigFile(value string) *ThanosRulerSpecApplyConfiguration { + b.AlertRelabelConfigFile = &value + return b +} + +// WithHostAliases adds the given value to the HostAliases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HostAliases field. +func (b *ThanosRulerSpecApplyConfiguration) WithHostAliases(values ...*HostAliasApplyConfiguration) *ThanosRulerSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHostAliases") + } + b.HostAliases = append(b.HostAliases, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/thanosrulerstatus.go b/pkg/client/applyconfiguration/monitoring/v1/thanosrulerstatus.go new file mode 100644 index 000000000..ed75fc5ee --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/thanosrulerstatus.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ThanosRulerStatusApplyConfiguration represents an declarative configuration of the ThanosRulerStatus type for use +// with apply. +type ThanosRulerStatusApplyConfiguration struct { + Paused *bool `json:"paused,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` +} + +// ThanosRulerStatusApplyConfiguration constructs an declarative configuration of the ThanosRulerStatus type for use with +// apply. +func ThanosRulerStatus() *ThanosRulerStatusApplyConfiguration { + return &ThanosRulerStatusApplyConfiguration{} +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *ThanosRulerStatusApplyConfiguration) WithPaused(value bool) *ThanosRulerStatusApplyConfiguration { + b.Paused = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ThanosRulerStatusApplyConfiguration) WithReplicas(value int32) *ThanosRulerStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdatedReplicas field is set to the value of the last call. +func (b *ThanosRulerStatusApplyConfiguration) WithUpdatedReplicas(value int32) *ThanosRulerStatusApplyConfiguration { + b.UpdatedReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *ThanosRulerStatusApplyConfiguration) WithAvailableReplicas(value int32) *ThanosRulerStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *ThanosRulerStatusApplyConfiguration) WithUnavailableReplicas(value int32) *ThanosRulerStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/thanosspec.go b/pkg/client/applyconfiguration/monitoring/v1/thanosspec.go new file mode 100644 index 000000000..b76717c3c --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/thanosspec.go @@ -0,0 +1,220 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apismonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/api/core/v1" +) + +// ThanosSpecApplyConfiguration represents an declarative configuration of the ThanosSpec type for use +// with apply. +type ThanosSpecApplyConfiguration struct { + Image *string `json:"image,omitempty"` + Version *string `json:"version,omitempty"` + Tag *string `json:"tag,omitempty"` + SHA *string `json:"sha,omitempty"` + BaseImage *string `json:"baseImage,omitempty"` + Resources *v1.ResourceRequirements `json:"resources,omitempty"` + ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"` + ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"` + ListenLocal *bool `json:"listenLocal,omitempty"` + GRPCListenLocal *bool `json:"grpcListenLocal,omitempty"` + HTTPListenLocal *bool `json:"httpListenLocal,omitempty"` + TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"` + TracingConfigFile *string `json:"tracingConfigFile,omitempty"` + GRPCServerTLSConfig *TLSConfigApplyConfiguration `json:"grpcServerTlsConfig,omitempty"` + LogLevel *string `json:"logLevel,omitempty"` + LogFormat *string `json:"logFormat,omitempty"` + MinTime *string `json:"minTime,omitempty"` + ReadyTimeout *apismonitoringv1.Duration `json:"readyTimeout,omitempty"` + VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` + AdditionalArgs []ArgumentApplyConfiguration `json:"additionalArgs,omitempty"` +} + +// ThanosSpecApplyConfiguration constructs an declarative configuration of the ThanosSpec type for use with +// apply. +func ThanosSpec() *ThanosSpecApplyConfiguration { + return &ThanosSpecApplyConfiguration{} +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithImage(value string) *ThanosSpecApplyConfiguration { + b.Image = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithVersion(value string) *ThanosSpecApplyConfiguration { + b.Version = &value + return b +} + +// WithTag sets the Tag field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Tag field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithTag(value string) *ThanosSpecApplyConfiguration { + b.Tag = &value + return b +} + +// WithSHA sets the SHA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SHA field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithSHA(value string) *ThanosSpecApplyConfiguration { + b.SHA = &value + return b +} + +// WithBaseImage sets the BaseImage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BaseImage field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithBaseImage(value string) *ThanosSpecApplyConfiguration { + b.BaseImage = &value + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithResources(value v1.ResourceRequirements) *ThanosSpecApplyConfiguration { + b.Resources = &value + return b +} + +// WithObjectStorageConfig sets the ObjectStorageConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObjectStorageConfig field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithObjectStorageConfig(value v1.SecretKeySelector) *ThanosSpecApplyConfiguration { + b.ObjectStorageConfig = &value + return b +} + +// WithObjectStorageConfigFile sets the ObjectStorageConfigFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObjectStorageConfigFile field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithObjectStorageConfigFile(value string) *ThanosSpecApplyConfiguration { + b.ObjectStorageConfigFile = &value + return b +} + +// WithListenLocal sets the ListenLocal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ListenLocal field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithListenLocal(value bool) *ThanosSpecApplyConfiguration { + b.ListenLocal = &value + return b +} + +// WithGRPCListenLocal sets the GRPCListenLocal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GRPCListenLocal field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithGRPCListenLocal(value bool) *ThanosSpecApplyConfiguration { + b.GRPCListenLocal = &value + return b +} + +// WithHTTPListenLocal sets the HTTPListenLocal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPListenLocal field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithHTTPListenLocal(value bool) *ThanosSpecApplyConfiguration { + b.HTTPListenLocal = &value + return b +} + +// WithTracingConfig sets the TracingConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TracingConfig field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithTracingConfig(value v1.SecretKeySelector) *ThanosSpecApplyConfiguration { + b.TracingConfig = &value + return b +} + +// WithTracingConfigFile sets the TracingConfigFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TracingConfigFile field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithTracingConfigFile(value string) *ThanosSpecApplyConfiguration { + b.TracingConfigFile = &value + return b +} + +// WithGRPCServerTLSConfig sets the GRPCServerTLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GRPCServerTLSConfig field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithGRPCServerTLSConfig(value *TLSConfigApplyConfiguration) *ThanosSpecApplyConfiguration { + b.GRPCServerTLSConfig = value + return b +} + +// WithLogLevel sets the LogLevel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogLevel field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithLogLevel(value string) *ThanosSpecApplyConfiguration { + b.LogLevel = &value + return b +} + +// WithLogFormat sets the LogFormat field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogFormat field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithLogFormat(value string) *ThanosSpecApplyConfiguration { + b.LogFormat = &value + return b +} + +// WithMinTime sets the MinTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinTime field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithMinTime(value string) *ThanosSpecApplyConfiguration { + b.MinTime = &value + return b +} + +// WithReadyTimeout sets the ReadyTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyTimeout field is set to the value of the last call. +func (b *ThanosSpecApplyConfiguration) WithReadyTimeout(value apismonitoringv1.Duration) *ThanosSpecApplyConfiguration { + b.ReadyTimeout = &value + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *ThanosSpecApplyConfiguration) WithVolumeMounts(values ...v1.VolumeMount) *ThanosSpecApplyConfiguration { + for i := range values { + b.VolumeMounts = append(b.VolumeMounts, values[i]) + } + return b +} + +// WithAdditionalArgs adds the given value to the AdditionalArgs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AdditionalArgs field. +func (b *ThanosSpecApplyConfiguration) WithAdditionalArgs(values ...*ArgumentApplyConfiguration) *ThanosSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAdditionalArgs") + } + b.AdditionalArgs = append(b.AdditionalArgs, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/tlsconfig.go b/pkg/client/applyconfiguration/monitoring/v1/tlsconfig.go new file mode 100644 index 000000000..6830ecc51 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/tlsconfig.go @@ -0,0 +1,100 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// TLSConfigApplyConfiguration represents an declarative configuration of the TLSConfig type for use +// with apply. +type TLSConfigApplyConfiguration struct { + SafeTLSConfigApplyConfiguration `json:",inline"` + CAFile *string `json:"caFile,omitempty"` + CertFile *string `json:"certFile,omitempty"` + KeyFile *string `json:"keyFile,omitempty"` +} + +// TLSConfigApplyConfiguration constructs an declarative configuration of the TLSConfig type for use with +// apply. +func TLSConfig() *TLSConfigApplyConfiguration { + return &TLSConfigApplyConfiguration{} +} + +// WithCA sets the CA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CA field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithCA(value *SecretOrConfigMapApplyConfiguration) *TLSConfigApplyConfiguration { + b.CA = value + return b +} + +// WithCert sets the Cert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cert field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithCert(value *SecretOrConfigMapApplyConfiguration) *TLSConfigApplyConfiguration { + b.Cert = value + return b +} + +// WithKeySecret sets the KeySecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KeySecret field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithKeySecret(value corev1.SecretKeySelector) *TLSConfigApplyConfiguration { + b.KeySecret = &value + return b +} + +// WithServerName sets the ServerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServerName field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithServerName(value string) *TLSConfigApplyConfiguration { + b.ServerName = &value + return b +} + +// WithInsecureSkipVerify sets the InsecureSkipVerify field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InsecureSkipVerify field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithInsecureSkipVerify(value bool) *TLSConfigApplyConfiguration { + b.InsecureSkipVerify = &value + return b +} + +// WithCAFile sets the CAFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CAFile field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithCAFile(value string) *TLSConfigApplyConfiguration { + b.CAFile = &value + return b +} + +// WithCertFile sets the CertFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CertFile field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithCertFile(value string) *TLSConfigApplyConfiguration { + b.CertFile = &value + return b +} + +// WithKeyFile sets the KeyFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KeyFile field is set to the value of the last call. +func (b *TLSConfigApplyConfiguration) WithKeyFile(value string) *TLSConfigApplyConfiguration { + b.KeyFile = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/tsdbspec.go b/pkg/client/applyconfiguration/monitoring/v1/tsdbspec.go new file mode 100644 index 000000000..fffda73cd --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/tsdbspec.go @@ -0,0 +1,41 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" +) + +// TSDBSpecApplyConfiguration represents an declarative configuration of the TSDBSpec type for use +// with apply. +type TSDBSpecApplyConfiguration struct { + OutOfOrderTimeWindow *v1.Duration `json:"outOfOrderTimeWindow,omitempty"` +} + +// TSDBSpecApplyConfiguration constructs an declarative configuration of the TSDBSpec type for use with +// apply. +func TSDBSpec() *TSDBSpecApplyConfiguration { + return &TSDBSpecApplyConfiguration{} +} + +// WithOutOfOrderTimeWindow sets the OutOfOrderTimeWindow field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OutOfOrderTimeWindow field is set to the value of the last call. +func (b *TSDBSpecApplyConfiguration) WithOutOfOrderTimeWindow(value v1.Duration) *TSDBSpecApplyConfiguration { + b.OutOfOrderTimeWindow = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/webconfigfilefields.go b/pkg/client/applyconfiguration/monitoring/v1/webconfigfilefields.go new file mode 100644 index 000000000..ed0e0792d --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/webconfigfilefields.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// WebConfigFileFieldsApplyConfiguration represents an declarative configuration of the WebConfigFileFields type for use +// with apply. +type WebConfigFileFieldsApplyConfiguration struct { + TLSConfig *WebTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + HTTPConfig *WebHTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// WebConfigFileFieldsApplyConfiguration constructs an declarative configuration of the WebConfigFileFields type for use with +// apply. +func WebConfigFileFields() *WebConfigFileFieldsApplyConfiguration { + return &WebConfigFileFieldsApplyConfiguration{} +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *WebConfigFileFieldsApplyConfiguration) WithTLSConfig(value *WebTLSConfigApplyConfiguration) *WebConfigFileFieldsApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *WebConfigFileFieldsApplyConfiguration) WithHTTPConfig(value *WebHTTPConfigApplyConfiguration) *WebConfigFileFieldsApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/webhttpconfig.go b/pkg/client/applyconfiguration/monitoring/v1/webhttpconfig.go new file mode 100644 index 000000000..b58aa6a90 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/webhttpconfig.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// WebHTTPConfigApplyConfiguration represents an declarative configuration of the WebHTTPConfig type for use +// with apply. +type WebHTTPConfigApplyConfiguration struct { + HTTP2 *bool `json:"http2,omitempty"` + Headers *WebHTTPHeadersApplyConfiguration `json:"headers,omitempty"` +} + +// WebHTTPConfigApplyConfiguration constructs an declarative configuration of the WebHTTPConfig type for use with +// apply. +func WebHTTPConfig() *WebHTTPConfigApplyConfiguration { + return &WebHTTPConfigApplyConfiguration{} +} + +// WithHTTP2 sets the HTTP2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTP2 field is set to the value of the last call. +func (b *WebHTTPConfigApplyConfiguration) WithHTTP2(value bool) *WebHTTPConfigApplyConfiguration { + b.HTTP2 = &value + return b +} + +// WithHeaders sets the Headers field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Headers field is set to the value of the last call. +func (b *WebHTTPConfigApplyConfiguration) WithHeaders(value *WebHTTPHeadersApplyConfiguration) *WebHTTPConfigApplyConfiguration { + b.Headers = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/webhttpheaders.go b/pkg/client/applyconfiguration/monitoring/v1/webhttpheaders.go new file mode 100644 index 000000000..0650767b1 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/webhttpheaders.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// WebHTTPHeadersApplyConfiguration represents an declarative configuration of the WebHTTPHeaders type for use +// with apply. +type WebHTTPHeadersApplyConfiguration struct { + ContentSecurityPolicy *string `json:"contentSecurityPolicy,omitempty"` + XFrameOptions *string `json:"xFrameOptions,omitempty"` + XContentTypeOptions *string `json:"xContentTypeOptions,omitempty"` + XXSSProtection *string `json:"xXSSProtection,omitempty"` + StrictTransportSecurity *string `json:"strictTransportSecurity,omitempty"` +} + +// WebHTTPHeadersApplyConfiguration constructs an declarative configuration of the WebHTTPHeaders type for use with +// apply. +func WebHTTPHeaders() *WebHTTPHeadersApplyConfiguration { + return &WebHTTPHeadersApplyConfiguration{} +} + +// WithContentSecurityPolicy sets the ContentSecurityPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContentSecurityPolicy field is set to the value of the last call. +func (b *WebHTTPHeadersApplyConfiguration) WithContentSecurityPolicy(value string) *WebHTTPHeadersApplyConfiguration { + b.ContentSecurityPolicy = &value + return b +} + +// WithXFrameOptions sets the XFrameOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XFrameOptions field is set to the value of the last call. +func (b *WebHTTPHeadersApplyConfiguration) WithXFrameOptions(value string) *WebHTTPHeadersApplyConfiguration { + b.XFrameOptions = &value + return b +} + +// WithXContentTypeOptions sets the XContentTypeOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XContentTypeOptions field is set to the value of the last call. +func (b *WebHTTPHeadersApplyConfiguration) WithXContentTypeOptions(value string) *WebHTTPHeadersApplyConfiguration { + b.XContentTypeOptions = &value + return b +} + +// WithXXSSProtection sets the XXSSProtection field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XXSSProtection field is set to the value of the last call. +func (b *WebHTTPHeadersApplyConfiguration) WithXXSSProtection(value string) *WebHTTPHeadersApplyConfiguration { + b.XXSSProtection = &value + return b +} + +// WithStrictTransportSecurity sets the StrictTransportSecurity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StrictTransportSecurity field is set to the value of the last call. +func (b *WebHTTPHeadersApplyConfiguration) WithStrictTransportSecurity(value string) *WebHTTPHeadersApplyConfiguration { + b.StrictTransportSecurity = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1/webtlsconfig.go b/pkg/client/applyconfiguration/monitoring/v1/webtlsconfig.go new file mode 100644 index 000000000..8bfd1f4c9 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1/webtlsconfig.go @@ -0,0 +1,117 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// WebTLSConfigApplyConfiguration represents an declarative configuration of the WebTLSConfig type for use +// with apply. +type WebTLSConfigApplyConfiguration struct { + KeySecret *v1.SecretKeySelector `json:"keySecret,omitempty"` + Cert *SecretOrConfigMapApplyConfiguration `json:"cert,omitempty"` + ClientAuthType *string `json:"clientAuthType,omitempty"` + ClientCA *SecretOrConfigMapApplyConfiguration `json:"client_ca,omitempty"` + MinVersion *string `json:"minVersion,omitempty"` + MaxVersion *string `json:"maxVersion,omitempty"` + CipherSuites []string `json:"cipherSuites,omitempty"` + PreferServerCipherSuites *bool `json:"preferServerCipherSuites,omitempty"` + CurvePreferences []string `json:"curvePreferences,omitempty"` +} + +// WebTLSConfigApplyConfiguration constructs an declarative configuration of the WebTLSConfig type for use with +// apply. +func WebTLSConfig() *WebTLSConfigApplyConfiguration { + return &WebTLSConfigApplyConfiguration{} +} + +// WithKeySecret sets the KeySecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KeySecret field is set to the value of the last call. +func (b *WebTLSConfigApplyConfiguration) WithKeySecret(value v1.SecretKeySelector) *WebTLSConfigApplyConfiguration { + b.KeySecret = &value + return b +} + +// WithCert sets the Cert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cert field is set to the value of the last call. +func (b *WebTLSConfigApplyConfiguration) WithCert(value *SecretOrConfigMapApplyConfiguration) *WebTLSConfigApplyConfiguration { + b.Cert = value + return b +} + +// WithClientAuthType sets the ClientAuthType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientAuthType field is set to the value of the last call. +func (b *WebTLSConfigApplyConfiguration) WithClientAuthType(value string) *WebTLSConfigApplyConfiguration { + b.ClientAuthType = &value + return b +} + +// WithClientCA sets the ClientCA field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientCA field is set to the value of the last call. +func (b *WebTLSConfigApplyConfiguration) WithClientCA(value *SecretOrConfigMapApplyConfiguration) *WebTLSConfigApplyConfiguration { + b.ClientCA = value + return b +} + +// WithMinVersion sets the MinVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinVersion field is set to the value of the last call. +func (b *WebTLSConfigApplyConfiguration) WithMinVersion(value string) *WebTLSConfigApplyConfiguration { + b.MinVersion = &value + return b +} + +// WithMaxVersion sets the MaxVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxVersion field is set to the value of the last call. +func (b *WebTLSConfigApplyConfiguration) WithMaxVersion(value string) *WebTLSConfigApplyConfiguration { + b.MaxVersion = &value + return b +} + +// WithCipherSuites adds the given value to the CipherSuites field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CipherSuites field. +func (b *WebTLSConfigApplyConfiguration) WithCipherSuites(values ...string) *WebTLSConfigApplyConfiguration { + for i := range values { + b.CipherSuites = append(b.CipherSuites, values[i]) + } + return b +} + +// WithPreferServerCipherSuites sets the PreferServerCipherSuites field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreferServerCipherSuites field is set to the value of the last call. +func (b *WebTLSConfigApplyConfiguration) WithPreferServerCipherSuites(value bool) *WebTLSConfigApplyConfiguration { + b.PreferServerCipherSuites = &value + return b +} + +// WithCurvePreferences adds the given value to the CurvePreferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CurvePreferences field. +func (b *WebTLSConfigApplyConfiguration) WithCurvePreferences(values ...string) *WebTLSConfigApplyConfiguration { + for i := range values { + b.CurvePreferences = append(b.CurvePreferences, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/alertmanagerconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/alertmanagerconfig.go new file mode 100644 index 000000000..62eb676c6 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/alertmanagerconfig.go @@ -0,0 +1,208 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// AlertmanagerConfigApplyConfiguration represents an declarative configuration of the AlertmanagerConfig type for use +// with apply. +type AlertmanagerConfigApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *AlertmanagerConfigSpecApplyConfiguration `json:"spec,omitempty"` +} + +// AlertmanagerConfig constructs an declarative configuration of the AlertmanagerConfig type for use with +// apply. +func AlertmanagerConfig(name, namespace string) *AlertmanagerConfigApplyConfiguration { + b := &AlertmanagerConfigApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("AlertmanagerConfig") + b.WithAPIVersion("monitoring.coreos.com/v1alpha1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithKind(value string) *AlertmanagerConfigApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithAPIVersion(value string) *AlertmanagerConfigApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithName(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithGenerateName(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithNamespace(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithUID(value types.UID) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithResourceVersion(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithGeneration(value int64) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *AlertmanagerConfigApplyConfiguration) WithLabels(entries map[string]string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *AlertmanagerConfigApplyConfiguration) WithAnnotations(entries map[string]string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *AlertmanagerConfigApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *AlertmanagerConfigApplyConfiguration) WithFinalizers(values ...string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *AlertmanagerConfigApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithSpec(value *AlertmanagerConfigSpecApplyConfiguration) *AlertmanagerConfigApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/alertmanagerconfigspec.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/alertmanagerconfigspec.go new file mode 100644 index 000000000..f0eae4765 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/alertmanagerconfigspec.go @@ -0,0 +1,79 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// AlertmanagerConfigSpecApplyConfiguration represents an declarative configuration of the AlertmanagerConfigSpec type for use +// with apply. +type AlertmanagerConfigSpecApplyConfiguration struct { + Route *RouteApplyConfiguration `json:"route,omitempty"` + Receivers []ReceiverApplyConfiguration `json:"receivers,omitempty"` + InhibitRules []InhibitRuleApplyConfiguration `json:"inhibitRules,omitempty"` + MuteTimeIntervals []MuteTimeIntervalApplyConfiguration `json:"muteTimeIntervals,omitempty"` +} + +// AlertmanagerConfigSpecApplyConfiguration constructs an declarative configuration of the AlertmanagerConfigSpec type for use with +// apply. +func AlertmanagerConfigSpec() *AlertmanagerConfigSpecApplyConfiguration { + return &AlertmanagerConfigSpecApplyConfiguration{} +} + +// WithRoute sets the Route field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Route field is set to the value of the last call. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithRoute(value *RouteApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + b.Route = value + return b +} + +// WithReceivers adds the given value to the Receivers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Receivers field. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithReceivers(values ...*ReceiverApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReceivers") + } + b.Receivers = append(b.Receivers, *values[i]) + } + return b +} + +// WithInhibitRules adds the given value to the InhibitRules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InhibitRules field. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithInhibitRules(values ...*InhibitRuleApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithInhibitRules") + } + b.InhibitRules = append(b.InhibitRules, *values[i]) + } + return b +} + +// WithMuteTimeIntervals adds the given value to the MuteTimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MuteTimeIntervals field. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithMuteTimeIntervals(values ...*MuteTimeIntervalApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMuteTimeIntervals") + } + b.MuteTimeIntervals = append(b.MuteTimeIntervals, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/dayofmonthrange.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/dayofmonthrange.go new file mode 100644 index 000000000..0dc46a518 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/dayofmonthrange.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// DayOfMonthRangeApplyConfiguration represents an declarative configuration of the DayOfMonthRange type for use +// with apply. +type DayOfMonthRangeApplyConfiguration struct { + Start *int `json:"start,omitempty"` + End *int `json:"end,omitempty"` +} + +// DayOfMonthRangeApplyConfiguration constructs an declarative configuration of the DayOfMonthRange type for use with +// apply. +func DayOfMonthRange() *DayOfMonthRangeApplyConfiguration { + return &DayOfMonthRangeApplyConfiguration{} +} + +// WithStart sets the Start field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Start field is set to the value of the last call. +func (b *DayOfMonthRangeApplyConfiguration) WithStart(value int) *DayOfMonthRangeApplyConfiguration { + b.Start = &value + return b +} + +// WithEnd sets the End field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the End field is set to the value of the last call. +func (b *DayOfMonthRangeApplyConfiguration) WithEnd(value int) *DayOfMonthRangeApplyConfiguration { + b.End = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/emailconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/emailconfig.go new file mode 100644 index 000000000..9f3e9fa2e --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/emailconfig.go @@ -0,0 +1,164 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" + v1 "k8s.io/api/core/v1" +) + +// EmailConfigApplyConfiguration represents an declarative configuration of the EmailConfig type for use +// with apply. +type EmailConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + To *string `json:"to,omitempty"` + From *string `json:"from,omitempty"` + Hello *string `json:"hello,omitempty"` + Smarthost *string `json:"smarthost,omitempty"` + AuthUsername *string `json:"authUsername,omitempty"` + AuthPassword *v1.SecretKeySelector `json:"authPassword,omitempty"` + AuthSecret *v1.SecretKeySelector `json:"authSecret,omitempty"` + AuthIdentity *string `json:"authIdentity,omitempty"` + Headers []KeyValueApplyConfiguration `json:"headers,omitempty"` + HTML *string `json:"html,omitempty"` + Text *string `json:"text,omitempty"` + RequireTLS *bool `json:"requireTLS,omitempty"` + TLSConfig *monitoringv1.SafeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` +} + +// EmailConfigApplyConfiguration constructs an declarative configuration of the EmailConfig type for use with +// apply. +func EmailConfig() *EmailConfigApplyConfiguration { + return &EmailConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithSendResolved(value bool) *EmailConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithTo sets the To field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the To field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithTo(value string) *EmailConfigApplyConfiguration { + b.To = &value + return b +} + +// WithFrom sets the From field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the From field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithFrom(value string) *EmailConfigApplyConfiguration { + b.From = &value + return b +} + +// WithHello sets the Hello field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hello field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithHello(value string) *EmailConfigApplyConfiguration { + b.Hello = &value + return b +} + +// WithSmarthost sets the Smarthost field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Smarthost field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithSmarthost(value string) *EmailConfigApplyConfiguration { + b.Smarthost = &value + return b +} + +// WithAuthUsername sets the AuthUsername field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthUsername field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthUsername(value string) *EmailConfigApplyConfiguration { + b.AuthUsername = &value + return b +} + +// WithAuthPassword sets the AuthPassword field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthPassword field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthPassword(value v1.SecretKeySelector) *EmailConfigApplyConfiguration { + b.AuthPassword = &value + return b +} + +// WithAuthSecret sets the AuthSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthSecret field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthSecret(value v1.SecretKeySelector) *EmailConfigApplyConfiguration { + b.AuthSecret = &value + return b +} + +// WithAuthIdentity sets the AuthIdentity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthIdentity field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthIdentity(value string) *EmailConfigApplyConfiguration { + b.AuthIdentity = &value + return b +} + +// WithHeaders adds the given value to the Headers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Headers field. +func (b *EmailConfigApplyConfiguration) WithHeaders(values ...*KeyValueApplyConfiguration) *EmailConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHeaders") + } + b.Headers = append(b.Headers, *values[i]) + } + return b +} + +// WithHTML sets the HTML field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTML field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithHTML(value string) *EmailConfigApplyConfiguration { + b.HTML = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithText(value string) *EmailConfigApplyConfiguration { + b.Text = &value + return b +} + +// WithRequireTLS sets the RequireTLS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequireTLS field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithRequireTLS(value bool) *EmailConfigApplyConfiguration { + b.RequireTLS = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithTLSConfig(value *monitoringv1.SafeTLSConfigApplyConfiguration) *EmailConfigApplyConfiguration { + b.TLSConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/httpconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/httpconfig.go new file mode 100644 index 000000000..0fe4a92a4 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/httpconfig.go @@ -0,0 +1,96 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" + corev1 "k8s.io/api/core/v1" +) + +// HTTPConfigApplyConfiguration represents an declarative configuration of the HTTPConfig type for use +// with apply. +type HTTPConfigApplyConfiguration struct { + Authorization *v1.SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` + BasicAuth *v1.BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + OAuth2 *v1.OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + BearerTokenSecret *corev1.SecretKeySelector `json:"bearerTokenSecret,omitempty"` + TLSConfig *v1.SafeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + ProxyURL *string `json:"proxyURL,omitempty"` + FollowRedirects *bool `json:"followRedirects,omitempty"` +} + +// HTTPConfigApplyConfiguration constructs an declarative configuration of the HTTPConfig type for use with +// apply. +func HTTPConfig() *HTTPConfigApplyConfiguration { + return &HTTPConfigApplyConfiguration{} +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithAuthorization(value *v1.SafeAuthorizationApplyConfiguration) *HTTPConfigApplyConfiguration { + b.Authorization = value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithBasicAuth(value *v1.BasicAuthApplyConfiguration) *HTTPConfigApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithOAuth2(value *v1.OAuth2ApplyConfiguration) *HTTPConfigApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenSecret field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithBearerTokenSecret(value corev1.SecretKeySelector) *HTTPConfigApplyConfiguration { + b.BearerTokenSecret = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithTLSConfig(value *v1.SafeTLSConfigApplyConfiguration) *HTTPConfigApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithProxyURL(value string) *HTTPConfigApplyConfiguration { + b.ProxyURL = &value + return b +} + +// WithFollowRedirects sets the FollowRedirects field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FollowRedirects field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithFollowRedirects(value bool) *HTTPConfigApplyConfiguration { + b.FollowRedirects = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/inhibitrule.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/inhibitrule.go new file mode 100644 index 000000000..eb4f9eaa7 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/inhibitrule.go @@ -0,0 +1,67 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// InhibitRuleApplyConfiguration represents an declarative configuration of the InhibitRule type for use +// with apply. +type InhibitRuleApplyConfiguration struct { + TargetMatch []MatcherApplyConfiguration `json:"targetMatch,omitempty"` + SourceMatch []MatcherApplyConfiguration `json:"sourceMatch,omitempty"` + Equal []string `json:"equal,omitempty"` +} + +// InhibitRuleApplyConfiguration constructs an declarative configuration of the InhibitRule type for use with +// apply. +func InhibitRule() *InhibitRuleApplyConfiguration { + return &InhibitRuleApplyConfiguration{} +} + +// WithTargetMatch adds the given value to the TargetMatch field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetMatch field. +func (b *InhibitRuleApplyConfiguration) WithTargetMatch(values ...*MatcherApplyConfiguration) *InhibitRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTargetMatch") + } + b.TargetMatch = append(b.TargetMatch, *values[i]) + } + return b +} + +// WithSourceMatch adds the given value to the SourceMatch field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SourceMatch field. +func (b *InhibitRuleApplyConfiguration) WithSourceMatch(values ...*MatcherApplyConfiguration) *InhibitRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSourceMatch") + } + b.SourceMatch = append(b.SourceMatch, *values[i]) + } + return b +} + +// WithEqual adds the given value to the Equal field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Equal field. +func (b *InhibitRuleApplyConfiguration) WithEqual(values ...string) *InhibitRuleApplyConfiguration { + for i := range values { + b.Equal = append(b.Equal, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/keyvalue.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/keyvalue.go new file mode 100644 index 000000000..31a44c862 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/keyvalue.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// KeyValueApplyConfiguration represents an declarative configuration of the KeyValue type for use +// with apply. +type KeyValueApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` +} + +// KeyValueApplyConfiguration constructs an declarative configuration of the KeyValue type for use with +// apply. +func KeyValue() *KeyValueApplyConfiguration { + return &KeyValueApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *KeyValueApplyConfiguration) WithKey(value string) *KeyValueApplyConfiguration { + b.Key = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *KeyValueApplyConfiguration) WithValue(value string) *KeyValueApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/matcher.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/matcher.go new file mode 100644 index 000000000..4491e98ac --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/matcher.go @@ -0,0 +1,68 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" +) + +// MatcherApplyConfiguration represents an declarative configuration of the Matcher type for use +// with apply. +type MatcherApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + MatchType *v1alpha1.MatchType `json:"matchType,omitempty"` + Regex *bool `json:"regex,omitempty"` +} + +// MatcherApplyConfiguration constructs an declarative configuration of the Matcher type for use with +// apply. +func Matcher() *MatcherApplyConfiguration { + return &MatcherApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MatcherApplyConfiguration) WithName(value string) *MatcherApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *MatcherApplyConfiguration) WithValue(value string) *MatcherApplyConfiguration { + b.Value = &value + return b +} + +// WithMatchType sets the MatchType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchType field is set to the value of the last call. +func (b *MatcherApplyConfiguration) WithMatchType(value v1alpha1.MatchType) *MatcherApplyConfiguration { + b.MatchType = &value + return b +} + +// WithRegex sets the Regex field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Regex field is set to the value of the last call. +func (b *MatcherApplyConfiguration) WithRegex(value bool) *MatcherApplyConfiguration { + b.Regex = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/mutetimeinterval.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/mutetimeinterval.go new file mode 100644 index 000000000..85092e523 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/mutetimeinterval.go @@ -0,0 +1,51 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// MuteTimeIntervalApplyConfiguration represents an declarative configuration of the MuteTimeInterval type for use +// with apply. +type MuteTimeIntervalApplyConfiguration struct { + Name *string `json:"name,omitempty"` + TimeIntervals []TimeIntervalApplyConfiguration `json:"timeIntervals,omitempty"` +} + +// MuteTimeIntervalApplyConfiguration constructs an declarative configuration of the MuteTimeInterval type for use with +// apply. +func MuteTimeInterval() *MuteTimeIntervalApplyConfiguration { + return &MuteTimeIntervalApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MuteTimeIntervalApplyConfiguration) WithName(value string) *MuteTimeIntervalApplyConfiguration { + b.Name = &value + return b +} + +// WithTimeIntervals adds the given value to the TimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TimeIntervals field. +func (b *MuteTimeIntervalApplyConfiguration) WithTimeIntervals(values ...*TimeIntervalApplyConfiguration) *MuteTimeIntervalApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTimeIntervals") + } + b.TimeIntervals = append(b.TimeIntervals, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/opsgenieconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/opsgenieconfig.go new file mode 100644 index 000000000..5e333de95 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/opsgenieconfig.go @@ -0,0 +1,177 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// OpsGenieConfigApplyConfiguration represents an declarative configuration of the OpsGenieConfig type for use +// with apply. +type OpsGenieConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIKey *v1.SecretKeySelector `json:"apiKey,omitempty"` + APIURL *string `json:"apiURL,omitempty"` + Message *string `json:"message,omitempty"` + Description *string `json:"description,omitempty"` + Source *string `json:"source,omitempty"` + Tags *string `json:"tags,omitempty"` + Note *string `json:"note,omitempty"` + Priority *string `json:"priority,omitempty"` + UpdateAlerts *bool `json:"updateAlerts,omitempty"` + Details []KeyValueApplyConfiguration `json:"details,omitempty"` + Responders []OpsGenieConfigResponderApplyConfiguration `json:"responders,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` + Entity *string `json:"entity,omitempty"` + Actions *string `json:"actions,omitempty"` +} + +// OpsGenieConfigApplyConfiguration constructs an declarative configuration of the OpsGenieConfig type for use with +// apply. +func OpsGenieConfig() *OpsGenieConfigApplyConfiguration { + return &OpsGenieConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithSendResolved(value bool) *OpsGenieConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIKey sets the APIKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIKey field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithAPIKey(value v1.SecretKeySelector) *OpsGenieConfigApplyConfiguration { + b.APIKey = &value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithAPIURL(value string) *OpsGenieConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithMessage(value string) *OpsGenieConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithDescription(value string) *OpsGenieConfigApplyConfiguration { + b.Description = &value + return b +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithSource(value string) *OpsGenieConfigApplyConfiguration { + b.Source = &value + return b +} + +// WithTags sets the Tags field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Tags field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithTags(value string) *OpsGenieConfigApplyConfiguration { + b.Tags = &value + return b +} + +// WithNote sets the Note field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Note field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithNote(value string) *OpsGenieConfigApplyConfiguration { + b.Note = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithPriority(value string) *OpsGenieConfigApplyConfiguration { + b.Priority = &value + return b +} + +// WithUpdateAlerts sets the UpdateAlerts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdateAlerts field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithUpdateAlerts(value bool) *OpsGenieConfigApplyConfiguration { + b.UpdateAlerts = &value + return b +} + +// WithDetails adds the given value to the Details field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Details field. +func (b *OpsGenieConfigApplyConfiguration) WithDetails(values ...*KeyValueApplyConfiguration) *OpsGenieConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDetails") + } + b.Details = append(b.Details, *values[i]) + } + return b +} + +// WithResponders adds the given value to the Responders field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Responders field. +func (b *OpsGenieConfigApplyConfiguration) WithResponders(values ...*OpsGenieConfigResponderApplyConfiguration) *OpsGenieConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResponders") + } + b.Responders = append(b.Responders, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *OpsGenieConfigApplyConfiguration { + b.HTTPConfig = value + return b +} + +// WithEntity sets the Entity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Entity field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithEntity(value string) *OpsGenieConfigApplyConfiguration { + b.Entity = &value + return b +} + +// WithActions sets the Actions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Actions field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithActions(value string) *OpsGenieConfigApplyConfiguration { + b.Actions = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/opsgenieconfigresponder.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/opsgenieconfigresponder.go new file mode 100644 index 000000000..c2b9caabc --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/opsgenieconfigresponder.go @@ -0,0 +1,64 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// OpsGenieConfigResponderApplyConfiguration represents an declarative configuration of the OpsGenieConfigResponder type for use +// with apply. +type OpsGenieConfigResponderApplyConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Username *string `json:"username,omitempty"` + Type *string `json:"type,omitempty"` +} + +// OpsGenieConfigResponderApplyConfiguration constructs an declarative configuration of the OpsGenieConfigResponder type for use with +// apply. +func OpsGenieConfigResponder() *OpsGenieConfigResponderApplyConfiguration { + return &OpsGenieConfigResponderApplyConfiguration{} +} + +// WithID sets the ID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ID field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithID(value string) *OpsGenieConfigResponderApplyConfiguration { + b.ID = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithName(value string) *OpsGenieConfigResponderApplyConfiguration { + b.Name = &value + return b +} + +// WithUsername sets the Username field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Username field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithUsername(value string) *OpsGenieConfigResponderApplyConfiguration { + b.Username = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithType(value string) *OpsGenieConfigResponderApplyConfiguration { + b.Type = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutyconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutyconfig.go new file mode 100644 index 000000000..0fc8abf23 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutyconfig.go @@ -0,0 +1,182 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PagerDutyConfigApplyConfiguration represents an declarative configuration of the PagerDutyConfig type for use +// with apply. +type PagerDutyConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + RoutingKey *v1.SecretKeySelector `json:"routingKey,omitempty"` + ServiceKey *v1.SecretKeySelector `json:"serviceKey,omitempty"` + URL *string `json:"url,omitempty"` + Client *string `json:"client,omitempty"` + ClientURL *string `json:"clientURL,omitempty"` + Description *string `json:"description,omitempty"` + Severity *string `json:"severity,omitempty"` + Class *string `json:"class,omitempty"` + Group *string `json:"group,omitempty"` + Component *string `json:"component,omitempty"` + Details []KeyValueApplyConfiguration `json:"details,omitempty"` + PagerDutyImageConfigs []PagerDutyImageConfigApplyConfiguration `json:"pagerDutyImageConfigs,omitempty"` + PagerDutyLinkConfigs []PagerDutyLinkConfigApplyConfiguration `json:"pagerDutyLinkConfigs,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// PagerDutyConfigApplyConfiguration constructs an declarative configuration of the PagerDutyConfig type for use with +// apply. +func PagerDutyConfig() *PagerDutyConfigApplyConfiguration { + return &PagerDutyConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithSendResolved(value bool) *PagerDutyConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithRoutingKey sets the RoutingKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutingKey field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithRoutingKey(value v1.SecretKeySelector) *PagerDutyConfigApplyConfiguration { + b.RoutingKey = &value + return b +} + +// WithServiceKey sets the ServiceKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceKey field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithServiceKey(value v1.SecretKeySelector) *PagerDutyConfigApplyConfiguration { + b.ServiceKey = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithURL(value string) *PagerDutyConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithClient sets the Client field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Client field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithClient(value string) *PagerDutyConfigApplyConfiguration { + b.Client = &value + return b +} + +// WithClientURL sets the ClientURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientURL field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithClientURL(value string) *PagerDutyConfigApplyConfiguration { + b.ClientURL = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithDescription(value string) *PagerDutyConfigApplyConfiguration { + b.Description = &value + return b +} + +// WithSeverity sets the Severity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Severity field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithSeverity(value string) *PagerDutyConfigApplyConfiguration { + b.Severity = &value + return b +} + +// WithClass sets the Class field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Class field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithClass(value string) *PagerDutyConfigApplyConfiguration { + b.Class = &value + return b +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithGroup(value string) *PagerDutyConfigApplyConfiguration { + b.Group = &value + return b +} + +// WithComponent sets the Component field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Component field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithComponent(value string) *PagerDutyConfigApplyConfiguration { + b.Component = &value + return b +} + +// WithDetails adds the given value to the Details field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Details field. +func (b *PagerDutyConfigApplyConfiguration) WithDetails(values ...*KeyValueApplyConfiguration) *PagerDutyConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDetails") + } + b.Details = append(b.Details, *values[i]) + } + return b +} + +// WithPagerDutyImageConfigs adds the given value to the PagerDutyImageConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PagerDutyImageConfigs field. +func (b *PagerDutyConfigApplyConfiguration) WithPagerDutyImageConfigs(values ...*PagerDutyImageConfigApplyConfiguration) *PagerDutyConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPagerDutyImageConfigs") + } + b.PagerDutyImageConfigs = append(b.PagerDutyImageConfigs, *values[i]) + } + return b +} + +// WithPagerDutyLinkConfigs adds the given value to the PagerDutyLinkConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PagerDutyLinkConfigs field. +func (b *PagerDutyConfigApplyConfiguration) WithPagerDutyLinkConfigs(values ...*PagerDutyLinkConfigApplyConfiguration) *PagerDutyConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPagerDutyLinkConfigs") + } + b.PagerDutyLinkConfigs = append(b.PagerDutyLinkConfigs, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *PagerDutyConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutyimageconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutyimageconfig.go new file mode 100644 index 000000000..c9c2addc7 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutyimageconfig.go @@ -0,0 +1,55 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// PagerDutyImageConfigApplyConfiguration represents an declarative configuration of the PagerDutyImageConfig type for use +// with apply. +type PagerDutyImageConfigApplyConfiguration struct { + Src *string `json:"src,omitempty"` + Href *string `json:"href,omitempty"` + Alt *string `json:"alt,omitempty"` +} + +// PagerDutyImageConfigApplyConfiguration constructs an declarative configuration of the PagerDutyImageConfig type for use with +// apply. +func PagerDutyImageConfig() *PagerDutyImageConfigApplyConfiguration { + return &PagerDutyImageConfigApplyConfiguration{} +} + +// WithSrc sets the Src field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Src field is set to the value of the last call. +func (b *PagerDutyImageConfigApplyConfiguration) WithSrc(value string) *PagerDutyImageConfigApplyConfiguration { + b.Src = &value + return b +} + +// WithHref sets the Href field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Href field is set to the value of the last call. +func (b *PagerDutyImageConfigApplyConfiguration) WithHref(value string) *PagerDutyImageConfigApplyConfiguration { + b.Href = &value + return b +} + +// WithAlt sets the Alt field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Alt field is set to the value of the last call. +func (b *PagerDutyImageConfigApplyConfiguration) WithAlt(value string) *PagerDutyImageConfigApplyConfiguration { + b.Alt = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutylinkconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutylinkconfig.go new file mode 100644 index 000000000..84c422111 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/pagerdutylinkconfig.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// PagerDutyLinkConfigApplyConfiguration represents an declarative configuration of the PagerDutyLinkConfig type for use +// with apply. +type PagerDutyLinkConfigApplyConfiguration struct { + Href *string `json:"href,omitempty"` + Text *string `json:"alt,omitempty"` +} + +// PagerDutyLinkConfigApplyConfiguration constructs an declarative configuration of the PagerDutyLinkConfig type for use with +// apply. +func PagerDutyLinkConfig() *PagerDutyLinkConfigApplyConfiguration { + return &PagerDutyLinkConfigApplyConfiguration{} +} + +// WithHref sets the Href field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Href field is set to the value of the last call. +func (b *PagerDutyLinkConfigApplyConfiguration) WithHref(value string) *PagerDutyLinkConfigApplyConfiguration { + b.Href = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *PagerDutyLinkConfigApplyConfiguration) WithText(value string) *PagerDutyLinkConfigApplyConfiguration { + b.Text = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/pushoverconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/pushoverconfig.go new file mode 100644 index 000000000..20923157e --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/pushoverconfig.go @@ -0,0 +1,149 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PushoverConfigApplyConfiguration represents an declarative configuration of the PushoverConfig type for use +// with apply. +type PushoverConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + UserKey *v1.SecretKeySelector `json:"userKey,omitempty"` + Token *v1.SecretKeySelector `json:"token,omitempty"` + Title *string `json:"title,omitempty"` + Message *string `json:"message,omitempty"` + URL *string `json:"url,omitempty"` + URLTitle *string `json:"urlTitle,omitempty"` + Sound *string `json:"sound,omitempty"` + Priority *string `json:"priority,omitempty"` + Retry *string `json:"retry,omitempty"` + Expire *string `json:"expire,omitempty"` + HTML *bool `json:"html,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// PushoverConfigApplyConfiguration constructs an declarative configuration of the PushoverConfig type for use with +// apply. +func PushoverConfig() *PushoverConfigApplyConfiguration { + return &PushoverConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithSendResolved(value bool) *PushoverConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithUserKey sets the UserKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UserKey field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithUserKey(value v1.SecretKeySelector) *PushoverConfigApplyConfiguration { + b.UserKey = &value + return b +} + +// WithToken sets the Token field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Token field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithToken(value v1.SecretKeySelector) *PushoverConfigApplyConfiguration { + b.Token = &value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithTitle(value string) *PushoverConfigApplyConfiguration { + b.Title = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithMessage(value string) *PushoverConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithURL(value string) *PushoverConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithURLTitle sets the URLTitle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URLTitle field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithURLTitle(value string) *PushoverConfigApplyConfiguration { + b.URLTitle = &value + return b +} + +// WithSound sets the Sound field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sound field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithSound(value string) *PushoverConfigApplyConfiguration { + b.Sound = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithPriority(value string) *PushoverConfigApplyConfiguration { + b.Priority = &value + return b +} + +// WithRetry sets the Retry field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Retry field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithRetry(value string) *PushoverConfigApplyConfiguration { + b.Retry = &value + return b +} + +// WithExpire sets the Expire field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expire field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithExpire(value string) *PushoverConfigApplyConfiguration { + b.Expire = &value + return b +} + +// WithHTML sets the HTML field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTML field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithHTML(value bool) *PushoverConfigApplyConfiguration { + b.HTML = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *PushoverConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/receiver.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/receiver.go new file mode 100644 index 000000000..e82fe9985 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/receiver.go @@ -0,0 +1,177 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// ReceiverApplyConfiguration represents an declarative configuration of the Receiver type for use +// with apply. +type ReceiverApplyConfiguration struct { + Name *string `json:"name,omitempty"` + OpsGenieConfigs []OpsGenieConfigApplyConfiguration `json:"opsgenieConfigs,omitempty"` + PagerDutyConfigs []PagerDutyConfigApplyConfiguration `json:"pagerdutyConfigs,omitempty"` + SlackConfigs []SlackConfigApplyConfiguration `json:"slackConfigs,omitempty"` + WebhookConfigs []WebhookConfigApplyConfiguration `json:"webhookConfigs,omitempty"` + WeChatConfigs []WeChatConfigApplyConfiguration `json:"wechatConfigs,omitempty"` + EmailConfigs []EmailConfigApplyConfiguration `json:"emailConfigs,omitempty"` + VictorOpsConfigs []VictorOpsConfigApplyConfiguration `json:"victoropsConfigs,omitempty"` + PushoverConfigs []PushoverConfigApplyConfiguration `json:"pushoverConfigs,omitempty"` + SNSConfigs []SNSConfigApplyConfiguration `json:"snsConfigs,omitempty"` + TelegramConfigs []TelegramConfigApplyConfiguration `json:"telegramConfigs,omitempty"` +} + +// ReceiverApplyConfiguration constructs an declarative configuration of the Receiver type for use with +// apply. +func Receiver() *ReceiverApplyConfiguration { + return &ReceiverApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ReceiverApplyConfiguration) WithName(value string) *ReceiverApplyConfiguration { + b.Name = &value + return b +} + +// WithOpsGenieConfigs adds the given value to the OpsGenieConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OpsGenieConfigs field. +func (b *ReceiverApplyConfiguration) WithOpsGenieConfigs(values ...*OpsGenieConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOpsGenieConfigs") + } + b.OpsGenieConfigs = append(b.OpsGenieConfigs, *values[i]) + } + return b +} + +// WithPagerDutyConfigs adds the given value to the PagerDutyConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PagerDutyConfigs field. +func (b *ReceiverApplyConfiguration) WithPagerDutyConfigs(values ...*PagerDutyConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPagerDutyConfigs") + } + b.PagerDutyConfigs = append(b.PagerDutyConfigs, *values[i]) + } + return b +} + +// WithSlackConfigs adds the given value to the SlackConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SlackConfigs field. +func (b *ReceiverApplyConfiguration) WithSlackConfigs(values ...*SlackConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSlackConfigs") + } + b.SlackConfigs = append(b.SlackConfigs, *values[i]) + } + return b +} + +// WithWebhookConfigs adds the given value to the WebhookConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the WebhookConfigs field. +func (b *ReceiverApplyConfiguration) WithWebhookConfigs(values ...*WebhookConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithWebhookConfigs") + } + b.WebhookConfigs = append(b.WebhookConfigs, *values[i]) + } + return b +} + +// WithWeChatConfigs adds the given value to the WeChatConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the WeChatConfigs field. +func (b *ReceiverApplyConfiguration) WithWeChatConfigs(values ...*WeChatConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithWeChatConfigs") + } + b.WeChatConfigs = append(b.WeChatConfigs, *values[i]) + } + return b +} + +// WithEmailConfigs adds the given value to the EmailConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EmailConfigs field. +func (b *ReceiverApplyConfiguration) WithEmailConfigs(values ...*EmailConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEmailConfigs") + } + b.EmailConfigs = append(b.EmailConfigs, *values[i]) + } + return b +} + +// WithVictorOpsConfigs adds the given value to the VictorOpsConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VictorOpsConfigs field. +func (b *ReceiverApplyConfiguration) WithVictorOpsConfigs(values ...*VictorOpsConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVictorOpsConfigs") + } + b.VictorOpsConfigs = append(b.VictorOpsConfigs, *values[i]) + } + return b +} + +// WithPushoverConfigs adds the given value to the PushoverConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PushoverConfigs field. +func (b *ReceiverApplyConfiguration) WithPushoverConfigs(values ...*PushoverConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPushoverConfigs") + } + b.PushoverConfigs = append(b.PushoverConfigs, *values[i]) + } + return b +} + +// WithSNSConfigs adds the given value to the SNSConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SNSConfigs field. +func (b *ReceiverApplyConfiguration) WithSNSConfigs(values ...*SNSConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSNSConfigs") + } + b.SNSConfigs = append(b.SNSConfigs, *values[i]) + } + return b +} + +// WithTelegramConfigs adds the given value to the TelegramConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TelegramConfigs field. +func (b *ReceiverApplyConfiguration) WithTelegramConfigs(values ...*TelegramConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTelegramConfigs") + } + b.TelegramConfigs = append(b.TelegramConfigs, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/route.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/route.go new file mode 100644 index 000000000..cbcca4076 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/route.go @@ -0,0 +1,135 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// RouteApplyConfiguration represents an declarative configuration of the Route type for use +// with apply. +type RouteApplyConfiguration struct { + Receiver *string `json:"receiver,omitempty"` + GroupBy []string `json:"groupBy,omitempty"` + GroupWait *string `json:"groupWait,omitempty"` + GroupInterval *string `json:"groupInterval,omitempty"` + RepeatInterval *string `json:"repeatInterval,omitempty"` + Matchers []MatcherApplyConfiguration `json:"matchers,omitempty"` + Continue *bool `json:"continue,omitempty"` + Routes []v1.JSON `json:"routes,omitempty"` + MuteTimeIntervals []string `json:"muteTimeIntervals,omitempty"` + ActiveTimeIntervals []string `json:"activeTimeIntervals,omitempty"` +} + +// RouteApplyConfiguration constructs an declarative configuration of the Route type for use with +// apply. +func Route() *RouteApplyConfiguration { + return &RouteApplyConfiguration{} +} + +// WithReceiver sets the Receiver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Receiver field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithReceiver(value string) *RouteApplyConfiguration { + b.Receiver = &value + return b +} + +// WithGroupBy adds the given value to the GroupBy field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the GroupBy field. +func (b *RouteApplyConfiguration) WithGroupBy(values ...string) *RouteApplyConfiguration { + for i := range values { + b.GroupBy = append(b.GroupBy, values[i]) + } + return b +} + +// WithGroupWait sets the GroupWait field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GroupWait field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithGroupWait(value string) *RouteApplyConfiguration { + b.GroupWait = &value + return b +} + +// WithGroupInterval sets the GroupInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GroupInterval field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithGroupInterval(value string) *RouteApplyConfiguration { + b.GroupInterval = &value + return b +} + +// WithRepeatInterval sets the RepeatInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RepeatInterval field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithRepeatInterval(value string) *RouteApplyConfiguration { + b.RepeatInterval = &value + return b +} + +// WithMatchers adds the given value to the Matchers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Matchers field. +func (b *RouteApplyConfiguration) WithMatchers(values ...*MatcherApplyConfiguration) *RouteApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchers") + } + b.Matchers = append(b.Matchers, *values[i]) + } + return b +} + +// WithContinue sets the Continue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Continue field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithContinue(value bool) *RouteApplyConfiguration { + b.Continue = &value + return b +} + +// WithRoutes adds the given value to the Routes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Routes field. +func (b *RouteApplyConfiguration) WithRoutes(values ...v1.JSON) *RouteApplyConfiguration { + for i := range values { + b.Routes = append(b.Routes, values[i]) + } + return b +} + +// WithMuteTimeIntervals adds the given value to the MuteTimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MuteTimeIntervals field. +func (b *RouteApplyConfiguration) WithMuteTimeIntervals(values ...string) *RouteApplyConfiguration { + for i := range values { + b.MuteTimeIntervals = append(b.MuteTimeIntervals, values[i]) + } + return b +} + +// WithActiveTimeIntervals adds the given value to the ActiveTimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ActiveTimeIntervals field. +func (b *RouteApplyConfiguration) WithActiveTimeIntervals(values ...string) *RouteApplyConfiguration { + for i := range values { + b.ActiveTimeIntervals = append(b.ActiveTimeIntervals, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/slackaction.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackaction.go new file mode 100644 index 000000000..bc536ddcb --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackaction.go @@ -0,0 +1,91 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// SlackActionApplyConfiguration represents an declarative configuration of the SlackAction type for use +// with apply. +type SlackActionApplyConfiguration struct { + Type *string `json:"type,omitempty"` + Text *string `json:"text,omitempty"` + URL *string `json:"url,omitempty"` + Style *string `json:"style,omitempty"` + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + ConfirmField *SlackConfirmationFieldApplyConfiguration `json:"confirm,omitempty"` +} + +// SlackActionApplyConfiguration constructs an declarative configuration of the SlackAction type for use with +// apply. +func SlackAction() *SlackActionApplyConfiguration { + return &SlackActionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithType(value string) *SlackActionApplyConfiguration { + b.Type = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithText(value string) *SlackActionApplyConfiguration { + b.Text = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithURL(value string) *SlackActionApplyConfiguration { + b.URL = &value + return b +} + +// WithStyle sets the Style field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Style field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithStyle(value string) *SlackActionApplyConfiguration { + b.Style = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithName(value string) *SlackActionApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithValue(value string) *SlackActionApplyConfiguration { + b.Value = &value + return b +} + +// WithConfirmField sets the ConfirmField field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfirmField field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithConfirmField(value *SlackConfirmationFieldApplyConfiguration) *SlackActionApplyConfiguration { + b.ConfirmField = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/slackconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackconfig.go new file mode 100644 index 000000000..72b66d34d --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackconfig.go @@ -0,0 +1,242 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// SlackConfigApplyConfiguration represents an declarative configuration of the SlackConfig type for use +// with apply. +type SlackConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIURL *v1.SecretKeySelector `json:"apiURL,omitempty"` + Channel *string `json:"channel,omitempty"` + Username *string `json:"username,omitempty"` + Color *string `json:"color,omitempty"` + Title *string `json:"title,omitempty"` + TitleLink *string `json:"titleLink,omitempty"` + Pretext *string `json:"pretext,omitempty"` + Text *string `json:"text,omitempty"` + Fields []SlackFieldApplyConfiguration `json:"fields,omitempty"` + ShortFields *bool `json:"shortFields,omitempty"` + Footer *string `json:"footer,omitempty"` + Fallback *string `json:"fallback,omitempty"` + CallbackID *string `json:"callbackId,omitempty"` + IconEmoji *string `json:"iconEmoji,omitempty"` + IconURL *string `json:"iconURL,omitempty"` + ImageURL *string `json:"imageURL,omitempty"` + ThumbURL *string `json:"thumbURL,omitempty"` + LinkNames *bool `json:"linkNames,omitempty"` + MrkdwnIn []string `json:"mrkdwnIn,omitempty"` + Actions []SlackActionApplyConfiguration `json:"actions,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// SlackConfigApplyConfiguration constructs an declarative configuration of the SlackConfig type for use with +// apply. +func SlackConfig() *SlackConfigApplyConfiguration { + return &SlackConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithSendResolved(value bool) *SlackConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithAPIURL(value v1.SecretKeySelector) *SlackConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithChannel sets the Channel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Channel field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithChannel(value string) *SlackConfigApplyConfiguration { + b.Channel = &value + return b +} + +// WithUsername sets the Username field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Username field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithUsername(value string) *SlackConfigApplyConfiguration { + b.Username = &value + return b +} + +// WithColor sets the Color field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Color field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithColor(value string) *SlackConfigApplyConfiguration { + b.Color = &value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithTitle(value string) *SlackConfigApplyConfiguration { + b.Title = &value + return b +} + +// WithTitleLink sets the TitleLink field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TitleLink field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithTitleLink(value string) *SlackConfigApplyConfiguration { + b.TitleLink = &value + return b +} + +// WithPretext sets the Pretext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pretext field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithPretext(value string) *SlackConfigApplyConfiguration { + b.Pretext = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithText(value string) *SlackConfigApplyConfiguration { + b.Text = &value + return b +} + +// WithFields adds the given value to the Fields field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Fields field. +func (b *SlackConfigApplyConfiguration) WithFields(values ...*SlackFieldApplyConfiguration) *SlackConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFields") + } + b.Fields = append(b.Fields, *values[i]) + } + return b +} + +// WithShortFields sets the ShortFields field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShortFields field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithShortFields(value bool) *SlackConfigApplyConfiguration { + b.ShortFields = &value + return b +} + +// WithFooter sets the Footer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Footer field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithFooter(value string) *SlackConfigApplyConfiguration { + b.Footer = &value + return b +} + +// WithFallback sets the Fallback field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Fallback field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithFallback(value string) *SlackConfigApplyConfiguration { + b.Fallback = &value + return b +} + +// WithCallbackID sets the CallbackID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CallbackID field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithCallbackID(value string) *SlackConfigApplyConfiguration { + b.CallbackID = &value + return b +} + +// WithIconEmoji sets the IconEmoji field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IconEmoji field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithIconEmoji(value string) *SlackConfigApplyConfiguration { + b.IconEmoji = &value + return b +} + +// WithIconURL sets the IconURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IconURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithIconURL(value string) *SlackConfigApplyConfiguration { + b.IconURL = &value + return b +} + +// WithImageURL sets the ImageURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImageURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithImageURL(value string) *SlackConfigApplyConfiguration { + b.ImageURL = &value + return b +} + +// WithThumbURL sets the ThumbURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ThumbURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithThumbURL(value string) *SlackConfigApplyConfiguration { + b.ThumbURL = &value + return b +} + +// WithLinkNames sets the LinkNames field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LinkNames field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithLinkNames(value bool) *SlackConfigApplyConfiguration { + b.LinkNames = &value + return b +} + +// WithMrkdwnIn adds the given value to the MrkdwnIn field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MrkdwnIn field. +func (b *SlackConfigApplyConfiguration) WithMrkdwnIn(values ...string) *SlackConfigApplyConfiguration { + for i := range values { + b.MrkdwnIn = append(b.MrkdwnIn, values[i]) + } + return b +} + +// WithActions adds the given value to the Actions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Actions field. +func (b *SlackConfigApplyConfiguration) WithActions(values ...*SlackActionApplyConfiguration) *SlackConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithActions") + } + b.Actions = append(b.Actions, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *SlackConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/slackconfirmationfield.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackconfirmationfield.go new file mode 100644 index 000000000..d2cdf2691 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackconfirmationfield.go @@ -0,0 +1,64 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// SlackConfirmationFieldApplyConfiguration represents an declarative configuration of the SlackConfirmationField type for use +// with apply. +type SlackConfirmationFieldApplyConfiguration struct { + Text *string `json:"text,omitempty"` + Title *string `json:"title,omitempty"` + OkText *string `json:"okText,omitempty"` + DismissText *string `json:"dismissText,omitempty"` +} + +// SlackConfirmationFieldApplyConfiguration constructs an declarative configuration of the SlackConfirmationField type for use with +// apply. +func SlackConfirmationField() *SlackConfirmationFieldApplyConfiguration { + return &SlackConfirmationFieldApplyConfiguration{} +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithText(value string) *SlackConfirmationFieldApplyConfiguration { + b.Text = &value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithTitle(value string) *SlackConfirmationFieldApplyConfiguration { + b.Title = &value + return b +} + +// WithOkText sets the OkText field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OkText field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithOkText(value string) *SlackConfirmationFieldApplyConfiguration { + b.OkText = &value + return b +} + +// WithDismissText sets the DismissText field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DismissText field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithDismissText(value string) *SlackConfirmationFieldApplyConfiguration { + b.DismissText = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/slackfield.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackfield.go new file mode 100644 index 000000000..3aad90eb7 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/slackfield.go @@ -0,0 +1,55 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// SlackFieldApplyConfiguration represents an declarative configuration of the SlackField type for use +// with apply. +type SlackFieldApplyConfiguration struct { + Title *string `json:"title,omitempty"` + Value *string `json:"value,omitempty"` + Short *bool `json:"short,omitempty"` +} + +// SlackFieldApplyConfiguration constructs an declarative configuration of the SlackField type for use with +// apply. +func SlackField() *SlackFieldApplyConfiguration { + return &SlackFieldApplyConfiguration{} +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *SlackFieldApplyConfiguration) WithTitle(value string) *SlackFieldApplyConfiguration { + b.Title = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *SlackFieldApplyConfiguration) WithValue(value string) *SlackFieldApplyConfiguration { + b.Value = &value + return b +} + +// WithShort sets the Short field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Short field is set to the value of the last call. +func (b *SlackFieldApplyConfiguration) WithShort(value bool) *SlackFieldApplyConfiguration { + b.Short = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/snsconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/snsconfig.go new file mode 100644 index 000000000..00616e002 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/snsconfig.go @@ -0,0 +1,128 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" +) + +// SNSConfigApplyConfiguration represents an declarative configuration of the SNSConfig type for use +// with apply. +type SNSConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + ApiURL *string `json:"apiURL,omitempty"` + Sigv4 *v1.Sigv4ApplyConfiguration `json:"sigv4,omitempty"` + TopicARN *string `json:"topicARN,omitempty"` + Subject *string `json:"subject,omitempty"` + PhoneNumber *string `json:"phoneNumber,omitempty"` + TargetARN *string `json:"targetARN,omitempty"` + Message *string `json:"message,omitempty"` + Attributes map[string]string `json:"attributes,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// SNSConfigApplyConfiguration constructs an declarative configuration of the SNSConfig type for use with +// apply. +func SNSConfig() *SNSConfigApplyConfiguration { + return &SNSConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithSendResolved(value bool) *SNSConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithApiURL sets the ApiURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ApiURL field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithApiURL(value string) *SNSConfigApplyConfiguration { + b.ApiURL = &value + return b +} + +// WithSigv4 sets the Sigv4 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sigv4 field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithSigv4(value *v1.Sigv4ApplyConfiguration) *SNSConfigApplyConfiguration { + b.Sigv4 = value + return b +} + +// WithTopicARN sets the TopicARN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TopicARN field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithTopicARN(value string) *SNSConfigApplyConfiguration { + b.TopicARN = &value + return b +} + +// WithSubject sets the Subject field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subject field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithSubject(value string) *SNSConfigApplyConfiguration { + b.Subject = &value + return b +} + +// WithPhoneNumber sets the PhoneNumber field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PhoneNumber field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithPhoneNumber(value string) *SNSConfigApplyConfiguration { + b.PhoneNumber = &value + return b +} + +// WithTargetARN sets the TargetARN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetARN field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithTargetARN(value string) *SNSConfigApplyConfiguration { + b.TargetARN = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithMessage(value string) *SNSConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithAttributes puts the entries into the Attributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Attributes field, +// overwriting an existing map entries in Attributes field with the same key. +func (b *SNSConfigApplyConfiguration) WithAttributes(entries map[string]string) *SNSConfigApplyConfiguration { + if b.Attributes == nil && len(entries) > 0 { + b.Attributes = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Attributes[k] = v + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *SNSConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/telegramconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/telegramconfig.go new file mode 100644 index 000000000..374567ef3 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/telegramconfig.go @@ -0,0 +1,104 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// TelegramConfigApplyConfiguration represents an declarative configuration of the TelegramConfig type for use +// with apply. +type TelegramConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIURL *string `json:"apiURL,omitempty"` + BotToken *v1.SecretKeySelector `json:"botToken,omitempty"` + ChatID *int64 `json:"chatID,omitempty"` + Message *string `json:"message,omitempty"` + DisableNotifications *bool `json:"disableNotifications,omitempty"` + ParseMode *string `json:"parseMode,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// TelegramConfigApplyConfiguration constructs an declarative configuration of the TelegramConfig type for use with +// apply. +func TelegramConfig() *TelegramConfigApplyConfiguration { + return &TelegramConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithSendResolved(value bool) *TelegramConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithAPIURL(value string) *TelegramConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithBotToken sets the BotToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BotToken field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithBotToken(value v1.SecretKeySelector) *TelegramConfigApplyConfiguration { + b.BotToken = &value + return b +} + +// WithChatID sets the ChatID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ChatID field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithChatID(value int64) *TelegramConfigApplyConfiguration { + b.ChatID = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithMessage(value string) *TelegramConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithDisableNotifications sets the DisableNotifications field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisableNotifications field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithDisableNotifications(value bool) *TelegramConfigApplyConfiguration { + b.DisableNotifications = &value + return b +} + +// WithParseMode sets the ParseMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParseMode field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithParseMode(value string) *TelegramConfigApplyConfiguration { + b.ParseMode = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *TelegramConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/timeinterval.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/timeinterval.go new file mode 100644 index 000000000..cc0eaa780 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/timeinterval.go @@ -0,0 +1,93 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + monitoringv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" +) + +// TimeIntervalApplyConfiguration represents an declarative configuration of the TimeInterval type for use +// with apply. +type TimeIntervalApplyConfiguration struct { + Times []TimeRangeApplyConfiguration `json:"times,omitempty"` + Weekdays []monitoringv1alpha1.WeekdayRange `json:"weekdays,omitempty"` + DaysOfMonth []DayOfMonthRangeApplyConfiguration `json:"daysOfMonth,omitempty"` + Months []monitoringv1alpha1.MonthRange `json:"months,omitempty"` + Years []monitoringv1alpha1.YearRange `json:"years,omitempty"` +} + +// TimeIntervalApplyConfiguration constructs an declarative configuration of the TimeInterval type for use with +// apply. +func TimeInterval() *TimeIntervalApplyConfiguration { + return &TimeIntervalApplyConfiguration{} +} + +// WithTimes adds the given value to the Times field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Times field. +func (b *TimeIntervalApplyConfiguration) WithTimes(values ...*TimeRangeApplyConfiguration) *TimeIntervalApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTimes") + } + b.Times = append(b.Times, *values[i]) + } + return b +} + +// WithWeekdays adds the given value to the Weekdays field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Weekdays field. +func (b *TimeIntervalApplyConfiguration) WithWeekdays(values ...monitoringv1alpha1.WeekdayRange) *TimeIntervalApplyConfiguration { + for i := range values { + b.Weekdays = append(b.Weekdays, values[i]) + } + return b +} + +// WithDaysOfMonth adds the given value to the DaysOfMonth field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DaysOfMonth field. +func (b *TimeIntervalApplyConfiguration) WithDaysOfMonth(values ...*DayOfMonthRangeApplyConfiguration) *TimeIntervalApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDaysOfMonth") + } + b.DaysOfMonth = append(b.DaysOfMonth, *values[i]) + } + return b +} + +// WithMonths adds the given value to the Months field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Months field. +func (b *TimeIntervalApplyConfiguration) WithMonths(values ...monitoringv1alpha1.MonthRange) *TimeIntervalApplyConfiguration { + for i := range values { + b.Months = append(b.Months, values[i]) + } + return b +} + +// WithYears adds the given value to the Years field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Years field. +func (b *TimeIntervalApplyConfiguration) WithYears(values ...monitoringv1alpha1.YearRange) *TimeIntervalApplyConfiguration { + for i := range values { + b.Years = append(b.Years, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/timerange.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/timerange.go new file mode 100644 index 000000000..0fb7a155f --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/timerange.go @@ -0,0 +1,50 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" +) + +// TimeRangeApplyConfiguration represents an declarative configuration of the TimeRange type for use +// with apply. +type TimeRangeApplyConfiguration struct { + StartTime *v1alpha1.Time `json:"startTime,omitempty"` + EndTime *v1alpha1.Time `json:"endTime,omitempty"` +} + +// TimeRangeApplyConfiguration constructs an declarative configuration of the TimeRange type for use with +// apply. +func TimeRange() *TimeRangeApplyConfiguration { + return &TimeRangeApplyConfiguration{} +} + +// WithStartTime sets the StartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartTime field is set to the value of the last call. +func (b *TimeRangeApplyConfiguration) WithStartTime(value v1alpha1.Time) *TimeRangeApplyConfiguration { + b.StartTime = &value + return b +} + +// WithEndTime sets the EndTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EndTime field is set to the value of the last call. +func (b *TimeRangeApplyConfiguration) WithEndTime(value v1alpha1.Time) *TimeRangeApplyConfiguration { + b.EndTime = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/victoropsconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/victoropsconfig.go new file mode 100644 index 000000000..0007d8531 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/victoropsconfig.go @@ -0,0 +1,127 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// VictorOpsConfigApplyConfiguration represents an declarative configuration of the VictorOpsConfig type for use +// with apply. +type VictorOpsConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIKey *v1.SecretKeySelector `json:"apiKey,omitempty"` + APIURL *string `json:"apiUrl,omitempty"` + RoutingKey *string `json:"routingKey,omitempty"` + MessageType *string `json:"messageType,omitempty"` + EntityDisplayName *string `json:"entityDisplayName,omitempty"` + StateMessage *string `json:"stateMessage,omitempty"` + MonitoringTool *string `json:"monitoringTool,omitempty"` + CustomFields []KeyValueApplyConfiguration `json:"customFields,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// VictorOpsConfigApplyConfiguration constructs an declarative configuration of the VictorOpsConfig type for use with +// apply. +func VictorOpsConfig() *VictorOpsConfigApplyConfiguration { + return &VictorOpsConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithSendResolved(value bool) *VictorOpsConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIKey sets the APIKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIKey field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithAPIKey(value v1.SecretKeySelector) *VictorOpsConfigApplyConfiguration { + b.APIKey = &value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithAPIURL(value string) *VictorOpsConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithRoutingKey sets the RoutingKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutingKey field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithRoutingKey(value string) *VictorOpsConfigApplyConfiguration { + b.RoutingKey = &value + return b +} + +// WithMessageType sets the MessageType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MessageType field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithMessageType(value string) *VictorOpsConfigApplyConfiguration { + b.MessageType = &value + return b +} + +// WithEntityDisplayName sets the EntityDisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EntityDisplayName field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithEntityDisplayName(value string) *VictorOpsConfigApplyConfiguration { + b.EntityDisplayName = &value + return b +} + +// WithStateMessage sets the StateMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StateMessage field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithStateMessage(value string) *VictorOpsConfigApplyConfiguration { + b.StateMessage = &value + return b +} + +// WithMonitoringTool sets the MonitoringTool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MonitoringTool field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithMonitoringTool(value string) *VictorOpsConfigApplyConfiguration { + b.MonitoringTool = &value + return b +} + +// WithCustomFields adds the given value to the CustomFields field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CustomFields field. +func (b *VictorOpsConfigApplyConfiguration) WithCustomFields(values ...*KeyValueApplyConfiguration) *VictorOpsConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCustomFields") + } + b.CustomFields = append(b.CustomFields, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *VictorOpsConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/webhookconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/webhookconfig.go new file mode 100644 index 000000000..cc404e67f --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/webhookconfig.go @@ -0,0 +1,77 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// WebhookConfigApplyConfiguration represents an declarative configuration of the WebhookConfig type for use +// with apply. +type WebhookConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + URL *string `json:"url,omitempty"` + URLSecret *v1.SecretKeySelector `json:"urlSecret,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` + MaxAlerts *int32 `json:"maxAlerts,omitempty"` +} + +// WebhookConfigApplyConfiguration constructs an declarative configuration of the WebhookConfig type for use with +// apply. +func WebhookConfig() *WebhookConfigApplyConfiguration { + return &WebhookConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithSendResolved(value bool) *WebhookConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithURL(value string) *WebhookConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithURLSecret sets the URLSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URLSecret field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithURLSecret(value v1.SecretKeySelector) *WebhookConfigApplyConfiguration { + b.URLSecret = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *WebhookConfigApplyConfiguration { + b.HTTPConfig = value + return b +} + +// WithMaxAlerts sets the MaxAlerts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxAlerts field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithMaxAlerts(value int32) *WebhookConfigApplyConfiguration { + b.MaxAlerts = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1alpha1/wechatconfig.go b/pkg/client/applyconfiguration/monitoring/v1alpha1/wechatconfig.go new file mode 100644 index 000000000..40dc03175 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1alpha1/wechatconfig.go @@ -0,0 +1,131 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// WeChatConfigApplyConfiguration represents an declarative configuration of the WeChatConfig type for use +// with apply. +type WeChatConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APISecret *v1.SecretKeySelector `json:"apiSecret,omitempty"` + APIURL *string `json:"apiURL,omitempty"` + CorpID *string `json:"corpID,omitempty"` + AgentID *string `json:"agentID,omitempty"` + ToUser *string `json:"toUser,omitempty"` + ToParty *string `json:"toParty,omitempty"` + ToTag *string `json:"toTag,omitempty"` + Message *string `json:"message,omitempty"` + MessageType *string `json:"messageType,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// WeChatConfigApplyConfiguration constructs an declarative configuration of the WeChatConfig type for use with +// apply. +func WeChatConfig() *WeChatConfigApplyConfiguration { + return &WeChatConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithSendResolved(value bool) *WeChatConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPISecret sets the APISecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APISecret field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithAPISecret(value v1.SecretKeySelector) *WeChatConfigApplyConfiguration { + b.APISecret = &value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithAPIURL(value string) *WeChatConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithCorpID sets the CorpID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CorpID field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithCorpID(value string) *WeChatConfigApplyConfiguration { + b.CorpID = &value + return b +} + +// WithAgentID sets the AgentID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AgentID field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithAgentID(value string) *WeChatConfigApplyConfiguration { + b.AgentID = &value + return b +} + +// WithToUser sets the ToUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ToUser field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithToUser(value string) *WeChatConfigApplyConfiguration { + b.ToUser = &value + return b +} + +// WithToParty sets the ToParty field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ToParty field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithToParty(value string) *WeChatConfigApplyConfiguration { + b.ToParty = &value + return b +} + +// WithToTag sets the ToTag field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ToTag field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithToTag(value string) *WeChatConfigApplyConfiguration { + b.ToTag = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithMessage(value string) *WeChatConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithMessageType sets the MessageType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MessageType field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithMessageType(value string) *WeChatConfigApplyConfiguration { + b.MessageType = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *WeChatConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/alertmanagerconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/alertmanagerconfig.go new file mode 100644 index 000000000..c0c240326 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/alertmanagerconfig.go @@ -0,0 +1,208 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// AlertmanagerConfigApplyConfiguration represents an declarative configuration of the AlertmanagerConfig type for use +// with apply. +type AlertmanagerConfigApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *AlertmanagerConfigSpecApplyConfiguration `json:"spec,omitempty"` +} + +// AlertmanagerConfig constructs an declarative configuration of the AlertmanagerConfig type for use with +// apply. +func AlertmanagerConfig(name, namespace string) *AlertmanagerConfigApplyConfiguration { + b := &AlertmanagerConfigApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("AlertmanagerConfig") + b.WithAPIVersion("monitoring.coreos.com/v1beta1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithKind(value string) *AlertmanagerConfigApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithAPIVersion(value string) *AlertmanagerConfigApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithName(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithGenerateName(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithNamespace(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithUID(value types.UID) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithResourceVersion(value string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithGeneration(value int64) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *AlertmanagerConfigApplyConfiguration) WithLabels(entries map[string]string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *AlertmanagerConfigApplyConfiguration) WithAnnotations(entries map[string]string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *AlertmanagerConfigApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *AlertmanagerConfigApplyConfiguration) WithFinalizers(values ...string) *AlertmanagerConfigApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *AlertmanagerConfigApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *AlertmanagerConfigApplyConfiguration) WithSpec(value *AlertmanagerConfigSpecApplyConfiguration) *AlertmanagerConfigApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/alertmanagerconfigspec.go b/pkg/client/applyconfiguration/monitoring/v1beta1/alertmanagerconfigspec.go new file mode 100644 index 000000000..372a9ec13 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/alertmanagerconfigspec.go @@ -0,0 +1,79 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// AlertmanagerConfigSpecApplyConfiguration represents an declarative configuration of the AlertmanagerConfigSpec type for use +// with apply. +type AlertmanagerConfigSpecApplyConfiguration struct { + Route *RouteApplyConfiguration `json:"route,omitempty"` + Receivers []ReceiverApplyConfiguration `json:"receivers,omitempty"` + InhibitRules []InhibitRuleApplyConfiguration `json:"inhibitRules,omitempty"` + TimeIntervals []TimeIntervalApplyConfiguration `json:"timeIntervals,omitempty"` +} + +// AlertmanagerConfigSpecApplyConfiguration constructs an declarative configuration of the AlertmanagerConfigSpec type for use with +// apply. +func AlertmanagerConfigSpec() *AlertmanagerConfigSpecApplyConfiguration { + return &AlertmanagerConfigSpecApplyConfiguration{} +} + +// WithRoute sets the Route field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Route field is set to the value of the last call. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithRoute(value *RouteApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + b.Route = value + return b +} + +// WithReceivers adds the given value to the Receivers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Receivers field. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithReceivers(values ...*ReceiverApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReceivers") + } + b.Receivers = append(b.Receivers, *values[i]) + } + return b +} + +// WithInhibitRules adds the given value to the InhibitRules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InhibitRules field. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithInhibitRules(values ...*InhibitRuleApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithInhibitRules") + } + b.InhibitRules = append(b.InhibitRules, *values[i]) + } + return b +} + +// WithTimeIntervals adds the given value to the TimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TimeIntervals field. +func (b *AlertmanagerConfigSpecApplyConfiguration) WithTimeIntervals(values ...*TimeIntervalApplyConfiguration) *AlertmanagerConfigSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTimeIntervals") + } + b.TimeIntervals = append(b.TimeIntervals, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/dayofmonthrange.go b/pkg/client/applyconfiguration/monitoring/v1beta1/dayofmonthrange.go new file mode 100644 index 000000000..b622ba3a2 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/dayofmonthrange.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// DayOfMonthRangeApplyConfiguration represents an declarative configuration of the DayOfMonthRange type for use +// with apply. +type DayOfMonthRangeApplyConfiguration struct { + Start *int `json:"start,omitempty"` + End *int `json:"end,omitempty"` +} + +// DayOfMonthRangeApplyConfiguration constructs an declarative configuration of the DayOfMonthRange type for use with +// apply. +func DayOfMonthRange() *DayOfMonthRangeApplyConfiguration { + return &DayOfMonthRangeApplyConfiguration{} +} + +// WithStart sets the Start field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Start field is set to the value of the last call. +func (b *DayOfMonthRangeApplyConfiguration) WithStart(value int) *DayOfMonthRangeApplyConfiguration { + b.Start = &value + return b +} + +// WithEnd sets the End field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the End field is set to the value of the last call. +func (b *DayOfMonthRangeApplyConfiguration) WithEnd(value int) *DayOfMonthRangeApplyConfiguration { + b.End = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/emailconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/emailconfig.go new file mode 100644 index 000000000..8b5964bdd --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/emailconfig.go @@ -0,0 +1,163 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" +) + +// EmailConfigApplyConfiguration represents an declarative configuration of the EmailConfig type for use +// with apply. +type EmailConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + To *string `json:"to,omitempty"` + From *string `json:"from,omitempty"` + Hello *string `json:"hello,omitempty"` + Smarthost *string `json:"smarthost,omitempty"` + AuthUsername *string `json:"authUsername,omitempty"` + AuthPassword *SecretKeySelectorApplyConfiguration `json:"authPassword,omitempty"` + AuthSecret *SecretKeySelectorApplyConfiguration `json:"authSecret,omitempty"` + AuthIdentity *string `json:"authIdentity,omitempty"` + Headers []KeyValueApplyConfiguration `json:"headers,omitempty"` + HTML *string `json:"html,omitempty"` + Text *string `json:"text,omitempty"` + RequireTLS *bool `json:"requireTLS,omitempty"` + TLSConfig *v1.SafeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` +} + +// EmailConfigApplyConfiguration constructs an declarative configuration of the EmailConfig type for use with +// apply. +func EmailConfig() *EmailConfigApplyConfiguration { + return &EmailConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithSendResolved(value bool) *EmailConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithTo sets the To field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the To field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithTo(value string) *EmailConfigApplyConfiguration { + b.To = &value + return b +} + +// WithFrom sets the From field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the From field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithFrom(value string) *EmailConfigApplyConfiguration { + b.From = &value + return b +} + +// WithHello sets the Hello field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hello field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithHello(value string) *EmailConfigApplyConfiguration { + b.Hello = &value + return b +} + +// WithSmarthost sets the Smarthost field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Smarthost field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithSmarthost(value string) *EmailConfigApplyConfiguration { + b.Smarthost = &value + return b +} + +// WithAuthUsername sets the AuthUsername field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthUsername field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthUsername(value string) *EmailConfigApplyConfiguration { + b.AuthUsername = &value + return b +} + +// WithAuthPassword sets the AuthPassword field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthPassword field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthPassword(value *SecretKeySelectorApplyConfiguration) *EmailConfigApplyConfiguration { + b.AuthPassword = value + return b +} + +// WithAuthSecret sets the AuthSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthSecret field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthSecret(value *SecretKeySelectorApplyConfiguration) *EmailConfigApplyConfiguration { + b.AuthSecret = value + return b +} + +// WithAuthIdentity sets the AuthIdentity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AuthIdentity field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithAuthIdentity(value string) *EmailConfigApplyConfiguration { + b.AuthIdentity = &value + return b +} + +// WithHeaders adds the given value to the Headers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Headers field. +func (b *EmailConfigApplyConfiguration) WithHeaders(values ...*KeyValueApplyConfiguration) *EmailConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHeaders") + } + b.Headers = append(b.Headers, *values[i]) + } + return b +} + +// WithHTML sets the HTML field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTML field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithHTML(value string) *EmailConfigApplyConfiguration { + b.HTML = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithText(value string) *EmailConfigApplyConfiguration { + b.Text = &value + return b +} + +// WithRequireTLS sets the RequireTLS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequireTLS field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithRequireTLS(value bool) *EmailConfigApplyConfiguration { + b.RequireTLS = &value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *EmailConfigApplyConfiguration) WithTLSConfig(value *v1.SafeTLSConfigApplyConfiguration) *EmailConfigApplyConfiguration { + b.TLSConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/httpconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/httpconfig.go new file mode 100644 index 000000000..581a7a0dc --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/httpconfig.go @@ -0,0 +1,95 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" +) + +// HTTPConfigApplyConfiguration represents an declarative configuration of the HTTPConfig type for use +// with apply. +type HTTPConfigApplyConfiguration struct { + Authorization *v1.SafeAuthorizationApplyConfiguration `json:"authorization,omitempty"` + BasicAuth *v1.BasicAuthApplyConfiguration `json:"basicAuth,omitempty"` + OAuth2 *v1.OAuth2ApplyConfiguration `json:"oauth2,omitempty"` + BearerTokenSecret *SecretKeySelectorApplyConfiguration `json:"bearerTokenSecret,omitempty"` + TLSConfig *v1.SafeTLSConfigApplyConfiguration `json:"tlsConfig,omitempty"` + ProxyURL *string `json:"proxyURL,omitempty"` + FollowRedirects *bool `json:"followRedirects,omitempty"` +} + +// HTTPConfigApplyConfiguration constructs an declarative configuration of the HTTPConfig type for use with +// apply. +func HTTPConfig() *HTTPConfigApplyConfiguration { + return &HTTPConfigApplyConfiguration{} +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithAuthorization(value *v1.SafeAuthorizationApplyConfiguration) *HTTPConfigApplyConfiguration { + b.Authorization = value + return b +} + +// WithBasicAuth sets the BasicAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicAuth field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithBasicAuth(value *v1.BasicAuthApplyConfiguration) *HTTPConfigApplyConfiguration { + b.BasicAuth = value + return b +} + +// WithOAuth2 sets the OAuth2 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OAuth2 field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithOAuth2(value *v1.OAuth2ApplyConfiguration) *HTTPConfigApplyConfiguration { + b.OAuth2 = value + return b +} + +// WithBearerTokenSecret sets the BearerTokenSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerTokenSecret field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithBearerTokenSecret(value *SecretKeySelectorApplyConfiguration) *HTTPConfigApplyConfiguration { + b.BearerTokenSecret = value + return b +} + +// WithTLSConfig sets the TLSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSConfig field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithTLSConfig(value *v1.SafeTLSConfigApplyConfiguration) *HTTPConfigApplyConfiguration { + b.TLSConfig = value + return b +} + +// WithProxyURL sets the ProxyURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProxyURL field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithProxyURL(value string) *HTTPConfigApplyConfiguration { + b.ProxyURL = &value + return b +} + +// WithFollowRedirects sets the FollowRedirects field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FollowRedirects field is set to the value of the last call. +func (b *HTTPConfigApplyConfiguration) WithFollowRedirects(value bool) *HTTPConfigApplyConfiguration { + b.FollowRedirects = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/inhibitrule.go b/pkg/client/applyconfiguration/monitoring/v1beta1/inhibitrule.go new file mode 100644 index 000000000..a2c5b8041 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/inhibitrule.go @@ -0,0 +1,67 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// InhibitRuleApplyConfiguration represents an declarative configuration of the InhibitRule type for use +// with apply. +type InhibitRuleApplyConfiguration struct { + TargetMatch []MatcherApplyConfiguration `json:"targetMatch,omitempty"` + SourceMatch []MatcherApplyConfiguration `json:"sourceMatch,omitempty"` + Equal []string `json:"equal,omitempty"` +} + +// InhibitRuleApplyConfiguration constructs an declarative configuration of the InhibitRule type for use with +// apply. +func InhibitRule() *InhibitRuleApplyConfiguration { + return &InhibitRuleApplyConfiguration{} +} + +// WithTargetMatch adds the given value to the TargetMatch field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetMatch field. +func (b *InhibitRuleApplyConfiguration) WithTargetMatch(values ...*MatcherApplyConfiguration) *InhibitRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTargetMatch") + } + b.TargetMatch = append(b.TargetMatch, *values[i]) + } + return b +} + +// WithSourceMatch adds the given value to the SourceMatch field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SourceMatch field. +func (b *InhibitRuleApplyConfiguration) WithSourceMatch(values ...*MatcherApplyConfiguration) *InhibitRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSourceMatch") + } + b.SourceMatch = append(b.SourceMatch, *values[i]) + } + return b +} + +// WithEqual adds the given value to the Equal field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Equal field. +func (b *InhibitRuleApplyConfiguration) WithEqual(values ...string) *InhibitRuleApplyConfiguration { + for i := range values { + b.Equal = append(b.Equal, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/keyvalue.go b/pkg/client/applyconfiguration/monitoring/v1beta1/keyvalue.go new file mode 100644 index 000000000..036912f17 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/keyvalue.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// KeyValueApplyConfiguration represents an declarative configuration of the KeyValue type for use +// with apply. +type KeyValueApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` +} + +// KeyValueApplyConfiguration constructs an declarative configuration of the KeyValue type for use with +// apply. +func KeyValue() *KeyValueApplyConfiguration { + return &KeyValueApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *KeyValueApplyConfiguration) WithKey(value string) *KeyValueApplyConfiguration { + b.Key = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *KeyValueApplyConfiguration) WithValue(value string) *KeyValueApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/matcher.go b/pkg/client/applyconfiguration/monitoring/v1beta1/matcher.go new file mode 100644 index 000000000..9f6fb7fb8 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/matcher.go @@ -0,0 +1,59 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1" +) + +// MatcherApplyConfiguration represents an declarative configuration of the Matcher type for use +// with apply. +type MatcherApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + MatchType *v1beta1.MatchType `json:"matchType,omitempty"` +} + +// MatcherApplyConfiguration constructs an declarative configuration of the Matcher type for use with +// apply. +func Matcher() *MatcherApplyConfiguration { + return &MatcherApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MatcherApplyConfiguration) WithName(value string) *MatcherApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *MatcherApplyConfiguration) WithValue(value string) *MatcherApplyConfiguration { + b.Value = &value + return b +} + +// WithMatchType sets the MatchType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchType field is set to the value of the last call. +func (b *MatcherApplyConfiguration) WithMatchType(value v1beta1.MatchType) *MatcherApplyConfiguration { + b.MatchType = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/opsgenieconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/opsgenieconfig.go new file mode 100644 index 000000000..4a278d9f6 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/opsgenieconfig.go @@ -0,0 +1,164 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// OpsGenieConfigApplyConfiguration represents an declarative configuration of the OpsGenieConfig type for use +// with apply. +type OpsGenieConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIKey *SecretKeySelectorApplyConfiguration `json:"apiKey,omitempty"` + APIURL *string `json:"apiURL,omitempty"` + Message *string `json:"message,omitempty"` + Description *string `json:"description,omitempty"` + Source *string `json:"source,omitempty"` + Tags *string `json:"tags,omitempty"` + Note *string `json:"note,omitempty"` + Priority *string `json:"priority,omitempty"` + Details []KeyValueApplyConfiguration `json:"details,omitempty"` + Responders []OpsGenieConfigResponderApplyConfiguration `json:"responders,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` + Entity *string `json:"entity,omitempty"` + Actions *string `json:"actions,omitempty"` +} + +// OpsGenieConfigApplyConfiguration constructs an declarative configuration of the OpsGenieConfig type for use with +// apply. +func OpsGenieConfig() *OpsGenieConfigApplyConfiguration { + return &OpsGenieConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithSendResolved(value bool) *OpsGenieConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIKey sets the APIKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIKey field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithAPIKey(value *SecretKeySelectorApplyConfiguration) *OpsGenieConfigApplyConfiguration { + b.APIKey = value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithAPIURL(value string) *OpsGenieConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithMessage(value string) *OpsGenieConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithDescription(value string) *OpsGenieConfigApplyConfiguration { + b.Description = &value + return b +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithSource(value string) *OpsGenieConfigApplyConfiguration { + b.Source = &value + return b +} + +// WithTags sets the Tags field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Tags field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithTags(value string) *OpsGenieConfigApplyConfiguration { + b.Tags = &value + return b +} + +// WithNote sets the Note field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Note field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithNote(value string) *OpsGenieConfigApplyConfiguration { + b.Note = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithPriority(value string) *OpsGenieConfigApplyConfiguration { + b.Priority = &value + return b +} + +// WithDetails adds the given value to the Details field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Details field. +func (b *OpsGenieConfigApplyConfiguration) WithDetails(values ...*KeyValueApplyConfiguration) *OpsGenieConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDetails") + } + b.Details = append(b.Details, *values[i]) + } + return b +} + +// WithResponders adds the given value to the Responders field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Responders field. +func (b *OpsGenieConfigApplyConfiguration) WithResponders(values ...*OpsGenieConfigResponderApplyConfiguration) *OpsGenieConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResponders") + } + b.Responders = append(b.Responders, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *OpsGenieConfigApplyConfiguration { + b.HTTPConfig = value + return b +} + +// WithEntity sets the Entity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Entity field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithEntity(value string) *OpsGenieConfigApplyConfiguration { + b.Entity = &value + return b +} + +// WithActions sets the Actions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Actions field is set to the value of the last call. +func (b *OpsGenieConfigApplyConfiguration) WithActions(value string) *OpsGenieConfigApplyConfiguration { + b.Actions = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/opsgenieconfigresponder.go b/pkg/client/applyconfiguration/monitoring/v1beta1/opsgenieconfigresponder.go new file mode 100644 index 000000000..a790765fc --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/opsgenieconfigresponder.go @@ -0,0 +1,64 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// OpsGenieConfigResponderApplyConfiguration represents an declarative configuration of the OpsGenieConfigResponder type for use +// with apply. +type OpsGenieConfigResponderApplyConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Username *string `json:"username,omitempty"` + Type *string `json:"type,omitempty"` +} + +// OpsGenieConfigResponderApplyConfiguration constructs an declarative configuration of the OpsGenieConfigResponder type for use with +// apply. +func OpsGenieConfigResponder() *OpsGenieConfigResponderApplyConfiguration { + return &OpsGenieConfigResponderApplyConfiguration{} +} + +// WithID sets the ID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ID field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithID(value string) *OpsGenieConfigResponderApplyConfiguration { + b.ID = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithName(value string) *OpsGenieConfigResponderApplyConfiguration { + b.Name = &value + return b +} + +// WithUsername sets the Username field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Username field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithUsername(value string) *OpsGenieConfigResponderApplyConfiguration { + b.Username = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *OpsGenieConfigResponderApplyConfiguration) WithType(value string) *OpsGenieConfigResponderApplyConfiguration { + b.Type = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutyconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutyconfig.go new file mode 100644 index 000000000..c57196490 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutyconfig.go @@ -0,0 +1,178 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// PagerDutyConfigApplyConfiguration represents an declarative configuration of the PagerDutyConfig type for use +// with apply. +type PagerDutyConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + RoutingKey *SecretKeySelectorApplyConfiguration `json:"routingKey,omitempty"` + ServiceKey *SecretKeySelectorApplyConfiguration `json:"serviceKey,omitempty"` + URL *string `json:"url,omitempty"` + Client *string `json:"client,omitempty"` + ClientURL *string `json:"clientURL,omitempty"` + Description *string `json:"description,omitempty"` + Severity *string `json:"severity,omitempty"` + Class *string `json:"class,omitempty"` + Group *string `json:"group,omitempty"` + Component *string `json:"component,omitempty"` + Details []KeyValueApplyConfiguration `json:"details,omitempty"` + PagerDutyImageConfigs []PagerDutyImageConfigApplyConfiguration `json:"pagerDutyImageConfigs,omitempty"` + PagerDutyLinkConfigs []PagerDutyLinkConfigApplyConfiguration `json:"pagerDutyLinkConfigs,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// PagerDutyConfigApplyConfiguration constructs an declarative configuration of the PagerDutyConfig type for use with +// apply. +func PagerDutyConfig() *PagerDutyConfigApplyConfiguration { + return &PagerDutyConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithSendResolved(value bool) *PagerDutyConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithRoutingKey sets the RoutingKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutingKey field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithRoutingKey(value *SecretKeySelectorApplyConfiguration) *PagerDutyConfigApplyConfiguration { + b.RoutingKey = value + return b +} + +// WithServiceKey sets the ServiceKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceKey field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithServiceKey(value *SecretKeySelectorApplyConfiguration) *PagerDutyConfigApplyConfiguration { + b.ServiceKey = value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithURL(value string) *PagerDutyConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithClient sets the Client field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Client field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithClient(value string) *PagerDutyConfigApplyConfiguration { + b.Client = &value + return b +} + +// WithClientURL sets the ClientURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientURL field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithClientURL(value string) *PagerDutyConfigApplyConfiguration { + b.ClientURL = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithDescription(value string) *PagerDutyConfigApplyConfiguration { + b.Description = &value + return b +} + +// WithSeverity sets the Severity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Severity field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithSeverity(value string) *PagerDutyConfigApplyConfiguration { + b.Severity = &value + return b +} + +// WithClass sets the Class field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Class field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithClass(value string) *PagerDutyConfigApplyConfiguration { + b.Class = &value + return b +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithGroup(value string) *PagerDutyConfigApplyConfiguration { + b.Group = &value + return b +} + +// WithComponent sets the Component field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Component field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithComponent(value string) *PagerDutyConfigApplyConfiguration { + b.Component = &value + return b +} + +// WithDetails adds the given value to the Details field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Details field. +func (b *PagerDutyConfigApplyConfiguration) WithDetails(values ...*KeyValueApplyConfiguration) *PagerDutyConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDetails") + } + b.Details = append(b.Details, *values[i]) + } + return b +} + +// WithPagerDutyImageConfigs adds the given value to the PagerDutyImageConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PagerDutyImageConfigs field. +func (b *PagerDutyConfigApplyConfiguration) WithPagerDutyImageConfigs(values ...*PagerDutyImageConfigApplyConfiguration) *PagerDutyConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPagerDutyImageConfigs") + } + b.PagerDutyImageConfigs = append(b.PagerDutyImageConfigs, *values[i]) + } + return b +} + +// WithPagerDutyLinkConfigs adds the given value to the PagerDutyLinkConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PagerDutyLinkConfigs field. +func (b *PagerDutyConfigApplyConfiguration) WithPagerDutyLinkConfigs(values ...*PagerDutyLinkConfigApplyConfiguration) *PagerDutyConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPagerDutyLinkConfigs") + } + b.PagerDutyLinkConfigs = append(b.PagerDutyLinkConfigs, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *PagerDutyConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *PagerDutyConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutyimageconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutyimageconfig.go new file mode 100644 index 000000000..9dfdae58b --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutyimageconfig.go @@ -0,0 +1,55 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// PagerDutyImageConfigApplyConfiguration represents an declarative configuration of the PagerDutyImageConfig type for use +// with apply. +type PagerDutyImageConfigApplyConfiguration struct { + Src *string `json:"src,omitempty"` + Href *string `json:"href,omitempty"` + Alt *string `json:"alt,omitempty"` +} + +// PagerDutyImageConfigApplyConfiguration constructs an declarative configuration of the PagerDutyImageConfig type for use with +// apply. +func PagerDutyImageConfig() *PagerDutyImageConfigApplyConfiguration { + return &PagerDutyImageConfigApplyConfiguration{} +} + +// WithSrc sets the Src field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Src field is set to the value of the last call. +func (b *PagerDutyImageConfigApplyConfiguration) WithSrc(value string) *PagerDutyImageConfigApplyConfiguration { + b.Src = &value + return b +} + +// WithHref sets the Href field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Href field is set to the value of the last call. +func (b *PagerDutyImageConfigApplyConfiguration) WithHref(value string) *PagerDutyImageConfigApplyConfiguration { + b.Href = &value + return b +} + +// WithAlt sets the Alt field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Alt field is set to the value of the last call. +func (b *PagerDutyImageConfigApplyConfiguration) WithAlt(value string) *PagerDutyImageConfigApplyConfiguration { + b.Alt = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutylinkconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutylinkconfig.go new file mode 100644 index 000000000..25b77ccaa --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/pagerdutylinkconfig.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// PagerDutyLinkConfigApplyConfiguration represents an declarative configuration of the PagerDutyLinkConfig type for use +// with apply. +type PagerDutyLinkConfigApplyConfiguration struct { + Href *string `json:"href,omitempty"` + Text *string `json:"alt,omitempty"` +} + +// PagerDutyLinkConfigApplyConfiguration constructs an declarative configuration of the PagerDutyLinkConfig type for use with +// apply. +func PagerDutyLinkConfig() *PagerDutyLinkConfigApplyConfiguration { + return &PagerDutyLinkConfigApplyConfiguration{} +} + +// WithHref sets the Href field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Href field is set to the value of the last call. +func (b *PagerDutyLinkConfigApplyConfiguration) WithHref(value string) *PagerDutyLinkConfigApplyConfiguration { + b.Href = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *PagerDutyLinkConfigApplyConfiguration) WithText(value string) *PagerDutyLinkConfigApplyConfiguration { + b.Text = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/pushoverconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/pushoverconfig.go new file mode 100644 index 000000000..603e44c8f --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/pushoverconfig.go @@ -0,0 +1,145 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// PushoverConfigApplyConfiguration represents an declarative configuration of the PushoverConfig type for use +// with apply. +type PushoverConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + UserKey *SecretKeySelectorApplyConfiguration `json:"userKey,omitempty"` + Token *SecretKeySelectorApplyConfiguration `json:"token,omitempty"` + Title *string `json:"title,omitempty"` + Message *string `json:"message,omitempty"` + URL *string `json:"url,omitempty"` + URLTitle *string `json:"urlTitle,omitempty"` + Sound *string `json:"sound,omitempty"` + Priority *string `json:"priority,omitempty"` + Retry *string `json:"retry,omitempty"` + Expire *string `json:"expire,omitempty"` + HTML *bool `json:"html,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// PushoverConfigApplyConfiguration constructs an declarative configuration of the PushoverConfig type for use with +// apply. +func PushoverConfig() *PushoverConfigApplyConfiguration { + return &PushoverConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithSendResolved(value bool) *PushoverConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithUserKey sets the UserKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UserKey field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithUserKey(value *SecretKeySelectorApplyConfiguration) *PushoverConfigApplyConfiguration { + b.UserKey = value + return b +} + +// WithToken sets the Token field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Token field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithToken(value *SecretKeySelectorApplyConfiguration) *PushoverConfigApplyConfiguration { + b.Token = value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithTitle(value string) *PushoverConfigApplyConfiguration { + b.Title = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithMessage(value string) *PushoverConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithURL(value string) *PushoverConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithURLTitle sets the URLTitle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URLTitle field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithURLTitle(value string) *PushoverConfigApplyConfiguration { + b.URLTitle = &value + return b +} + +// WithSound sets the Sound field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sound field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithSound(value string) *PushoverConfigApplyConfiguration { + b.Sound = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithPriority(value string) *PushoverConfigApplyConfiguration { + b.Priority = &value + return b +} + +// WithRetry sets the Retry field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Retry field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithRetry(value string) *PushoverConfigApplyConfiguration { + b.Retry = &value + return b +} + +// WithExpire sets the Expire field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expire field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithExpire(value string) *PushoverConfigApplyConfiguration { + b.Expire = &value + return b +} + +// WithHTML sets the HTML field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTML field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithHTML(value bool) *PushoverConfigApplyConfiguration { + b.HTML = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *PushoverConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *PushoverConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/receiver.go b/pkg/client/applyconfiguration/monitoring/v1beta1/receiver.go new file mode 100644 index 000000000..09d47db99 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/receiver.go @@ -0,0 +1,177 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ReceiverApplyConfiguration represents an declarative configuration of the Receiver type for use +// with apply. +type ReceiverApplyConfiguration struct { + Name *string `json:"name,omitempty"` + OpsGenieConfigs []OpsGenieConfigApplyConfiguration `json:"opsgenieConfigs,omitempty"` + PagerDutyConfigs []PagerDutyConfigApplyConfiguration `json:"pagerdutyConfigs,omitempty"` + SlackConfigs []SlackConfigApplyConfiguration `json:"slackConfigs,omitempty"` + WebhookConfigs []WebhookConfigApplyConfiguration `json:"webhookConfigs,omitempty"` + WeChatConfigs []WeChatConfigApplyConfiguration `json:"wechatConfigs,omitempty"` + EmailConfigs []EmailConfigApplyConfiguration `json:"emailConfigs,omitempty"` + VictorOpsConfigs []VictorOpsConfigApplyConfiguration `json:"victoropsConfigs,omitempty"` + PushoverConfigs []PushoverConfigApplyConfiguration `json:"pushoverConfigs,omitempty"` + SNSConfigs []SNSConfigApplyConfiguration `json:"snsConfigs,omitempty"` + TelegramConfigs []TelegramConfigApplyConfiguration `json:"telegramConfigs,omitempty"` +} + +// ReceiverApplyConfiguration constructs an declarative configuration of the Receiver type for use with +// apply. +func Receiver() *ReceiverApplyConfiguration { + return &ReceiverApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ReceiverApplyConfiguration) WithName(value string) *ReceiverApplyConfiguration { + b.Name = &value + return b +} + +// WithOpsGenieConfigs adds the given value to the OpsGenieConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OpsGenieConfigs field. +func (b *ReceiverApplyConfiguration) WithOpsGenieConfigs(values ...*OpsGenieConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOpsGenieConfigs") + } + b.OpsGenieConfigs = append(b.OpsGenieConfigs, *values[i]) + } + return b +} + +// WithPagerDutyConfigs adds the given value to the PagerDutyConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PagerDutyConfigs field. +func (b *ReceiverApplyConfiguration) WithPagerDutyConfigs(values ...*PagerDutyConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPagerDutyConfigs") + } + b.PagerDutyConfigs = append(b.PagerDutyConfigs, *values[i]) + } + return b +} + +// WithSlackConfigs adds the given value to the SlackConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SlackConfigs field. +func (b *ReceiverApplyConfiguration) WithSlackConfigs(values ...*SlackConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSlackConfigs") + } + b.SlackConfigs = append(b.SlackConfigs, *values[i]) + } + return b +} + +// WithWebhookConfigs adds the given value to the WebhookConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the WebhookConfigs field. +func (b *ReceiverApplyConfiguration) WithWebhookConfigs(values ...*WebhookConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithWebhookConfigs") + } + b.WebhookConfigs = append(b.WebhookConfigs, *values[i]) + } + return b +} + +// WithWeChatConfigs adds the given value to the WeChatConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the WeChatConfigs field. +func (b *ReceiverApplyConfiguration) WithWeChatConfigs(values ...*WeChatConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithWeChatConfigs") + } + b.WeChatConfigs = append(b.WeChatConfigs, *values[i]) + } + return b +} + +// WithEmailConfigs adds the given value to the EmailConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EmailConfigs field. +func (b *ReceiverApplyConfiguration) WithEmailConfigs(values ...*EmailConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEmailConfigs") + } + b.EmailConfigs = append(b.EmailConfigs, *values[i]) + } + return b +} + +// WithVictorOpsConfigs adds the given value to the VictorOpsConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VictorOpsConfigs field. +func (b *ReceiverApplyConfiguration) WithVictorOpsConfigs(values ...*VictorOpsConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVictorOpsConfigs") + } + b.VictorOpsConfigs = append(b.VictorOpsConfigs, *values[i]) + } + return b +} + +// WithPushoverConfigs adds the given value to the PushoverConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PushoverConfigs field. +func (b *ReceiverApplyConfiguration) WithPushoverConfigs(values ...*PushoverConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPushoverConfigs") + } + b.PushoverConfigs = append(b.PushoverConfigs, *values[i]) + } + return b +} + +// WithSNSConfigs adds the given value to the SNSConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SNSConfigs field. +func (b *ReceiverApplyConfiguration) WithSNSConfigs(values ...*SNSConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSNSConfigs") + } + b.SNSConfigs = append(b.SNSConfigs, *values[i]) + } + return b +} + +// WithTelegramConfigs adds the given value to the TelegramConfigs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TelegramConfigs field. +func (b *ReceiverApplyConfiguration) WithTelegramConfigs(values ...*TelegramConfigApplyConfiguration) *ReceiverApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTelegramConfigs") + } + b.TelegramConfigs = append(b.TelegramConfigs, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/route.go b/pkg/client/applyconfiguration/monitoring/v1beta1/route.go new file mode 100644 index 000000000..659dddceb --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/route.go @@ -0,0 +1,135 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// RouteApplyConfiguration represents an declarative configuration of the Route type for use +// with apply. +type RouteApplyConfiguration struct { + Receiver *string `json:"receiver,omitempty"` + GroupBy []string `json:"groupBy,omitempty"` + GroupWait *string `json:"groupWait,omitempty"` + GroupInterval *string `json:"groupInterval,omitempty"` + RepeatInterval *string `json:"repeatInterval,omitempty"` + Matchers []MatcherApplyConfiguration `json:"matchers,omitempty"` + Continue *bool `json:"continue,omitempty"` + Routes []v1.JSON `json:"routes,omitempty"` + MuteTimeIntervals []string `json:"muteTimeIntervals,omitempty"` + ActiveTimeIntervals []string `json:"activeTimeIntervals,omitempty"` +} + +// RouteApplyConfiguration constructs an declarative configuration of the Route type for use with +// apply. +func Route() *RouteApplyConfiguration { + return &RouteApplyConfiguration{} +} + +// WithReceiver sets the Receiver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Receiver field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithReceiver(value string) *RouteApplyConfiguration { + b.Receiver = &value + return b +} + +// WithGroupBy adds the given value to the GroupBy field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the GroupBy field. +func (b *RouteApplyConfiguration) WithGroupBy(values ...string) *RouteApplyConfiguration { + for i := range values { + b.GroupBy = append(b.GroupBy, values[i]) + } + return b +} + +// WithGroupWait sets the GroupWait field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GroupWait field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithGroupWait(value string) *RouteApplyConfiguration { + b.GroupWait = &value + return b +} + +// WithGroupInterval sets the GroupInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GroupInterval field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithGroupInterval(value string) *RouteApplyConfiguration { + b.GroupInterval = &value + return b +} + +// WithRepeatInterval sets the RepeatInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RepeatInterval field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithRepeatInterval(value string) *RouteApplyConfiguration { + b.RepeatInterval = &value + return b +} + +// WithMatchers adds the given value to the Matchers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Matchers field. +func (b *RouteApplyConfiguration) WithMatchers(values ...*MatcherApplyConfiguration) *RouteApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchers") + } + b.Matchers = append(b.Matchers, *values[i]) + } + return b +} + +// WithContinue sets the Continue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Continue field is set to the value of the last call. +func (b *RouteApplyConfiguration) WithContinue(value bool) *RouteApplyConfiguration { + b.Continue = &value + return b +} + +// WithRoutes adds the given value to the Routes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Routes field. +func (b *RouteApplyConfiguration) WithRoutes(values ...v1.JSON) *RouteApplyConfiguration { + for i := range values { + b.Routes = append(b.Routes, values[i]) + } + return b +} + +// WithMuteTimeIntervals adds the given value to the MuteTimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MuteTimeIntervals field. +func (b *RouteApplyConfiguration) WithMuteTimeIntervals(values ...string) *RouteApplyConfiguration { + for i := range values { + b.MuteTimeIntervals = append(b.MuteTimeIntervals, values[i]) + } + return b +} + +// WithActiveTimeIntervals adds the given value to the ActiveTimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ActiveTimeIntervals field. +func (b *RouteApplyConfiguration) WithActiveTimeIntervals(values ...string) *RouteApplyConfiguration { + for i := range values { + b.ActiveTimeIntervals = append(b.ActiveTimeIntervals, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/secretkeyselector.go b/pkg/client/applyconfiguration/monitoring/v1beta1/secretkeyselector.go new file mode 100644 index 000000000..eceffc17f --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/secretkeyselector.go @@ -0,0 +1,46 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// SecretKeySelectorApplyConfiguration represents an declarative configuration of the SecretKeySelector type for use +// with apply. +type SecretKeySelectorApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Key *string `json:"key,omitempty"` +} + +// SecretKeySelectorApplyConfiguration constructs an declarative configuration of the SecretKeySelector type for use with +// apply. +func SecretKeySelector() *SecretKeySelectorApplyConfiguration { + return &SecretKeySelectorApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SecretKeySelectorApplyConfiguration) WithName(value string) *SecretKeySelectorApplyConfiguration { + b.Name = &value + return b +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *SecretKeySelectorApplyConfiguration) WithKey(value string) *SecretKeySelectorApplyConfiguration { + b.Key = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/slackaction.go b/pkg/client/applyconfiguration/monitoring/v1beta1/slackaction.go new file mode 100644 index 000000000..6515391f0 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/slackaction.go @@ -0,0 +1,91 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// SlackActionApplyConfiguration represents an declarative configuration of the SlackAction type for use +// with apply. +type SlackActionApplyConfiguration struct { + Type *string `json:"type,omitempty"` + Text *string `json:"text,omitempty"` + URL *string `json:"url,omitempty"` + Style *string `json:"style,omitempty"` + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + ConfirmField *SlackConfirmationFieldApplyConfiguration `json:"confirm,omitempty"` +} + +// SlackActionApplyConfiguration constructs an declarative configuration of the SlackAction type for use with +// apply. +func SlackAction() *SlackActionApplyConfiguration { + return &SlackActionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithType(value string) *SlackActionApplyConfiguration { + b.Type = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithText(value string) *SlackActionApplyConfiguration { + b.Text = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithURL(value string) *SlackActionApplyConfiguration { + b.URL = &value + return b +} + +// WithStyle sets the Style field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Style field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithStyle(value string) *SlackActionApplyConfiguration { + b.Style = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithName(value string) *SlackActionApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithValue(value string) *SlackActionApplyConfiguration { + b.Value = &value + return b +} + +// WithConfirmField sets the ConfirmField field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfirmField field is set to the value of the last call. +func (b *SlackActionApplyConfiguration) WithConfirmField(value *SlackConfirmationFieldApplyConfiguration) *SlackActionApplyConfiguration { + b.ConfirmField = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/slackconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/slackconfig.go new file mode 100644 index 000000000..bf4b03d90 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/slackconfig.go @@ -0,0 +1,238 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// SlackConfigApplyConfiguration represents an declarative configuration of the SlackConfig type for use +// with apply. +type SlackConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIURL *SecretKeySelectorApplyConfiguration `json:"apiURL,omitempty"` + Channel *string `json:"channel,omitempty"` + Username *string `json:"username,omitempty"` + Color *string `json:"color,omitempty"` + Title *string `json:"title,omitempty"` + TitleLink *string `json:"titleLink,omitempty"` + Pretext *string `json:"pretext,omitempty"` + Text *string `json:"text,omitempty"` + Fields []SlackFieldApplyConfiguration `json:"fields,omitempty"` + ShortFields *bool `json:"shortFields,omitempty"` + Footer *string `json:"footer,omitempty"` + Fallback *string `json:"fallback,omitempty"` + CallbackID *string `json:"callbackId,omitempty"` + IconEmoji *string `json:"iconEmoji,omitempty"` + IconURL *string `json:"iconURL,omitempty"` + ImageURL *string `json:"imageURL,omitempty"` + ThumbURL *string `json:"thumbURL,omitempty"` + LinkNames *bool `json:"linkNames,omitempty"` + MrkdwnIn []string `json:"mrkdwnIn,omitempty"` + Actions []SlackActionApplyConfiguration `json:"actions,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// SlackConfigApplyConfiguration constructs an declarative configuration of the SlackConfig type for use with +// apply. +func SlackConfig() *SlackConfigApplyConfiguration { + return &SlackConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithSendResolved(value bool) *SlackConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithAPIURL(value *SecretKeySelectorApplyConfiguration) *SlackConfigApplyConfiguration { + b.APIURL = value + return b +} + +// WithChannel sets the Channel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Channel field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithChannel(value string) *SlackConfigApplyConfiguration { + b.Channel = &value + return b +} + +// WithUsername sets the Username field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Username field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithUsername(value string) *SlackConfigApplyConfiguration { + b.Username = &value + return b +} + +// WithColor sets the Color field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Color field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithColor(value string) *SlackConfigApplyConfiguration { + b.Color = &value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithTitle(value string) *SlackConfigApplyConfiguration { + b.Title = &value + return b +} + +// WithTitleLink sets the TitleLink field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TitleLink field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithTitleLink(value string) *SlackConfigApplyConfiguration { + b.TitleLink = &value + return b +} + +// WithPretext sets the Pretext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pretext field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithPretext(value string) *SlackConfigApplyConfiguration { + b.Pretext = &value + return b +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithText(value string) *SlackConfigApplyConfiguration { + b.Text = &value + return b +} + +// WithFields adds the given value to the Fields field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Fields field. +func (b *SlackConfigApplyConfiguration) WithFields(values ...*SlackFieldApplyConfiguration) *SlackConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFields") + } + b.Fields = append(b.Fields, *values[i]) + } + return b +} + +// WithShortFields sets the ShortFields field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShortFields field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithShortFields(value bool) *SlackConfigApplyConfiguration { + b.ShortFields = &value + return b +} + +// WithFooter sets the Footer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Footer field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithFooter(value string) *SlackConfigApplyConfiguration { + b.Footer = &value + return b +} + +// WithFallback sets the Fallback field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Fallback field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithFallback(value string) *SlackConfigApplyConfiguration { + b.Fallback = &value + return b +} + +// WithCallbackID sets the CallbackID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CallbackID field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithCallbackID(value string) *SlackConfigApplyConfiguration { + b.CallbackID = &value + return b +} + +// WithIconEmoji sets the IconEmoji field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IconEmoji field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithIconEmoji(value string) *SlackConfigApplyConfiguration { + b.IconEmoji = &value + return b +} + +// WithIconURL sets the IconURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IconURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithIconURL(value string) *SlackConfigApplyConfiguration { + b.IconURL = &value + return b +} + +// WithImageURL sets the ImageURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImageURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithImageURL(value string) *SlackConfigApplyConfiguration { + b.ImageURL = &value + return b +} + +// WithThumbURL sets the ThumbURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ThumbURL field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithThumbURL(value string) *SlackConfigApplyConfiguration { + b.ThumbURL = &value + return b +} + +// WithLinkNames sets the LinkNames field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LinkNames field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithLinkNames(value bool) *SlackConfigApplyConfiguration { + b.LinkNames = &value + return b +} + +// WithMrkdwnIn adds the given value to the MrkdwnIn field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MrkdwnIn field. +func (b *SlackConfigApplyConfiguration) WithMrkdwnIn(values ...string) *SlackConfigApplyConfiguration { + for i := range values { + b.MrkdwnIn = append(b.MrkdwnIn, values[i]) + } + return b +} + +// WithActions adds the given value to the Actions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Actions field. +func (b *SlackConfigApplyConfiguration) WithActions(values ...*SlackActionApplyConfiguration) *SlackConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithActions") + } + b.Actions = append(b.Actions, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *SlackConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *SlackConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/slackconfirmationfield.go b/pkg/client/applyconfiguration/monitoring/v1beta1/slackconfirmationfield.go new file mode 100644 index 000000000..d9dbdafba --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/slackconfirmationfield.go @@ -0,0 +1,64 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// SlackConfirmationFieldApplyConfiguration represents an declarative configuration of the SlackConfirmationField type for use +// with apply. +type SlackConfirmationFieldApplyConfiguration struct { + Text *string `json:"text,omitempty"` + Title *string `json:"title,omitempty"` + OkText *string `json:"okText,omitempty"` + DismissText *string `json:"dismissText,omitempty"` +} + +// SlackConfirmationFieldApplyConfiguration constructs an declarative configuration of the SlackConfirmationField type for use with +// apply. +func SlackConfirmationField() *SlackConfirmationFieldApplyConfiguration { + return &SlackConfirmationFieldApplyConfiguration{} +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithText(value string) *SlackConfirmationFieldApplyConfiguration { + b.Text = &value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithTitle(value string) *SlackConfirmationFieldApplyConfiguration { + b.Title = &value + return b +} + +// WithOkText sets the OkText field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OkText field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithOkText(value string) *SlackConfirmationFieldApplyConfiguration { + b.OkText = &value + return b +} + +// WithDismissText sets the DismissText field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DismissText field is set to the value of the last call. +func (b *SlackConfirmationFieldApplyConfiguration) WithDismissText(value string) *SlackConfirmationFieldApplyConfiguration { + b.DismissText = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/slackfield.go b/pkg/client/applyconfiguration/monitoring/v1beta1/slackfield.go new file mode 100644 index 000000000..a32a9ad21 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/slackfield.go @@ -0,0 +1,55 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// SlackFieldApplyConfiguration represents an declarative configuration of the SlackField type for use +// with apply. +type SlackFieldApplyConfiguration struct { + Title *string `json:"title,omitempty"` + Value *string `json:"value,omitempty"` + Short *bool `json:"short,omitempty"` +} + +// SlackFieldApplyConfiguration constructs an declarative configuration of the SlackField type for use with +// apply. +func SlackField() *SlackFieldApplyConfiguration { + return &SlackFieldApplyConfiguration{} +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *SlackFieldApplyConfiguration) WithTitle(value string) *SlackFieldApplyConfiguration { + b.Title = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *SlackFieldApplyConfiguration) WithValue(value string) *SlackFieldApplyConfiguration { + b.Value = &value + return b +} + +// WithShort sets the Short field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Short field is set to the value of the last call. +func (b *SlackFieldApplyConfiguration) WithShort(value bool) *SlackFieldApplyConfiguration { + b.Short = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/snsconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/snsconfig.go new file mode 100644 index 000000000..71c7e5fe3 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/snsconfig.go @@ -0,0 +1,128 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" +) + +// SNSConfigApplyConfiguration represents an declarative configuration of the SNSConfig type for use +// with apply. +type SNSConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + ApiURL *string `json:"apiURL,omitempty"` + Sigv4 *v1.Sigv4ApplyConfiguration `json:"sigv4,omitempty"` + TopicARN *string `json:"topicARN,omitempty"` + Subject *string `json:"subject,omitempty"` + PhoneNumber *string `json:"phoneNumber,omitempty"` + TargetARN *string `json:"targetARN,omitempty"` + Message *string `json:"message,omitempty"` + Attributes map[string]string `json:"attributes,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// SNSConfigApplyConfiguration constructs an declarative configuration of the SNSConfig type for use with +// apply. +func SNSConfig() *SNSConfigApplyConfiguration { + return &SNSConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithSendResolved(value bool) *SNSConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithApiURL sets the ApiURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ApiURL field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithApiURL(value string) *SNSConfigApplyConfiguration { + b.ApiURL = &value + return b +} + +// WithSigv4 sets the Sigv4 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sigv4 field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithSigv4(value *v1.Sigv4ApplyConfiguration) *SNSConfigApplyConfiguration { + b.Sigv4 = value + return b +} + +// WithTopicARN sets the TopicARN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TopicARN field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithTopicARN(value string) *SNSConfigApplyConfiguration { + b.TopicARN = &value + return b +} + +// WithSubject sets the Subject field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subject field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithSubject(value string) *SNSConfigApplyConfiguration { + b.Subject = &value + return b +} + +// WithPhoneNumber sets the PhoneNumber field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PhoneNumber field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithPhoneNumber(value string) *SNSConfigApplyConfiguration { + b.PhoneNumber = &value + return b +} + +// WithTargetARN sets the TargetARN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetARN field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithTargetARN(value string) *SNSConfigApplyConfiguration { + b.TargetARN = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithMessage(value string) *SNSConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithAttributes puts the entries into the Attributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Attributes field, +// overwriting an existing map entries in Attributes field with the same key. +func (b *SNSConfigApplyConfiguration) WithAttributes(entries map[string]string) *SNSConfigApplyConfiguration { + if b.Attributes == nil && len(entries) > 0 { + b.Attributes = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Attributes[k] = v + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *SNSConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *SNSConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/telegramconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/telegramconfig.go new file mode 100644 index 000000000..84c647d44 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/telegramconfig.go @@ -0,0 +1,100 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// TelegramConfigApplyConfiguration represents an declarative configuration of the TelegramConfig type for use +// with apply. +type TelegramConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIURL *string `json:"apiURL,omitempty"` + BotToken *SecretKeySelectorApplyConfiguration `json:"botToken,omitempty"` + ChatID *int64 `json:"chatID,omitempty"` + Message *string `json:"message,omitempty"` + DisableNotifications *bool `json:"disableNotifications,omitempty"` + ParseMode *string `json:"parseMode,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// TelegramConfigApplyConfiguration constructs an declarative configuration of the TelegramConfig type for use with +// apply. +func TelegramConfig() *TelegramConfigApplyConfiguration { + return &TelegramConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithSendResolved(value bool) *TelegramConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithAPIURL(value string) *TelegramConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithBotToken sets the BotToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BotToken field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithBotToken(value *SecretKeySelectorApplyConfiguration) *TelegramConfigApplyConfiguration { + b.BotToken = value + return b +} + +// WithChatID sets the ChatID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ChatID field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithChatID(value int64) *TelegramConfigApplyConfiguration { + b.ChatID = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithMessage(value string) *TelegramConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithDisableNotifications sets the DisableNotifications field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisableNotifications field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithDisableNotifications(value bool) *TelegramConfigApplyConfiguration { + b.DisableNotifications = &value + return b +} + +// WithParseMode sets the ParseMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParseMode field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithParseMode(value string) *TelegramConfigApplyConfiguration { + b.ParseMode = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *TelegramConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *TelegramConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/timeinterval.go b/pkg/client/applyconfiguration/monitoring/v1beta1/timeinterval.go new file mode 100644 index 000000000..a87e4c98c --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/timeinterval.go @@ -0,0 +1,51 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// TimeIntervalApplyConfiguration represents an declarative configuration of the TimeInterval type for use +// with apply. +type TimeIntervalApplyConfiguration struct { + Name *string `json:"name,omitempty"` + TimeIntervals []TimePeriodApplyConfiguration `json:"timeIntervals,omitempty"` +} + +// TimeIntervalApplyConfiguration constructs an declarative configuration of the TimeInterval type for use with +// apply. +func TimeInterval() *TimeIntervalApplyConfiguration { + return &TimeIntervalApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TimeIntervalApplyConfiguration) WithName(value string) *TimeIntervalApplyConfiguration { + b.Name = &value + return b +} + +// WithTimeIntervals adds the given value to the TimeIntervals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TimeIntervals field. +func (b *TimeIntervalApplyConfiguration) WithTimeIntervals(values ...*TimePeriodApplyConfiguration) *TimeIntervalApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTimeIntervals") + } + b.TimeIntervals = append(b.TimeIntervals, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/timeperiod.go b/pkg/client/applyconfiguration/monitoring/v1beta1/timeperiod.go new file mode 100644 index 000000000..b373615af --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/timeperiod.go @@ -0,0 +1,93 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + monitoringv1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1" +) + +// TimePeriodApplyConfiguration represents an declarative configuration of the TimePeriod type for use +// with apply. +type TimePeriodApplyConfiguration struct { + Times []TimeRangeApplyConfiguration `json:"times,omitempty"` + Weekdays []monitoringv1beta1.WeekdayRange `json:"weekdays,omitempty"` + DaysOfMonth []DayOfMonthRangeApplyConfiguration `json:"daysOfMonth,omitempty"` + Months []monitoringv1beta1.MonthRange `json:"months,omitempty"` + Years []monitoringv1beta1.YearRange `json:"years,omitempty"` +} + +// TimePeriodApplyConfiguration constructs an declarative configuration of the TimePeriod type for use with +// apply. +func TimePeriod() *TimePeriodApplyConfiguration { + return &TimePeriodApplyConfiguration{} +} + +// WithTimes adds the given value to the Times field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Times field. +func (b *TimePeriodApplyConfiguration) WithTimes(values ...*TimeRangeApplyConfiguration) *TimePeriodApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTimes") + } + b.Times = append(b.Times, *values[i]) + } + return b +} + +// WithWeekdays adds the given value to the Weekdays field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Weekdays field. +func (b *TimePeriodApplyConfiguration) WithWeekdays(values ...monitoringv1beta1.WeekdayRange) *TimePeriodApplyConfiguration { + for i := range values { + b.Weekdays = append(b.Weekdays, values[i]) + } + return b +} + +// WithDaysOfMonth adds the given value to the DaysOfMonth field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DaysOfMonth field. +func (b *TimePeriodApplyConfiguration) WithDaysOfMonth(values ...*DayOfMonthRangeApplyConfiguration) *TimePeriodApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDaysOfMonth") + } + b.DaysOfMonth = append(b.DaysOfMonth, *values[i]) + } + return b +} + +// WithMonths adds the given value to the Months field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Months field. +func (b *TimePeriodApplyConfiguration) WithMonths(values ...monitoringv1beta1.MonthRange) *TimePeriodApplyConfiguration { + for i := range values { + b.Months = append(b.Months, values[i]) + } + return b +} + +// WithYears adds the given value to the Years field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Years field. +func (b *TimePeriodApplyConfiguration) WithYears(values ...monitoringv1beta1.YearRange) *TimePeriodApplyConfiguration { + for i := range values { + b.Years = append(b.Years, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/timerange.go b/pkg/client/applyconfiguration/monitoring/v1beta1/timerange.go new file mode 100644 index 000000000..1f453ea8a --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/timerange.go @@ -0,0 +1,50 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1" +) + +// TimeRangeApplyConfiguration represents an declarative configuration of the TimeRange type for use +// with apply. +type TimeRangeApplyConfiguration struct { + StartTime *v1beta1.Time `json:"startTime,omitempty"` + EndTime *v1beta1.Time `json:"endTime,omitempty"` +} + +// TimeRangeApplyConfiguration constructs an declarative configuration of the TimeRange type for use with +// apply. +func TimeRange() *TimeRangeApplyConfiguration { + return &TimeRangeApplyConfiguration{} +} + +// WithStartTime sets the StartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartTime field is set to the value of the last call. +func (b *TimeRangeApplyConfiguration) WithStartTime(value v1beta1.Time) *TimeRangeApplyConfiguration { + b.StartTime = &value + return b +} + +// WithEndTime sets the EndTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EndTime field is set to the value of the last call. +func (b *TimeRangeApplyConfiguration) WithEndTime(value v1beta1.Time) *TimeRangeApplyConfiguration { + b.EndTime = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/victoropsconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/victoropsconfig.go new file mode 100644 index 000000000..4eb8b18c1 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/victoropsconfig.go @@ -0,0 +1,123 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// VictorOpsConfigApplyConfiguration represents an declarative configuration of the VictorOpsConfig type for use +// with apply. +type VictorOpsConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APIKey *SecretKeySelectorApplyConfiguration `json:"apiKey,omitempty"` + APIURL *string `json:"apiUrl,omitempty"` + RoutingKey *string `json:"routingKey,omitempty"` + MessageType *string `json:"messageType,omitempty"` + EntityDisplayName *string `json:"entityDisplayName,omitempty"` + StateMessage *string `json:"stateMessage,omitempty"` + MonitoringTool *string `json:"monitoringTool,omitempty"` + CustomFields []KeyValueApplyConfiguration `json:"customFields,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// VictorOpsConfigApplyConfiguration constructs an declarative configuration of the VictorOpsConfig type for use with +// apply. +func VictorOpsConfig() *VictorOpsConfigApplyConfiguration { + return &VictorOpsConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithSendResolved(value bool) *VictorOpsConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPIKey sets the APIKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIKey field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithAPIKey(value *SecretKeySelectorApplyConfiguration) *VictorOpsConfigApplyConfiguration { + b.APIKey = value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithAPIURL(value string) *VictorOpsConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithRoutingKey sets the RoutingKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RoutingKey field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithRoutingKey(value string) *VictorOpsConfigApplyConfiguration { + b.RoutingKey = &value + return b +} + +// WithMessageType sets the MessageType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MessageType field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithMessageType(value string) *VictorOpsConfigApplyConfiguration { + b.MessageType = &value + return b +} + +// WithEntityDisplayName sets the EntityDisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EntityDisplayName field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithEntityDisplayName(value string) *VictorOpsConfigApplyConfiguration { + b.EntityDisplayName = &value + return b +} + +// WithStateMessage sets the StateMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StateMessage field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithStateMessage(value string) *VictorOpsConfigApplyConfiguration { + b.StateMessage = &value + return b +} + +// WithMonitoringTool sets the MonitoringTool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MonitoringTool field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithMonitoringTool(value string) *VictorOpsConfigApplyConfiguration { + b.MonitoringTool = &value + return b +} + +// WithCustomFields adds the given value to the CustomFields field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CustomFields field. +func (b *VictorOpsConfigApplyConfiguration) WithCustomFields(values ...*KeyValueApplyConfiguration) *VictorOpsConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCustomFields") + } + b.CustomFields = append(b.CustomFields, *values[i]) + } + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *VictorOpsConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *VictorOpsConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/webhookconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/webhookconfig.go new file mode 100644 index 000000000..d87935342 --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/webhookconfig.go @@ -0,0 +1,73 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// WebhookConfigApplyConfiguration represents an declarative configuration of the WebhookConfig type for use +// with apply. +type WebhookConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + URL *string `json:"url,omitempty"` + URLSecret *SecretKeySelectorApplyConfiguration `json:"urlSecret,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` + MaxAlerts *int32 `json:"maxAlerts,omitempty"` +} + +// WebhookConfigApplyConfiguration constructs an declarative configuration of the WebhookConfig type for use with +// apply. +func WebhookConfig() *WebhookConfigApplyConfiguration { + return &WebhookConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithSendResolved(value bool) *WebhookConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithURL(value string) *WebhookConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithURLSecret sets the URLSecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URLSecret field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithURLSecret(value *SecretKeySelectorApplyConfiguration) *WebhookConfigApplyConfiguration { + b.URLSecret = value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *WebhookConfigApplyConfiguration { + b.HTTPConfig = value + return b +} + +// WithMaxAlerts sets the MaxAlerts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxAlerts field is set to the value of the last call. +func (b *WebhookConfigApplyConfiguration) WithMaxAlerts(value int32) *WebhookConfigApplyConfiguration { + b.MaxAlerts = &value + return b +} diff --git a/pkg/client/applyconfiguration/monitoring/v1beta1/wechatconfig.go b/pkg/client/applyconfiguration/monitoring/v1beta1/wechatconfig.go new file mode 100644 index 000000000..5eaccca2b --- /dev/null +++ b/pkg/client/applyconfiguration/monitoring/v1beta1/wechatconfig.go @@ -0,0 +1,127 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// WeChatConfigApplyConfiguration represents an declarative configuration of the WeChatConfig type for use +// with apply. +type WeChatConfigApplyConfiguration struct { + SendResolved *bool `json:"sendResolved,omitempty"` + APISecret *SecretKeySelectorApplyConfiguration `json:"apiSecret,omitempty"` + APIURL *string `json:"apiURL,omitempty"` + CorpID *string `json:"corpID,omitempty"` + AgentID *string `json:"agentID,omitempty"` + ToUser *string `json:"toUser,omitempty"` + ToParty *string `json:"toParty,omitempty"` + ToTag *string `json:"toTag,omitempty"` + Message *string `json:"message,omitempty"` + MessageType *string `json:"messageType,omitempty"` + HTTPConfig *HTTPConfigApplyConfiguration `json:"httpConfig,omitempty"` +} + +// WeChatConfigApplyConfiguration constructs an declarative configuration of the WeChatConfig type for use with +// apply. +func WeChatConfig() *WeChatConfigApplyConfiguration { + return &WeChatConfigApplyConfiguration{} +} + +// WithSendResolved sets the SendResolved field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SendResolved field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithSendResolved(value bool) *WeChatConfigApplyConfiguration { + b.SendResolved = &value + return b +} + +// WithAPISecret sets the APISecret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APISecret field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithAPISecret(value *SecretKeySelectorApplyConfiguration) *WeChatConfigApplyConfiguration { + b.APISecret = value + return b +} + +// WithAPIURL sets the APIURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIURL field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithAPIURL(value string) *WeChatConfigApplyConfiguration { + b.APIURL = &value + return b +} + +// WithCorpID sets the CorpID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CorpID field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithCorpID(value string) *WeChatConfigApplyConfiguration { + b.CorpID = &value + return b +} + +// WithAgentID sets the AgentID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AgentID field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithAgentID(value string) *WeChatConfigApplyConfiguration { + b.AgentID = &value + return b +} + +// WithToUser sets the ToUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ToUser field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithToUser(value string) *WeChatConfigApplyConfiguration { + b.ToUser = &value + return b +} + +// WithToParty sets the ToParty field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ToParty field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithToParty(value string) *WeChatConfigApplyConfiguration { + b.ToParty = &value + return b +} + +// WithToTag sets the ToTag field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ToTag field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithToTag(value string) *WeChatConfigApplyConfiguration { + b.ToTag = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithMessage(value string) *WeChatConfigApplyConfiguration { + b.Message = &value + return b +} + +// WithMessageType sets the MessageType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MessageType field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithMessageType(value string) *WeChatConfigApplyConfiguration { + b.MessageType = &value + return b +} + +// WithHTTPConfig sets the HTTPConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPConfig field is set to the value of the last call. +func (b *WeChatConfigApplyConfiguration) WithHTTPConfig(value *HTTPConfigApplyConfiguration) *WeChatConfigApplyConfiguration { + b.HTTPConfig = value + return b +} diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go new file mode 100644 index 000000000..f05597a07 --- /dev/null +++ b/pkg/client/applyconfiguration/utils.go @@ -0,0 +1,299 @@ +// Copyright The prometheus-operator Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfiguration + +import ( + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" + v1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" + monitoringv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1alpha1" + monitoringv1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1beta1" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=monitoring.coreos.com, Version=v1 + case v1.SchemeGroupVersion.WithKind("AlertingSpec"): + return &monitoringv1.AlertingSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Alertmanager"): + return &monitoringv1.AlertmanagerApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AlertmanagerConfigMatcherStrategy"): + return &monitoringv1.AlertmanagerConfigMatcherStrategyApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AlertmanagerConfiguration"): + return &monitoringv1.AlertmanagerConfigurationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AlertmanagerEndpoints"): + return &monitoringv1.AlertmanagerEndpointsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AlertmanagerGlobalConfig"): + return &monitoringv1.AlertmanagerGlobalConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AlertmanagerSpec"): + return &monitoringv1.AlertmanagerSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AlertmanagerStatus"): + return &monitoringv1.AlertmanagerStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AlertmanagerWebSpec"): + return &monitoringv1.AlertmanagerWebSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("APIServerConfig"): + return &monitoringv1.APIServerConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ArbitraryFSAccessThroughSMsConfig"): + return &monitoringv1.ArbitraryFSAccessThroughSMsConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Argument"): + return &monitoringv1.ArgumentApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AttachMetadata"): + return &monitoringv1.AttachMetadataApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Authorization"): + return &monitoringv1.AuthorizationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("BasicAuth"): + return &monitoringv1.BasicAuthApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CommonPrometheusFields"): + return &monitoringv1.CommonPrometheusFieldsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("EmbeddedObjectMetadata"): + return &monitoringv1.EmbeddedObjectMetadataApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("EmbeddedPersistentVolumeClaim"): + return &monitoringv1.EmbeddedPersistentVolumeClaimApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Endpoint"): + return &monitoringv1.EndpointApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Exemplars"): + return &monitoringv1.ExemplarsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HostAlias"): + return &monitoringv1.HostAliasApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPConfig"): + return &monitoringv1.HTTPConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MetadataConfig"): + return &monitoringv1.MetadataConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("NamespaceSelector"): + return &monitoringv1.NamespaceSelectorApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("OAuth2"): + return &monitoringv1.OAuth2ApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ObjectReference"): + return &monitoringv1.ObjectReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PodMetricsEndpoint"): + return &monitoringv1.PodMetricsEndpointApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PodMetricsEndpointTLSConfig"): + return &monitoringv1.PodMetricsEndpointTLSConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PodMonitor"): + return &monitoringv1.PodMonitorApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PodMonitorSpec"): + return &monitoringv1.PodMonitorSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Probe"): + return &monitoringv1.ProbeApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ProberSpec"): + return &monitoringv1.ProberSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ProbeSpec"): + return &monitoringv1.ProbeSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ProbeTargetIngress"): + return &monitoringv1.ProbeTargetIngressApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ProbeTargets"): + return &monitoringv1.ProbeTargetsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ProbeTargetStaticConfig"): + return &monitoringv1.ProbeTargetStaticConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ProbeTLSConfig"): + return &monitoringv1.ProbeTLSConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Prometheus"): + return &monitoringv1.PrometheusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PrometheusCondition"): + return &monitoringv1.PrometheusConditionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PrometheusRule"): + return &monitoringv1.PrometheusRuleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PrometheusRuleExcludeConfig"): + return &monitoringv1.PrometheusRuleExcludeConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PrometheusRuleSpec"): + return &monitoringv1.PrometheusRuleSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PrometheusSpec"): + return &monitoringv1.PrometheusSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PrometheusStatus"): + return &monitoringv1.PrometheusStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PrometheusWebSpec"): + return &monitoringv1.PrometheusWebSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("QuerySpec"): + return &monitoringv1.QuerySpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("QueueConfig"): + return &monitoringv1.QueueConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RelabelConfig"): + return &monitoringv1.RelabelConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RemoteReadSpec"): + return &monitoringv1.RemoteReadSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RemoteWriteSpec"): + return &monitoringv1.RemoteWriteSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Rule"): + return &monitoringv1.RuleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RuleGroup"): + return &monitoringv1.RuleGroupApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Rules"): + return &monitoringv1.RulesApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RulesAlert"): + return &monitoringv1.RulesAlertApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SafeAuthorization"): + return &monitoringv1.SafeAuthorizationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SafeTLSConfig"): + return &monitoringv1.SafeTLSConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SecretOrConfigMap"): + return &monitoringv1.SecretOrConfigMapApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ServiceMonitor"): + return &monitoringv1.ServiceMonitorApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ServiceMonitorSpec"): + return &monitoringv1.ServiceMonitorSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ShardStatus"): + return &monitoringv1.ShardStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Sigv4"): + return &monitoringv1.Sigv4ApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("StorageSpec"): + return &monitoringv1.StorageSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ThanosRuler"): + return &monitoringv1.ThanosRulerApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ThanosRulerSpec"): + return &monitoringv1.ThanosRulerSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ThanosRulerStatus"): + return &monitoringv1.ThanosRulerStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ThanosSpec"): + return &monitoringv1.ThanosSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("TLSConfig"): + return &monitoringv1.TLSConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("TSDBSpec"): + return &monitoringv1.TSDBSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("WebConfigFileFields"): + return &monitoringv1.WebConfigFileFieldsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("WebHTTPConfig"): + return &monitoringv1.WebHTTPConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("WebHTTPHeaders"): + return &monitoringv1.WebHTTPHeadersApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("WebTLSConfig"): + return &monitoringv1.WebTLSConfigApplyConfiguration{} + + // Group=monitoring.coreos.com, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithKind("AlertmanagerConfig"): + return &monitoringv1alpha1.AlertmanagerConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("AlertmanagerConfigSpec"): + return &monitoringv1alpha1.AlertmanagerConfigSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("DayOfMonthRange"): + return &monitoringv1alpha1.DayOfMonthRangeApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EmailConfig"): + return &monitoringv1alpha1.EmailConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("HTTPConfig"): + return &monitoringv1alpha1.HTTPConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("InhibitRule"): + return &monitoringv1alpha1.InhibitRuleApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("KeyValue"): + return &monitoringv1alpha1.KeyValueApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Matcher"): + return &monitoringv1alpha1.MatcherApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("MuteTimeInterval"): + return &monitoringv1alpha1.MuteTimeIntervalApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("OpsGenieConfig"): + return &monitoringv1alpha1.OpsGenieConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("OpsGenieConfigResponder"): + return &monitoringv1alpha1.OpsGenieConfigResponderApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("PagerDutyConfig"): + return &monitoringv1alpha1.PagerDutyConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("PagerDutyImageConfig"): + return &monitoringv1alpha1.PagerDutyImageConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("PagerDutyLinkConfig"): + return &monitoringv1alpha1.PagerDutyLinkConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("PushoverConfig"): + return &monitoringv1alpha1.PushoverConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Receiver"): + return &monitoringv1alpha1.ReceiverApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Route"): + return &monitoringv1alpha1.RouteApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("SlackAction"): + return &monitoringv1alpha1.SlackActionApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("SlackConfig"): + return &monitoringv1alpha1.SlackConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("SlackConfirmationField"): + return &monitoringv1alpha1.SlackConfirmationFieldApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("SlackField"): + return &monitoringv1alpha1.SlackFieldApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("SNSConfig"): + return &monitoringv1alpha1.SNSConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("TelegramConfig"): + return &monitoringv1alpha1.TelegramConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("TimeInterval"): + return &monitoringv1alpha1.TimeIntervalApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("TimeRange"): + return &monitoringv1alpha1.TimeRangeApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("VictorOpsConfig"): + return &monitoringv1alpha1.VictorOpsConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("WebhookConfig"): + return &monitoringv1alpha1.WebhookConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("WeChatConfig"): + return &monitoringv1alpha1.WeChatConfigApplyConfiguration{} + + // Group=monitoring.coreos.com, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithKind("AlertmanagerConfig"): + return &monitoringv1beta1.AlertmanagerConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("AlertmanagerConfigSpec"): + return &monitoringv1beta1.AlertmanagerConfigSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("DayOfMonthRange"): + return &monitoringv1beta1.DayOfMonthRangeApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("EmailConfig"): + return &monitoringv1beta1.EmailConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("HTTPConfig"): + return &monitoringv1beta1.HTTPConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("InhibitRule"): + return &monitoringv1beta1.InhibitRuleApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("KeyValue"): + return &monitoringv1beta1.KeyValueApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("Matcher"): + return &monitoringv1beta1.MatcherApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("OpsGenieConfig"): + return &monitoringv1beta1.OpsGenieConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("OpsGenieConfigResponder"): + return &monitoringv1beta1.OpsGenieConfigResponderApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("PagerDutyConfig"): + return &monitoringv1beta1.PagerDutyConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("PagerDutyImageConfig"): + return &monitoringv1beta1.PagerDutyImageConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("PagerDutyLinkConfig"): + return &monitoringv1beta1.PagerDutyLinkConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("PushoverConfig"): + return &monitoringv1beta1.PushoverConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("Receiver"): + return &monitoringv1beta1.ReceiverApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("Route"): + return &monitoringv1beta1.RouteApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("SecretKeySelector"): + return &monitoringv1beta1.SecretKeySelectorApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("SlackAction"): + return &monitoringv1beta1.SlackActionApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("SlackConfig"): + return &monitoringv1beta1.SlackConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("SlackConfirmationField"): + return &monitoringv1beta1.SlackConfirmationFieldApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("SlackField"): + return &monitoringv1beta1.SlackFieldApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("SNSConfig"): + return &monitoringv1beta1.SNSConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("TelegramConfig"): + return &monitoringv1beta1.TelegramConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("TimeInterval"): + return &monitoringv1beta1.TimeIntervalApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("TimePeriod"): + return &monitoringv1beta1.TimePeriodApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("TimeRange"): + return &monitoringv1beta1.TimeRangeApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("VictorOpsConfig"): + return &monitoringv1beta1.VictorOpsConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("WebhookConfig"): + return &monitoringv1beta1.WebhookConfigApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("WeChatConfig"): + return &monitoringv1beta1.WeChatConfigApplyConfiguration{} + + } + return nil +} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 0af137740..e5af80e2d 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -45,6 +45,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -105,20 +110,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -165,11 +189,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Monitoring() monitoring.Interface } diff --git a/pkg/client/versioned/clientset.go b/pkg/client/versioned/clientset.go index f358005c4..ef08b5025 100644 --- a/pkg/client/versioned/clientset.go +++ b/pkg/client/versioned/clientset.go @@ -35,8 +35,7 @@ type Interface interface { MonitoringV1beta1() monitoringv1beta1.MonitoringV1beta1Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient monitoringV1 *monitoringv1.MonitoringV1Client diff --git a/pkg/client/versioned/typed/monitoring/v1/alertmanager.go b/pkg/client/versioned/typed/monitoring/v1/alertmanager.go index 3ccfdeebb..919b188f2 100644 --- a/pkg/client/versioned/typed/monitoring/v1/alertmanager.go +++ b/pkg/client/versioned/typed/monitoring/v1/alertmanager.go @@ -18,9 +18,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -45,6 +48,8 @@ type AlertmanagerInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.AlertmanagerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Alertmanager, err error) + Apply(ctx context.Context, alertmanager *monitoringv1.AlertmanagerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Alertmanager, err error) + ApplyStatus(ctx context.Context, alertmanager *monitoringv1.AlertmanagerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Alertmanager, err error) AlertmanagerExpansion } @@ -191,3 +196,59 @@ func (c *alertmanagers) Patch(ctx context.Context, name string, pt types.PatchTy Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied alertmanager. +func (c *alertmanagers) Apply(ctx context.Context, alertmanager *monitoringv1.AlertmanagerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Alertmanager, err error) { + if alertmanager == nil { + return nil, fmt.Errorf("alertmanager provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(alertmanager) + if err != nil { + return nil, err + } + name := alertmanager.Name + if name == nil { + return nil, fmt.Errorf("alertmanager.Name must be provided to Apply") + } + result = &v1.Alertmanager{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("alertmanagers"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *alertmanagers) ApplyStatus(ctx context.Context, alertmanager *monitoringv1.AlertmanagerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Alertmanager, err error) { + if alertmanager == nil { + return nil, fmt.Errorf("alertmanager provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(alertmanager) + if err != nil { + return nil, err + } + + name := alertmanager.Name + if name == nil { + return nil, fmt.Errorf("alertmanager.Name must be provided to Apply") + } + + result = &v1.Alertmanager{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("alertmanagers"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1/fake/fake_alertmanager.go b/pkg/client/versioned/typed/monitoring/v1/fake/fake_alertmanager.go index 08bb80767..e94e8b678 100644 --- a/pkg/client/versioned/typed/monitoring/v1/fake/fake_alertmanager.go +++ b/pkg/client/versioned/typed/monitoring/v1/fake/fake_alertmanager.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + applyconfigurationmonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -138,3 +141,48 @@ func (c *FakeAlertmanagers) Patch(ctx context.Context, name string, pt types.Pat } return obj.(*monitoringv1.Alertmanager), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied alertmanager. +func (c *FakeAlertmanagers) Apply(ctx context.Context, alertmanager *applyconfigurationmonitoringv1.AlertmanagerApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.Alertmanager, err error) { + if alertmanager == nil { + return nil, fmt.Errorf("alertmanager provided to Apply must not be nil") + } + data, err := json.Marshal(alertmanager) + if err != nil { + return nil, err + } + name := alertmanager.Name + if name == nil { + return nil, fmt.Errorf("alertmanager.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(alertmanagersResource, c.ns, *name, types.ApplyPatchType, data), &monitoringv1.Alertmanager{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Alertmanager), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeAlertmanagers) ApplyStatus(ctx context.Context, alertmanager *applyconfigurationmonitoringv1.AlertmanagerApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.Alertmanager, err error) { + if alertmanager == nil { + return nil, fmt.Errorf("alertmanager provided to Apply must not be nil") + } + data, err := json.Marshal(alertmanager) + if err != nil { + return nil, err + } + name := alertmanager.Name + if name == nil { + return nil, fmt.Errorf("alertmanager.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(alertmanagersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &monitoringv1.Alertmanager{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Alertmanager), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1/fake/fake_podmonitor.go b/pkg/client/versioned/typed/monitoring/v1/fake/fake_podmonitor.go index 504c0a0a6..c93cc80f0 100644 --- a/pkg/client/versioned/typed/monitoring/v1/fake/fake_podmonitor.go +++ b/pkg/client/versioned/typed/monitoring/v1/fake/fake_podmonitor.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + applyconfigurationmonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -126,3 +129,25 @@ func (c *FakePodMonitors) Patch(ctx context.Context, name string, pt types.Patch } return obj.(*monitoringv1.PodMonitor), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied podMonitor. +func (c *FakePodMonitors) Apply(ctx context.Context, podMonitor *applyconfigurationmonitoringv1.PodMonitorApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.PodMonitor, err error) { + if podMonitor == nil { + return nil, fmt.Errorf("podMonitor provided to Apply must not be nil") + } + data, err := json.Marshal(podMonitor) + if err != nil { + return nil, err + } + name := podMonitor.Name + if name == nil { + return nil, fmt.Errorf("podMonitor.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(podmonitorsResource, c.ns, *name, types.ApplyPatchType, data), &monitoringv1.PodMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PodMonitor), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1/fake/fake_probe.go b/pkg/client/versioned/typed/monitoring/v1/fake/fake_probe.go index be869cfcc..570a73743 100644 --- a/pkg/client/versioned/typed/monitoring/v1/fake/fake_probe.go +++ b/pkg/client/versioned/typed/monitoring/v1/fake/fake_probe.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + applyconfigurationmonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -126,3 +129,25 @@ func (c *FakeProbes) Patch(ctx context.Context, name string, pt types.PatchType, } return obj.(*monitoringv1.Probe), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied probe. +func (c *FakeProbes) Apply(ctx context.Context, probe *applyconfigurationmonitoringv1.ProbeApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.Probe, err error) { + if probe == nil { + return nil, fmt.Errorf("probe provided to Apply must not be nil") + } + data, err := json.Marshal(probe) + if err != nil { + return nil, err + } + name := probe.Name + if name == nil { + return nil, fmt.Errorf("probe.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(probesResource, c.ns, *name, types.ApplyPatchType, data), &monitoringv1.Probe{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Probe), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheus.go b/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheus.go index ac68c1afc..22dfcf417 100644 --- a/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheus.go +++ b/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheus.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + applyconfigurationmonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -138,3 +141,48 @@ func (c *FakePrometheuses) Patch(ctx context.Context, name string, pt types.Patc } return obj.(*monitoringv1.Prometheus), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied prometheus. +func (c *FakePrometheuses) Apply(ctx context.Context, prometheus *applyconfigurationmonitoringv1.PrometheusApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.Prometheus, err error) { + if prometheus == nil { + return nil, fmt.Errorf("prometheus provided to Apply must not be nil") + } + data, err := json.Marshal(prometheus) + if err != nil { + return nil, err + } + name := prometheus.Name + if name == nil { + return nil, fmt.Errorf("prometheus.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(prometheusesResource, c.ns, *name, types.ApplyPatchType, data), &monitoringv1.Prometheus{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Prometheus), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakePrometheuses) ApplyStatus(ctx context.Context, prometheus *applyconfigurationmonitoringv1.PrometheusApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.Prometheus, err error) { + if prometheus == nil { + return nil, fmt.Errorf("prometheus provided to Apply must not be nil") + } + data, err := json.Marshal(prometheus) + if err != nil { + return nil, err + } + name := prometheus.Name + if name == nil { + return nil, fmt.Errorf("prometheus.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(prometheusesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &monitoringv1.Prometheus{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Prometheus), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheusrule.go b/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheusrule.go index 34048dab7..507b37c59 100644 --- a/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheusrule.go +++ b/pkg/client/versioned/typed/monitoring/v1/fake/fake_prometheusrule.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + applyconfigurationmonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -126,3 +129,25 @@ func (c *FakePrometheusRules) Patch(ctx context.Context, name string, pt types.P } return obj.(*monitoringv1.PrometheusRule), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied prometheusRule. +func (c *FakePrometheusRules) Apply(ctx context.Context, prometheusRule *applyconfigurationmonitoringv1.PrometheusRuleApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.PrometheusRule, err error) { + if prometheusRule == nil { + return nil, fmt.Errorf("prometheusRule provided to Apply must not be nil") + } + data, err := json.Marshal(prometheusRule) + if err != nil { + return nil, err + } + name := prometheusRule.Name + if name == nil { + return nil, fmt.Errorf("prometheusRule.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(prometheusrulesResource, c.ns, *name, types.ApplyPatchType, data), &monitoringv1.PrometheusRule{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PrometheusRule), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1/fake/fake_servicemonitor.go b/pkg/client/versioned/typed/monitoring/v1/fake/fake_servicemonitor.go index e898a9db2..40d8a92a3 100644 --- a/pkg/client/versioned/typed/monitoring/v1/fake/fake_servicemonitor.go +++ b/pkg/client/versioned/typed/monitoring/v1/fake/fake_servicemonitor.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + applyconfigurationmonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -126,3 +129,25 @@ func (c *FakeServiceMonitors) Patch(ctx context.Context, name string, pt types.P } return obj.(*monitoringv1.ServiceMonitor), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied serviceMonitor. +func (c *FakeServiceMonitors) Apply(ctx context.Context, serviceMonitor *applyconfigurationmonitoringv1.ServiceMonitorApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.ServiceMonitor, err error) { + if serviceMonitor == nil { + return nil, fmt.Errorf("serviceMonitor provided to Apply must not be nil") + } + data, err := json.Marshal(serviceMonitor) + if err != nil { + return nil, err + } + name := serviceMonitor.Name + if name == nil { + return nil, fmt.Errorf("serviceMonitor.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(servicemonitorsResource, c.ns, *name, types.ApplyPatchType, data), &monitoringv1.ServiceMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ServiceMonitor), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1/fake/fake_thanosruler.go b/pkg/client/versioned/typed/monitoring/v1/fake/fake_thanosruler.go index 4d5ba6781..74807bbf6 100644 --- a/pkg/client/versioned/typed/monitoring/v1/fake/fake_thanosruler.go +++ b/pkg/client/versioned/typed/monitoring/v1/fake/fake_thanosruler.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + applyconfigurationmonitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -138,3 +141,48 @@ func (c *FakeThanosRulers) Patch(ctx context.Context, name string, pt types.Patc } return obj.(*monitoringv1.ThanosRuler), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied thanosRuler. +func (c *FakeThanosRulers) Apply(ctx context.Context, thanosRuler *applyconfigurationmonitoringv1.ThanosRulerApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.ThanosRuler, err error) { + if thanosRuler == nil { + return nil, fmt.Errorf("thanosRuler provided to Apply must not be nil") + } + data, err := json.Marshal(thanosRuler) + if err != nil { + return nil, err + } + name := thanosRuler.Name + if name == nil { + return nil, fmt.Errorf("thanosRuler.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(thanosrulersResource, c.ns, *name, types.ApplyPatchType, data), &monitoringv1.ThanosRuler{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ThanosRuler), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeThanosRulers) ApplyStatus(ctx context.Context, thanosRuler *applyconfigurationmonitoringv1.ThanosRulerApplyConfiguration, opts v1.ApplyOptions) (result *monitoringv1.ThanosRuler, err error) { + if thanosRuler == nil { + return nil, fmt.Errorf("thanosRuler provided to Apply must not be nil") + } + data, err := json.Marshal(thanosRuler) + if err != nil { + return nil, err + } + name := thanosRuler.Name + if name == nil { + return nil, fmt.Errorf("thanosRuler.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(thanosrulersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &monitoringv1.ThanosRuler{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ThanosRuler), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1/podmonitor.go b/pkg/client/versioned/typed/monitoring/v1/podmonitor.go index 3940819dc..34a3fdc11 100644 --- a/pkg/client/versioned/typed/monitoring/v1/podmonitor.go +++ b/pkg/client/versioned/typed/monitoring/v1/podmonitor.go @@ -18,9 +18,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -44,6 +47,7 @@ type PodMonitorInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.PodMonitorList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodMonitor, err error) + Apply(ctx context.Context, podMonitor *monitoringv1.PodMonitorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodMonitor, err error) PodMonitorExpansion } @@ -174,3 +178,29 @@ func (c *podMonitors) Patch(ctx context.Context, name string, pt types.PatchType Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied podMonitor. +func (c *podMonitors) Apply(ctx context.Context, podMonitor *monitoringv1.PodMonitorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodMonitor, err error) { + if podMonitor == nil { + return nil, fmt.Errorf("podMonitor provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(podMonitor) + if err != nil { + return nil, err + } + name := podMonitor.Name + if name == nil { + return nil, fmt.Errorf("podMonitor.Name must be provided to Apply") + } + result = &v1.PodMonitor{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("podmonitors"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1/probe.go b/pkg/client/versioned/typed/monitoring/v1/probe.go index 1b956c415..96e0e434d 100644 --- a/pkg/client/versioned/typed/monitoring/v1/probe.go +++ b/pkg/client/versioned/typed/monitoring/v1/probe.go @@ -18,9 +18,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -44,6 +47,7 @@ type ProbeInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.ProbeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Probe, err error) + Apply(ctx context.Context, probe *monitoringv1.ProbeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Probe, err error) ProbeExpansion } @@ -174,3 +178,29 @@ func (c *probes) Patch(ctx context.Context, name string, pt types.PatchType, dat Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied probe. +func (c *probes) Apply(ctx context.Context, probe *monitoringv1.ProbeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Probe, err error) { + if probe == nil { + return nil, fmt.Errorf("probe provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(probe) + if err != nil { + return nil, err + } + name := probe.Name + if name == nil { + return nil, fmt.Errorf("probe.Name must be provided to Apply") + } + result = &v1.Probe{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("probes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1/prometheus.go b/pkg/client/versioned/typed/monitoring/v1/prometheus.go index 96146511d..be623df4d 100644 --- a/pkg/client/versioned/typed/monitoring/v1/prometheus.go +++ b/pkg/client/versioned/typed/monitoring/v1/prometheus.go @@ -18,9 +18,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -45,6 +48,8 @@ type PrometheusInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.PrometheusList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Prometheus, err error) + Apply(ctx context.Context, prometheus *monitoringv1.PrometheusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Prometheus, err error) + ApplyStatus(ctx context.Context, prometheus *monitoringv1.PrometheusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Prometheus, err error) PrometheusExpansion } @@ -191,3 +196,59 @@ func (c *prometheuses) Patch(ctx context.Context, name string, pt types.PatchTyp Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied prometheus. +func (c *prometheuses) Apply(ctx context.Context, prometheus *monitoringv1.PrometheusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Prometheus, err error) { + if prometheus == nil { + return nil, fmt.Errorf("prometheus provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(prometheus) + if err != nil { + return nil, err + } + name := prometheus.Name + if name == nil { + return nil, fmt.Errorf("prometheus.Name must be provided to Apply") + } + result = &v1.Prometheus{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("prometheuses"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *prometheuses) ApplyStatus(ctx context.Context, prometheus *monitoringv1.PrometheusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Prometheus, err error) { + if prometheus == nil { + return nil, fmt.Errorf("prometheus provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(prometheus) + if err != nil { + return nil, err + } + + name := prometheus.Name + if name == nil { + return nil, fmt.Errorf("prometheus.Name must be provided to Apply") + } + + result = &v1.Prometheus{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("prometheuses"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go b/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go index 30776954e..69fbeffc5 100644 --- a/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go +++ b/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go @@ -18,9 +18,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -44,6 +47,7 @@ type PrometheusRuleInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.PrometheusRuleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PrometheusRule, err error) + Apply(ctx context.Context, prometheusRule *monitoringv1.PrometheusRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PrometheusRule, err error) PrometheusRuleExpansion } @@ -174,3 +178,29 @@ func (c *prometheusRules) Patch(ctx context.Context, name string, pt types.Patch Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied prometheusRule. +func (c *prometheusRules) Apply(ctx context.Context, prometheusRule *monitoringv1.PrometheusRuleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PrometheusRule, err error) { + if prometheusRule == nil { + return nil, fmt.Errorf("prometheusRule provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(prometheusRule) + if err != nil { + return nil, err + } + name := prometheusRule.Name + if name == nil { + return nil, fmt.Errorf("prometheusRule.Name must be provided to Apply") + } + result = &v1.PrometheusRule{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("prometheusrules"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go b/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go index 9bf84093a..02f5e5e4d 100644 --- a/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go +++ b/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go @@ -18,9 +18,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -44,6 +47,7 @@ type ServiceMonitorInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceMonitorList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceMonitor, err error) + Apply(ctx context.Context, serviceMonitor *monitoringv1.ServiceMonitorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceMonitor, err error) ServiceMonitorExpansion } @@ -174,3 +178,29 @@ func (c *serviceMonitors) Patch(ctx context.Context, name string, pt types.Patch Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied serviceMonitor. +func (c *serviceMonitors) Apply(ctx context.Context, serviceMonitor *monitoringv1.ServiceMonitorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceMonitor, err error) { + if serviceMonitor == nil { + return nil, fmt.Errorf("serviceMonitor provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(serviceMonitor) + if err != nil { + return nil, err + } + name := serviceMonitor.Name + if name == nil { + return nil, fmt.Errorf("serviceMonitor.Name must be provided to Apply") + } + result = &v1.ServiceMonitor{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("servicemonitors"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1/thanosruler.go b/pkg/client/versioned/typed/monitoring/v1/thanosruler.go index 6cd797ff6..af077f470 100644 --- a/pkg/client/versioned/typed/monitoring/v1/thanosruler.go +++ b/pkg/client/versioned/typed/monitoring/v1/thanosruler.go @@ -18,9 +18,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -45,6 +48,8 @@ type ThanosRulerInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.ThanosRulerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ThanosRuler, err error) + Apply(ctx context.Context, thanosRuler *monitoringv1.ThanosRulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ThanosRuler, err error) + ApplyStatus(ctx context.Context, thanosRuler *monitoringv1.ThanosRulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ThanosRuler, err error) ThanosRulerExpansion } @@ -191,3 +196,59 @@ func (c *thanosRulers) Patch(ctx context.Context, name string, pt types.PatchTyp Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied thanosRuler. +func (c *thanosRulers) Apply(ctx context.Context, thanosRuler *monitoringv1.ThanosRulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ThanosRuler, err error) { + if thanosRuler == nil { + return nil, fmt.Errorf("thanosRuler provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(thanosRuler) + if err != nil { + return nil, err + } + name := thanosRuler.Name + if name == nil { + return nil, fmt.Errorf("thanosRuler.Name must be provided to Apply") + } + result = &v1.ThanosRuler{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("thanosrulers"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *thanosRulers) ApplyStatus(ctx context.Context, thanosRuler *monitoringv1.ThanosRulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ThanosRuler, err error) { + if thanosRuler == nil { + return nil, fmt.Errorf("thanosRuler provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(thanosRuler) + if err != nil { + return nil, err + } + + name := thanosRuler.Name + if name == nil { + return nil, fmt.Errorf("thanosRuler.Name must be provided to Apply") + } + + result = &v1.ThanosRuler{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("thanosrulers"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1alpha1/alertmanagerconfig.go b/pkg/client/versioned/typed/monitoring/v1alpha1/alertmanagerconfig.go index 90b4bc490..f84155940 100644 --- a/pkg/client/versioned/typed/monitoring/v1alpha1/alertmanagerconfig.go +++ b/pkg/client/versioned/typed/monitoring/v1alpha1/alertmanagerconfig.go @@ -18,9 +18,12 @@ package v1alpha1 import ( "context" + json "encoding/json" + "fmt" "time" v1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" + monitoringv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1alpha1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -44,6 +47,7 @@ type AlertmanagerConfigInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AlertmanagerConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AlertmanagerConfig, err error) + Apply(ctx context.Context, alertmanagerConfig *monitoringv1alpha1.AlertmanagerConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AlertmanagerConfig, err error) AlertmanagerConfigExpansion } @@ -174,3 +178,29 @@ func (c *alertmanagerConfigs) Patch(ctx context.Context, name string, pt types.P Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied alertmanagerConfig. +func (c *alertmanagerConfigs) Apply(ctx context.Context, alertmanagerConfig *monitoringv1alpha1.AlertmanagerConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AlertmanagerConfig, err error) { + if alertmanagerConfig == nil { + return nil, fmt.Errorf("alertmanagerConfig provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(alertmanagerConfig) + if err != nil { + return nil, err + } + name := alertmanagerConfig.Name + if name == nil { + return nil, fmt.Errorf("alertmanagerConfig.Name must be provided to Apply") + } + result = &v1alpha1.AlertmanagerConfig{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("alertmanagerconfigs"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1alpha1/fake/fake_alertmanagerconfig.go b/pkg/client/versioned/typed/monitoring/v1alpha1/fake/fake_alertmanagerconfig.go index 8b9673539..9f628f13f 100644 --- a/pkg/client/versioned/typed/monitoring/v1alpha1/fake/fake_alertmanagerconfig.go +++ b/pkg/client/versioned/typed/monitoring/v1alpha1/fake/fake_alertmanagerconfig.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" + monitoringv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -126,3 +129,25 @@ func (c *FakeAlertmanagerConfigs) Patch(ctx context.Context, name string, pt typ } return obj.(*v1alpha1.AlertmanagerConfig), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied alertmanagerConfig. +func (c *FakeAlertmanagerConfigs) Apply(ctx context.Context, alertmanagerConfig *monitoringv1alpha1.AlertmanagerConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AlertmanagerConfig, err error) { + if alertmanagerConfig == nil { + return nil, fmt.Errorf("alertmanagerConfig provided to Apply must not be nil") + } + data, err := json.Marshal(alertmanagerConfig) + if err != nil { + return nil, err + } + name := alertmanagerConfig.Name + if name == nil { + return nil, fmt.Errorf("alertmanagerConfig.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(alertmanagerconfigsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.AlertmanagerConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.AlertmanagerConfig), err +} diff --git a/pkg/client/versioned/typed/monitoring/v1beta1/alertmanagerconfig.go b/pkg/client/versioned/typed/monitoring/v1beta1/alertmanagerconfig.go index a17a5879b..c807dfb3e 100644 --- a/pkg/client/versioned/typed/monitoring/v1beta1/alertmanagerconfig.go +++ b/pkg/client/versioned/typed/monitoring/v1beta1/alertmanagerconfig.go @@ -18,9 +18,12 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" v1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1" + monitoringv1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1beta1" scheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -44,6 +47,7 @@ type AlertmanagerConfigInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AlertmanagerConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AlertmanagerConfig, err error) + Apply(ctx context.Context, alertmanagerConfig *monitoringv1beta1.AlertmanagerConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AlertmanagerConfig, err error) AlertmanagerConfigExpansion } @@ -174,3 +178,29 @@ func (c *alertmanagerConfigs) Patch(ctx context.Context, name string, pt types.P Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied alertmanagerConfig. +func (c *alertmanagerConfigs) Apply(ctx context.Context, alertmanagerConfig *monitoringv1beta1.AlertmanagerConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AlertmanagerConfig, err error) { + if alertmanagerConfig == nil { + return nil, fmt.Errorf("alertmanagerConfig provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(alertmanagerConfig) + if err != nil { + return nil, err + } + name := alertmanagerConfig.Name + if name == nil { + return nil, fmt.Errorf("alertmanagerConfig.Name must be provided to Apply") + } + result = &v1beta1.AlertmanagerConfig{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("alertmanagerconfigs"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/versioned/typed/monitoring/v1beta1/fake/fake_alertmanagerconfig.go b/pkg/client/versioned/typed/monitoring/v1beta1/fake/fake_alertmanagerconfig.go index 22ca35930..ccddead84 100644 --- a/pkg/client/versioned/typed/monitoring/v1beta1/fake/fake_alertmanagerconfig.go +++ b/pkg/client/versioned/typed/monitoring/v1beta1/fake/fake_alertmanagerconfig.go @@ -18,8 +18,11 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1" + monitoringv1beta1 "github.com/prometheus-operator/prometheus-operator/pkg/client/applyconfiguration/monitoring/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -126,3 +129,25 @@ func (c *FakeAlertmanagerConfigs) Patch(ctx context.Context, name string, pt typ } return obj.(*v1beta1.AlertmanagerConfig), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied alertmanagerConfig. +func (c *FakeAlertmanagerConfigs) Apply(ctx context.Context, alertmanagerConfig *monitoringv1beta1.AlertmanagerConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AlertmanagerConfig, err error) { + if alertmanagerConfig == nil { + return nil, fmt.Errorf("alertmanagerConfig provided to Apply must not be nil") + } + data, err := json.Marshal(alertmanagerConfig) + if err != nil { + return nil, err + } + name := alertmanagerConfig.Name + if name == nil { + return nil, fmt.Errorf("alertmanagerConfig.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(alertmanagerconfigsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.AlertmanagerConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.AlertmanagerConfig), err +} diff --git a/scripts/go.mod b/scripts/go.mod index ab697650a..54d8d55d4 100644 --- a/scripts/go.mod +++ b/scripts/go.mod @@ -10,7 +10,7 @@ require ( github.com/google/go-jsonnet v0.18.0 github.com/jsonnet-bundler/jsonnet-bundler v0.5.1 github.com/yeya24/promlinter v0.2.0 - k8s.io/code-generator v0.24.2 + k8s.io/code-generator v0.26.0 sigs.k8s.io/controller-tools v0.9.2 ) @@ -72,7 +72,10 @@ require ( github.com/go-critic/go-critic v0.6.5 // indirect github.com/go-kit/kit v0.10.0 // indirect github.com/go-logfmt/logfmt v0.5.0 // indirect - github.com/go-logr/logr v1.2.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/swag v0.19.14 // indirect github.com/go-toolsmith/astcast v1.0.0 // indirect github.com/go-toolsmith/astcopy v1.0.2 // indirect github.com/go-toolsmith/astequal v1.0.3 // indirect @@ -98,6 +101,7 @@ require ( github.com/golangci/misspell v0.3.5 // indirect github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect + github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect @@ -116,6 +120,7 @@ require ( github.com/jgautheron/goconst v1.5.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/julz/importas v0.1.0 // indirect github.com/kennygrant/sanitize v1.2.4 // indirect @@ -131,6 +136,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/lufeee/execinquery v1.2.1 // indirect github.com/magiconair/properties v1.8.6 // indirect + github.com/mailru/easyjson v0.7.6 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.0 // indirect github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect @@ -219,14 +225,14 @@ require ( go.uber.org/zap v1.19.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/mod v0.6.0 // indirect + golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect - golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/tools v0.1.12 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect + golang.org/x/tools v0.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -236,15 +242,16 @@ require ( k8s.io/api v0.24.0 // indirect k8s.io/apiextensions-apiserver v0.24.0 // indirect k8s.io/apimachinery v0.24.0 // indirect - k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect + k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect k8s.io/klog v0.2.0 // indirect - k8s.io/klog/v2 v2.60.1 // indirect + k8s.io/klog/v2 v2.80.1 // indirect + k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect mvdan.cc/gofumpt v0.4.0 // indirect mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 // indirect sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/scripts/go.sum b/scripts/go.sum index 7b95ecbbd..8e4a9c303 100644 --- a/scripts/go.sum +++ b/scripts/go.sum @@ -413,14 +413,19 @@ github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= @@ -541,6 +546,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= +github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -699,6 +705,7 @@ github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhB github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -774,6 +781,7 @@ github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamh github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= @@ -888,12 +896,12 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= @@ -1285,8 +1293,9 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1350,8 +1359,9 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1481,8 +1491,8 @@ golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 h1:ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc= -golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1493,8 +1503,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1597,8 +1608,9 @@ golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1789,8 +1801,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1853,20 +1866,24 @@ k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2U k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/code-generator v0.24.0/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= -k8s.io/code-generator v0.24.2 h1:EGeRWzJrpwi6T6CvoNl0spM6fnAnOdCr0rz7H4NU1rk= -k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= +k8s.io/code-generator v0.26.0 h1:ZDY+7Gic9p/lACgD1G72gQg2CvNGeAYZTPIncv+iALM= +k8s.io/code-generator v0.26.0/go.mod h1:OMoJ5Dqx1wgaQzKgc+ZWaZPfGjdRq/Y3WubFrZmeI3I= k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 h1:TT1WdmqqXareKxZ/oNXEUSwKlLiHzPMyB0t8BaFeBYI= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= @@ -1889,8 +1906,9 @@ sigs.k8s.io/controller-tools v0.9.2/go.mod h1:NUkn8FTV3Sad3wWpSK7dt/145qfuQ8CKJV sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/scripts/tools.go b/scripts/tools.go index 4ede2530d..0d1faa853 100644 --- a/scripts/tools.go +++ b/scripts/tools.go @@ -28,6 +28,7 @@ import ( _ "github.com/google/go-jsonnet/cmd/jsonnetfmt" _ "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb" _ "github.com/yeya24/promlinter/cmd/promlinter" + _ "k8s.io/code-generator/cmd/applyconfiguration-gen" _ "k8s.io/code-generator/cmd/client-gen" _ "k8s.io/code-generator/cmd/informer-gen" _ "k8s.io/code-generator/cmd/lister-gen"