update prometheus dependencies (#5520)

Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
junot
2023-02-14 09:46:22 +08:00
committed by GitHub
parent a979342f56
commit 2cd5f45d47
769 changed files with 81283 additions and 30511 deletions

View File

@@ -0,0 +1,351 @@
// Copyright 2018 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.
package v1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
const (
AlertmanagersKind = "Alertmanager"
AlertmanagerName = "alertmanagers"
AlertManagerKindKey = "alertmanager"
)
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:categories="prometheus-operator",shortName="am"
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="The version of Alertmanager"
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.replicas",description="The number of desired replicas"
// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.availableReplicas",description="The number of ready replicas"
// +kubebuilder:printcolumn:name="Reconciled",type="string",JSONPath=".status.conditions[?(@.type == 'Reconciled')].status"
// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.conditions[?(@.type == 'Available')].status"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".status.paused",description="Whether the resource reconciliation is paused or not",priority=1
// +kubebuilder:subresource:status
// Alertmanager describes an Alertmanager cluster.
type Alertmanager struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the Alertmanager cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec AlertmanagerSpec `json:"spec"`
// Most recent observed status of the Alertmanager cluster. Read-only.
// More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Status AlertmanagerStatus `json:"status,omitempty"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *Alertmanager) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// AlertmanagerSpec is a specification of the desired behavior of the Alertmanager cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +k8s:openapi-gen=true
type AlertmanagerSpec struct {
// PodMetadata configures Labels and Annotations which are propagated to the alertmanager pods.
PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"`
// Image if specified has precedence over baseImage, tag and sha
// combinations. Specifying the version is still necessary to ensure the
// Prometheus Operator knows what version of Alertmanager is being
// configured.
Image *string `json:"image,omitempty"`
// Image pull policy for the 'alertmanager', 'init-config-reloader' and 'config-reloader' containers.
// See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details.
// +kubebuilder:validation:Enum="";Always;Never;IfNotPresent
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
// Version the cluster should be on.
Version string `json:"version,omitempty"`
// Tag of Alertmanager container image to be deployed. Defaults to the value of `version`.
// Version is ignored if Tag is set.
// Deprecated: use 'image' instead. The image tag can be specified
// as part of the image URL.
Tag string `json:"tag,omitempty"`
// SHA of Alertmanager container image to be deployed. Defaults to the value of `version`.
// Similar to a tag, but the SHA explicitly deploys an immutable container image.
// Version and Tag are ignored if SHA is set.
// Deprecated: use 'image' instead. The image digest can be specified
// as part of the image URL.
SHA string `json:"sha,omitempty"`
// Base image that is used to deploy pods, without tag.
// Deprecated: use 'image' instead
BaseImage string `json:"baseImage,omitempty"`
// An optional list of references to secrets in the same namespace
// to use for pulling prometheus and alertmanager images from registries
// see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// Secrets is a list of Secrets in the same namespace as the Alertmanager
// object, which shall be mounted into the Alertmanager Pods.
// Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`.
// The Secrets are mounted into `/etc/alertmanager/secrets/<secret-name>` in the 'alertmanager' container.
Secrets []string `json:"secrets,omitempty"`
// ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager
// object, which shall be mounted into the Alertmanager Pods.
// Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-<configmap-name>`.
// The ConfigMaps are mounted into `/etc/alertmanager/configmaps/<configmap-name>` in the 'alertmanager' container.
ConfigMaps []string `json:"configMaps,omitempty"`
// ConfigSecret is the name of a Kubernetes Secret in the same namespace as the
// Alertmanager object, which contains the configuration for this Alertmanager
// instance. If empty, it defaults to `alertmanager-<alertmanager-name>`.
//
// The Alertmanager configuration should be available under the
// `alertmanager.yaml` key. Additional keys from the original secret are
// copied to the generated secret and mounted into the
// `/etc/alertmanager/config` directory in the `alertmanager` container.
//
// If either the secret or the `alertmanager.yaml` key is missing, the
// operator provisions a minimal Alertmanager configuration with one empty
// receiver (effectively dropping alert notifications).
ConfigSecret string `json:"configSecret,omitempty"`
// Log level for Alertmanager to be configured with.
//+kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for Alertmanager to be configured with.
//+kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// Size is the expected size of the alertmanager cluster. The controller will
// eventually make the size of the running cluster equal to the expected
// size.
Replicas *int32 `json:"replicas,omitempty"`
// Time duration Alertmanager shall retain data for. Default is '120h',
// and must match the regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours).
// +kubebuilder:default:="120h"
Retention GoDuration `json:"retention,omitempty"`
// Storage is the definition of how storage will be used by the Alertmanager
// instances.
Storage *StorageSpec `json:"storage,omitempty"`
// Volumes allows configuration of additional volumes on the output StatefulSet definition.
// Volumes specified will be appended to other volumes that are generated as a result of
// StorageSpec objects.
Volumes []v1.Volume `json:"volumes,omitempty"`
// VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition.
// VolumeMounts specified will be appended to other VolumeMounts in the alertmanager container,
// that are generated as a result of StorageSpec objects.
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// The external URL the Alertmanager instances will be available under. This is
// necessary to generate correct URLs. This is necessary if Alertmanager is not
// served from root of a DNS name.
ExternalURL string `json:"externalUrl,omitempty"`
// The route prefix Alertmanager registers HTTP handlers for. This is useful,
// if using ExternalURL and a proxy is rewriting HTTP routes of a request,
// and the actual ExternalURL is still true, but the server serves requests
// under a different route prefix. For example for use with `kubectl proxy`.
RoutePrefix string `json:"routePrefix,omitempty"`
// If set to true all actions on the underlying managed objects are not
// goint to be performed, except for delete actions.
Paused bool `json:"paused,omitempty"`
// Define which Nodes the Pods are scheduled on.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Define resources requests and limits for single Pods.
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// If specified, the pod's scheduling constraints.
Affinity *v1.Affinity `json:"affinity,omitempty"`
// If specified, the pod's tolerations.
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// If specified, the pod's topology spread constraints.
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// This defaults to the default PodSecurityContext.
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the
// Prometheus Pods.
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// ListenLocal makes the Alertmanager server listen on loopback, so that it
// does not bind against the Pod IP. Note this is only for the Alertmanager
// UI, not the gossip communication.
ListenLocal bool `json:"listenLocal,omitempty"`
// Containers allows injecting additional containers. This is meant to
// allow adding an authentication proxy to an Alertmanager pod.
// Containers described here modify an operator generated container if they
// share the same name and modifications are done via a strategic merge
// patch. The current container names are: `alertmanager` and
// `config-reloader`. Overriding containers is entirely outside the scope
// of what the maintainers will support and by doing so, you accept that
// this behaviour may break at any time without notice.
Containers []v1.Container `json:"containers,omitempty"`
// InitContainers allows adding initContainers to the pod definition. Those can be used to e.g.
// fetch secrets for injection into the Alertmanager configuration from external sources. Any
// errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
// Using initContainers for any use case other then secret fetching is entirely outside the scope
// of what the maintainers will support and by doing so, you accept that this behaviour may break
// at any time without notice.
InitContainers []v1.Container `json:"initContainers,omitempty"`
// Priority class assigned to the Pods
PriorityClassName string `json:"priorityClassName,omitempty"`
// AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster.
AdditionalPeers []string `json:"additionalPeers,omitempty"`
// ClusterAdvertiseAddress is the explicit address to advertise in cluster.
// Needs to be provided for non RFC1918 [1] (public) addresses.
// [1] RFC1918: https://tools.ietf.org/html/rfc1918
ClusterAdvertiseAddress string `json:"clusterAdvertiseAddress,omitempty"`
// Interval between gossip attempts.
ClusterGossipInterval GoDuration `json:"clusterGossipInterval,omitempty"`
// Interval between pushpull attempts.
ClusterPushpullInterval GoDuration `json:"clusterPushpullInterval,omitempty"`
// Timeout for cluster peering.
ClusterPeerTimeout GoDuration `json:"clusterPeerTimeout,omitempty"`
// Port name used for the pods and governing service.
// This defaults to web
PortName string `json:"portName,omitempty"`
// ForceEnableClusterMode ensures Alertmanager does not deactivate the cluster mode when running with a single replica.
// Use case is e.g. spanning an Alertmanager cluster across Kubernetes clusters with a single replica in each.
ForceEnableClusterMode bool `json:"forceEnableClusterMode,omitempty"`
// AlertmanagerConfigs to be selected for to merge and configure Alertmanager with.
AlertmanagerConfigSelector *metav1.LabelSelector `json:"alertmanagerConfigSelector,omitempty"`
// The AlertmanagerConfigMatcherStrategy defines how AlertmanagerConfig objects match the alerts.
// In the future more options may be added.
AlertmanagerConfigMatcherStrategy AlertmanagerConfigMatcherStrategy `json:"alertmanagerConfigMatcherStrategy,omitempty"`
// Namespaces to be selected for AlertmanagerConfig discovery. If nil, only
// check own namespace.
AlertmanagerConfigNamespaceSelector *metav1.LabelSelector `json:"alertmanagerConfigNamespaceSelector,omitempty"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
// +optional
MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"`
// Pods' hostAliases configuration
// +listType=map
// +listMapKey=ip
HostAliases []HostAlias `json:"hostAliases,omitempty"`
// Defines the web command line flags when starting Alertmanager.
Web *AlertmanagerWebSpec `json:"web,omitempty"`
// EXPERIMENTAL: alertmanagerConfiguration specifies the configuration of Alertmanager.
// If defined, it takes precedence over the `configSecret` field.
// This field may change in future releases.
AlertmanagerConfiguration *AlertmanagerConfiguration `json:"alertmanagerConfiguration,omitempty"`
}
// AlertmanagerConfigMatcherStrategy defines the strategy used by AlertmanagerConfig objects to match alerts.
type AlertmanagerConfigMatcherStrategy struct {
// If set to `OnNamespace`, the operator injects a label matcher matching the namespace of the AlertmanagerConfig object for all its routes and inhibition rules.
// `None` will not add any additional matchers other than the ones specified in the AlertmanagerConfig.
// Default is `OnNamespace`.
// +kubebuilder:validation:Enum="OnNamespace";"None"
// +kubebuilder:default:="OnNamespace"
Type string `json:"type,omitempty"`
}
// AlertmanagerConfiguration defines the Alertmanager configuration.
// +k8s:openapi-gen=true
type AlertmanagerConfiguration struct {
// The name of the AlertmanagerConfig resource which is used to generate the Alertmanager configuration.
// It must be defined in the same namespace as the Alertmanager object.
// The operator will not enforce a `namespace` label for routes and inhibition rules.
// +kubebuilder:validation:MinLength=1
Name string `json:"name,omitempty"`
// Defines the global parameters of the Alertmanager configuration.
// +optional
Global *AlertmanagerGlobalConfig `json:"global,omitempty"`
// Custom notification templates.
// +optional
Templates []SecretOrConfigMap `json:"templates,omitempty"`
}
// AlertmanagerGlobalConfig configures parameters that are valid in all other configuration contexts.
// See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file
type AlertmanagerGlobalConfig struct {
// ResolveTimeout is the default value used by alertmanager if the alert does
// not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated.
// This has no impact on alerts from Prometheus, as they always include EndsAt.
ResolveTimeout Duration `json:"resolveTimeout,omitempty"`
// HTTP client configuration.
HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"`
}
// AlertmanagerStatus is the most recent observed status of the Alertmanager cluster. Read-only.
// More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +k8s:openapi-gen=true
type AlertmanagerStatus struct {
// Represents whether any actions on the underlying managed objects are
// being performed. Only delete actions will be performed.
Paused bool `json:"paused"`
// Total number of non-terminated pods targeted by this Alertmanager
// object (their labels match the selector).
Replicas int32 `json:"replicas"`
// Total number of non-terminated pods targeted by this Alertmanager
// object that have the desired version spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this Alertmanager cluster.
AvailableReplicas int32 `json:"availableReplicas"`
// Total number of unavailable pods targeted by this Alertmanager object.
UnavailableReplicas int32 `json:"unavailableReplicas"`
// The current state of the Alertmanager object.
// +listType=map
// +listMapKey=type
// +optional
Conditions []Condition `json:"conditions,omitempty"`
}
// AlertmanagerWebSpec defines the web command line flags when starting Alertmanager.
// +k8s:openapi-gen=true
type AlertmanagerWebSpec struct {
WebConfigFileFields `json:",inline"`
}
// HTTPConfig defines a client HTTP configuration.
// See https://prometheus.io/docs/alerting/latest/configuration/#http_config
type HTTPConfig struct {
// Authorization header configuration for the client.
// This is mutually exclusive with BasicAuth and is only available starting from Alertmanager v0.22+.
// +optional
Authorization *SafeAuthorization `json:"authorization,omitempty"`
// BasicAuth for the client.
// This is mutually exclusive with Authorization. If both are defined, BasicAuth takes precedence.
// +optional
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// OAuth2 client credentials used to fetch a token for the targets.
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// The secret's key that contains the bearer token to be used by the client
// for authentication.
// The secret needs to be in the same namespace as the Alertmanager
// object and accessible by the Prometheus Operator.
// +optional
BearerTokenSecret *v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"`
// TLS configuration for the client.
// +optional
TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"`
// Optional proxy URL.
// +optional
ProxyURL string `json:"proxyURL,omitempty"`
// FollowRedirects specifies whether the client should follow HTTP 3xx redirects.
// +optional
FollowRedirects *bool `json:"followRedirects,omitempty"`
}
// AlertmanagerList is a list of Alertmanagers.
// +k8s:openapi-gen=true
type AlertmanagerList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Alertmanagers
Items []Alertmanager `json:"items"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *AlertmanagerList) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}

View File

@@ -0,0 +1,153 @@
// Copyright 2018 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.
package v1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
)
const (
PodMonitorsKind = "PodMonitor"
PodMonitorName = "podmonitors"
PodMonitorKindKey = "podmonitor"
)
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:categories="prometheus-operator",shortName="pmon"
// PodMonitor defines monitoring for a set of pods.
type PodMonitor struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Pod selection for target discovery by Prometheus.
Spec PodMonitorSpec `json:"spec"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *PodMonitor) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// PodMonitorSpec contains specification parameters for a PodMonitor.
// +k8s:openapi-gen=true
type PodMonitorSpec struct {
// The label to use to retrieve the job name from.
JobLabel string `json:"jobLabel,omitempty"`
// PodTargetLabels transfers labels on the Kubernetes Pod onto the target.
PodTargetLabels []string `json:"podTargetLabels,omitempty"`
// A list of endpoints allowed as part of this PodMonitor.
PodMetricsEndpoints []PodMetricsEndpoint `json:"podMetricsEndpoints"`
// Selector to select Pod objects.
Selector metav1.LabelSelector `json:"selector"`
// Selector to select which namespaces the Endpoints objects are discovered from.
NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
// SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
SampleLimit uint64 `json:"sampleLimit,omitempty"`
// TargetLimit defines a limit on the number of scraped targets that will be accepted.
TargetLimit uint64 `json:"targetLimit,omitempty"`
// Per-scrape limit on number of labels that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelLimit uint64 `json:"labelLimit,omitempty"`
// Per-scrape limit on length of labels name that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelNameLengthLimit uint64 `json:"labelNameLengthLimit,omitempty"`
// Per-scrape limit on length of labels value that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelValueLengthLimit uint64 `json:"labelValueLengthLimit,omitempty"`
// Attaches node metadata to discovered targets.
// Requires Prometheus v2.35.0 and above.
AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"`
}
// PodMonitorList is a list of PodMonitors.
// +k8s:openapi-gen=true
type PodMonitorList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of PodMonitors
Items []*PodMonitor `json:"items"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *PodMonitorList) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// PodMetricsEndpoint defines a scrapeable endpoint of a Kubernetes Pod serving Prometheus metrics.
// +k8s:openapi-gen=true
type PodMetricsEndpoint struct {
// Name of the pod port this endpoint refers to. Mutually exclusive with targetPort.
Port string `json:"port,omitempty"`
// Deprecated: Use 'port' instead.
TargetPort *intstr.IntOrString `json:"targetPort,omitempty"`
// HTTP path to scrape for metrics.
// If empty, Prometheus uses the default value (e.g. `/metrics`).
Path string `json:"path,omitempty"`
// HTTP scheme to use for scraping.
Scheme string `json:"scheme,omitempty"`
// Optional HTTP URL parameters
Params map[string][]string `json:"params,omitempty"`
// Interval at which metrics should be scraped
// If not specified Prometheus' global scrape interval is used.
Interval Duration `json:"interval,omitempty"`
// Timeout after which the scrape is ended
// If not specified, the Prometheus global scrape interval is used.
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
// TLS configuration to use when scraping the endpoint.
TLSConfig *PodMetricsEndpointTLSConfig `json:"tlsConfig,omitempty"`
// Secret to mount to read bearer token for scraping targets. The secret
// needs to be in the same namespace as the pod monitor and accessible by
// the Prometheus Operator.
BearerTokenSecret v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"`
// HonorLabels chooses the metric's labels on collisions with target labels.
HonorLabels bool `json:"honorLabels,omitempty"`
// HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.
HonorTimestamps *bool `json:"honorTimestamps,omitempty"`
// BasicAuth allow an endpoint to authenticate over basic authentication.
// More info: https://prometheus.io/docs/operating/configuration/#endpoint
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// Authorization section for this endpoint
Authorization *SafeAuthorization `json:"authorization,omitempty"`
// MetricRelabelConfigs to apply to samples before ingestion.
MetricRelabelConfigs []*RelabelConfig `json:"metricRelabelings,omitempty"`
// RelabelConfigs to apply to samples before scraping.
// Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields.
// The original scrape job's name is available via the `__tmp_prometheus_job_name` label.
// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
RelabelConfigs []*RelabelConfig `json:"relabelings,omitempty"`
// ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.
ProxyURL *string `json:"proxyUrl,omitempty"`
// FollowRedirects configures whether scrape requests follow HTTP 3xx redirects.
FollowRedirects *bool `json:"followRedirects,omitempty"`
// Whether to enable HTTP2.
EnableHttp2 *bool `json:"enableHttp2,omitempty"`
// Drop pods that are not running. (Failed, Succeeded). Enabled by default.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
FilterRunning *bool `json:"filterRunning,omitempty"`
}
// PodMetricsEndpointTLSConfig specifies TLS configuration parameters.
// +k8s:openapi-gen=true
type PodMetricsEndpointTLSConfig struct {
SafeTLSConfig `json:",inline"`
}

View File

@@ -0,0 +1,199 @@
// Copyright 2018 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.
package v1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
const (
ProbesKind = "Probe"
ProbeName = "probes"
ProbeKindKey = "probe"
)
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:categories="prometheus-operator",shortName="prb"
// Probe defines monitoring for a set of static targets or ingresses.
type Probe struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Ingress selection for target discovery by Prometheus.
Spec ProbeSpec `json:"spec"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *Probe) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// ProbeSpec contains specification parameters for a Probe.
// +k8s:openapi-gen=true
type ProbeSpec struct {
// The job name assigned to scraped metrics by default.
JobName string `json:"jobName,omitempty"`
// Specification for the prober to use for probing targets.
// The prober.URL parameter is required. Targets cannot be probed if left empty.
ProberSpec ProberSpec `json:"prober,omitempty"`
// The module to use for probing specifying how to probe the target.
// Example module configuring in the blackbox exporter:
// https://github.com/prometheus/blackbox_exporter/blob/master/example.yml
Module string `json:"module,omitempty"`
// Targets defines a set of static or dynamically discovered targets to probe.
Targets ProbeTargets `json:"targets,omitempty"`
// Interval at which targets are probed using the configured prober.
// If not specified Prometheus' global scrape interval is used.
Interval Duration `json:"interval,omitempty"`
// Timeout for scraping metrics from the Prometheus exporter.
// If not specified, the Prometheus global scrape interval is used.
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
// TLS configuration to use when scraping the endpoint.
TLSConfig *ProbeTLSConfig `json:"tlsConfig,omitempty"`
// Secret to mount to read bearer token for scraping targets. The secret
// needs to be in the same namespace as the probe and accessible by
// the Prometheus Operator.
BearerTokenSecret v1.SecretKeySelector `json:"bearerTokenSecret,omitempty"`
// BasicAuth allow an endpoint to authenticate over basic authentication.
// More info: https://prometheus.io/docs/operating/configuration/#endpoint
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// MetricRelabelConfigs to apply to samples before ingestion.
MetricRelabelConfigs []*RelabelConfig `json:"metricRelabelings,omitempty"`
// Authorization section for this endpoint
Authorization *SafeAuthorization `json:"authorization,omitempty"`
// SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
SampleLimit uint64 `json:"sampleLimit,omitempty"`
// TargetLimit defines a limit on the number of scraped targets that will be accepted.
TargetLimit uint64 `json:"targetLimit,omitempty"`
// Per-scrape limit on number of labels that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelLimit uint64 `json:"labelLimit,omitempty"`
// Per-scrape limit on length of labels name that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelNameLengthLimit uint64 `json:"labelNameLengthLimit,omitempty"`
// Per-scrape limit on length of labels value that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelValueLengthLimit uint64 `json:"labelValueLengthLimit,omitempty"`
}
// ProbeTargets defines how to discover the probed targets.
// One of the `staticConfig` or `ingress` must be defined.
// If both are defined, `staticConfig` takes precedence.
// +k8s:openapi-gen=true
type ProbeTargets struct {
// staticConfig defines the static list of targets to probe and the
// relabeling configuration.
// If `ingress` is also defined, `staticConfig` takes precedence.
// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config.
StaticConfig *ProbeTargetStaticConfig `json:"staticConfig,omitempty"`
// ingress defines the Ingress objects to probe and the relabeling
// configuration.
// If `staticConfig` is also defined, `staticConfig` takes precedence.
Ingress *ProbeTargetIngress `json:"ingress,omitempty"`
}
// Validate semantically validates the given ProbeTargets.
func (it *ProbeTargets) Validate() error {
if it.StaticConfig == nil && it.Ingress == nil {
return &ProbeTargetsValidationError{"at least one of .spec.targets.staticConfig and .spec.targets.ingress is required"}
}
return nil
}
// ProbeTargetsValidationError is returned by ProbeTargets.Validate()
// on semantically invalid configurations.
// +k8s:openapi-gen=false
type ProbeTargetsValidationError struct {
err string
}
func (e *ProbeTargetsValidationError) Error() string {
return e.err
}
// ProbeTargetStaticConfig defines the set of static targets considered for probing.
// +k8s:openapi-gen=true
type ProbeTargetStaticConfig struct {
// The list of hosts to probe.
Targets []string `json:"static,omitempty"`
// Labels assigned to all metrics scraped from the targets.
Labels map[string]string `json:"labels,omitempty"`
// RelabelConfigs to apply to the label set of the targets before it gets
// scraped.
// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
RelabelConfigs []*RelabelConfig `json:"relabelingConfigs,omitempty"`
}
// ProbeTargetIngress defines the set of Ingress objects considered for probing.
// The operator configures a target for each host/path combination of each ingress object.
// +k8s:openapi-gen=true
type ProbeTargetIngress struct {
// Selector to select the Ingress objects.
Selector metav1.LabelSelector `json:"selector,omitempty"`
// From which namespaces to select Ingress objects.
NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
// RelabelConfigs to apply to the label set of the target before it gets
// scraped.
// The original ingress address is available via the
// `__tmp_prometheus_ingress_address` label. It can be used to customize the
// probed URL.
// The original scrape job's name is available via the `__tmp_prometheus_job_name` label.
// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
RelabelConfigs []*RelabelConfig `json:"relabelingConfigs,omitempty"`
}
// ProberSpec contains specification parameters for the Prober used for probing.
// +k8s:openapi-gen=true
type ProberSpec struct {
// Mandatory URL of the prober.
URL string `json:"url"`
// HTTP scheme to use for scraping.
// Defaults to `http`.
Scheme string `json:"scheme,omitempty"`
// Path to collect metrics from.
// Defaults to `/probe`.
// +kubebuilder:default:="/probe"
Path string `json:"path,omitempty"`
// Optional ProxyURL.
ProxyURL string `json:"proxyUrl,omitempty"`
}
// ProbeList is a list of Probes.
// +k8s:openapi-gen=true
type ProbeList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Probes
Items []*Probe `json:"items"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *ProbeList) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// ProbeTLSConfig specifies TLS configuration parameters for the prober.
// +k8s:openapi-gen=true
type ProbeTLSConfig struct {
SafeTLSConfig `json:",inline"`
}

View File

@@ -0,0 +1,979 @@
// Copyright 2018 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.
package v1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"strings"
)
const (
PrometheusesKind = "Prometheus"
PrometheusName = "prometheuses"
PrometheusKindKey = "prometheus"
)
// CommonPrometheusFields are the options available to both the Prometheus server and agent.
// +k8s:deepcopy-gen=true
type CommonPrometheusFields struct {
// PodMetadata configures Labels and Annotations which are propagated to the prometheus pods.
PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"`
// ServiceMonitors to be selected for target discovery.
//
// If `spec.serviceMonitorSelector`, `spec.podMonitorSelector` and
// `spec.probeSelector` are null, the Prometheus configuration is unmanaged.
// The Prometheus operator will ensure that the Prometheus configuration's
// Secret exists, but it is the responsibility of the user to provide the raw
// gzipped Prometheus configuration under the `prometheus.yaml.gz` key.
// This behavior is deprecated and will be removed in the next major version
// of the custom resource definition. It is recommended to use
// `spec.additionalScrapeConfigs` instead.
ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
// Namespace's labels to match for ServiceMonitor discovery. If nil, only
// check own namespace.
ServiceMonitorNamespaceSelector *metav1.LabelSelector `json:"serviceMonitorNamespaceSelector,omitempty"`
// *Experimental* PodMonitors to be selected for target discovery.
//
// If `spec.serviceMonitorSelector`, `spec.podMonitorSelector` and
// `spec.probeSelector` are null, the Prometheus configuration is unmanaged.
// The Prometheus operator will ensure that the Prometheus configuration's
// Secret exists, but it is the responsibility of the user to provide the raw
// gzipped Prometheus configuration under the `prometheus.yaml.gz` key.
// This behavior is deprecated and will be removed in the next major version
// of the custom resource definition. It is recommended to use
// `spec.additionalScrapeConfigs` instead.
PodMonitorSelector *metav1.LabelSelector `json:"podMonitorSelector,omitempty"`
// Namespace's labels to match for PodMonitor discovery. If nil, only
// check own namespace.
PodMonitorNamespaceSelector *metav1.LabelSelector `json:"podMonitorNamespaceSelector,omitempty"`
// *Experimental* Probes to be selected for target discovery.
//
// If `spec.serviceMonitorSelector`, `spec.podMonitorSelector` and
// `spec.probeSelector` are null, the Prometheus configuration is unmanaged.
// The Prometheus operator will ensure that the Prometheus configuration's
// Secret exists, but it is the responsibility of the user to provide the raw
// gzipped Prometheus configuration under the `prometheus.yaml.gz` key.
// This behavior is deprecated and will be removed in the next major version
// of the custom resource definition. It is recommended to use
// `spec.additionalScrapeConfigs` instead.
ProbeSelector *metav1.LabelSelector `json:"probeSelector,omitempty"`
// *Experimental* Namespaces to be selected for Probe discovery. If nil, only check own namespace.
ProbeNamespaceSelector *metav1.LabelSelector `json:"probeNamespaceSelector,omitempty"`
// Version of Prometheus to be deployed.
Version string `json:"version,omitempty"`
// When a Prometheus deployment is paused, no actions except for deletion
// will be performed on the underlying objects.
Paused bool `json:"paused,omitempty"`
// Image if specified has precedence over baseImage, tag and sha
// combinations. Specifying the version is still necessary to ensure the
// Prometheus Operator knows what version of Prometheus is being
// configured.
Image *string `json:"image,omitempty"`
// Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers.
// See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details.
// +kubebuilder:validation:Enum="";Always;Never;IfNotPresent
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
// An optional list of references to secrets in the same namespace
// to use for pulling prometheus and alertmanager images from registries
// see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// Number of replicas of each shard to deploy for a Prometheus deployment.
// Number of replicas multiplied by shards is the total number of Pods
// created.
Replicas *int32 `json:"replicas,omitempty"`
// EXPERIMENTAL: Number of shards to distribute targets onto. Number of
// replicas multiplied by shards is the total number of Pods created. Note
// that scaling down shards will not reshard data onto remaining instances,
// it must be manually moved. Increasing shards will not reshard data
// either but it will continue to be available from the same instances. To
// query globally use Thanos sidecar and Thanos querier or remote write
// data to a central location. Sharding is done on the content of the
// `__address__` target meta-label.
Shards *int32 `json:"shards,omitempty"`
// Name of Prometheus external label used to denote replica name.
// Defaults to the value of `prometheus_replica`. External label will
// _not_ be added when value is set to empty string (`""`).
ReplicaExternalLabelName *string `json:"replicaExternalLabelName,omitempty"`
// Name of Prometheus external label used to denote Prometheus instance
// name. Defaults to the value of `prometheus`. External label will
// _not_ be added when value is set to empty string (`""`).
PrometheusExternalLabelName *string `json:"prometheusExternalLabelName,omitempty"`
// Log level for Prometheus to be configured with.
//+kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for Prometheus to be configured with.
//+kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// Interval between consecutive scrapes. Default: `30s`
// +kubebuilder:default:="30s"
ScrapeInterval Duration `json:"scrapeInterval,omitempty"`
// Number of seconds to wait for target to respond before erroring.
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
// The labels to add to any time series or alerts when communicating with
// external systems (federation, remote storage, Alertmanager).
ExternalLabels map[string]string `json:"externalLabels,omitempty"`
// Enable Prometheus to be used as a receiver for the Prometheus remote write protocol. Defaults to the value of `false`.
// WARNING: This is not considered an efficient way of ingesting samples.
// Use it with caution for specific low-volume use cases.
// It is not suitable for replacing the ingestion via scraping and turning
// Prometheus into a push-based metrics collection system.
// For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver
// Only valid in Prometheus versions 2.33.0 and newer.
EnableRemoteWriteReceiver bool `json:"enableRemoteWriteReceiver,omitempty"`
// Enable access to Prometheus disabled features. By default, no features are enabled.
// Enabling disabled features is entirely outside the scope of what the maintainers will
// support and by doing so, you accept that this behaviour may break at any
// time without notice.
// For more information see https://prometheus.io/docs/prometheus/latest/disabled_features/
EnableFeatures []string `json:"enableFeatures,omitempty"`
// The external URL the Prometheus instances will be available under. This is
// necessary to generate correct URLs. This is necessary if Prometheus is not
// served from root of a DNS name.
ExternalURL string `json:"externalUrl,omitempty"`
// The route prefix Prometheus registers HTTP handlers for. This is useful,
// if using ExternalURL and a proxy is rewriting HTTP routes of a request,
// and the actual ExternalURL is still true, but the server serves requests
// under a different route prefix. For example for use with `kubectl proxy`.
RoutePrefix string `json:"routePrefix,omitempty"`
// Storage spec to specify how storage shall be used.
Storage *StorageSpec `json:"storage,omitempty"`
// Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will
// be appended to other volumes that are generated as a result of StorageSpec objects.
Volumes []v1.Volume `json:"volumes,omitempty"`
// VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition.
// VolumeMounts specified will be appended to other VolumeMounts in the prometheus container,
// that are generated as a result of StorageSpec objects.
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// Defines the web command line flags when starting Prometheus.
Web *PrometheusWebSpec `json:"web,omitempty"`
// Define resources requests and limits for single Pods.
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// Define which Nodes the Pods are scheduled on.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the
// Prometheus Pods.
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// Secrets is a list of Secrets in the same namespace as the Prometheus
// object, which shall be mounted into the Prometheus Pods.
// Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`.
// The Secrets are mounted into /etc/prometheus/secrets/<secret-name> in the 'prometheus' container.
Secrets []string `json:"secrets,omitempty"`
// ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus
// object, which shall be mounted into the Prometheus Pods.
// Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-<configmap-name>`.
// The ConfigMaps are mounted into /etc/prometheus/configmaps/<configmap-name> in the 'prometheus' container.
ConfigMaps []string `json:"configMaps,omitempty"`
// If specified, the pod's scheduling constraints.
Affinity *v1.Affinity `json:"affinity,omitempty"`
// If specified, the pod's tolerations.
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// If specified, the pod's topology spread constraints.
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// remoteWrite is the list of remote write configurations.
RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// This defaults to the default PodSecurityContext.
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
// ListenLocal makes the Prometheus server listen on loopback, so that it
// does not bind against the Pod IP.
ListenLocal bool `json:"listenLocal,omitempty"`
// Containers allows injecting additional containers or modifying operator
// generated containers. This can be used to allow adding an authentication
// proxy to a Prometheus pod or to change the behavior of an operator
// generated container. Containers described here modify an operator
// generated container if they share the same name and modifications are
// done via a strategic merge patch. The current container names are:
// `prometheus`, `config-reloader`, and `thanos-sidecar`. Overriding
// containers is entirely outside the scope of what the maintainers will
// support and by doing so, you accept that this behaviour may break at any
// time without notice.
Containers []v1.Container `json:"containers,omitempty"`
// InitContainers allows adding initContainers to the pod definition. Those can be used to e.g.
// fetch secrets for injection into the Prometheus configuration from external sources. Any errors
// during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
// InitContainers described here modify an operator
// generated init containers if they share the same name and modifications are
// done via a strategic merge patch. The current init container name is:
// `init-config-reloader`. Overriding init containers is entirely outside the
// scope of what the maintainers will support and by doing so, you accept that
// this behaviour may break at any time without notice.
InitContainers []v1.Container `json:"initContainers,omitempty"`
// AdditionalScrapeConfigs allows specifying a key of a Secret containing
// additional Prometheus scrape configurations. Scrape configurations
// specified are appended to the configurations generated by the Prometheus
// Operator. Job configurations specified must have the form as specified
// in the official Prometheus documentation:
// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config.
// As scrape configs are appended, the user is responsible to make sure it
// is valid. Note that using this feature may expose the possibility to
// break upgrades of Prometheus. It is advised to review Prometheus release
// notes to ensure that no incompatible scrape configs are going to break
// Prometheus after the upgrade.
AdditionalScrapeConfigs *v1.SecretKeySelector `json:"additionalScrapeConfigs,omitempty"`
// APIServerConfig allows specifying a host and auth methods to access apiserver.
// If left empty, Prometheus is assumed to run inside of the cluster
// and will discover API servers automatically and use the pod's CA certificate
// and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/.
APIServerConfig *APIServerConfig `json:"apiserverConfig,omitempty"`
// Priority class assigned to the Pods
PriorityClassName string `json:"priorityClassName,omitempty"`
// Port name used for the pods and governing service.
// This defaults to web
PortName string `json:"portName,omitempty"`
// ArbitraryFSAccessThroughSMs configures whether configuration
// based on a service monitor can access arbitrary files on the file system
// of the Prometheus container e.g. bearer token files.
ArbitraryFSAccessThroughSMs ArbitraryFSAccessThroughSMsConfig `json:"arbitraryFSAccessThroughSMs,omitempty"`
// When true, Prometheus resolves label conflicts by renaming the labels in
// the scraped data to "exported_<label value>" for all targets created
// from service and pod monitors.
// Otherwise the HonorLabels field of the service or pod monitor applies.
OverrideHonorLabels bool `json:"overrideHonorLabels,omitempty"`
// When true, Prometheus ignores the timestamps for all the targets created
// from service and pod monitors.
// Otherwise the HonorTimestamps field of the service or pod monitor applies.
OverrideHonorTimestamps bool `json:"overrideHonorTimestamps,omitempty"`
// IgnoreNamespaceSelectors if set to true will ignore NamespaceSelector
// settings from all PodMonitor, ServiceMonitor and Probe objects. They will
// only discover endpoints within the namespace of the PodMonitor,
// ServiceMonitor and Probe objects.
// Defaults to false.
IgnoreNamespaceSelectors bool `json:"ignoreNamespaceSelectors,omitempty"`
// EnforcedNamespaceLabel If set, a label will be added to
//
// 1. all user-metrics (created by `ServiceMonitor`, `PodMonitor` and `Probe` objects) and
// 2. in all `PrometheusRule` objects (except the ones excluded in `prometheusRulesExcludedFromEnforce`) to
// * alerting & recording rules and
// * the metrics used in their expressions (`expr`).
//
// Label name is this field's value.
// Label value is the namespace of the created object (mentioned above).
EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"`
// EnforcedSampleLimit defines global limit on number of scraped samples
// that will be accepted. This overrides any SampleLimit set per
// ServiceMonitor or/and PodMonitor. It is meant to be used by admins to
// enforce the SampleLimit to keep overall number of samples/series under
// the desired limit.
// Note that if SampleLimit is lower that value will be taken instead.
EnforcedSampleLimit *uint64 `json:"enforcedSampleLimit,omitempty"`
// EnforcedTargetLimit defines a global limit on the number of scraped
// targets. This overrides any TargetLimit set per ServiceMonitor or/and
// PodMonitor. It is meant to be used by admins to enforce the TargetLimit
// to keep the overall number of targets under the desired limit.
// Note that if TargetLimit is lower, that value will be taken instead,
// except if either value is zero, in which case the non-zero value will be
// used. If both values are zero, no limit is enforced.
EnforcedTargetLimit *uint64 `json:"enforcedTargetLimit,omitempty"`
// Per-scrape limit on number of labels that will be accepted for a sample. If
// more than this number of labels are present post metric-relabeling, the
// entire scrape will be treated as failed. 0 means no limit.
// Only valid in Prometheus versions 2.27.0 and newer.
EnforcedLabelLimit *uint64 `json:"enforcedLabelLimit,omitempty"`
// Per-scrape limit on length of labels name that will be accepted for a sample.
// If a label name is longer than this number post metric-relabeling, the entire
// scrape will be treated as failed. 0 means no limit.
// Only valid in Prometheus versions 2.27.0 and newer.
EnforcedLabelNameLengthLimit *uint64 `json:"enforcedLabelNameLengthLimit,omitempty"`
// Per-scrape limit on length of labels value that will be accepted for a sample.
// If a label value is longer than this number post metric-relabeling, the
// entire scrape will be treated as failed. 0 means no limit.
// Only valid in Prometheus versions 2.27.0 and newer.
EnforcedLabelValueLengthLimit *uint64 `json:"enforcedLabelValueLengthLimit,omitempty"`
// EnforcedBodySizeLimit defines the maximum size of uncompressed response body
// that will be accepted by Prometheus. Targets responding with a body larger than this many bytes
// will cause the scrape to fail. Example: 100MB.
// If defined, the limit will apply to all service/pod monitors and probes.
// This is an experimental feature, this behaviour could
// change or be removed in the future.
// Only valid in Prometheus versions 2.28.0 and newer.
EnforcedBodySizeLimit ByteSize `json:"enforcedBodySizeLimit,omitempty"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
// +optional
MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"`
// Pods' hostAliases configuration
// +listType=map
// +listMapKey=ip
HostAliases []HostAlias `json:"hostAliases,omitempty"`
// AdditionalArgs allows setting additional arguments for the Prometheus container.
// It is intended for e.g. activating hidden flags which are not supported by
// the dedicated configuration options yet. The arguments are passed as-is to the
// Prometheus container which may cause issues if they are invalid or not supported
// by the given Prometheus version.
// In case of an argument conflict (e.g. an argument which is already set by the
// operator itself) or when providing an invalid argument the reconciliation will
// fail and an error will be logged.
AdditionalArgs []Argument `json:"additionalArgs,omitempty"`
// Enable compression of the write-ahead log using Snappy. This flag is
// only available in versions of Prometheus >= 2.11.0.
WALCompression *bool `json:"walCompression,omitempty"`
// List of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects
// to be excluded from enforcing a namespace label of origin.
// Applies only if enforcedNamespaceLabel set to true.
ExcludedFromEnforcement []ObjectReference `json:"excludedFromEnforcement,omitempty"`
// Use the host's network namespace if true.
// Make sure to understand the security implications if you want to enable it.
// When hostNetwork is enabled, this will set dnsPolicy to ClusterFirstWithHostNet automatically.
HostNetwork bool `json:"hostNetwork,omitempty"`
// PodTargetLabels are added to all Pod/ServiceMonitors' podTargetLabels
PodTargetLabels []string `json:"podTargetLabels,omitempty"`
}
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:categories="prometheus-operator",shortName="prom"
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="The version of Prometheus"
// +kubebuilder:printcolumn:name="Desired",type="integer",JSONPath=".spec.replicas",description="The number of desired replicas"
// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.availableReplicas",description="The number of ready replicas"
// +kubebuilder:printcolumn:name="Reconciled",type="string",JSONPath=".status.conditions[?(@.type == 'Reconciled')].status"
// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.conditions[?(@.type == 'Available')].status"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".status.paused",description="Whether the resource reconciliation is paused or not",priority=1
// +kubebuilder:subresource:status
// Prometheus defines a Prometheus deployment.
type Prometheus struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the Prometheus cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec PrometheusSpec `json:"spec"`
// Most recent observed status of the Prometheus cluster. Read-only.
// More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Status PrometheusStatus `json:"status,omitempty"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *Prometheus) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// PrometheusList is a list of Prometheuses.
// +k8s:openapi-gen=true
type PrometheusList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Prometheuses
Items []*Prometheus `json:"items"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *PrometheusList) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +k8s:openapi-gen=true
type PrometheusSpec struct {
CommonPrometheusFields `json:",inline"`
// Base image to use for a Prometheus deployment.
// Deprecated: use 'image' instead
BaseImage string `json:"baseImage,omitempty"`
// Tag of Prometheus container image to be deployed. Defaults to the value of `version`.
// Version is ignored if Tag is set.
// Deprecated: use 'image' instead. The image tag can be specified
// as part of the image URL.
Tag string `json:"tag,omitempty"`
// SHA of Prometheus container image to be deployed. Defaults to the value of `version`.
// Similar to a tag, but the SHA explicitly deploys an immutable container image.
// Version and Tag are ignored if SHA is set.
// Deprecated: use 'image' instead. The image digest can be specified
// as part of the image URL.
SHA string `json:"sha,omitempty"`
// Time duration Prometheus shall retain data for. Default is '24h' if
// retentionSize is not set, and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)`
// (milliseconds seconds minutes hours days weeks years).
Retention Duration `json:"retention,omitempty"`
// Maximum amount of disk space used by blocks.
RetentionSize ByteSize `json:"retentionSize,omitempty"`
// Disable prometheus compaction.
DisableCompaction bool `json:"disableCompaction,omitempty"`
// /--rules.*/ command-line arguments.
Rules Rules `json:"rules,omitempty"`
// PrometheusRulesExcludedFromEnforce - list of prometheus rules to be excluded from enforcing
// of adding namespace labels. Works only if enforcedNamespaceLabel set to true.
// Make sure both ruleNamespace and ruleName are set for each pair.
// Deprecated: use excludedFromEnforcement instead.
PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfig `json:"prometheusRulesExcludedFromEnforce,omitempty"`
// QuerySpec defines the query command line flags when starting Prometheus.
Query *QuerySpec `json:"query,omitempty"`
// A selector to select which PrometheusRules to mount for loading alerting/recording
// rules from. Until (excluding) Prometheus Operator v0.24.0 Prometheus
// Operator will migrate any legacy rule ConfigMaps to PrometheusRule custom
// resources selected by RuleSelector. Make sure it does not match any config
// maps that you do not want to be migrated.
RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"`
// Namespaces to be selected for PrometheusRules discovery. If unspecified, only
// the same namespace as the Prometheus object is in is used.
RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"`
// Define details regarding alerting.
Alerting *AlertingSpec `json:"alerting,omitempty"`
// remoteRead is the list of remote read configurations.
RemoteRead []RemoteReadSpec `json:"remoteRead,omitempty"`
// AdditionalAlertRelabelConfigs allows specifying a key of a Secret containing
// additional Prometheus alert relabel configurations. Alert relabel configurations
// specified are appended to the configurations generated by the Prometheus
// Operator. Alert relabel configurations specified must have the form as specified
// in the official Prometheus documentation:
// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs.
// As alert relabel configs are appended, the user is responsible to make sure it
// is valid. Note that using this feature may expose the possibility to
// break upgrades of Prometheus. It is advised to review Prometheus release
// notes to ensure that no incompatible alert relabel configs are going to break
// Prometheus after the upgrade.
AdditionalAlertRelabelConfigs *v1.SecretKeySelector `json:"additionalAlertRelabelConfigs,omitempty"`
// AdditionalAlertManagerConfigs allows specifying a key of a Secret containing
// additional Prometheus AlertManager configurations. AlertManager configurations
// specified are appended to the configurations generated by the Prometheus
// Operator. Job configurations specified must have the form as specified
// in the official Prometheus documentation:
// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config.
// As AlertManager configs are appended, the user is responsible to make sure it
// is valid. Note that using this feature may expose the possibility to
// break upgrades of Prometheus. It is advised to review Prometheus release
// notes to ensure that no incompatible AlertManager configs are going to break
// Prometheus after the upgrade.
AdditionalAlertManagerConfigs *v1.SecretKeySelector `json:"additionalAlertManagerConfigs,omitempty"`
// Thanos configuration allows configuring various aspects of a Prometheus
// server in a Thanos environment.
//
// This section is experimental, it may change significantly without
// deprecation notice in any release.
//
// This is experimental and may change significantly without backward
// compatibility in any release.
Thanos *ThanosSpec `json:"thanos,omitempty"`
// QueryLogFile specifies the file to which PromQL queries are logged.
// If the filename has an empty path, e.g. 'query.log', prometheus-operator will mount the file into an
// emptyDir volume at `/var/log/prometheus`. If a full path is provided, e.g. /var/log/prometheus/query.log, you must mount a volume
// in the specified directory and it must be writable. This is because the prometheus container runs with a read-only root filesystem for security reasons.
// Alternatively, the location can be set to a stdout location such as `/dev/stdout` to log
// query information to the default Prometheus log stream.
// This is only available in versions of Prometheus >= 2.16.0.
// For more details, see the Prometheus docs (https://prometheus.io/docs/guides/query-log/)
QueryLogFile string `json:"queryLogFile,omitempty"`
// AllowOverlappingBlocks enables vertical compaction and vertical query merge in Prometheus.
// This is still experimental in Prometheus so it may change in any upcoming release.
AllowOverlappingBlocks bool `json:"allowOverlappingBlocks,omitempty"`
// Exemplars related settings that are runtime reloadable.
// It requires to enable the exemplar storage feature to be effective.
Exemplars *Exemplars `json:"exemplars,omitempty"`
// Interval between consecutive evaluations. Default: `30s`
// +kubebuilder:default:="30s"
EvaluationInterval Duration `json:"evaluationInterval,omitempty"`
// Enable access to prometheus web admin API. Defaults to the value of `false`.
// WARNING: Enabling the admin APIs enables mutating endpoints, to delete data,
// shutdown Prometheus, and more. Enabling this should be done with care and the
// user is advised to add additional authentication authorization via a proxy to
// ensure only clients authorized to perform these actions can do so.
// For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis
EnableAdminAPI bool `json:"enableAdminAPI,omitempty"`
// Defines the runtime reloadable configuration of the timeseries database
// (TSDB).
TSDB TSDBSpec `json:"tsdb,omitempty"`
}
// PrometheusStatus is the most recent observed status of the Prometheus cluster.
// More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +k8s:openapi-gen=true
type PrometheusStatus struct {
// Represents whether any actions on the underlying managed objects are
// being performed. Only delete actions will be performed.
Paused bool `json:"paused"`
// Total number of non-terminated pods targeted by this Prometheus deployment
// (their labels match the selector).
Replicas int32 `json:"replicas"`
// Total number of non-terminated pods targeted by this Prometheus deployment
// that have the desired version spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this Prometheus deployment.
AvailableReplicas int32 `json:"availableReplicas"`
// Total number of unavailable pods targeted by this Prometheus deployment.
UnavailableReplicas int32 `json:"unavailableReplicas"`
// The current state of the Prometheus deployment.
// +listType=map
// +listMapKey=type
// +optional
Conditions []Condition `json:"conditions,omitempty"`
// The list has one entry per shard. Each entry provides a summary of the shard status.
// +listType=map
// +listMapKey=shardID
// +optional
ShardStatuses []ShardStatus `json:"shardStatuses,omitempty"`
}
// AlertingSpec defines parameters for alerting configuration of Prometheus servers.
// +k8s:openapi-gen=true
type AlertingSpec struct {
// AlertmanagerEndpoints Prometheus should fire alerts against.
Alertmanagers []AlertmanagerEndpoints `json:"alertmanagers"`
}
// StorageSpec defines the configured storage for a group Prometheus servers.
// If no storage option is specified, then by default an [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) will be used.
// If multiple storage options are specified, priority will be given as follows: EmptyDir, Ephemeral, and lastly VolumeClaimTemplate.
// +k8s:openapi-gen=true
type StorageSpec struct {
// Deprecated: subPath usage will be disabled by default in a future release, this option will become unnecessary.
// DisableMountSubPath allows to remove any subPath usage in volume mounts.
DisableMountSubPath bool `json:"disableMountSubPath,omitempty"`
// EmptyDirVolumeSource to be used by the StatefulSet. If specified, used in place of any volumeClaimTemplate. More
// info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
EmptyDir *v1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`
// EphemeralVolumeSource to be used by the StatefulSet.
// This is a beta field in k8s 1.21, for lower versions, starting with k8s 1.19, it requires enabling the GenericEphemeralVolume feature gate.
// More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes
Ephemeral *v1.EphemeralVolumeSource `json:"ephemeral,omitempty"`
// A PVC spec to be used by the StatefulSet. The easiest way to use a volume that cannot be automatically provisioned
// (for whatever reason) is to use a label selector alongside manually created PersistentVolumes.
VolumeClaimTemplate EmbeddedPersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"`
}
// QuerySpec defines the query command line flags when starting Prometheus.
// +k8s:openapi-gen=true
type QuerySpec struct {
// The delta difference allowed for retrieving metrics during expression evaluations.
LookbackDelta *string `json:"lookbackDelta,omitempty"`
// Number of concurrent queries that can be run at once.
// +kubebuilder:validation:Minimum:=1
MaxConcurrency *int32 `json:"maxConcurrency,omitempty"`
// Maximum number of samples a single query can load into memory. Note that queries will fail if they would load more samples than this into memory, so this also limits the number of samples a query can return.
MaxSamples *int32 `json:"maxSamples,omitempty"`
// Maximum time a query may take before being aborted.
Timeout *Duration `json:"timeout,omitempty"`
}
// PrometheusWebSpec defines the web command line flags when starting Prometheus.
// +k8s:openapi-gen=true
type PrometheusWebSpec struct {
WebConfigFileFields `json:",inline"`
// The prometheus web page title
PageTitle *string `json:"pageTitle,omitempty"`
// Defines the maximum number of simultaneous connections
// A zero value means that Prometheus doesn't accept any incoming connection.
// +kubebuilder:validation:Minimum:=0
MaxConnections *int32 `json:"maxConnections,omitempty"`
}
// ThanosSpec defines parameters for a Prometheus server within a Thanos deployment.
// +k8s:openapi-gen=true
type ThanosSpec struct {
// Image if specified has precedence over baseImage, tag and sha
// combinations. Specifying the version is still necessary to ensure the
// Prometheus Operator knows what version of Thanos is being
// configured.
Image *string `json:"image,omitempty"`
// Version describes the version of Thanos to use.
Version *string `json:"version,omitempty"`
// Tag of Thanos sidecar container image to be deployed. Defaults to the value of `version`.
// Version is ignored if Tag is set.
// Deprecated: use 'image' instead. The image tag can be specified
// as part of the image URL.
Tag *string `json:"tag,omitempty"`
// SHA of Thanos container image to be deployed. Defaults to the value of `version`.
// Similar to a tag, but the SHA explicitly deploys an immutable container image.
// Version and Tag are ignored if SHA is set.
// Deprecated: use 'image' instead. The image digest can be specified
// as part of the image URL.
SHA *string `json:"sha,omitempty"`
// Thanos base image if other than default.
// Deprecated: use 'image' instead
BaseImage *string `json:"baseImage,omitempty"`
// Resources defines the resource requirements for the Thanos sidecar.
// If not provided, no requests/limits will be set
Resources v1.ResourceRequirements `json:"resources,omitempty"`
// ObjectStorageConfig configures object storage in Thanos.
// Alternative to ObjectStorageConfigFile, and lower order priority.
ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"`
// ObjectStorageConfigFile specifies the path of the object storage configuration file.
// When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.
ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"`
// If true, the Thanos sidecar listens on the loopback interface
// for the HTTP and gRPC endpoints.
// It takes precedence over `grpcListenLocal` and `httpListenLocal`.
// Deprecated: use `grpcListenLocal` and `httpListenLocal` instead.
ListenLocal bool `json:"listenLocal,omitempty"`
// If true, the Thanos sidecar listens on the loopback interface
// for the gRPC endpoints.
// It has no effect if `listenLocal` is true.
GRPCListenLocal bool `json:"grpcListenLocal,omitempty"`
// If true, the Thanos sidecar listens on the loopback interface
// for the HTTP endpoints.
// It has no effect if `listenLocal` is true.
HTTPListenLocal bool `json:"httpListenLocal,omitempty"`
// TracingConfig configures tracing in Thanos. This is an experimental feature, it may change in any upcoming release in a breaking way.
TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"`
// TracingConfig specifies the path of the tracing configuration file.
// When used alongside with TracingConfig, TracingConfigFile takes precedence.
TracingConfigFile string `json:"tracingConfigFile,omitempty"`
// GRPCServerTLSConfig configures the TLS parameters for the gRPC server
// providing the StoreAPI.
// Note: Currently only the CAFile, CertFile, and KeyFile fields are supported.
// Maps to the '--grpc-server-tls-*' CLI args.
GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"`
// LogLevel for Thanos sidecar to be configured with.
//+kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// LogFormat for Thanos sidecar to be configured with.
//+kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// MinTime for Thanos sidecar to be configured with. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y.
MinTime string `json:"minTime,omitempty"`
// ReadyTimeout is the maximum time Thanos sidecar will wait for Prometheus to start. Eg 10m
ReadyTimeout Duration `json:"readyTimeout,omitempty"`
// VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition.
// VolumeMounts specified will be appended to other VolumeMounts in the thanos-sidecar container.
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// AdditionalArgs allows setting additional arguments for the Thanos container.
// The arguments are passed as-is to the Thanos container which may cause issues
// if they are invalid or not supported the given Thanos version.
// In case of an argument conflict (e.g. an argument which is already set by the
// operator itself) or when providing an invalid argument the reconciliation will
// fail and an error will be logged.
AdditionalArgs []Argument `json:"additionalArgs,omitempty"`
}
// RemoteWriteSpec defines the configuration to write samples from Prometheus
// to a remote endpoint.
// +k8s:openapi-gen=true
type RemoteWriteSpec struct {
// The URL of the endpoint to send samples to.
URL string `json:"url"`
// The name of the remote write queue, it must be unique if specified. The
// name is used in metrics and logging in order to differentiate queues.
// Only valid in Prometheus versions 2.15.0 and newer.
Name string `json:"name,omitempty"`
// Enables sending of exemplars over remote write. Note that
// exemplar-storage itself must be enabled using the enableFeature option
// for exemplars to be scraped in the first place. Only valid in
// Prometheus versions 2.27.0 and newer.
SendExemplars *bool `json:"sendExemplars,omitempty"`
// Timeout for requests to the remote write endpoint.
RemoteTimeout Duration `json:"remoteTimeout,omitempty"`
// Custom HTTP headers to be sent along with each remote write request.
// Be aware that headers that are set by Prometheus itself can't be overwritten.
// Only valid in Prometheus versions 2.25.0 and newer.
Headers map[string]string `json:"headers,omitempty"`
// The list of remote write relabel configurations.
WriteRelabelConfigs []RelabelConfig `json:"writeRelabelConfigs,omitempty"`
// OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// BasicAuth for the URL.
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// Bearer token for remote write.
BearerToken string `json:"bearerToken,omitempty"`
// File to read bearer token for remote write.
BearerTokenFile string `json:"bearerTokenFile,omitempty"`
// Authorization section for remote write
Authorization *Authorization `json:"authorization,omitempty"`
// Sigv4 allows to configures AWS's Signature Verification 4
Sigv4 *Sigv4 `json:"sigv4,omitempty"`
// TLS Config to use for remote write.
TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
// Optional ProxyURL.
ProxyURL string `json:"proxyUrl,omitempty"`
// QueueConfig allows tuning of the remote write queue parameters.
QueueConfig *QueueConfig `json:"queueConfig,omitempty"`
// MetadataConfig configures the sending of series metadata to the remote storage.
MetadataConfig *MetadataConfig `json:"metadataConfig,omitempty"`
}
// QueueConfig allows the tuning of remote write's queue_config parameters.
// This object is referenced in the RemoteWriteSpec object.
// +k8s:openapi-gen=true
type QueueConfig struct {
// Capacity is the number of samples to buffer per shard before we start dropping them.
Capacity int `json:"capacity,omitempty"`
// MinShards is the minimum number of shards, i.e. amount of concurrency.
MinShards int `json:"minShards,omitempty"`
// MaxShards is the maximum number of shards, i.e. amount of concurrency.
MaxShards int `json:"maxShards,omitempty"`
// MaxSamplesPerSend is the maximum number of samples per send.
MaxSamplesPerSend int `json:"maxSamplesPerSend,omitempty"`
// BatchSendDeadline is the maximum time a sample will wait in buffer.
BatchSendDeadline string `json:"batchSendDeadline,omitempty"`
// MaxRetries is the maximum number of times to retry a batch on recoverable errors.
MaxRetries int `json:"maxRetries,omitempty"`
// MinBackoff is the initial retry delay. Gets doubled for every retry.
MinBackoff string `json:"minBackoff,omitempty"`
// MaxBackoff is the maximum retry delay.
MaxBackoff string `json:"maxBackoff,omitempty"`
// Retry upon receiving a 429 status code from the remote-write storage.
// This is experimental feature and might change in the future.
RetryOnRateLimit bool `json:"retryOnRateLimit,omitempty"`
}
// Sigv4 optionally configures AWS's Signature Verification 4 signing process to
// sign requests. Cannot be set at the same time as basic_auth or authorization.
// +k8s:openapi-gen=true
type Sigv4 struct {
// Region is the AWS region. If blank, the region from the default credentials chain used.
Region string `json:"region,omitempty"`
// AccessKey is the AWS API key. If blank, the environment variable `AWS_ACCESS_KEY_ID` is used.
AccessKey *v1.SecretKeySelector `json:"accessKey,omitempty"`
// SecretKey is the AWS API secret. If blank, the environment variable `AWS_SECRET_ACCESS_KEY` is used.
SecretKey *v1.SecretKeySelector `json:"secretKey,omitempty"`
// Profile is the named AWS profile used to authenticate.
Profile string `json:"profile,omitempty"`
// RoleArn is the named AWS profile used to authenticate.
RoleArn string `json:"roleArn,omitempty"`
}
// RemoteReadSpec defines the configuration for Prometheus to read back samples
// from a remote endpoint.
// +k8s:openapi-gen=true
type RemoteReadSpec struct {
// The URL of the endpoint to query from.
URL string `json:"url"`
// The name of the remote read queue, it must be unique if specified. The name
// is used in metrics and logging in order to differentiate read
// configurations. Only valid in Prometheus versions 2.15.0 and newer.
Name string `json:"name,omitempty"`
// An optional list of equality matchers which have to be present
// in a selector to query the remote read endpoint.
RequiredMatchers map[string]string `json:"requiredMatchers,omitempty"`
// Timeout for requests to the remote read endpoint.
RemoteTimeout Duration `json:"remoteTimeout,omitempty"`
// Custom HTTP headers to be sent along with each remote read request.
// Be aware that headers that are set by Prometheus itself can't be overwritten.
// Only valid in Prometheus versions 2.26.0 and newer.
Headers map[string]string `json:"headers,omitempty"`
// Whether reads should be made for queries for time ranges that
// the local storage should have complete data for.
ReadRecent bool `json:"readRecent,omitempty"`
// BasicAuth for the URL.
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
// Bearer token for remote read.
BearerToken string `json:"bearerToken,omitempty"`
// File to read bearer token for remote read.
BearerTokenFile string `json:"bearerTokenFile,omitempty"`
// Authorization section for remote read
Authorization *Authorization `json:"authorization,omitempty"`
// TLS Config to use for remote read.
TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
// Optional ProxyURL.
ProxyURL string `json:"proxyUrl,omitempty"`
// Whether to use the external labels as selectors for the remote read endpoint.
// Requires Prometheus v2.34.0 and above.
FilterExternalLabels *bool `json:"filterExternalLabels,omitempty"`
}
// RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion.
// It defines `<metric_relabel_configs>`-section of Prometheus configuration.
// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
// +k8s:openapi-gen=true
type RelabelConfig struct {
// The source labels select values from existing labels. Their content is concatenated
// using the configured separator and matched against the configured regular expression
// for the replace, keep, and drop actions.
SourceLabels []LabelName `json:"sourceLabels,omitempty"`
// Separator placed between concatenated source label values. default is ';'.
Separator string `json:"separator,omitempty"`
// Label to which the resulting value is written in a replace action.
// It is mandatory for replace actions. Regex capture groups are available.
TargetLabel string `json:"targetLabel,omitempty"`
// Regular expression against which the extracted value is matched. Default is '(.*)'
Regex string `json:"regex,omitempty"`
// Modulus to take of the hash of the source label values.
Modulus uint64 `json:"modulus,omitempty"`
// Replacement value against which a regex replace is performed if the
// regular expression matches. Regex capture groups are available. Default is '$1'
Replacement string `json:"replacement,omitempty"`
//Action to perform based on regex matching. Default is 'replace'.
//uppercase and lowercase actions require Prometheus >= 2.36.
//+kubebuilder:validation:Enum=replace;Replace;keep;Keep;drop;Drop;hashmod;HashMod;labelmap;LabelMap;labeldrop;LabelDrop;labelkeep;LabelKeep;lowercase;Lowercase;uppercase;Uppercase
//+kubebuilder:default=replace
Action string `json:"action,omitempty"`
}
// APIServerConfig defines a host and auth methods to access apiserver.
// More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
// +k8s:openapi-gen=true
type APIServerConfig struct {
// Host of apiserver.
// A valid string consisting of a hostname or IP followed by an optional port number
Host string `json:"host"`
// BasicAuth allow an endpoint to authenticate over basic authentication
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// Bearer token for accessing apiserver.
BearerToken string `json:"bearerToken,omitempty"`
// File to read bearer token for accessing apiserver.
BearerTokenFile string `json:"bearerTokenFile,omitempty"`
// TLS Config to use for accessing apiserver.
TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
// Authorization section for accessing apiserver
Authorization *Authorization `json:"authorization,omitempty"`
}
// AlertmanagerEndpoints defines a selection of a single Endpoints object
// containing alertmanager IPs to fire alerts against.
// +k8s:openapi-gen=true
type AlertmanagerEndpoints struct {
// Namespace of Endpoints object.
Namespace string `json:"namespace"`
// Name of Endpoints object in Namespace.
Name string `json:"name"`
// Port the Alertmanager API is exposed on.
Port intstr.IntOrString `json:"port"`
// Scheme to use when firing alerts.
Scheme string `json:"scheme,omitempty"`
// Prefix for the HTTP path alerts are pushed to.
PathPrefix string `json:"pathPrefix,omitempty"`
// TLS Config to use for alertmanager connection.
TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
// BasicAuth allow an endpoint to authenticate over basic authentication
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
// BearerTokenFile to read from filesystem to use when authenticating to
// Alertmanager.
BearerTokenFile string `json:"bearerTokenFile,omitempty"`
// Authorization section for this alertmanager endpoint
Authorization *SafeAuthorization `json:"authorization,omitempty"`
// Version of the Alertmanager API that Prometheus uses to send alerts. It
// can be "v1" or "v2".
APIVersion string `json:"apiVersion,omitempty"`
// Timeout is a per-target Alertmanager timeout when pushing alerts.
Timeout *Duration `json:"timeout,omitempty"`
// Whether to enable HTTP2.
EnableHttp2 *bool `json:"enableHttp2,omitempty"`
}
// /--rules.*/ command-line arguments
// +k8s:openapi-gen=true
type Rules struct {
Alert RulesAlert `json:"alert,omitempty"`
}
// /--rules.alert.*/ command-line arguments
// +k8s:openapi-gen=true
type RulesAlert struct {
// Max time to tolerate prometheus outage for restoring 'for' state of alert.
ForOutageTolerance string `json:"forOutageTolerance,omitempty"`
// Minimum duration between alert and restored 'for' state.
// This is maintained only for alerts with configured 'for' time greater than grace period.
ForGracePeriod string `json:"forGracePeriod,omitempty"`
// Minimum amount of time to wait before resending an alert to Alertmanager.
ResendDelay string `json:"resendDelay,omitempty"`
}
// MetadataConfig configures the sending of series metadata to the remote storage.
// +k8s:openapi-gen=true
type MetadataConfig struct {
// Whether metric metadata is sent to the remote storage or not.
Send bool `json:"send,omitempty"`
// How frequently metric metadata is sent to the remote storage.
SendInterval Duration `json:"sendInterval,omitempty"`
}
type ShardStatus struct {
// Identifier of the shard.
// +required
ShardID string `json:"shardID"`
// Total number of pods targeted by this shard.
Replicas int32 `json:"replicas"`
// Total number of non-terminated pods targeted by this shard
// that have the desired spec.
UpdatedReplicas int32 `json:"updatedReplicas"`
// Total number of available pods (ready for at least minReadySeconds)
// targeted by this shard.
AvailableReplicas int32 `json:"availableReplicas"`
// Total number of unavailable pods targeted by this shard.
UnavailableReplicas int32 `json:"unavailableReplicas"`
}
type TSDBSpec struct {
// Configures how old an out-of-order/out-of-bounds sample can be w.r.t.
// the TSDB max time.
// An out-of-order/out-of-bounds sample is ingested into the TSDB as long as
// the timestamp of the sample is >= (TSDB.MaxTime - outOfOrderTimeWindow).
// Out of order ingestion is an experimental feature and requires
// Prometheus >= v2.39.0.
OutOfOrderTimeWindow Duration `json:"outOfOrderTimeWindow,omitempty"`
}
type Exemplars struct {
// Maximum number of exemplars stored in memory for all series.
// If not set, Prometheus uses its default value.
// A value of zero or less than zero disables the storage.
MaxSize *int64 `json:"maxSize,omitempty"`
}
// SafeAuthorization specifies a subset of the Authorization struct, that is
// safe for use in Endpoints (no CredentialsFile field)
// +k8s:openapi-gen=true
type SafeAuthorization struct {
// Set the authentication type. Defaults to Bearer, Basic will cause an
// error
Type string `json:"type,omitempty"`
// The secret's key that contains the credentials of the request
Credentials *v1.SecretKeySelector `json:"credentials,omitempty"`
}
// Validate semantically validates the given Authorization section.
func (c *SafeAuthorization) Validate() error {
if c == nil {
return nil
}
if strings.ToLower(strings.TrimSpace(c.Type)) == "basic" {
return &AuthorizationValidationError{`Authorization type cannot be set to "basic", use "basic_auth" instead`}
}
if c.Credentials == nil {
return &AuthorizationValidationError{"Authorization credentials are required"}
}
return nil
}
// Authorization contains optional `Authorization` header configuration.
// This section is only understood by versions of Prometheus >= 2.26.0.
type Authorization struct {
SafeAuthorization `json:",inline"`
// File to read a secret from, mutually exclusive with Credentials (from SafeAuthorization)
CredentialsFile string `json:"credentialsFile,omitempty"`
}
// Validate semantically validates the given Authorization section.
func (c *Authorization) Validate() error {
if c.Credentials != nil && c.CredentialsFile != "" {
return &AuthorizationValidationError{"Authorization can not specify both Credentials and CredentialsFile"}
}
if strings.ToLower(strings.TrimSpace(c.Type)) == "basic" {
return &AuthorizationValidationError{"Authorization type cannot be set to \"basic\", use \"basic_auth\" instead"}
}
return nil
}
// AuthorizationValidationError is returned by Authorization.Validate()
// on semantically invalid configurations.
// +k8s:openapi-gen=false
type AuthorizationValidationError struct {
err string
}
func (e *AuthorizationValidationError) Error() string {
return e.err
}

View File

@@ -0,0 +1,110 @@
// Copyright 2018 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.
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
)
const (
PrometheusRuleKind = "PrometheusRule"
PrometheusRuleName = "prometheusrules"
PrometheusRuleKindKey = "prometheusrule"
)
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:categories="prometheus-operator",shortName="promrule"
// PrometheusRule defines recording and alerting rules for a Prometheus instance
type PrometheusRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired alerting rule definitions for Prometheus.
Spec PrometheusRuleSpec `json:"spec"`
}
// DeepCopyObject implements the runtime.Object interface.
func (f *PrometheusRule) DeepCopyObject() runtime.Object {
return f.DeepCopy()
}
// PrometheusRuleSpec contains specification parameters for a Rule.
// +k8s:openapi-gen=true
type PrometheusRuleSpec struct {
// Content of Prometheus rule file
// +listType=map
// +listMapKey=name
Groups []RuleGroup `json:"groups,omitempty"`
}
// RuleGroup and Rule are copied instead of vendored because the
// upstream Prometheus struct definitions don't have json struct tags.
// RuleGroup is a list of sequentially evaluated recording and alerting rules.
// +k8s:openapi-gen=true
type RuleGroup struct {
// Name of the rule group.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// Interval determines how often rules in the group are evaluated.
Interval Duration `json:"interval,omitempty"`
// List of alerting and recording rules.
Rules []Rule `json:"rules"`
// PartialResponseStrategy is only used by ThanosRuler and will
// be ignored by Prometheus instances.
// More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response
// +kubebuilder:validation:Pattern="^(?i)(abort|warn)?$"
PartialResponseStrategy string `json:"partial_response_strategy,omitempty"`
}
// Rule describes an alerting or recording rule
// See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules) rule
// +k8s:openapi-gen=true
type Rule struct {
// Name of the time series to output to. Must be a valid metric name.
// Only one of `record` and `alert` must be set.
Record string `json:"record,omitempty"`
// Name of the alert. Must be a valid label value.
// Only one of `record` and `alert` must be set.
Alert string `json:"alert,omitempty"`
// PromQL expression to evaluate.
Expr intstr.IntOrString `json:"expr"`
// Alerts are considered firing once they have been returned for this long.
For Duration `json:"for,omitempty"`
// Labels to add or overwrite.
Labels map[string]string `json:"labels,omitempty"`
// Annotations to add to each alert.
// Only valid for alerting rules.
Annotations map[string]string `json:"annotations,omitempty"`
}
// PrometheusRuleList is a list of PrometheusRules.
// +k8s:openapi-gen=true
type PrometheusRuleList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of Rules
Items []*PrometheusRule `json:"items"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *PrometheusRuleList) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}

View File

@@ -0,0 +1,99 @@
// Copyright 2018 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.
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
const (
ServiceMonitorsKind = "ServiceMonitor"
ServiceMonitorName = "servicemonitors"
ServiceMonitorKindKey = "servicemonitor"
)
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:categories="prometheus-operator",shortName="smon"
// ServiceMonitor defines monitoring for a set of services.
type ServiceMonitor struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Service selection for target discovery by
// Prometheus.
Spec ServiceMonitorSpec `json:"spec"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *ServiceMonitor) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}
// ServiceMonitorSpec contains specification parameters for a ServiceMonitor.
// +k8s:openapi-gen=true
type ServiceMonitorSpec struct {
// JobLabel selects the label from the associated Kubernetes service which will be used as the `job` label for all metrics.
//
// For example:
// If in `ServiceMonitor.spec.jobLabel: foo` and in `Service.metadata.labels.foo: bar`,
// then the `job="bar"` label is added to all metrics.
//
// If the value of this field is empty or if the label doesn't exist for the given Service, the `job` label of the metrics defaults to the name of the Kubernetes Service.
JobLabel string `json:"jobLabel,omitempty"`
// TargetLabels transfers labels from the Kubernetes `Service` onto the created metrics.
TargetLabels []string `json:"targetLabels,omitempty"`
// PodTargetLabels transfers labels on the Kubernetes `Pod` onto the created metrics.
PodTargetLabels []string `json:"podTargetLabels,omitempty"`
// A list of endpoints allowed as part of this ServiceMonitor.
Endpoints []Endpoint `json:"endpoints"`
// Selector to select Endpoints objects.
Selector metav1.LabelSelector `json:"selector"`
// Selector to select which namespaces the Kubernetes Endpoints objects are discovered from.
NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
// SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
SampleLimit uint64 `json:"sampleLimit,omitempty"`
// TargetLimit defines a limit on the number of scraped targets that will be accepted.
TargetLimit uint64 `json:"targetLimit,omitempty"`
// Per-scrape limit on number of labels that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelLimit uint64 `json:"labelLimit,omitempty"`
// Per-scrape limit on length of labels name that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelNameLengthLimit uint64 `json:"labelNameLengthLimit,omitempty"`
// Per-scrape limit on length of labels value that will be accepted for a sample.
// Only valid in Prometheus versions 2.27.0 and newer.
LabelValueLengthLimit uint64 `json:"labelValueLengthLimit,omitempty"`
// Attaches node metadata to discovered targets.
// Requires Prometheus v2.37.0 and above.
AttachMetadata *AttachMetadata `json:"attachMetadata,omitempty"`
}
// ServiceMonitorList is a list of ServiceMonitors.
// +k8s:openapi-gen=true
type ServiceMonitorList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// List of ServiceMonitors
Items []*ServiceMonitor `json:"items"`
}
// DeepCopyObject implements the runtime.Object interface.
func (l *ServiceMonitorList) DeepCopyObject() runtime.Object {
return l.DeepCopy()
}

View File

@@ -26,9 +26,14 @@ const (
ThanosRulerKindKey = "thanosrulers"
)
// ThanosRuler defines a ThanosRuler deployment.
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:categories="prometheus-operator",shortName="ruler"
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.replicas",description="The number of desired replicas"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".status.paused",description="Whether the resource reconciliation is paused or not",priority=1
// ThanosRuler defines a ThanosRuler deployment.
type ThanosRuler struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -57,10 +62,16 @@ type ThanosRulerList struct {
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +k8s:openapi-gen=true
type ThanosRulerSpec struct {
// Version of Thanos to be deployed.
Version string `json:"version,omitempty"`
// PodMetadata contains Labels and Annotations gets propagated to the thanos ruler pods.
PodMetadata *EmbeddedObjectMetadata `json:"podMetadata,omitempty"`
// Thanos container image URL.
Image string `json:"image,omitempty"`
// Image pull policy for the 'thanos', 'init-config-reloader' and 'config-reloader' containers.
// See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details.
// +kubebuilder:validation:Enum="";Always;Never;IfNotPresent
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
// An optional list of references to secrets in the same namespace
// to use for pulling thanos images from registries
// see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
@@ -79,6 +90,8 @@ type ThanosRulerSpec struct {
Affinity *v1.Affinity `json:"affinity,omitempty"`
// If specified, the pod's tolerations.
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// If specified, the pod's topology spread constraints.
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// This defaults to the default PodSecurityContext.
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
@@ -93,7 +106,11 @@ type ThanosRulerSpec struct {
// be appended to other volumes that are generated as a result of StorageSpec objects.
Volumes []v1.Volume `json:"volumes,omitempty"`
// ObjectStorageConfig configures object storage in Thanos.
// Alternative to ObjectStorageConfigFile, and lower order priority.
ObjectStorageConfig *v1.SecretKeySelector `json:"objectStorageConfig,omitempty"`
// ObjectStorageConfigFile specifies the path of the object storage configuration file.
// When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.
ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"`
// ListenLocal makes the Thanos ruler listen on loopback, so that it
// does not bind against the Pod IP.
ListenLocal bool `json:"listenLocal,omitempty"`
@@ -123,27 +140,36 @@ type ThanosRulerSpec struct {
// and metric that is user created. The label value will always be the namespace of the object that is
// being created.
EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"`
// List of references to PrometheusRule objects
// to be excluded from enforcing a namespace label of origin.
// Applies only if enforcedNamespaceLabel set to true.
ExcludedFromEnforcement []ObjectReference `json:"excludedFromEnforcement,omitempty"`
// PrometheusRulesExcludedFromEnforce - list of Prometheus rules to be excluded from enforcing
// of adding namespace labels. Works only if enforcedNamespaceLabel set to true.
// Make sure both ruleNamespace and ruleName are set for each pair
// Deprecated: use excludedFromEnforcement instead.
PrometheusRulesExcludedFromEnforce []PrometheusRuleExcludeConfig `json:"prometheusRulesExcludedFromEnforce,omitempty"`
// Log level for ThanosRuler to be configured with.
//+kubebuilder:validation:Enum="";debug;info;warn;error
LogLevel string `json:"logLevel,omitempty"`
// Log format for ThanosRuler to be configured with.
//+kubebuilder:validation:Enum="";logfmt;json
LogFormat string `json:"logFormat,omitempty"`
// Port name used for the pods and governing service.
// This defaults to web
PortName string `json:"portName,omitempty"`
// Interval between consecutive evaluations.
EvaluationInterval string `json:"evaluationInterval,omitempty"`
// +kubebuilder:default:="15s"
EvaluationInterval Duration `json:"evaluationInterval,omitempty"`
// Time duration ThanosRuler shall retain data for. Default is '24h',
// and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds seconds minutes hours days weeks years).
Retention string `json:"retention,omitempty"`
// +kubebuilder:default:="24h"
Retention Duration `json:"retention,omitempty"`
// Containers allows injecting additional containers or modifying operator generated
// containers. This can be used to allow adding an authentication proxy to a ThanosRuler pod or
// to change the behavior of an operator generated container. Containers described here modify
// an operator generated container if they share the same name and modifications are done via a
// strategic merge patch. The current container names are: `thanos-ruler` and `rules-configmap-reloader`.
// strategic merge patch. The current container names are: `thanos-ruler` and `config-reloader`.
// Overriding containers is entirely outside the scope of what the maintainers will support and by doing
// so, you accept that this behaviour may break at any time without notice.
Containers []v1.Container `json:"containers,omitempty"`
@@ -157,11 +183,14 @@ type ThanosRulerSpec struct {
InitContainers []v1.Container `json:"initContainers,omitempty"`
// TracingConfig configures tracing in Thanos. This is an experimental feature, it may change in any upcoming release in a breaking way.
TracingConfig *v1.SecretKeySelector `json:"tracingConfig,omitempty"`
// Labels configure the external label pairs to ThanosRuler. If not provided, default replica label
// `thanos_ruler_replica` will be added as a label and be dropped in alerts.
// TracingConfig specifies the path of the tracing configuration file.
// When used alongside with TracingConfig, TracingConfigFile takes precedence.
TracingConfigFile string `json:"tracingConfigFile,omitempty"`
// Labels configure the external label pairs to ThanosRuler. A default replica label
// `thanos_ruler_replica` will be always added as a label with the value of the pod's name and it will be dropped in the alerts.
Labels map[string]string `json:"labels,omitempty"`
// AlertDropLabels configure the label names which should be dropped in ThanosRuler alerts.
// If `labels` field is not provided, `thanos_ruler_replica` will be dropped in alerts by default.
// The replica label `thanos_ruler_replica` will always be dropped in alerts.
AlertDropLabels []string `json:"alertDropLabels,omitempty"`
// The external URL the Thanos Ruler instances will be available under. This is
// necessary to generate correct URLs. This is necessary if Thanos Ruler is not
@@ -178,6 +207,33 @@ type ThanosRulerSpec struct {
// of all alerts.
// Maps to the '--alert.query-url' CLI arg.
AlertQueryURL string `json:"alertQueryUrl,omitempty"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
// This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
// +optional
MinReadySeconds *uint32 `json:"minReadySeconds,omitempty"`
// AlertRelabelConfigs configures alert relabeling in ThanosRuler.
// Alert relabel configurations must have the form as specified in the official Prometheus documentation:
// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs
// Alternative to AlertRelabelConfigFile, and lower order priority.
AlertRelabelConfigs *v1.SecretKeySelector `json:"alertRelabelConfigs,omitempty"`
// AlertRelabelConfigFile specifies the path of the alert relabeling configuration file.
// When used alongside with AlertRelabelConfigs, alertRelabelConfigFile takes precedence.
AlertRelabelConfigFile *string `json:"alertRelabelConfigFile,omitempty"`
// Pods' hostAliases configuration
// +listType=map
// +listMapKey=ip
HostAliases []HostAlias `json:"hostAliases,omitempty"`
// AdditionalArgs allows setting additional arguments for the ThanosRuler container.
// It is intended for e.g. activating hidden flags which are not supported by
// the dedicated configuration options yet. The arguments are passed as-is to the
// ThanosRuler container which may cause issues if they are invalid or not supported
// by the given ThanosRuler version.
// In case of an argument conflict (e.g. an argument which is already set by the
// operator itself) or when providing an invalid argument the reconciliation will
// fail and an error will be logged.
AdditionalArgs []Argument `json:"additionalArgs,omitempty"`
}
// ThanosRulerStatus is the most recent observed status of the ThanosRuler. Read-only. Not

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
// Copyright 2022 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.
package v1alpha1
// Hub marks this type as a conversion hub.
func (*AlertmanagerConfig) Hub() {}

View File

@@ -0,0 +1,18 @@
// Copyright 2020 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.
// +k8s:deepcopy-gen=package
// +groupName=monitoring.coreos.com
package v1alpha1

View File

@@ -0,0 +1,55 @@
// Copyright 2020 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.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring"
)
// SchemeGroupVersion is the group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: monitoring.GroupName, Version: Version}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)
func init() {
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder.Register(addKnownTypes)
}
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&AlertmanagerConfig{},
&AlertmanagerConfigList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@@ -0,0 +1,350 @@
// Copyright 2021 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.
package v1alpha1
import (
"errors"
"fmt"
"regexp"
"strconv"
"strings"
)
func (hc *HTTPConfig) Validate() error {
if hc == nil {
return nil
}
if (hc.BasicAuth != nil || hc.OAuth2 != nil) && (hc.BearerTokenSecret != nil) {
return fmt.Errorf("at most one of basicAuth, oauth2, bearerTokenSecret must be configured")
}
if hc.Authorization != nil {
if hc.BearerTokenSecret != nil {
return fmt.Errorf("authorization is not compatible with bearerTokenSecret")
}
if hc.BasicAuth != nil || hc.OAuth2 != nil {
return fmt.Errorf("at most one of basicAuth, oauth2 & authorization must be configured")
}
if err := hc.Authorization.Validate(); err != nil {
return err
}
}
if hc.OAuth2 != nil {
if hc.BasicAuth != nil {
return fmt.Errorf("at most one of basicAuth, oauth2 & authorization must be configured")
}
if err := hc.OAuth2.Validate(); err != nil {
return err
}
}
if hc.TLSConfig != nil {
if err := hc.TLSConfig.Validate(); err != nil {
return err
}
}
return nil
}
// Validate the MuteTimeInterval
func (mti MuteTimeInterval) Validate() error {
if mti.Name == "" {
return errors.New("empty name field for mute time interval")
}
for i, ti := range mti.TimeIntervals {
for _, time := range ti.Times {
if err := time.Validate(); err != nil {
return fmt.Errorf("time range at %d is invalid: %w", i, err)
}
}
for _, weekday := range ti.Weekdays {
if err := weekday.Validate(); err != nil {
return fmt.Errorf("weekday range at %d is invalid: %w", i, err)
}
}
for _, dom := range ti.DaysOfMonth {
if err := dom.Validate(); err != nil {
return fmt.Errorf("mute time interval is invalid - day of month range at %d is invalid: %w", i, err)
}
}
for _, month := range ti.Months {
if err := month.Validate(); err != nil {
return fmt.Errorf("month range at %d is invalid: %w", i, err)
}
}
for _, year := range ti.Years {
if err := year.Validate(); err != nil {
return fmt.Errorf("year range at %d is invalid: %w", i, err)
}
}
}
return nil
}
// Validate the TimeRange
func (tr TimeRange) Validate() error {
_, err := tr.Parse()
return err
}
// Parse returns a ParsedRange on valid input or an error if the fields cannot be parsed
// End of the day is represented as 1440.
func (tr TimeRange) Parse() (*ParsedRange, error) {
if tr.StartTime == "" || tr.EndTime == "" {
return nil, fmt.Errorf("start and end are required")
}
start, err := parseTime(string(tr.StartTime))
if err != nil {
return nil, fmt.Errorf("start time invalid: %w", err)
}
end, err := parseTime(string(tr.EndTime))
if err != nil {
return nil, fmt.Errorf("end time invalid: %w", err)
}
if start >= end {
return nil, fmt.Errorf("start time %d cannot be equal or greater than end time %d", start, end)
}
return &ParsedRange{
Start: start,
End: end,
}, nil
}
// Validate the WeekdayRange
func (wr WeekdayRange) Validate() error {
_, err := wr.Parse()
return err
}
// Parse returns a ParsedRange on valid input or an error if the fields cannot be parsed
// The week starts on Sunday -> 0
func (wr WeekdayRange) Parse() (*ParsedRange, error) {
startStr, endStr, err := parseRange(string(wr))
if err != nil {
return nil, err
}
start, err := Weekday(startStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse start day from weekday range: %w", err)
}
end, err := Weekday(endStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse end day from weekday range: %w", err)
}
if start > end {
return nil, errors.New("start day cannot be before end day")
}
if start < 0 || start > 6 {
return nil, fmt.Errorf("%s is not a valid day of the week: out of range", startStr)
}
if end < 0 || end > 6 {
return nil, fmt.Errorf("%s is not a valid day of the week: out of range", endStr)
}
return &ParsedRange{Start: start, End: end}, nil
}
// Validate the YearRange
func (yr YearRange) Validate() error {
_, err := yr.Parse()
return err
}
// Parse returns a ParsedRange on valid input or an error if the fields cannot be parsed
func (yr YearRange) Parse() (*ParsedRange, error) {
startStr, endStr, err := parseRange(string(yr))
if err != nil {
return nil, err
}
start, err := strconv.Atoi(startStr)
if err != nil {
fmt.Errorf("start year cannot be %s parsed: %w", startStr, err)
}
end, err := strconv.Atoi(endStr)
if err != nil {
fmt.Errorf("end year cannot be %s parsed: %w", endStr, err)
}
if start > end {
return nil, fmt.Errorf("end year %d is before start year %d", end, start)
}
return &ParsedRange{Start: start, End: end}, nil
}
// Int returns an integer, which is the canonical representation
// of the Weekday in upstream types.
// Returns an error if the Weekday is invalid
func (w Weekday) Int() (int, error) {
normaliseWeekday := Weekday(strings.ToLower(string(w)))
day, found := daysOfWeek[normaliseWeekday]
if !found {
i, err := strconv.Atoi(string(normaliseWeekday))
if err != nil {
return day, fmt.Errorf("%s is an invalid weekday", w)
}
day = i
}
return day, nil
}
// Int validates the Month and returns an integer, which is the canonical representation
// of the Month in upstream types.
// Returns an error if the Month is invalid
func (m Month) Int() (int, error) {
normaliseMonth := Month(strings.ToLower(string(m)))
day, found := months[normaliseMonth]
if !found {
i, err := strconv.Atoi(string(normaliseMonth))
if err != nil {
return day, fmt.Errorf("%s is an invalid month", m)
}
day = i
}
return day, nil
}
// Validate the DayOfMonthRange
func (r DayOfMonthRange) Validate() error {
// Note: Validation is copied from UnmarshalYAML for DayOfMonthRange in alertmanager repo
// Check beginning <= end accounting for negatives day of month indices as well.
// Months != 31 days can't be addressed here and are clamped, but at least we can catch blatant errors.
if r.Start == 0 || r.Start < -31 || r.Start > 31 {
return fmt.Errorf("%d is not a valid day of the month: out of range", r.Start)
}
if r.End == 0 || r.End < -31 || r.End > 31 {
return fmt.Errorf("%d is not a valid day of the month: out of range", r.End)
}
// Restricting here prevents errors where begin > end in longer months but not shorter months.
if r.Start < 0 && r.End > 0 {
return fmt.Errorf("end day must be negative if start day is negative")
}
// Check begin <= end. We can't know this for sure when using negative indices,
// but we can prevent cases where its always invalid (using 28 day minimum length).
checkBegin := r.Start
checkEnd := r.End
if r.Start < 0 {
checkBegin = 28 + r.Start
}
if r.End < 0 {
checkEnd = 28 + r.End
}
if checkBegin > checkEnd {
return fmt.Errorf("end day %d is always before start day %d", r.End, r.Start)
}
return nil
}
// Validate the month range
func (mr MonthRange) Validate() error {
_, err := mr.Parse()
return err
}
// Parse returns a ParsedMonthRange or error on invalid input
func (mr MonthRange) Parse() (*ParsedRange, error) {
startStr, endStr, err := parseRange(string(mr))
if err != nil {
return nil, err
}
start, err := Month(startStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse start month from month range: %w", err)
}
end, err := Month(endStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse start month from month range: %w", err)
}
if start > end {
return nil, fmt.Errorf("end month %s is before start month %s", endStr, startStr)
}
return &ParsedRange{
Start: start,
End: end,
}, nil
}
// ParsedRange is an integer representation of a range
// +kubebuilder:object:generate:=false
type ParsedRange struct {
// Start is the beginning of the range
Start int `json:"start,omitempty"`
// End of the range
End int `json:"end,omitempty"`
}
var (
validTime = "^((([01][0-9])|(2[0-3])):[0-5][0-9])$|(^24:00$)"
validTimeRE = regexp.MustCompile(validTime)
)
// Converts a string of the form "HH:MM" into the number of minutes elapsed in the day.
func parseTime(in string) (mins int, err error) {
if !validTimeRE.MatchString(in) {
return 0, fmt.Errorf("couldn't parse timestamp %s, invalid format", in)
}
timestampComponents := strings.Split(in, ":")
if len(timestampComponents) != 2 {
return 0, fmt.Errorf("invalid timestamp format: %s", in)
}
timeStampHours, err := strconv.Atoi(timestampComponents[0])
if err != nil {
return 0, err
}
timeStampMinutes, err := strconv.Atoi(timestampComponents[1])
if err != nil {
return 0, err
}
if timeStampHours < 0 || timeStampHours > 24 || timeStampMinutes < 0 || timeStampMinutes > 60 {
return 0, fmt.Errorf("timestamp %s out of range", in)
}
// Timestamps are stored as minutes elapsed in the day, so multiply hours by 60.
mins = timeStampHours*60 + timeStampMinutes
return mins, nil
}
// parseRange parses a valid range string into parts
func parseRange(in string) (start, end string, err error) {
if !strings.ContainsRune(in, ':') {
return in, in, nil
}
parts := strings.Split(string(in), ":")
if len(parts) != 2 {
return start, end, fmt.Errorf("invalid range provided %s", in)
}
return parts[0], parts[1], nil
}

View File

@@ -0,0 +1,933 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// 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 controller-gen. DO NOT EDIT.
package v1alpha1
import (
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AlertmanagerConfig) DeepCopyInto(out *AlertmanagerConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfig.
func (in *AlertmanagerConfig) DeepCopy() *AlertmanagerConfig {
if in == nil {
return nil
}
out := new(AlertmanagerConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AlertmanagerConfigList) DeepCopyInto(out *AlertmanagerConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]*AlertmanagerConfig, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(AlertmanagerConfig)
(*in).DeepCopyInto(*out)
}
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfigList.
func (in *AlertmanagerConfigList) DeepCopy() *AlertmanagerConfigList {
if in == nil {
return nil
}
out := new(AlertmanagerConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AlertmanagerConfigSpec) DeepCopyInto(out *AlertmanagerConfigSpec) {
*out = *in
if in.Route != nil {
in, out := &in.Route, &out.Route
*out = new(Route)
(*in).DeepCopyInto(*out)
}
if in.Receivers != nil {
in, out := &in.Receivers, &out.Receivers
*out = make([]Receiver, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.InhibitRules != nil {
in, out := &in.InhibitRules, &out.InhibitRules
*out = make([]InhibitRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.MuteTimeIntervals != nil {
in, out := &in.MuteTimeIntervals, &out.MuteTimeIntervals
*out = make([]MuteTimeInterval, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfigSpec.
func (in *AlertmanagerConfigSpec) DeepCopy() *AlertmanagerConfigSpec {
if in == nil {
return nil
}
out := new(AlertmanagerConfigSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DayOfMonthRange) DeepCopyInto(out *DayOfMonthRange) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DayOfMonthRange.
func (in *DayOfMonthRange) DeepCopy() *DayOfMonthRange {
if in == nil {
return nil
}
out := new(DayOfMonthRange)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EmailConfig) DeepCopyInto(out *EmailConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.AuthPassword != nil {
in, out := &in.AuthPassword, &out.AuthPassword
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.AuthSecret != nil {
in, out := &in.AuthSecret, &out.AuthSecret
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.Headers != nil {
in, out := &in.Headers, &out.Headers
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.RequireTLS != nil {
in, out := &in.RequireTLS, &out.RequireTLS
*out = new(bool)
**out = **in
}
if in.TLSConfig != nil {
in, out := &in.TLSConfig, &out.TLSConfig
*out = new(monitoringv1.SafeTLSConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmailConfig.
func (in *EmailConfig) DeepCopy() *EmailConfig {
if in == nil {
return nil
}
out := new(EmailConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPConfig) DeepCopyInto(out *HTTPConfig) {
*out = *in
if in.Authorization != nil {
in, out := &in.Authorization, &out.Authorization
*out = new(monitoringv1.SafeAuthorization)
(*in).DeepCopyInto(*out)
}
if in.BasicAuth != nil {
in, out := &in.BasicAuth, &out.BasicAuth
*out = new(monitoringv1.BasicAuth)
(*in).DeepCopyInto(*out)
}
if in.OAuth2 != nil {
in, out := &in.OAuth2, &out.OAuth2
*out = new(monitoringv1.OAuth2)
(*in).DeepCopyInto(*out)
}
if in.BearerTokenSecret != nil {
in, out := &in.BearerTokenSecret, &out.BearerTokenSecret
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.TLSConfig != nil {
in, out := &in.TLSConfig, &out.TLSConfig
*out = new(monitoringv1.SafeTLSConfig)
(*in).DeepCopyInto(*out)
}
if in.FollowRedirects != nil {
in, out := &in.FollowRedirects, &out.FollowRedirects
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPConfig.
func (in *HTTPConfig) DeepCopy() *HTTPConfig {
if in == nil {
return nil
}
out := new(HTTPConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InhibitRule) DeepCopyInto(out *InhibitRule) {
*out = *in
if in.TargetMatch != nil {
in, out := &in.TargetMatch, &out.TargetMatch
*out = make([]Matcher, len(*in))
copy(*out, *in)
}
if in.SourceMatch != nil {
in, out := &in.SourceMatch, &out.SourceMatch
*out = make([]Matcher, len(*in))
copy(*out, *in)
}
if in.Equal != nil {
in, out := &in.Equal, &out.Equal
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InhibitRule.
func (in *InhibitRule) DeepCopy() *InhibitRule {
if in == nil {
return nil
}
out := new(InhibitRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KeyValue) DeepCopyInto(out *KeyValue) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyValue.
func (in *KeyValue) DeepCopy() *KeyValue {
if in == nil {
return nil
}
out := new(KeyValue)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Matcher) DeepCopyInto(out *Matcher) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Matcher.
func (in *Matcher) DeepCopy() *Matcher {
if in == nil {
return nil
}
out := new(Matcher)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MuteTimeInterval) DeepCopyInto(out *MuteTimeInterval) {
*out = *in
if in.TimeIntervals != nil {
in, out := &in.TimeIntervals, &out.TimeIntervals
*out = make([]TimeInterval, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MuteTimeInterval.
func (in *MuteTimeInterval) DeepCopy() *MuteTimeInterval {
if in == nil {
return nil
}
out := new(MuteTimeInterval)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OpsGenieConfig) DeepCopyInto(out *OpsGenieConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APIKey != nil {
in, out := &in.APIKey, &out.APIKey
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.UpdateAlerts != nil {
in, out := &in.UpdateAlerts, &out.UpdateAlerts
*out = new(bool)
**out = **in
}
if in.Details != nil {
in, out := &in.Details, &out.Details
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.Responders != nil {
in, out := &in.Responders, &out.Responders
*out = make([]OpsGenieConfigResponder, len(*in))
copy(*out, *in)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpsGenieConfig.
func (in *OpsGenieConfig) DeepCopy() *OpsGenieConfig {
if in == nil {
return nil
}
out := new(OpsGenieConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OpsGenieConfigResponder) DeepCopyInto(out *OpsGenieConfigResponder) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpsGenieConfigResponder.
func (in *OpsGenieConfigResponder) DeepCopy() *OpsGenieConfigResponder {
if in == nil {
return nil
}
out := new(OpsGenieConfigResponder)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PagerDutyConfig) DeepCopyInto(out *PagerDutyConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.RoutingKey != nil {
in, out := &in.RoutingKey, &out.RoutingKey
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.ServiceKey != nil {
in, out := &in.ServiceKey, &out.ServiceKey
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.Details != nil {
in, out := &in.Details, &out.Details
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.PagerDutyImageConfigs != nil {
in, out := &in.PagerDutyImageConfigs, &out.PagerDutyImageConfigs
*out = make([]PagerDutyImageConfig, len(*in))
copy(*out, *in)
}
if in.PagerDutyLinkConfigs != nil {
in, out := &in.PagerDutyLinkConfigs, &out.PagerDutyLinkConfigs
*out = make([]PagerDutyLinkConfig, len(*in))
copy(*out, *in)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerDutyConfig.
func (in *PagerDutyConfig) DeepCopy() *PagerDutyConfig {
if in == nil {
return nil
}
out := new(PagerDutyConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PagerDutyImageConfig) DeepCopyInto(out *PagerDutyImageConfig) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerDutyImageConfig.
func (in *PagerDutyImageConfig) DeepCopy() *PagerDutyImageConfig {
if in == nil {
return nil
}
out := new(PagerDutyImageConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PagerDutyLinkConfig) DeepCopyInto(out *PagerDutyLinkConfig) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerDutyLinkConfig.
func (in *PagerDutyLinkConfig) DeepCopy() *PagerDutyLinkConfig {
if in == nil {
return nil
}
out := new(PagerDutyLinkConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PushoverConfig) DeepCopyInto(out *PushoverConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.UserKey != nil {
in, out := &in.UserKey, &out.UserKey
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.Token != nil {
in, out := &in.Token, &out.Token
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PushoverConfig.
func (in *PushoverConfig) DeepCopy() *PushoverConfig {
if in == nil {
return nil
}
out := new(PushoverConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Receiver) DeepCopyInto(out *Receiver) {
*out = *in
if in.OpsGenieConfigs != nil {
in, out := &in.OpsGenieConfigs, &out.OpsGenieConfigs
*out = make([]OpsGenieConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PagerDutyConfigs != nil {
in, out := &in.PagerDutyConfigs, &out.PagerDutyConfigs
*out = make([]PagerDutyConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.SlackConfigs != nil {
in, out := &in.SlackConfigs, &out.SlackConfigs
*out = make([]SlackConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.WebhookConfigs != nil {
in, out := &in.WebhookConfigs, &out.WebhookConfigs
*out = make([]WebhookConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.WeChatConfigs != nil {
in, out := &in.WeChatConfigs, &out.WeChatConfigs
*out = make([]WeChatConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.EmailConfigs != nil {
in, out := &in.EmailConfigs, &out.EmailConfigs
*out = make([]EmailConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.VictorOpsConfigs != nil {
in, out := &in.VictorOpsConfigs, &out.VictorOpsConfigs
*out = make([]VictorOpsConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PushoverConfigs != nil {
in, out := &in.PushoverConfigs, &out.PushoverConfigs
*out = make([]PushoverConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.SNSConfigs != nil {
in, out := &in.SNSConfigs, &out.SNSConfigs
*out = make([]SNSConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.TelegramConfigs != nil {
in, out := &in.TelegramConfigs, &out.TelegramConfigs
*out = make([]TelegramConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Receiver.
func (in *Receiver) DeepCopy() *Receiver {
if in == nil {
return nil
}
out := new(Receiver)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Route) DeepCopyInto(out *Route) {
*out = *in
if in.GroupBy != nil {
in, out := &in.GroupBy, &out.GroupBy
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Matchers != nil {
in, out := &in.Matchers, &out.Matchers
*out = make([]Matcher, len(*in))
copy(*out, *in)
}
if in.Routes != nil {
in, out := &in.Routes, &out.Routes
*out = make([]v1.JSON, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.MuteTimeIntervals != nil {
in, out := &in.MuteTimeIntervals, &out.MuteTimeIntervals
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ActiveTimeIntervals != nil {
in, out := &in.ActiveTimeIntervals, &out.ActiveTimeIntervals
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.
func (in *Route) DeepCopy() *Route {
if in == nil {
return nil
}
out := new(Route)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SNSConfig) DeepCopyInto(out *SNSConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.Sigv4 != nil {
in, out := &in.Sigv4, &out.Sigv4
*out = new(monitoringv1.Sigv4)
(*in).DeepCopyInto(*out)
}
if in.Attributes != nil {
in, out := &in.Attributes, &out.Attributes
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SNSConfig.
func (in *SNSConfig) DeepCopy() *SNSConfig {
if in == nil {
return nil
}
out := new(SNSConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackAction) DeepCopyInto(out *SlackAction) {
*out = *in
if in.ConfirmField != nil {
in, out := &in.ConfirmField, &out.ConfirmField
*out = new(SlackConfirmationField)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackAction.
func (in *SlackAction) DeepCopy() *SlackAction {
if in == nil {
return nil
}
out := new(SlackAction)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackConfig) DeepCopyInto(out *SlackConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APIURL != nil {
in, out := &in.APIURL, &out.APIURL
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.Fields != nil {
in, out := &in.Fields, &out.Fields
*out = make([]SlackField, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.MrkdwnIn != nil {
in, out := &in.MrkdwnIn, &out.MrkdwnIn
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Actions != nil {
in, out := &in.Actions, &out.Actions
*out = make([]SlackAction, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackConfig.
func (in *SlackConfig) DeepCopy() *SlackConfig {
if in == nil {
return nil
}
out := new(SlackConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackConfirmationField) DeepCopyInto(out *SlackConfirmationField) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackConfirmationField.
func (in *SlackConfirmationField) DeepCopy() *SlackConfirmationField {
if in == nil {
return nil
}
out := new(SlackConfirmationField)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackField) DeepCopyInto(out *SlackField) {
*out = *in
if in.Short != nil {
in, out := &in.Short, &out.Short
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackField.
func (in *SlackField) DeepCopy() *SlackField {
if in == nil {
return nil
}
out := new(SlackField)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TelegramConfig) DeepCopyInto(out *TelegramConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.BotToken != nil {
in, out := &in.BotToken, &out.BotToken
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.DisableNotifications != nil {
in, out := &in.DisableNotifications, &out.DisableNotifications
*out = new(bool)
**out = **in
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelegramConfig.
func (in *TelegramConfig) DeepCopy() *TelegramConfig {
if in == nil {
return nil
}
out := new(TelegramConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimeInterval) DeepCopyInto(out *TimeInterval) {
*out = *in
if in.Times != nil {
in, out := &in.Times, &out.Times
*out = make([]TimeRange, len(*in))
copy(*out, *in)
}
if in.Weekdays != nil {
in, out := &in.Weekdays, &out.Weekdays
*out = make([]WeekdayRange, len(*in))
copy(*out, *in)
}
if in.DaysOfMonth != nil {
in, out := &in.DaysOfMonth, &out.DaysOfMonth
*out = make([]DayOfMonthRange, len(*in))
copy(*out, *in)
}
if in.Months != nil {
in, out := &in.Months, &out.Months
*out = make([]MonthRange, len(*in))
copy(*out, *in)
}
if in.Years != nil {
in, out := &in.Years, &out.Years
*out = make([]YearRange, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeInterval.
func (in *TimeInterval) DeepCopy() *TimeInterval {
if in == nil {
return nil
}
out := new(TimeInterval)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimeRange) DeepCopyInto(out *TimeRange) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeRange.
func (in *TimeRange) DeepCopy() *TimeRange {
if in == nil {
return nil
}
out := new(TimeRange)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VictorOpsConfig) DeepCopyInto(out *VictorOpsConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APIKey != nil {
in, out := &in.APIKey, &out.APIKey
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.CustomFields != nil {
in, out := &in.CustomFields, &out.CustomFields
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VictorOpsConfig.
func (in *VictorOpsConfig) DeepCopy() *VictorOpsConfig {
if in == nil {
return nil
}
out := new(VictorOpsConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WeChatConfig) DeepCopyInto(out *WeChatConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APISecret != nil {
in, out := &in.APISecret, &out.APISecret
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeChatConfig.
func (in *WeChatConfig) DeepCopy() *WeChatConfig {
if in == nil {
return nil
}
out := new(WeChatConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WebhookConfig) DeepCopyInto(out *WebhookConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.URL != nil {
in, out := &in.URL, &out.URL
*out = new(string)
**out = **in
}
if in.URLSecret != nil {
in, out := &in.URLSecret, &out.URLSecret
*out = new(corev1.SecretKeySelector)
(*in).DeepCopyInto(*out)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfig.
func (in *WebhookConfig) DeepCopy() *WebhookConfig {
if in == nil {
return nil
}
out := new(WebhookConfig)
in.DeepCopyInto(out)
return out
}

View File

@@ -0,0 +1,544 @@
// Copyright 2022 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.
package v1beta1
import (
"encoding/json"
"fmt"
v1 "k8s.io/api/core/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1"
)
func convertRouteFrom(in *v1alpha1.Route) (*Route, error) {
if in == nil {
return nil, nil
}
out := &Route{
Receiver: in.Receiver,
GroupBy: in.GroupBy,
GroupWait: in.GroupWait,
GroupInterval: in.GroupInterval,
RepeatInterval: in.RepeatInterval,
Matchers: convertMatchersFrom(in.Matchers),
MuteTimeIntervals: in.MuteTimeIntervals,
ActiveTimeIntervals: in.ActiveTimeIntervals,
}
// Deserialize child routes to convert them to v1alpha1 and serialize back.
crs, err := in.ChildRoutes()
if err != nil {
return nil, err
}
out.Routes = make([]apiextensionsv1.JSON, 0, len(in.Routes))
for i := range crs {
cr, err := convertRouteFrom(&crs[i])
if err != nil {
return nil, fmt.Errorf("route[%d]: %w", i, err)
}
b, err := json.Marshal(cr)
if err != nil {
return nil, fmt.Errorf("route[%d]: %w", i, err)
}
out.Routes = append(out.Routes, apiextensionsv1.JSON{Raw: b})
}
return out, nil
}
func convertMatchersFrom(in []v1alpha1.Matcher) []Matcher {
out := make([]Matcher, 0, len(in))
for _, m := range in {
mt := m.MatchType
if mt == "" {
mt = "="
if m.Regex {
mt = "=~"
}
}
out = append(
out,
Matcher{
Name: m.Name,
Value: m.Value,
MatchType: MatchType(mt),
},
)
}
return out
}
func convertTimeIntervalsFrom(in []v1alpha1.TimeInterval) []TimePeriod {
out := make([]TimePeriod, 0, len(in))
for _, ti := range in {
var (
trs = make([]TimeRange, 0, len(ti.Times))
wds = make([]WeekdayRange, 0, len(ti.Weekdays))
doms = make([]DayOfMonthRange, 0, len(ti.DaysOfMonth))
mrs = make([]MonthRange, 0, len(ti.Months))
yrs = make([]YearRange, 0, len(ti.Years))
)
for _, tr := range ti.Times {
trs = append(trs, TimeRange{StartTime: Time(tr.StartTime), EndTime: Time(tr.EndTime)})
}
for _, wd := range ti.Weekdays {
wds = append(wds, WeekdayRange(wd))
}
for _, dm := range ti.DaysOfMonth {
doms = append(doms, DayOfMonthRange{Start: dm.Start, End: dm.End})
}
for _, mr := range ti.Months {
mrs = append(mrs, MonthRange(mr))
}
for _, yr := range ti.Years {
yrs = append(yrs, YearRange(yr))
}
out = append(
out,
TimePeriod{
Times: trs,
Weekdays: wds,
DaysOfMonth: doms,
Months: mrs,
Years: yrs,
},
)
}
return out
}
func convertHTTPConfigFrom(in *v1alpha1.HTTPConfig) *HTTPConfig {
if in == nil {
return nil
}
return &HTTPConfig{
Authorization: in.Authorization,
BasicAuth: in.BasicAuth,
OAuth2: in.OAuth2,
BearerTokenSecret: convertSecretKeySelectorFrom(in.BearerTokenSecret),
TLSConfig: in.TLSConfig,
ProxyURL: in.ProxyURL,
FollowRedirects: in.FollowRedirects,
}
}
func convertKeyValuesFrom(in []v1alpha1.KeyValue) []KeyValue {
out := make([]KeyValue, len(in))
for i := range in {
out[i] = KeyValue{
Key: in[i].Key,
Value: in[i].Value,
}
}
return out
}
func convertSecretKeySelectorFrom(in *v1.SecretKeySelector) *SecretKeySelector {
if in == nil {
return nil
}
return &SecretKeySelector{
Name: in.Name,
Key: in.Key,
}
}
func convertOpsGenieConfigRespondersFrom(in []v1alpha1.OpsGenieConfigResponder) []OpsGenieConfigResponder {
out := make([]OpsGenieConfigResponder, len(in))
for i := range in {
out[i] = OpsGenieConfigResponder{
ID: in[i].ID,
Name: in[i].Name,
Username: in[i].Username,
Type: in[i].Type,
}
}
return out
}
func convertOpsGenieConfigFrom(in v1alpha1.OpsGenieConfig) OpsGenieConfig {
return OpsGenieConfig{
SendResolved: in.SendResolved,
APIKey: convertSecretKeySelectorFrom(in.APIKey),
APIURL: in.APIURL,
Message: in.Message,
Description: in.Description,
Source: in.Source,
Tags: in.Tags,
Note: in.Note,
Priority: in.Priority,
Details: convertKeyValuesFrom(in.Details),
Responders: convertOpsGenieConfigRespondersFrom(in.Responders),
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
Entity: in.Entity,
Actions: in.Actions,
}
}
func convertPagerDutyImageConfigsFrom(in []v1alpha1.PagerDutyImageConfig) []PagerDutyImageConfig {
out := make([]PagerDutyImageConfig, len(in))
for i := range in {
out[i] = PagerDutyImageConfig{
Src: in[i].Src,
Href: in[i].Href,
Alt: in[i].Alt,
}
}
return out
}
func convertPagerDutyLinkConfigsFrom(in []v1alpha1.PagerDutyLinkConfig) []PagerDutyLinkConfig {
out := make([]PagerDutyLinkConfig, len(in))
for i := range in {
out[i] = PagerDutyLinkConfig{
Href: in[i].Href,
Text: in[i].Text,
}
}
return out
}
func convertPagerDutyConfigFrom(in v1alpha1.PagerDutyConfig) PagerDutyConfig {
return PagerDutyConfig{
SendResolved: in.SendResolved,
RoutingKey: convertSecretKeySelectorFrom(in.RoutingKey),
ServiceKey: convertSecretKeySelectorFrom(in.ServiceKey),
URL: in.URL,
Client: in.Client,
ClientURL: in.ClientURL,
Description: in.Description,
Severity: in.Severity,
Class: in.Class,
Group: in.Group,
Component: in.Component,
Details: convertKeyValuesFrom(in.Details),
PagerDutyImageConfigs: convertPagerDutyImageConfigsFrom(in.PagerDutyImageConfigs),
PagerDutyLinkConfigs: convertPagerDutyLinkConfigsFrom(in.PagerDutyLinkConfigs),
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
}
}
func convertSlackFieldsFrom(in []v1alpha1.SlackField) []SlackField {
out := make([]SlackField, len(in))
for i := range in {
out[i] = SlackField{
Title: in[i].Title,
Value: in[i].Value,
Short: in[i].Short,
}
}
return out
}
func convertSlackActionsFrom(in []v1alpha1.SlackAction) []SlackAction {
out := make([]SlackAction, len(in))
for i := range in {
out[i] = SlackAction{
Type: in[i].Type,
Text: in[i].Text,
URL: in[i].URL,
Style: in[i].Style,
Name: in[i].Name,
Value: in[i].Value,
}
if in[i].ConfirmField != nil {
out[i].ConfirmField = &SlackConfirmationField{
Text: in[i].ConfirmField.Text,
Title: in[i].ConfirmField.Title,
OkText: in[i].ConfirmField.OkText,
DismissText: in[i].ConfirmField.DismissText,
}
}
}
return out
}
func convertSlackConfigFrom(in v1alpha1.SlackConfig) SlackConfig {
return SlackConfig{
SendResolved: in.SendResolved,
APIURL: convertSecretKeySelectorFrom(in.APIURL),
Channel: in.Channel,
Username: in.Username,
Color: in.Color,
Title: in.Title,
TitleLink: in.TitleLink,
Pretext: in.Pretext,
Text: in.Text,
Fields: convertSlackFieldsFrom(in.Fields),
ShortFields: in.ShortFields,
Footer: in.Footer,
Fallback: in.Fallback,
CallbackID: in.CallbackID,
IconEmoji: in.IconEmoji,
IconURL: in.IconURL,
ImageURL: in.ImageURL,
ThumbURL: in.ThumbURL,
LinkNames: in.LinkNames,
MrkdwnIn: in.MrkdwnIn,
Actions: convertSlackActionsFrom(in.Actions),
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
}
}
func convertWebhookConfigFrom(in v1alpha1.WebhookConfig) WebhookConfig {
return WebhookConfig{
SendResolved: in.SendResolved,
URL: in.URL,
URLSecret: convertSecretKeySelectorFrom(in.URLSecret),
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
MaxAlerts: in.MaxAlerts,
}
}
func convertWeChatConfigFrom(in v1alpha1.WeChatConfig) WeChatConfig {
return WeChatConfig{
SendResolved: in.SendResolved,
APISecret: convertSecretKeySelectorFrom(in.APISecret),
APIURL: in.APIURL,
CorpID: in.CorpID,
AgentID: in.AgentID,
ToUser: in.ToUser,
ToParty: in.ToParty,
ToTag: in.ToTag,
Message: in.Message,
MessageType: in.MessageType,
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
}
}
func convertEmailConfigFrom(in v1alpha1.EmailConfig) EmailConfig {
return EmailConfig{
SendResolved: in.SendResolved,
To: in.To,
From: in.From,
Hello: in.Hello,
Smarthost: in.Smarthost,
AuthUsername: in.AuthUsername,
AuthPassword: convertSecretKeySelectorFrom(in.AuthPassword),
AuthSecret: convertSecretKeySelectorFrom(in.AuthSecret),
AuthIdentity: in.AuthIdentity,
Headers: convertKeyValuesFrom(in.Headers),
HTML: in.HTML,
Text: in.Text,
RequireTLS: in.RequireTLS,
TLSConfig: in.TLSConfig,
}
}
func convertVictorOpsConfigFrom(in v1alpha1.VictorOpsConfig) VictorOpsConfig {
return VictorOpsConfig{
SendResolved: in.SendResolved,
APIKey: convertSecretKeySelectorFrom(in.APIKey),
APIURL: in.APIURL,
RoutingKey: in.RoutingKey,
MessageType: in.MessageType,
EntityDisplayName: in.EntityDisplayName,
StateMessage: in.StateMessage,
MonitoringTool: in.MonitoringTool,
CustomFields: convertKeyValuesFrom(in.CustomFields),
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
}
}
func convertPushoverConfigFrom(in v1alpha1.PushoverConfig) PushoverConfig {
return PushoverConfig{
SendResolved: in.SendResolved,
UserKey: convertSecretKeySelectorFrom(in.UserKey),
Token: convertSecretKeySelectorFrom(in.Token),
Title: in.Title,
Message: in.Message,
URL: in.URL,
URLTitle: in.URLTitle,
Sound: in.Sound,
Priority: in.Priority,
Retry: in.Retry,
Expire: in.Expire,
HTML: in.HTML,
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
}
}
func convertSNSConfigFrom(in v1alpha1.SNSConfig) SNSConfig {
return SNSConfig{
SendResolved: in.SendResolved,
ApiURL: in.ApiURL,
Sigv4: in.Sigv4,
TopicARN: in.TopicARN,
Subject: in.Subject,
PhoneNumber: in.PhoneNumber,
TargetARN: in.TargetARN,
Message: in.Message,
Attributes: in.Attributes,
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
}
}
func convertTelegramConfigFrom(in v1alpha1.TelegramConfig) TelegramConfig {
return TelegramConfig{
SendResolved: in.SendResolved,
APIURL: in.APIURL,
BotToken: convertSecretKeySelectorFrom(in.BotToken),
ChatID: in.ChatID,
Message: in.Message,
DisableNotifications: in.DisableNotifications,
ParseMode: in.ParseMode,
HTTPConfig: convertHTTPConfigFrom(in.HTTPConfig),
}
}
// ConvertFrom converts from the Hub version (v1alpha1) to this version (v1beta1).
func (dst *AlertmanagerConfig) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*v1alpha1.AlertmanagerConfig)
dst.ObjectMeta = src.ObjectMeta
for _, in := range src.Spec.Receivers {
out := Receiver{
Name: in.Name,
}
for _, in := range in.OpsGenieConfigs {
out.OpsGenieConfigs = append(
out.OpsGenieConfigs,
convertOpsGenieConfigFrom(in),
)
}
for _, in := range in.PagerDutyConfigs {
out.PagerDutyConfigs = append(
out.PagerDutyConfigs,
convertPagerDutyConfigFrom(in),
)
}
for _, in := range in.SlackConfigs {
out.SlackConfigs = append(
out.SlackConfigs,
convertSlackConfigFrom(in),
)
}
for _, in := range in.WebhookConfigs {
out.WebhookConfigs = append(
out.WebhookConfigs,
convertWebhookConfigFrom(in),
)
}
for _, in := range in.WeChatConfigs {
out.WeChatConfigs = append(
out.WeChatConfigs,
convertWeChatConfigFrom(in),
)
}
for _, in := range in.EmailConfigs {
out.EmailConfigs = append(
out.EmailConfigs,
convertEmailConfigFrom(in),
)
}
for _, in := range in.VictorOpsConfigs {
out.VictorOpsConfigs = append(
out.VictorOpsConfigs,
convertVictorOpsConfigFrom(in),
)
}
for _, in := range in.PushoverConfigs {
out.PushoverConfigs = append(
out.PushoverConfigs,
convertPushoverConfigFrom(in),
)
}
for _, in := range in.SNSConfigs {
out.SNSConfigs = append(
out.SNSConfigs,
convertSNSConfigFrom(in),
)
}
for _, in := range in.TelegramConfigs {
out.TelegramConfigs = append(
out.TelegramConfigs,
convertTelegramConfigFrom(in),
)
}
dst.Spec.Receivers = append(dst.Spec.Receivers, out)
}
for _, in := range src.Spec.InhibitRules {
dst.Spec.InhibitRules = append(
dst.Spec.InhibitRules,
InhibitRule{
TargetMatch: convertMatchersFrom(in.TargetMatch),
SourceMatch: convertMatchersFrom(in.SourceMatch),
Equal: in.Equal,
},
)
}
for _, in := range src.Spec.MuteTimeIntervals {
dst.Spec.TimeIntervals = append(
dst.Spec.TimeIntervals,
TimeInterval{
Name: in.Name,
TimeIntervals: convertTimeIntervalsFrom(in.TimeIntervals),
},
)
}
r, err := convertRouteFrom(src.Spec.Route)
if err != nil {
return err
}
dst.Spec.Route = r
return nil
}

View File

@@ -0,0 +1,541 @@
// Copyright 2022 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.
package v1beta1
import (
"encoding/json"
"fmt"
v1 "k8s.io/api/core/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1"
)
func convertRouteTo(in *Route) (*v1alpha1.Route, error) {
if in == nil {
return nil, nil
}
out := &v1alpha1.Route{
Receiver: in.Receiver,
GroupBy: in.GroupBy,
GroupWait: in.GroupWait,
GroupInterval: in.GroupInterval,
RepeatInterval: in.RepeatInterval,
Matchers: convertMatchersTo(in.Matchers),
MuteTimeIntervals: in.MuteTimeIntervals,
ActiveTimeIntervals: in.ActiveTimeIntervals,
}
// Deserialize child routes to convert them to v1alpha1 and serialize back.
crs, err := in.ChildRoutes()
if err != nil {
return nil, err
}
out.Routes = make([]apiextensionsv1.JSON, 0, len(in.Routes))
for i := range crs {
cr, err := convertRouteTo(&crs[i])
if err != nil {
return nil, fmt.Errorf("route[%d]: %w", i, err)
}
b, err := json.Marshal(cr)
if err != nil {
return nil, fmt.Errorf("route[%d]: %w", i, err)
}
out.Routes = append(out.Routes, apiextensionsv1.JSON{Raw: b})
}
return out, nil
}
func convertMatchersTo(in []Matcher) []v1alpha1.Matcher {
out := make([]v1alpha1.Matcher, 0, len(in))
for _, m := range in {
out = append(
out,
v1alpha1.Matcher{
Name: m.Name,
Value: m.Value,
MatchType: v1alpha1.MatchType(m.MatchType),
},
)
}
return out
}
func convertTimeIntervalsTo(in []TimePeriod) []v1alpha1.TimeInterval {
out := make([]v1alpha1.TimeInterval, 0, len(in))
for _, ti := range in {
var (
trs = make([]v1alpha1.TimeRange, 0, len(ti.Times))
wds = make([]v1alpha1.WeekdayRange, 0, len(ti.Weekdays))
doms = make([]v1alpha1.DayOfMonthRange, 0, len(ti.DaysOfMonth))
mrs = make([]v1alpha1.MonthRange, 0, len(ti.Months))
yrs = make([]v1alpha1.YearRange, 0, len(ti.Years))
)
for _, tr := range ti.Times {
trs = append(trs, v1alpha1.TimeRange{StartTime: v1alpha1.Time(tr.StartTime), EndTime: v1alpha1.Time(tr.EndTime)})
}
for _, wd := range ti.Weekdays {
wds = append(wds, v1alpha1.WeekdayRange(wd))
}
for _, dm := range ti.DaysOfMonth {
doms = append(doms, v1alpha1.DayOfMonthRange{Start: dm.Start, End: dm.End})
}
for _, mr := range ti.Months {
mrs = append(mrs, v1alpha1.MonthRange(mr))
}
for _, yr := range ti.Years {
yrs = append(yrs, v1alpha1.YearRange(yr))
}
out = append(
out,
v1alpha1.TimeInterval{
Times: trs,
Weekdays: wds,
DaysOfMonth: doms,
Months: mrs,
Years: yrs,
},
)
}
return out
}
func convertHTTPConfigTo(in *HTTPConfig) *v1alpha1.HTTPConfig {
if in == nil {
return nil
}
return &v1alpha1.HTTPConfig{
Authorization: in.Authorization,
BasicAuth: in.BasicAuth,
OAuth2: in.OAuth2,
BearerTokenSecret: convertSecretKeySelectorTo(in.BearerTokenSecret),
TLSConfig: in.TLSConfig,
ProxyURL: in.ProxyURL,
FollowRedirects: in.FollowRedirects,
}
}
func convertKeyValuesTo(in []KeyValue) []v1alpha1.KeyValue {
out := make([]v1alpha1.KeyValue, len(in))
for i := range in {
out[i] = v1alpha1.KeyValue{
Key: in[i].Key,
Value: in[i].Value,
}
}
return out
}
func convertSecretKeySelectorTo(in *SecretKeySelector) *v1.SecretKeySelector {
if in == nil {
return nil
}
return &v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{
Name: in.Name,
},
Key: in.Key,
}
}
func convertOpsGenieConfigRespondersTo(in []OpsGenieConfigResponder) []v1alpha1.OpsGenieConfigResponder {
out := make([]v1alpha1.OpsGenieConfigResponder, len(in))
for i := range in {
out[i] = v1alpha1.OpsGenieConfigResponder{
ID: in[i].ID,
Name: in[i].Name,
Username: in[i].Username,
Type: in[i].Type,
}
}
return out
}
func convertOpsGenieConfigTo(in OpsGenieConfig) v1alpha1.OpsGenieConfig {
return v1alpha1.OpsGenieConfig{
SendResolved: in.SendResolved,
APIKey: convertSecretKeySelectorTo(in.APIKey),
APIURL: in.APIURL,
Message: in.Message,
Description: in.Description,
Source: in.Source,
Tags: in.Tags,
Note: in.Note,
Priority: in.Priority,
Details: convertKeyValuesTo(in.Details),
Responders: convertOpsGenieConfigRespondersTo(in.Responders),
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
Entity: in.Entity,
Actions: in.Actions,
}
}
func convertPagerDutyImageConfigsTo(in []PagerDutyImageConfig) []v1alpha1.PagerDutyImageConfig {
out := make([]v1alpha1.PagerDutyImageConfig, len(in))
for i := range in {
out[i] = v1alpha1.PagerDutyImageConfig{
Src: in[i].Src,
Href: in[i].Href,
Alt: in[i].Alt,
}
}
return out
}
func convertPagerDutyLinkConfigsTo(in []PagerDutyLinkConfig) []v1alpha1.PagerDutyLinkConfig {
out := make([]v1alpha1.PagerDutyLinkConfig, len(in))
for i := range in {
out[i] = v1alpha1.PagerDutyLinkConfig{
Href: in[i].Href,
Text: in[i].Text,
}
}
return out
}
func convertPagerDutyConfigTo(in PagerDutyConfig) v1alpha1.PagerDutyConfig {
return v1alpha1.PagerDutyConfig{
SendResolved: in.SendResolved,
RoutingKey: convertSecretKeySelectorTo(in.RoutingKey),
ServiceKey: convertSecretKeySelectorTo(in.ServiceKey),
URL: in.URL,
Client: in.Client,
ClientURL: in.ClientURL,
Description: in.Description,
Severity: in.Severity,
Class: in.Class,
Group: in.Group,
Component: in.Component,
Details: convertKeyValuesTo(in.Details),
PagerDutyImageConfigs: convertPagerDutyImageConfigsTo(in.PagerDutyImageConfigs),
PagerDutyLinkConfigs: convertPagerDutyLinkConfigsTo(in.PagerDutyLinkConfigs),
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
}
}
func convertSlackFieldsTo(in []SlackField) []v1alpha1.SlackField {
out := make([]v1alpha1.SlackField, len(in))
for i := range in {
out[i] = v1alpha1.SlackField{
Title: in[i].Title,
Value: in[i].Value,
Short: in[i].Short,
}
}
return out
}
func convertSlackActionsTo(in []SlackAction) []v1alpha1.SlackAction {
out := make([]v1alpha1.SlackAction, len(in))
for i := range in {
out[i] = v1alpha1.SlackAction{
Type: in[i].Type,
Text: in[i].Text,
URL: in[i].URL,
Style: in[i].Style,
Name: in[i].Name,
Value: in[i].Value,
}
if in[i].ConfirmField != nil {
out[i].ConfirmField = &v1alpha1.SlackConfirmationField{
Text: in[i].ConfirmField.Text,
Title: in[i].ConfirmField.Title,
OkText: in[i].ConfirmField.OkText,
DismissText: in[i].ConfirmField.DismissText,
}
}
}
return out
}
func convertSlackConfigTo(in SlackConfig) v1alpha1.SlackConfig {
return v1alpha1.SlackConfig{
SendResolved: in.SendResolved,
APIURL: convertSecretKeySelectorTo(in.APIURL),
Channel: in.Channel,
Username: in.Username,
Color: in.Color,
Title: in.Title,
TitleLink: in.TitleLink,
Pretext: in.Pretext,
Text: in.Text,
Fields: convertSlackFieldsTo(in.Fields),
ShortFields: in.ShortFields,
Footer: in.Footer,
Fallback: in.Fallback,
CallbackID: in.CallbackID,
IconEmoji: in.IconEmoji,
IconURL: in.IconURL,
ImageURL: in.ImageURL,
ThumbURL: in.ThumbURL,
LinkNames: in.LinkNames,
MrkdwnIn: in.MrkdwnIn,
Actions: convertSlackActionsTo(in.Actions),
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
}
}
func convertWebhookConfigTo(in WebhookConfig) v1alpha1.WebhookConfig {
return v1alpha1.WebhookConfig{
SendResolved: in.SendResolved,
URL: in.URL,
URLSecret: convertSecretKeySelectorTo(in.URLSecret),
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
MaxAlerts: in.MaxAlerts,
}
}
func convertWeChatConfigTo(in WeChatConfig) v1alpha1.WeChatConfig {
return v1alpha1.WeChatConfig{
SendResolved: in.SendResolved,
APISecret: convertSecretKeySelectorTo(in.APISecret),
APIURL: in.APIURL,
CorpID: in.CorpID,
AgentID: in.AgentID,
ToUser: in.ToUser,
ToParty: in.ToParty,
ToTag: in.ToTag,
Message: in.Message,
MessageType: in.MessageType,
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
}
}
func convertEmailConfigTo(in EmailConfig) v1alpha1.EmailConfig {
return v1alpha1.EmailConfig{
SendResolved: in.SendResolved,
To: in.To,
From: in.From,
Hello: in.Hello,
Smarthost: in.Smarthost,
AuthUsername: in.AuthUsername,
AuthPassword: convertSecretKeySelectorTo(in.AuthPassword),
AuthSecret: convertSecretKeySelectorTo(in.AuthSecret),
AuthIdentity: in.AuthIdentity,
Headers: convertKeyValuesTo(in.Headers),
HTML: in.HTML,
Text: in.Text,
RequireTLS: in.RequireTLS,
TLSConfig: in.TLSConfig,
}
}
func convertVictorOpsConfigTo(in VictorOpsConfig) v1alpha1.VictorOpsConfig {
return v1alpha1.VictorOpsConfig{
SendResolved: in.SendResolved,
APIKey: convertSecretKeySelectorTo(in.APIKey),
APIURL: in.APIURL,
RoutingKey: in.RoutingKey,
MessageType: in.MessageType,
EntityDisplayName: in.EntityDisplayName,
StateMessage: in.StateMessage,
MonitoringTool: in.MonitoringTool,
CustomFields: convertKeyValuesTo(in.CustomFields),
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
}
}
func convertPushoverConfigTo(in PushoverConfig) v1alpha1.PushoverConfig {
return v1alpha1.PushoverConfig{
SendResolved: in.SendResolved,
UserKey: convertSecretKeySelectorTo(in.UserKey),
Token: convertSecretKeySelectorTo(in.Token),
Title: in.Title,
Message: in.Message,
URL: in.URL,
URLTitle: in.URLTitle,
Sound: in.Sound,
Priority: in.Priority,
Retry: in.Retry,
Expire: in.Expire,
HTML: in.HTML,
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
}
}
func convertSNSConfigTo(in SNSConfig) v1alpha1.SNSConfig {
return v1alpha1.SNSConfig{
SendResolved: in.SendResolved,
ApiURL: in.ApiURL,
Sigv4: in.Sigv4,
TopicARN: in.TopicARN,
Subject: in.Subject,
PhoneNumber: in.PhoneNumber,
TargetARN: in.TargetARN,
Message: in.Message,
Attributes: in.Attributes,
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
}
}
func convertTelegramConfigTo(in TelegramConfig) v1alpha1.TelegramConfig {
return v1alpha1.TelegramConfig{
SendResolved: in.SendResolved,
APIURL: in.APIURL,
BotToken: convertSecretKeySelectorTo(in.BotToken),
ChatID: in.ChatID,
Message: in.Message,
DisableNotifications: in.DisableNotifications,
ParseMode: in.ParseMode,
HTTPConfig: convertHTTPConfigTo(in.HTTPConfig),
}
}
// ConvertTo converts from this version (v1beta1) to the Hub version (v1alpha1).
func (src *AlertmanagerConfig) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*v1alpha1.AlertmanagerConfig)
dst.ObjectMeta = src.ObjectMeta
for _, in := range src.Spec.Receivers {
out := v1alpha1.Receiver{
Name: in.Name,
}
for _, in := range in.OpsGenieConfigs {
out.OpsGenieConfigs = append(
out.OpsGenieConfigs,
convertOpsGenieConfigTo(in),
)
}
for _, in := range in.PagerDutyConfigs {
out.PagerDutyConfigs = append(
out.PagerDutyConfigs,
convertPagerDutyConfigTo(in),
)
}
for _, in := range in.SlackConfigs {
out.SlackConfigs = append(
out.SlackConfigs,
convertSlackConfigTo(in),
)
}
for _, in := range in.WebhookConfigs {
out.WebhookConfigs = append(
out.WebhookConfigs,
convertWebhookConfigTo(in),
)
}
for _, in := range in.WeChatConfigs {
out.WeChatConfigs = append(
out.WeChatConfigs,
convertWeChatConfigTo(in),
)
}
for _, in := range in.EmailConfigs {
out.EmailConfigs = append(
out.EmailConfigs,
convertEmailConfigTo(in),
)
}
for _, in := range in.VictorOpsConfigs {
out.VictorOpsConfigs = append(
out.VictorOpsConfigs,
convertVictorOpsConfigTo(in),
)
}
for _, in := range in.PushoverConfigs {
out.PushoverConfigs = append(
out.PushoverConfigs,
convertPushoverConfigTo(in),
)
}
for _, in := range in.SNSConfigs {
out.SNSConfigs = append(
out.SNSConfigs,
convertSNSConfigTo(in),
)
}
for _, in := range in.TelegramConfigs {
out.TelegramConfigs = append(
out.TelegramConfigs,
convertTelegramConfigTo(in),
)
}
dst.Spec.Receivers = append(dst.Spec.Receivers, out)
}
for _, in := range src.Spec.InhibitRules {
dst.Spec.InhibitRules = append(
dst.Spec.InhibitRules,
v1alpha1.InhibitRule{
TargetMatch: convertMatchersTo(in.TargetMatch),
SourceMatch: convertMatchersTo(in.SourceMatch),
Equal: in.Equal,
},
)
}
for _, in := range src.Spec.TimeIntervals {
dst.Spec.MuteTimeIntervals = append(
dst.Spec.MuteTimeIntervals,
v1alpha1.MuteTimeInterval{
Name: in.Name,
TimeIntervals: convertTimeIntervalsTo(in.TimeIntervals),
},
)
}
r, err := convertRouteTo(src.Spec.Route)
if err != nil {
return err
}
dst.Spec.Route = r
return nil
}

View File

@@ -0,0 +1,18 @@
// Copyright 2020 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.
// +k8s:deepcopy-gen=package
// +groupName=monitoring.coreos.com
package v1beta1

View File

@@ -0,0 +1,55 @@
// Copyright 2020 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.
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring"
)
// SchemeGroupVersion is the group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: monitoring.GroupName, Version: Version}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)
func init() {
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder.Register(addKnownTypes)
}
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&AlertmanagerConfig{},
&AlertmanagerConfigList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@@ -0,0 +1,348 @@
// Copyright 2021 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.
package v1beta1
import (
"errors"
"fmt"
"regexp"
"strconv"
"strings"
)
func (hc *HTTPConfig) Validate() error {
if hc == nil {
return nil
}
if (hc.BasicAuth != nil || hc.OAuth2 != nil) && (hc.BearerTokenSecret != nil) {
return fmt.Errorf("at most one of basicAuth, oauth2, bearerTokenSecret must be configured")
}
if hc.Authorization != nil {
if hc.BearerTokenSecret != nil {
return fmt.Errorf("authorization is not compatible with bearerTokenSecret")
}
if hc.BasicAuth != nil || hc.OAuth2 != nil {
return fmt.Errorf("at most one of basicAuth, oauth2 & authorization must be configured")
}
if err := hc.Authorization.Validate(); err != nil {
return err
}
}
if hc.OAuth2 != nil {
if hc.BasicAuth != nil {
return fmt.Errorf("at most one of basicAuth, oauth2 & authorization must be configured")
}
if err := hc.OAuth2.Validate(); err != nil {
return err
}
}
if hc.TLSConfig != nil {
if err := hc.TLSConfig.Validate(); err != nil {
return err
}
}
return nil
}
// Validate the TimeInterval
func (ti TimeInterval) Validate() error {
if ti.Name == "" {
return errors.New("empty name field for time interval")
}
for i, ti := range ti.TimeIntervals {
for _, time := range ti.Times {
if err := time.Validate(); err != nil {
return fmt.Errorf("time range at %d is invalid: %w", i, err)
}
}
for _, weekday := range ti.Weekdays {
if err := weekday.Validate(); err != nil {
return fmt.Errorf("weekday range at %d is invalid: %w", i, err)
}
}
for _, dom := range ti.DaysOfMonth {
if err := dom.Validate(); err != nil {
return fmt.Errorf("day of month range at %d is invalid: %w", i, err)
}
}
for _, month := range ti.Months {
if err := month.Validate(); err != nil {
return fmt.Errorf("month range at %d is invalid: %w", i, err)
}
}
for _, year := range ti.Years {
if err := year.Validate(); err != nil {
return fmt.Errorf("year range at %d is invalid: %w", i, err)
}
}
}
return nil
}
// Validate the TimeRange
func (tr TimeRange) Validate() error {
_, err := tr.Parse()
return err
}
// Parse returns a ParsedRange on valid input or an error if the fields cannot be parsed
// End of the day is represented as 1440.
func (tr TimeRange) Parse() (*ParsedRange, error) {
if tr.StartTime == "" || tr.EndTime == "" {
return nil, fmt.Errorf("start and end are required")
}
start, err := parseTime(string(tr.StartTime))
if err != nil {
return nil, fmt.Errorf("start time invalid: %w", err)
}
end, err := parseTime(string(tr.EndTime))
if err != nil {
return nil, fmt.Errorf("end time invalid: %w", err)
}
if start >= end {
return nil, fmt.Errorf("start time %d cannot be equal or greater than end time %d", start, end)
}
return &ParsedRange{
Start: start,
End: end,
}, nil
}
// Validate the WeekdayRange
func (wr WeekdayRange) Validate() error {
_, err := wr.Parse()
return err
}
// Parse returns a ParsedRange on valid input or an error if the fields cannot be parsed
// The week starts on Sunday -> 0
func (wr WeekdayRange) Parse() (*ParsedRange, error) {
startStr, endStr, err := parseRange(string(wr))
if err != nil {
return nil, err
}
start, err := Weekday(startStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse start day from weekday range: %w", err)
}
end, err := Weekday(endStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse end day from weekday range: %w", err)
}
if start > end {
return nil, errors.New("start day cannot be before end day")
}
if start < 0 || start > 6 {
return nil, fmt.Errorf("%s is not a valid day of the week: out of range", startStr)
}
if end < 0 || end > 6 {
return nil, fmt.Errorf("%s is not a valid day of the week: out of range", endStr)
}
return &ParsedRange{Start: start, End: end}, nil
}
// Validate the YearRange
func (yr YearRange) Validate() error {
_, err := yr.Parse()
return err
}
// Parse returns a ParsedRange on valid input or an error if the fields cannot be parsed
func (yr YearRange) Parse() (*ParsedRange, error) {
startStr, endStr, err := parseRange(string(yr))
if err != nil {
return nil, err
}
start, err := strconv.Atoi(startStr)
if err != nil {
fmt.Errorf("start year cannot be %s parsed: %w", startStr, err)
}
end, err := strconv.Atoi(endStr)
if err != nil {
fmt.Errorf("end year cannot be %s parsed: %w", endStr, err)
}
if start > end {
return nil, fmt.Errorf("end year %d is before start year %d", end, start)
}
return &ParsedRange{Start: start, End: end}, nil
}
// Int returns an integer, which is the canonical representation
// of the Weekday in upstream types.
// Returns an error if the Weekday is invalid
func (w Weekday) Int() (int, error) {
normaliseWeekday := Weekday(strings.ToLower(string(w)))
day, found := daysOfWeek[normaliseWeekday]
if !found {
i, err := strconv.Atoi(string(normaliseWeekday))
if err != nil {
return day, fmt.Errorf("%s is an invalid weekday", w)
}
day = i
}
return day, nil
}
// Int validates the Month and returns an integer, which is the canonical representation
// of the Month in upstream types.
// Returns an error if the Month is invalid
func (m Month) Int() (int, error) {
normaliseMonth := Month(strings.ToLower(string(m)))
day, found := months[normaliseMonth]
if !found {
i, err := strconv.Atoi(string(normaliseMonth))
if err != nil {
return day, fmt.Errorf("%s is an invalid month", m)
}
day = i
}
return day, nil
}
// Validate the DayOfMonthRange
func (r DayOfMonthRange) Validate() error {
// Note: Validation is copied from UnmarshalYAML for DayOfMonthRange in alertmanager repo
// Check beginning <= end accounting for negatives day of month indices as well.
// Months != 31 days can't be addressed here and are clamped, but at least we can catch blatant errors.
if r.Start == 0 || r.Start < -31 || r.Start > 31 {
return fmt.Errorf("%d is not a valid day of the month: out of range", r.Start)
}
if r.End == 0 || r.End < -31 || r.End > 31 {
return fmt.Errorf("%d is not a valid day of the month: out of range", r.End)
}
// Restricting here prevents errors where begin > end in longer months but not shorter months.
if r.Start < 0 && r.End > 0 {
return fmt.Errorf("end day must be negative if start day is negative")
}
// Check begin <= end. We can't know this for sure when using negative indices,
// but we can prevent cases where its always invalid (using 28 day minimum length).
checkBegin := r.Start
checkEnd := r.End
if r.Start < 0 {
checkBegin = 28 + r.Start
}
if r.End < 0 {
checkEnd = 28 + r.End
}
if checkBegin > checkEnd {
return fmt.Errorf("end day %d is always before start day %d", r.End, r.Start)
}
return nil
}
// Validate the month range
func (mr MonthRange) Validate() error {
_, err := mr.Parse()
return err
}
// Parse returns a ParsedMonthRange or error on invalid input
func (mr MonthRange) Parse() (*ParsedRange, error) {
startStr, endStr, err := parseRange(string(mr))
if err != nil {
return nil, err
}
start, err := Month(startStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse start month from month range: %w", err)
}
end, err := Month(endStr).Int()
if err != nil {
return nil, fmt.Errorf("failed to parse start month from month range: %w", err)
}
if start > end {
return nil, fmt.Errorf("end month %s is before start month %s", endStr, startStr)
}
return &ParsedRange{
Start: start,
End: end,
}, nil
}
// ParsedRange is an integer representation of a range
// +kubebuilder:object:generate:=false
type ParsedRange struct {
// Start is the beginning of the range
Start int `json:"start,omitempty"`
// End of the range
End int `json:"end,omitempty"`
}
var validTime = "^((([01][0-9])|(2[0-3])):[0-5][0-9])$|(^24:00$)"
var validTimeRE = regexp.MustCompile(validTime)
// Converts a string of the form "HH:MM" into the number of minutes elapsed in the day.
func parseTime(in string) (mins int, err error) {
if !validTimeRE.MatchString(in) {
return 0, fmt.Errorf("couldn't parse timestamp %s, invalid format", in)
}
timestampComponents := strings.Split(in, ":")
if len(timestampComponents) != 2 {
return 0, fmt.Errorf("invalid timestamp format: %s", in)
}
timeStampHours, err := strconv.Atoi(timestampComponents[0])
if err != nil {
return 0, err
}
timeStampMinutes, err := strconv.Atoi(timestampComponents[1])
if err != nil {
return 0, err
}
if timeStampHours < 0 || timeStampHours > 24 || timeStampMinutes < 0 || timeStampMinutes > 60 {
return 0, fmt.Errorf("timestamp %s out of range", in)
}
// Timestamps are stored as minutes elapsed in the day, so multiply hours by 60.
mins = timeStampHours*60 + timeStampMinutes
return mins, nil
}
// parseRange parses a valid range string into parts
func parseRange(in string) (start, end string, err error) {
if !strings.ContainsRune(in, ':') {
return in, in, nil
}
parts := strings.Split(string(in), ":")
if len(parts) != 2 {
return start, end, fmt.Errorf("invalid range provided %s", in)
}
return parts[0], parts[1], nil
}

View File

@@ -0,0 +1,942 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// 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 controller-gen. DO NOT EDIT.
package v1beta1
import (
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AlertmanagerConfig) DeepCopyInto(out *AlertmanagerConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfig.
func (in *AlertmanagerConfig) DeepCopy() *AlertmanagerConfig {
if in == nil {
return nil
}
out := new(AlertmanagerConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AlertmanagerConfigList) DeepCopyInto(out *AlertmanagerConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]*AlertmanagerConfig, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(AlertmanagerConfig)
(*in).DeepCopyInto(*out)
}
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfigList.
func (in *AlertmanagerConfigList) DeepCopy() *AlertmanagerConfigList {
if in == nil {
return nil
}
out := new(AlertmanagerConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AlertmanagerConfigSpec) DeepCopyInto(out *AlertmanagerConfigSpec) {
*out = *in
if in.Route != nil {
in, out := &in.Route, &out.Route
*out = new(Route)
(*in).DeepCopyInto(*out)
}
if in.Receivers != nil {
in, out := &in.Receivers, &out.Receivers
*out = make([]Receiver, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.InhibitRules != nil {
in, out := &in.InhibitRules, &out.InhibitRules
*out = make([]InhibitRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.TimeIntervals != nil {
in, out := &in.TimeIntervals, &out.TimeIntervals
*out = make([]TimeInterval, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerConfigSpec.
func (in *AlertmanagerConfigSpec) DeepCopy() *AlertmanagerConfigSpec {
if in == nil {
return nil
}
out := new(AlertmanagerConfigSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DayOfMonthRange) DeepCopyInto(out *DayOfMonthRange) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DayOfMonthRange.
func (in *DayOfMonthRange) DeepCopy() *DayOfMonthRange {
if in == nil {
return nil
}
out := new(DayOfMonthRange)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EmailConfig) DeepCopyInto(out *EmailConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.AuthPassword != nil {
in, out := &in.AuthPassword, &out.AuthPassword
*out = new(SecretKeySelector)
**out = **in
}
if in.AuthSecret != nil {
in, out := &in.AuthSecret, &out.AuthSecret
*out = new(SecretKeySelector)
**out = **in
}
if in.Headers != nil {
in, out := &in.Headers, &out.Headers
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.RequireTLS != nil {
in, out := &in.RequireTLS, &out.RequireTLS
*out = new(bool)
**out = **in
}
if in.TLSConfig != nil {
in, out := &in.TLSConfig, &out.TLSConfig
*out = new(monitoringv1.SafeTLSConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmailConfig.
func (in *EmailConfig) DeepCopy() *EmailConfig {
if in == nil {
return nil
}
out := new(EmailConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HTTPConfig) DeepCopyInto(out *HTTPConfig) {
*out = *in
if in.Authorization != nil {
in, out := &in.Authorization, &out.Authorization
*out = new(monitoringv1.SafeAuthorization)
(*in).DeepCopyInto(*out)
}
if in.BasicAuth != nil {
in, out := &in.BasicAuth, &out.BasicAuth
*out = new(monitoringv1.BasicAuth)
(*in).DeepCopyInto(*out)
}
if in.OAuth2 != nil {
in, out := &in.OAuth2, &out.OAuth2
*out = new(monitoringv1.OAuth2)
(*in).DeepCopyInto(*out)
}
if in.BearerTokenSecret != nil {
in, out := &in.BearerTokenSecret, &out.BearerTokenSecret
*out = new(SecretKeySelector)
**out = **in
}
if in.TLSConfig != nil {
in, out := &in.TLSConfig, &out.TLSConfig
*out = new(monitoringv1.SafeTLSConfig)
(*in).DeepCopyInto(*out)
}
if in.FollowRedirects != nil {
in, out := &in.FollowRedirects, &out.FollowRedirects
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPConfig.
func (in *HTTPConfig) DeepCopy() *HTTPConfig {
if in == nil {
return nil
}
out := new(HTTPConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InhibitRule) DeepCopyInto(out *InhibitRule) {
*out = *in
if in.TargetMatch != nil {
in, out := &in.TargetMatch, &out.TargetMatch
*out = make([]Matcher, len(*in))
copy(*out, *in)
}
if in.SourceMatch != nil {
in, out := &in.SourceMatch, &out.SourceMatch
*out = make([]Matcher, len(*in))
copy(*out, *in)
}
if in.Equal != nil {
in, out := &in.Equal, &out.Equal
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InhibitRule.
func (in *InhibitRule) DeepCopy() *InhibitRule {
if in == nil {
return nil
}
out := new(InhibitRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KeyValue) DeepCopyInto(out *KeyValue) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyValue.
func (in *KeyValue) DeepCopy() *KeyValue {
if in == nil {
return nil
}
out := new(KeyValue)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Matcher) DeepCopyInto(out *Matcher) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Matcher.
func (in *Matcher) DeepCopy() *Matcher {
if in == nil {
return nil
}
out := new(Matcher)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OpsGenieConfig) DeepCopyInto(out *OpsGenieConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APIKey != nil {
in, out := &in.APIKey, &out.APIKey
*out = new(SecretKeySelector)
**out = **in
}
if in.Details != nil {
in, out := &in.Details, &out.Details
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.Responders != nil {
in, out := &in.Responders, &out.Responders
*out = make([]OpsGenieConfigResponder, len(*in))
copy(*out, *in)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpsGenieConfig.
func (in *OpsGenieConfig) DeepCopy() *OpsGenieConfig {
if in == nil {
return nil
}
out := new(OpsGenieConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OpsGenieConfigResponder) DeepCopyInto(out *OpsGenieConfigResponder) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpsGenieConfigResponder.
func (in *OpsGenieConfigResponder) DeepCopy() *OpsGenieConfigResponder {
if in == nil {
return nil
}
out := new(OpsGenieConfigResponder)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PagerDutyConfig) DeepCopyInto(out *PagerDutyConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.RoutingKey != nil {
in, out := &in.RoutingKey, &out.RoutingKey
*out = new(SecretKeySelector)
**out = **in
}
if in.ServiceKey != nil {
in, out := &in.ServiceKey, &out.ServiceKey
*out = new(SecretKeySelector)
**out = **in
}
if in.Details != nil {
in, out := &in.Details, &out.Details
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.PagerDutyImageConfigs != nil {
in, out := &in.PagerDutyImageConfigs, &out.PagerDutyImageConfigs
*out = make([]PagerDutyImageConfig, len(*in))
copy(*out, *in)
}
if in.PagerDutyLinkConfigs != nil {
in, out := &in.PagerDutyLinkConfigs, &out.PagerDutyLinkConfigs
*out = make([]PagerDutyLinkConfig, len(*in))
copy(*out, *in)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerDutyConfig.
func (in *PagerDutyConfig) DeepCopy() *PagerDutyConfig {
if in == nil {
return nil
}
out := new(PagerDutyConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PagerDutyImageConfig) DeepCopyInto(out *PagerDutyImageConfig) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerDutyImageConfig.
func (in *PagerDutyImageConfig) DeepCopy() *PagerDutyImageConfig {
if in == nil {
return nil
}
out := new(PagerDutyImageConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PagerDutyLinkConfig) DeepCopyInto(out *PagerDutyLinkConfig) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerDutyLinkConfig.
func (in *PagerDutyLinkConfig) DeepCopy() *PagerDutyLinkConfig {
if in == nil {
return nil
}
out := new(PagerDutyLinkConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PushoverConfig) DeepCopyInto(out *PushoverConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.UserKey != nil {
in, out := &in.UserKey, &out.UserKey
*out = new(SecretKeySelector)
**out = **in
}
if in.Token != nil {
in, out := &in.Token, &out.Token
*out = new(SecretKeySelector)
**out = **in
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PushoverConfig.
func (in *PushoverConfig) DeepCopy() *PushoverConfig {
if in == nil {
return nil
}
out := new(PushoverConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Receiver) DeepCopyInto(out *Receiver) {
*out = *in
if in.OpsGenieConfigs != nil {
in, out := &in.OpsGenieConfigs, &out.OpsGenieConfigs
*out = make([]OpsGenieConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PagerDutyConfigs != nil {
in, out := &in.PagerDutyConfigs, &out.PagerDutyConfigs
*out = make([]PagerDutyConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.SlackConfigs != nil {
in, out := &in.SlackConfigs, &out.SlackConfigs
*out = make([]SlackConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.WebhookConfigs != nil {
in, out := &in.WebhookConfigs, &out.WebhookConfigs
*out = make([]WebhookConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.WeChatConfigs != nil {
in, out := &in.WeChatConfigs, &out.WeChatConfigs
*out = make([]WeChatConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.EmailConfigs != nil {
in, out := &in.EmailConfigs, &out.EmailConfigs
*out = make([]EmailConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.VictorOpsConfigs != nil {
in, out := &in.VictorOpsConfigs, &out.VictorOpsConfigs
*out = make([]VictorOpsConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PushoverConfigs != nil {
in, out := &in.PushoverConfigs, &out.PushoverConfigs
*out = make([]PushoverConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.SNSConfigs != nil {
in, out := &in.SNSConfigs, &out.SNSConfigs
*out = make([]SNSConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.TelegramConfigs != nil {
in, out := &in.TelegramConfigs, &out.TelegramConfigs
*out = make([]TelegramConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Receiver.
func (in *Receiver) DeepCopy() *Receiver {
if in == nil {
return nil
}
out := new(Receiver)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Route) DeepCopyInto(out *Route) {
*out = *in
if in.GroupBy != nil {
in, out := &in.GroupBy, &out.GroupBy
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Matchers != nil {
in, out := &in.Matchers, &out.Matchers
*out = make([]Matcher, len(*in))
copy(*out, *in)
}
if in.Routes != nil {
in, out := &in.Routes, &out.Routes
*out = make([]v1.JSON, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.MuteTimeIntervals != nil {
in, out := &in.MuteTimeIntervals, &out.MuteTimeIntervals
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ActiveTimeIntervals != nil {
in, out := &in.ActiveTimeIntervals, &out.ActiveTimeIntervals
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.
func (in *Route) DeepCopy() *Route {
if in == nil {
return nil
}
out := new(Route)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SNSConfig) DeepCopyInto(out *SNSConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.Sigv4 != nil {
in, out := &in.Sigv4, &out.Sigv4
*out = new(monitoringv1.Sigv4)
(*in).DeepCopyInto(*out)
}
if in.Attributes != nil {
in, out := &in.Attributes, &out.Attributes
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SNSConfig.
func (in *SNSConfig) DeepCopy() *SNSConfig {
if in == nil {
return nil
}
out := new(SNSConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeySelector.
func (in *SecretKeySelector) DeepCopy() *SecretKeySelector {
if in == nil {
return nil
}
out := new(SecretKeySelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackAction) DeepCopyInto(out *SlackAction) {
*out = *in
if in.ConfirmField != nil {
in, out := &in.ConfirmField, &out.ConfirmField
*out = new(SlackConfirmationField)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackAction.
func (in *SlackAction) DeepCopy() *SlackAction {
if in == nil {
return nil
}
out := new(SlackAction)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackConfig) DeepCopyInto(out *SlackConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APIURL != nil {
in, out := &in.APIURL, &out.APIURL
*out = new(SecretKeySelector)
**out = **in
}
if in.Fields != nil {
in, out := &in.Fields, &out.Fields
*out = make([]SlackField, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.MrkdwnIn != nil {
in, out := &in.MrkdwnIn, &out.MrkdwnIn
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Actions != nil {
in, out := &in.Actions, &out.Actions
*out = make([]SlackAction, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackConfig.
func (in *SlackConfig) DeepCopy() *SlackConfig {
if in == nil {
return nil
}
out := new(SlackConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackConfirmationField) DeepCopyInto(out *SlackConfirmationField) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackConfirmationField.
func (in *SlackConfirmationField) DeepCopy() *SlackConfirmationField {
if in == nil {
return nil
}
out := new(SlackConfirmationField)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SlackField) DeepCopyInto(out *SlackField) {
*out = *in
if in.Short != nil {
in, out := &in.Short, &out.Short
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackField.
func (in *SlackField) DeepCopy() *SlackField {
if in == nil {
return nil
}
out := new(SlackField)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TelegramConfig) DeepCopyInto(out *TelegramConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.BotToken != nil {
in, out := &in.BotToken, &out.BotToken
*out = new(SecretKeySelector)
**out = **in
}
if in.DisableNotifications != nil {
in, out := &in.DisableNotifications, &out.DisableNotifications
*out = new(bool)
**out = **in
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelegramConfig.
func (in *TelegramConfig) DeepCopy() *TelegramConfig {
if in == nil {
return nil
}
out := new(TelegramConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimeInterval) DeepCopyInto(out *TimeInterval) {
*out = *in
if in.TimeIntervals != nil {
in, out := &in.TimeIntervals, &out.TimeIntervals
*out = make([]TimePeriod, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeInterval.
func (in *TimeInterval) DeepCopy() *TimeInterval {
if in == nil {
return nil
}
out := new(TimeInterval)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimePeriod) DeepCopyInto(out *TimePeriod) {
*out = *in
if in.Times != nil {
in, out := &in.Times, &out.Times
*out = make([]TimeRange, len(*in))
copy(*out, *in)
}
if in.Weekdays != nil {
in, out := &in.Weekdays, &out.Weekdays
*out = make([]WeekdayRange, len(*in))
copy(*out, *in)
}
if in.DaysOfMonth != nil {
in, out := &in.DaysOfMonth, &out.DaysOfMonth
*out = make([]DayOfMonthRange, len(*in))
copy(*out, *in)
}
if in.Months != nil {
in, out := &in.Months, &out.Months
*out = make([]MonthRange, len(*in))
copy(*out, *in)
}
if in.Years != nil {
in, out := &in.Years, &out.Years
*out = make([]YearRange, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimePeriod.
func (in *TimePeriod) DeepCopy() *TimePeriod {
if in == nil {
return nil
}
out := new(TimePeriod)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimeRange) DeepCopyInto(out *TimeRange) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeRange.
func (in *TimeRange) DeepCopy() *TimeRange {
if in == nil {
return nil
}
out := new(TimeRange)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VictorOpsConfig) DeepCopyInto(out *VictorOpsConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APIKey != nil {
in, out := &in.APIKey, &out.APIKey
*out = new(SecretKeySelector)
**out = **in
}
if in.CustomFields != nil {
in, out := &in.CustomFields, &out.CustomFields
*out = make([]KeyValue, len(*in))
copy(*out, *in)
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VictorOpsConfig.
func (in *VictorOpsConfig) DeepCopy() *VictorOpsConfig {
if in == nil {
return nil
}
out := new(VictorOpsConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WeChatConfig) DeepCopyInto(out *WeChatConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.APISecret != nil {
in, out := &in.APISecret, &out.APISecret
*out = new(SecretKeySelector)
**out = **in
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeChatConfig.
func (in *WeChatConfig) DeepCopy() *WeChatConfig {
if in == nil {
return nil
}
out := new(WeChatConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WebhookConfig) DeepCopyInto(out *WebhookConfig) {
*out = *in
if in.SendResolved != nil {
in, out := &in.SendResolved, &out.SendResolved
*out = new(bool)
**out = **in
}
if in.URL != nil {
in, out := &in.URL, &out.URL
*out = new(string)
**out = **in
}
if in.URLSecret != nil {
in, out := &in.URLSecret, &out.URLSecret
*out = new(SecretKeySelector)
**out = **in
}
if in.HTTPConfig != nil {
in, out := &in.HTTPConfig, &out.HTTPConfig
*out = new(HTTPConfig)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfig.
func (in *WebhookConfig) DeepCopy() *WebhookConfig {
if in == nil {
return nil
}
out := new(WebhookConfig)
in.DeepCopyInto(out)
return out
}

View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
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.

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
// 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"`
Conditions []ConditionApplyConfiguration `json:"conditions,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
}
// 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 *AlertmanagerStatusApplyConfiguration) WithConditions(values ...*ConditionApplyConfiguration) *AlertmanagerStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -0,0 +1,664 @@
// 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"`
PodTargetLabels []string `json:"podTargetLabels,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
}
// 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 *CommonPrometheusFieldsApplyConfiguration) WithPodTargetLabels(values ...string) *CommonPrometheusFieldsApplyConfiguration {
for i := range values {
b.PodTargetLabels = append(b.PodTargetLabels, values[i])
}
return b
}

View File

@@ -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"
)
// ConditionApplyConfiguration represents an declarative configuration of the Condition type for use
// with apply.
type ConditionApplyConfiguration struct {
Type *v1.ConditionType `json:"type,omitempty"`
Status *v1.ConditionStatus `json:"status,omitempty"`
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
}
// ConditionApplyConfiguration constructs an declarative configuration of the Condition type for use with
// apply.
func Condition() *ConditionApplyConfiguration {
return &ConditionApplyConfiguration{}
}
// 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 *ConditionApplyConfiguration) WithType(value v1.ConditionType) *ConditionApplyConfiguration {
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 *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ConditionApplyConfiguration {
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 *ConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ConditionApplyConfiguration {
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 *ConditionApplyConfiguration) WithReason(value string) *ConditionApplyConfiguration {
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 *ConditionApplyConfiguration) WithMessage(value string) *ConditionApplyConfiguration {
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 *ConditionApplyConfiguration) WithObservedGeneration(value int64) *ConditionApplyConfiguration {
b.ObservedGeneration = &value
return b
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -0,0 +1,809 @@
// 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
}
// 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 *PrometheusSpecApplyConfiguration) WithPodTargetLabels(values ...string) *PrometheusSpecApplyConfiguration {
for i := range values {
b.PodTargetLabels = append(b.PodTargetLabels, values[i])
}
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
}

View File

@@ -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 []ConditionApplyConfiguration `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 ...*ConditionApplyConfiguration) *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
}

View File

@@ -0,0 +1,63 @@
// 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"`
MaxConnections *int32 `json:"maxConnections,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
}
// WithMaxConnections sets the MaxConnections field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MaxConnections field is set to the value of the last call.
func (b *PrometheusWebSpecApplyConfiguration) WithMaxConnections(value int32) *PrometheusWebSpecApplyConfiguration {
b.MaxConnections = &value
return b
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -0,0 +1,525 @@
// 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"`
AdditionalArgs []ArgumentApplyConfiguration `json:"additionalArgs,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
}
// 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 *ThanosRulerSpecApplyConfiguration) WithAdditionalArgs(values ...*ArgumentApplyConfiguration) *ThanosRulerSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithAdditionalArgs")
}
b.AdditionalArgs = append(b.AdditionalArgs, *values[i])
}
return b
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

Some files were not shown because too many files have changed in this diff Show More