Upgrade operator-sdk to 1.3.0 without e2e tests

This commit is contained in:
Tomasz Sęk
2021-01-19 15:47:05 +01:00
parent aa45c79c56
commit cb26623f5f
108 changed files with 5962 additions and 1981 deletions
+36
View File
@@ -0,0 +1,36 @@
/*
Copyright 2021.
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 v1alpha2 contains API Schema definitions for the jenkins.io v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=jenkins.io.jenkins.io
package v1alpha2
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "jenkins.io.jenkins.io", Version: "v1alpha2"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
+680
View File
@@ -0,0 +1,680 @@
/*
Copyright 2021.
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 v1alpha2
import (
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// JenkinsSpec defines the desired state of Jenkins
type JenkinsSpec struct {
// Master represents Jenkins master pod properties and Jenkins plugins.
// Every single change here requires a pod restart.
Master JenkinsMaster `json:"master"`
// SeedJobs defines list of Jenkins Seed Job configurations
// More info: https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuration#configure-seed-jobs-and-pipelines
// +optional
SeedJobs []SeedJob `json:"seedJobs,omitempty"`
// Notifications defines list of a services which are used to inform about Jenkins status
// Can be used to integrate chat services like Slack, Microsoft Teams or Mailgun
// +optional
Notifications []Notification `json:"notifications,omitempty"`
// Service is Kubernetes service of Jenkins master HTTP pod
// Defaults to :
// port: 8080
// type: ClusterIP
// +optional
Service Service `json:"service,omitempty"`
// Service is Kubernetes service of Jenkins slave pods
// Defaults to :
// port: 50000
// type: ClusterIP
// +optional
SlaveService Service `json:"slaveService,omitempty"`
// Backup defines configuration of Jenkins backup
// More info: https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configure-backup-and-restore/
// +optional
Backup Backup `json:"backup,omitempty"`
// Backup defines configuration of Jenkins backup restore
// More info: https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configure-backup-and-restore/
// +optional
Restore Restore `json:"restore,omitempty"`
// GroovyScripts defines configuration of Jenkins customization via groovy scripts
// +optional
GroovyScripts GroovyScripts `json:"groovyScripts,omitempty"`
// ConfigurationAsCode defines configuration of Jenkins customization via Configuration as Code Jenkins plugin
// +optional
ConfigurationAsCode ConfigurationAsCode `json:"configurationAsCode,omitempty"`
// Roles defines list of extra RBAC roles for the Jenkins Master pod service account
// +optional
Roles []rbacv1.RoleRef `json:"roles,omitempty"`
// ServiceAccount defines Jenkins master service account attributes
// +optional
ServiceAccount ServiceAccount `json:"serviceAccount,omitempty"`
// JenkinsAPISettings defines configuration used by the operator to gain admin access to the Jenkins API
JenkinsAPISettings JenkinsAPISettings `json:"jenkinsAPISettings"`
}
// AuthorizationStrategy defines authorization strategy of the operator for the Jenkins API
type AuthorizationStrategy string
const (
// CreateUserAuthorizationStrategy operator sets HudsonPrivateSecurityRealm and FullControlOnceLoggedInAuthorizationStrategy than creates user using init.d groovy script
CreateUserAuthorizationStrategy AuthorizationStrategy = "createUser"
// ServiceAccountAuthorizationStrategy operator gets token associated with Jenkins service account and uses it as bearer token
ServiceAccountAuthorizationStrategy AuthorizationStrategy = "serviceAccount"
)
// JenkinsAPISettings defines configuration used by the operator to gain admin access to the Jenkins API
type JenkinsAPISettings struct {
AuthorizationStrategy AuthorizationStrategy `json:"authorizationStrategy"`
}
// ServiceAccount defines Kubernetes service account attributes
type ServiceAccount struct {
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: http://kubernetes.io/docs/user-guide/annotations
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
// NotificationLevel defines the level of a Notification.
type NotificationLevel string
const (
// NotificationLevelWarning - Only Warnings
NotificationLevelWarning NotificationLevel = "warning"
// NotificationLevelInfo - Only info
NotificationLevelInfo NotificationLevel = "info"
)
// Notification is a service configuration used to send notifications about Jenkins status.
type Notification struct {
LoggingLevel NotificationLevel `json:"level"`
Verbose bool `json:"verbose"`
Name string `json:"name"`
Slack *Slack `json:"slack,omitempty"`
Teams *MicrosoftTeams `json:"teams,omitempty"`
Mailgun *Mailgun `json:"mailgun,omitempty"`
SMTP *SMTP `json:"smtp,omitempty"`
}
// Slack is handler for Slack notification channel.
type Slack struct {
// The web hook URL to Slack App
WebHookURLSecretKeySelector SecretKeySelector `json:"webHookURLSecretKeySelector"`
}
// SMTP is handler for sending emails via this protocol.
type SMTP struct {
UsernameSecretKeySelector SecretKeySelector `json:"usernameSecretKeySelector"`
PasswordSecretKeySelector SecretKeySelector `json:"passwordSecretKeySelector"`
Port int `json:"port"`
Server string `json:"server"`
TLSInsecureSkipVerify bool `json:"tlsInsecureSkipVerify,omitempty"`
From string `json:"from"`
To string `json:"to"`
}
// MicrosoftTeams is handler for Microsoft MicrosoftTeams notification channel.
type MicrosoftTeams struct {
// The web hook URL to MicrosoftTeams App
WebHookURLSecretKeySelector SecretKeySelector `json:"webHookURLSecretKeySelector"`
}
// Mailgun is handler for Mailgun email service notification channel.
type Mailgun struct {
Domain string `json:"domain"`
APIKeySecretKeySelector SecretKeySelector `json:"apiKeySecretKeySelector"`
Recipient string `json:"recipient"`
From string `json:"from"`
}
// SecretKeySelector selects a key of a Secret.
type SecretKeySelector struct {
// The name of the secret in the pod's namespace to select from.
corev1.LocalObjectReference `json:"secret"`
// The key of the secret to select from. Must be a valid secret key.
Key string `json:"key"`
}
// Container defines Kubernetes container attributes.
type Container struct {
// Name of the container specified as a DNS_LABEL.
// Each container in a pod must have a unique name (DNS_LABEL).
Name string `json:"name"`
// Docker image name.
// More info: https://kubernetes.io/docs/concepts/containers/images
Image string `json:"image"`
// Image pull policy.
// One of Always, Never, IfNotPresent.
// Defaults to Always.
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`
// Compute Resources required by this container.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
Resources corev1.ResourceRequirements `json:"resources"`
// Entrypoint array. Not executed within a shell.
// The docker image's ENTRYPOINT is used if this is not provided.
// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
// regardless of whether the variable exists or not.
// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
// +optional
Command []string `json:"command,omitempty"`
// Arguments to the entrypoint.
// The docker image's CMD is used if this is not provided.
// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
// regardless of whether the variable exists or not.
// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
// +optional
Args []string `json:"args,omitempty"`
// Container's working directory.
// If not specified, the container runtime's default will be used, which
// might be configured in the container image.
// +optional
WorkingDir string `json:"workingDir,omitempty"`
// List of ports to expose from the container. Exposing a port here gives
// the system additional information about the network connections a
// container uses, but is primarily informational. Not specifying a port here
// DOES NOT prevent that port from being exposed. Any port which is
// listening on the default "0.0.0.0" address inside a container will be
// accessible from the network.
// +optional
Ports []corev1.ContainerPort `json:"ports,omitempty"`
// List of sources to populate environment variables in the container.
// The keys defined within a source must be a C_IDENTIFIER. All invalid keys
// will be reported as an event when the container is starting. When a key exists in multiple
// sources, the value associated with the last source will take precedence.
// Values defined by an Env with a duplicate key will take precedence.
// +optional
EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
// List of environment variables to set in the container.
// +optional
Env []corev1.EnvVar `json:"env,omitempty"`
// Pod volumes to mount into the container's filesystem.
// +optional
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// Periodic probe of container liveness.
// Container will be restarted if the probe fails.
// +optional
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`
// Periodic probe of container service readiness.
// Container will be removed from service endpoints if the probe fails.
// +optional
ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
// Actions that the management system should take in response to container lifecycle events.
// +optional
Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"`
// Security options the pod should run with.
// More info: https://kubernetes.io/docs/concepts/policy/security-context/
// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
// +optional
SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
}
// Plugin defines Jenkins plugin.
type Plugin struct {
// Name is the name of Jenkins plugin
Name string `json:"name"`
// Version is the version of Jenkins plugin
Version string `json:"version"`
// DownloadURL is the custom url from where plugin has to be downloaded.
DownloadURL string `json:"downloadURL,omitempty"`
}
// JenkinsMaster defines the Jenkins master pod attributes and plugins,
// every single change requires a Jenkins master pod restart.
type JenkinsMaster struct {
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: http://kubernetes.io/docs/user-guide/annotations
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// Map of string keys and values that can be used to organize and categorize
// (scope and select) objects. May match selectors of replication controllers
// and services.
// More info: http://kubernetes.io/docs/user-guide/labels
// +optional
Labels map[string]string `json:"labels,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node.
// Selector which must match a node's labels for the pod to be scheduled on that node.
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// SecurityContext that applies to all the containers of the Jenkins
// Master. As per kubernetes specification, it can be overridden
// for each container individually.
// +optional
// Defaults to:
// runAsUser: 1000
// fsGroup: 1000
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// List of containers belonging to the pod.
// Containers cannot currently be added or removed.
// There must be at least one container in a Pod.
// +optional
// Defaults to:
// - image: jenkins/jenkins:lts
// imagePullPolicy: Always
// livenessProbe:
// failureThreshold: 12
// httpGet:
// path: /login
// port: http
// scheme: HTTP
// initialDelaySeconds: 80
// periodSeconds: 10
// successThreshold: 1
// timeoutSeconds: 5
// name: jenkins-master
// readinessProbe:
// failureThreshold: 3
// httpGet:
// path: /login
// port: http
// scheme: HTTP
// initialDelaySeconds: 30
// periodSeconds: 10
// successThreshold: 1
// timeoutSeconds: 1
// resources:
// limits:
// cpu: 1500m
// memory: 3Gi
// requests:
// cpu: "1"
// memory: 600Mi
Containers []Container `json:"containers,omitempty"`
// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
// in the case of docker, only DockerConfig type secrets are honored.
// More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
// +optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// List of volumes that can be mounted by containers belonging to the pod.
// More info: https://kubernetes.io/docs/concepts/storage/volumes
// +optional
Volumes []corev1.Volume `json:"volumes,omitempty"`
// If specified, the pod's tolerations.
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// BasePlugins contains plugins required by operator
// +optional
// Defaults to :
// - name: kubernetes
// version: "1.28.6"
// - name: workflow-job
// version: "2.40"
// - name: workflow-aggregator
// version: "2.6"
// - name: git
// version: "4.5.0"
// - name: job-dsl
// version: "1.77"
// - name: configuration-as-code
// version: "1.46"
// - name: kubernetes-credentials-provider
// version: "0.15"
BasePlugins []Plugin `json:"basePlugins,omitempty"`
// Plugins contains plugins required by user
// +optional
Plugins []Plugin `json:"plugins,omitempty"`
// DisableCSRFProtection allows you to toggle CSRF Protection on Jenkins
DisableCSRFProtection bool `json:"disableCSRFProtection"`
// PriorityClassName for Jenkins master pod
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`
}
// Service defines Kubernetes service attributes
type Service struct {
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: http://kubernetes.io/docs/user-guide/annotations
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// Route service traffic to pods with label keys and values matching this
// selector. If empty or not present, the service is assumed to have an
// external process managing its endpoints, which Kubernetes will not
// modify. Only applies to types ClusterIP, NodePort, and LoadBalancer.
// Ignored if type is ExternalName.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/
// +optional
Labels map[string]string `json:"labels,omitempty"`
// Type determines how the Service is exposed. Defaults to ClusterIP. Valid
// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
// "ExternalName" maps to the specified externalName.
// "ClusterIP" allocates a cluster-internal IP address for load-balancing to
// endpoints. Endpoints are determined by the selector or if that is not
// specified, by manual construction of an Endpoints object. If clusterIP is
// "None", no virtual IP is allocated and the endpoints are published as a
// set of endpoints rather than a stable IP.
// "NodePort" builds on ClusterIP and allocates a port on every node which
// routes to the clusterIP.
// "LoadBalancer" builds on NodePort and creates an
// external load-balancer (if supported in the current cloud) which routes
// to the clusterIP.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types
// +optional
Type corev1.ServiceType `json:"type,omitempty"`
// The port that are exposed by this service.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
Port int32 `json:"port,omitempty"`
// The port on each node on which this service is exposed when type=NodePort or LoadBalancer.
// Usually assigned by the system. If specified, it will be allocated to the service
// if unused or else creation of the service will fail.
// Default is to auto-allocate a port if the ServiceType of this Service requires one.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
// +optional
NodePort int32 `json:"nodePort,omitempty"`
// If specified and supported by the platform, this will restrict traffic through the cloud-provider
// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
// cloud-provider does not support the feature."
// More info: https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/#restricting-cloud-metadata-api-access
// +optional
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
// Only applies to Service Type: LoadBalancer
// LoadBalancer will get created with the IP specified in this field.
// This feature depends on whether the underlying cloud-provider supports specifying
// the loadBalancerIP when a load balancer is created.
// This field will be ignored if the cloud-provider does not support the feature.
// +optional
LoadBalancerIP string `json:"loadBalancerIP,omitempty"`
}
// JenkinsStatus defines the observed state of Jenkins
type JenkinsStatus struct {
// OperatorVersion is the operator version which manages this CR
// +optional
OperatorVersion string `json:"operatorVersion,omitempty"`
// ProvisionStartTime is a time when Jenkins master pod has been created
// +optional
ProvisionStartTime *metav1.Time `json:"provisionStartTime,omitempty"`
// BaseConfigurationCompletedTime is a time when Jenkins base configuration phase has been completed
// +optional
BaseConfigurationCompletedTime *metav1.Time `json:"baseConfigurationCompletedTime,omitempty"`
// UserConfigurationCompletedTime is a time when Jenkins user configuration phase has been completed
// +optional
UserConfigurationCompletedTime *metav1.Time `json:"userConfigurationCompletedTime,omitempty"`
// RestoredBackup is the restored backup number after Jenkins master pod restart
// +optional
RestoredBackup uint64 `json:"restoredBackup,omitempty"`
// LastBackup is the latest backup number
// +optional
LastBackup uint64 `json:"lastBackup,omitempty"`
// PendingBackup is the pending backup number
// +optional
PendingBackup uint64 `json:"pendingBackup,omitempty"`
// BackupDoneBeforePodDeletion tells if backup before pod deletion has been made
// +optional
BackupDoneBeforePodDeletion bool `json:"backupDoneBeforePodDeletion,omitempty"`
// UserAndPasswordHash is a SHA256 hash made from user and password
// +optional
UserAndPasswordHash string `json:"userAndPasswordHash,omitempty"`
// CreatedSeedJobs contains list of seed job id already created in Jenkins
// +optional
CreatedSeedJobs []string `json:"createdSeedJobs,omitempty"`
// AppliedGroovyScripts is a list with all applied groovy scripts in Jenkins by the operator
// +optional
AppliedGroovyScripts []AppliedGroovyScript `json:"appliedGroovyScripts,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// Jenkins is the Schema for the jenkins API
type Jenkins struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec JenkinsSpec `json:"spec,omitempty"`
Status JenkinsStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// JenkinsList contains a list of Jenkins
type JenkinsList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Jenkins `json:"items"`
}
// JenkinsCredentialType defines type of Jenkins credential used to seed job mechanism.
type JenkinsCredentialType string
const (
// NoJenkinsCredentialCredentialType define none Jenkins credential type
NoJenkinsCredentialCredentialType JenkinsCredentialType = ""
// BasicSSHCredentialType define basic SSH Jenkins credential type
BasicSSHCredentialType JenkinsCredentialType = "basicSSHUserPrivateKey"
// UsernamePasswordCredentialType define username & password Jenkins credential type
UsernamePasswordCredentialType JenkinsCredentialType = "usernamePassword"
// ExternalCredentialType defines other credential type
ExternalCredentialType JenkinsCredentialType = "external"
)
// AllowedJenkinsCredentialMap contains all allowed Jenkins credentials types.
var AllowedJenkinsCredentialMap = map[string]string{
string(NoJenkinsCredentialCredentialType): "",
string(BasicSSHCredentialType): "",
string(UsernamePasswordCredentialType): "",
string(ExternalCredentialType): "",
}
// SeedJob defines configuration for seed job
// More info: https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuration/#configure-seed-jobs-and-pipelines.
type SeedJob struct {
// ID is the unique seed job name
ID string `json:"id,omitempty"`
// CredentialID is the Kubernetes secret name which stores repository access credentials
CredentialID string `json:"credentialID,omitempty"`
// Description is the description of the seed job
// +optional
Description string `json:"description,omitempty"`
// Targets is the repository path where are seed job definitions
Targets string `json:"targets,omitempty"`
// RepositoryBranch is the repository branch where are seed job definitions
RepositoryBranch string `json:"repositoryBranch,omitempty"`
// RepositoryURL is the repository access URL. Can be SSH or HTTPS.
RepositoryURL string `json:"repositoryUrl,omitempty"`
// JenkinsCredentialType is the https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/ credential type
// +optional
JenkinsCredentialType JenkinsCredentialType `json:"credentialType,omitempty"`
// BitbucketPushTrigger is used for Bitbucket web hooks
// +optional
BitbucketPushTrigger bool `json:"bitbucketPushTrigger"`
// GitHubPushTrigger is used for GitHub web hooks
// +optional
GitHubPushTrigger bool `json:"githubPushTrigger"`
// BuildPeriodically is setting for scheduled trigger
// +optional
BuildPeriodically string `json:"buildPeriodically"`
// PollSCM is setting for polling changes in SCM
// +optional
PollSCM string `json:"pollSCM"`
// IgnoreMissingFiles is setting for Job DSL API plugin to ignore files that miss
// +optional
IgnoreMissingFiles bool `json:"ignoreMissingFiles"`
// AdditionalClasspath is setting for Job DSL API plugin to set Additional Classpath
// +optional
AdditionalClasspath string `json:"additionalClasspath"`
// FailOnMissingPlugin is setting for Job DSL API plugin that fails job if required plugin is missing
// +optional
FailOnMissingPlugin bool `json:"failOnMissingPlugin"`
// UnstableOnDeprecation is setting for Job DSL API plugin that sets build status as unstable if build using deprecated features
// +optional
UnstableOnDeprecation bool `json:"unstableOnDeprecation"`
}
// Handler defines a specific action that should be taken.
type Handler struct {
// Exec specifies the action to take.
Exec *corev1.ExecAction `json:"exec,omitempty"`
}
// Backup defines configuration of Jenkins backup.
type Backup struct {
// ContainerName is the container name responsible for backup operation
ContainerName string `json:"containerName"`
// Action defines action which performs backup in backup container sidecar
Action Handler `json:"action"`
// Interval tells how often make backup in seconds
// Defaults to 30.
Interval uint64 `json:"interval"`
// MakeBackupBeforePodDeletion tells operator to make backup before Jenkins master pod deletion
MakeBackupBeforePodDeletion bool `json:"makeBackupBeforePodDeletion"`
}
// Restore defines configuration of Jenkins backup restore operation.
type Restore struct {
// ContainerName is the container name responsible for restore backup operation
ContainerName string `json:"containerName"`
// Action defines action which performs restore backup in restore container sidecar
Action Handler `json:"action"`
// GetLatestAction defines action which returns the latest backup number. If there is no backup "-1" should be
// returned.
// +optional
GetLatestAction Handler `json:"getLatestAction"`
// RecoveryOnce if want to restore specific backup set this field and then Jenkins will be restarted and desired backup will be restored
// +optional
RecoveryOnce uint64 `json:"recoveryOnce,omitempty"`
}
// AppliedGroovyScript is the applied groovy script in Jenkins by the operator.
type AppliedGroovyScript struct {
// ConfigurationType is the name of the configuration type(base-groovy, user-groovy, user-casc)
ConfigurationType string `json:"configurationType"`
// Source is the name of source where is located groovy script
Source string `json:"source"`
// Name is the name of the groovy script
Name string `json:"name"`
// Hash is the hash of the groovy script and secrets which it uses
Hash string `json:"hash"`
}
// SecretRef is reference to Kubernetes secret.
type SecretRef struct {
Name string `json:"name"`
}
// ConfigMapRef is reference to Kubernetes ConfigMap.
type ConfigMapRef struct {
Name string `json:"name"`
}
// Customization defines configuration of Jenkins customization.
type Customization struct {
Secret SecretRef `json:"secret"`
Configurations []ConfigMapRef `json:"configurations"`
}
// GroovyScripts defines configuration of Jenkins customization via groovy scripts.
type GroovyScripts struct {
Customization `json:",inline"`
}
// ConfigurationAsCode defines configuration of Jenkins customization via Configuration as Code Jenkins plugin.
type ConfigurationAsCode struct {
Customization `json:",inline"`
}
func init() {
SchemeBuilder.Register(&Jenkins{}, &JenkinsList{})
}
+53
View File
@@ -0,0 +1,53 @@
package v1alpha2
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// JenkinsImageSpec defines the desired state of JenkinsImage
type JenkinsImageSpec struct {
BaseImage Image `json:"image"`
Plugins []JenkinsPlugin `json:"plugins"` // Plugins list
}
// Defines Jenkins Plugin structure
type JenkinsPlugin struct {
Name string `json:"name"`
Version string `json:"version,omitempty"`
}
// Defines Jenkins Plugin structure
type Image struct {
Name string `json:"name"`
Tag string `json:"version,omitempty"`
}
// JenkinsImageStatus defines the observed state of JenkinsImage
type JenkinsImageStatus struct {
Image string `json:"image,omitempty"`
MD5Sum string `json:"md5sum,omitempty"`
InstalledPlugins []JenkinsPlugin `json:"installedPlugins,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// JenkinsImage is the Schema for the jenkinsimages API
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=jenkinsimages,scope=Namespaced
type JenkinsImage struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec JenkinsImageSpec `json:"spec,omitempty"`
Status JenkinsImageStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// JenkinsImageList contains a list of JenkinsImage
type JenkinsImageList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []JenkinsImage `json:"items"`
}
func init() {
SchemeBuilder.Register(&JenkinsImage{}, &JenkinsImageList{})
}
+47
View File
@@ -0,0 +1,47 @@
// Package v1alpha2 contains API Schema definitions for the jenkins.io v1alpha2 API group
// +k8s:deepcopy-gen=package,register
// +groupName=jenkins.io
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const (
// Kind defines Jenkins CRD kind name
Kind = "Jenkins"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "jenkins.io", Version: "v1alpha2"}
)
// GetObjectKind returns Jenkins object kind
func (in *Jenkins) GetObjectKind() schema.ObjectKind { return in }
// SetGroupVersionKind sets GroupVersionKind
func (in *Jenkins) SetGroupVersionKind(kind schema.GroupVersionKind) {}
// GroupVersionKind returns GroupVersionKind
func (in *Jenkins) GroupVersionKind() schema.GroupVersionKind {
return schema.GroupVersionKind{
Group: SchemeGroupVersion.Group,
Version: SchemeGroupVersion.Version,
Kind: Kind,
}
}
// JenkinsTypeMeta returns Jenkins type meta
func JenkinsTypeMeta() metav1.TypeMeta {
return metav1.TypeMeta{
Kind: Kind,
APIVersion: SchemeGroupVersion.String(),
}
}
func init() {
SchemeBuilder.Register(&Jenkins{}, &JenkinsList{})
SchemeBuilder.Register(&JenkinsImage{}, &JenkinsImageList{})
}
+811
View File
@@ -0,0 +1,811 @@
// +build !ignore_autogenerated
/*
Copyright 2021.
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 v1alpha2
import (
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppliedGroovyScript) DeepCopyInto(out *AppliedGroovyScript) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedGroovyScript.
func (in *AppliedGroovyScript) DeepCopy() *AppliedGroovyScript {
if in == nil {
return nil
}
out := new(AppliedGroovyScript)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Backup) DeepCopyInto(out *Backup) {
*out = *in
in.Action.DeepCopyInto(&out.Action)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backup.
func (in *Backup) DeepCopy() *Backup {
if in == nil {
return nil
}
out := new(Backup)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigMapRef) DeepCopyInto(out *ConfigMapRef) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapRef.
func (in *ConfigMapRef) DeepCopy() *ConfigMapRef {
if in == nil {
return nil
}
out := new(ConfigMapRef)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigurationAsCode) DeepCopyInto(out *ConfigurationAsCode) {
*out = *in
in.Customization.DeepCopyInto(&out.Customization)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationAsCode.
func (in *ConfigurationAsCode) DeepCopy() *ConfigurationAsCode {
if in == nil {
return nil
}
out := new(ConfigurationAsCode)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Container) DeepCopyInto(out *Container) {
*out = *in
in.Resources.DeepCopyInto(&out.Resources)
if in.Command != nil {
in, out := &in.Command, &out.Command
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Args != nil {
in, out := &in.Args, &out.Args
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Ports != nil {
in, out := &in.Ports, &out.Ports
*out = make([]corev1.ContainerPort, len(*in))
copy(*out, *in)
}
if in.EnvFrom != nil {
in, out := &in.EnvFrom, &out.EnvFrom
*out = make([]corev1.EnvFromSource, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Env != nil {
in, out := &in.Env, &out.Env
*out = make([]corev1.EnvVar, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.VolumeMounts != nil {
in, out := &in.VolumeMounts, &out.VolumeMounts
*out = make([]corev1.VolumeMount, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.LivenessProbe != nil {
in, out := &in.LivenessProbe, &out.LivenessProbe
*out = new(corev1.Probe)
(*in).DeepCopyInto(*out)
}
if in.ReadinessProbe != nil {
in, out := &in.ReadinessProbe, &out.ReadinessProbe
*out = new(corev1.Probe)
(*in).DeepCopyInto(*out)
}
if in.Lifecycle != nil {
in, out := &in.Lifecycle, &out.Lifecycle
*out = new(corev1.Lifecycle)
(*in).DeepCopyInto(*out)
}
if in.SecurityContext != nil {
in, out := &in.SecurityContext, &out.SecurityContext
*out = new(corev1.SecurityContext)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Container.
func (in *Container) DeepCopy() *Container {
if in == nil {
return nil
}
out := new(Container)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Customization) DeepCopyInto(out *Customization) {
*out = *in
out.Secret = in.Secret
if in.Configurations != nil {
in, out := &in.Configurations, &out.Configurations
*out = make([]ConfigMapRef, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Customization.
func (in *Customization) DeepCopy() *Customization {
if in == nil {
return nil
}
out := new(Customization)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GroovyScripts) DeepCopyInto(out *GroovyScripts) {
*out = *in
in.Customization.DeepCopyInto(&out.Customization)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroovyScripts.
func (in *GroovyScripts) DeepCopy() *GroovyScripts {
if in == nil {
return nil
}
out := new(GroovyScripts)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Handler) DeepCopyInto(out *Handler) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
*out = new(corev1.ExecAction)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Handler.
func (in *Handler) DeepCopy() *Handler {
if in == nil {
return nil
}
out := new(Handler)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Image) DeepCopyInto(out *Image) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image.
func (in *Image) DeepCopy() *Image {
if in == nil {
return nil
}
out := new(Image)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Jenkins) DeepCopyInto(out *Jenkins) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Jenkins.
func (in *Jenkins) DeepCopy() *Jenkins {
if in == nil {
return nil
}
out := new(Jenkins)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Jenkins) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsAPISettings) DeepCopyInto(out *JenkinsAPISettings) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsAPISettings.
func (in *JenkinsAPISettings) DeepCopy() *JenkinsAPISettings {
if in == nil {
return nil
}
out := new(JenkinsAPISettings)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsImage) DeepCopyInto(out *JenkinsImage) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsImage.
func (in *JenkinsImage) DeepCopy() *JenkinsImage {
if in == nil {
return nil
}
out := new(JenkinsImage)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *JenkinsImage) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsImageList) DeepCopyInto(out *JenkinsImageList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]JenkinsImage, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsImageList.
func (in *JenkinsImageList) DeepCopy() *JenkinsImageList {
if in == nil {
return nil
}
out := new(JenkinsImageList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *JenkinsImageList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsImageSpec) DeepCopyInto(out *JenkinsImageSpec) {
*out = *in
out.BaseImage = in.BaseImage
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]JenkinsPlugin, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsImageSpec.
func (in *JenkinsImageSpec) DeepCopy() *JenkinsImageSpec {
if in == nil {
return nil
}
out := new(JenkinsImageSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsImageStatus) DeepCopyInto(out *JenkinsImageStatus) {
*out = *in
if in.InstalledPlugins != nil {
in, out := &in.InstalledPlugins, &out.InstalledPlugins
*out = make([]JenkinsPlugin, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsImageStatus.
func (in *JenkinsImageStatus) DeepCopy() *JenkinsImageStatus {
if in == nil {
return nil
}
out := new(JenkinsImageStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsList) DeepCopyInto(out *JenkinsList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Jenkins, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsList.
func (in *JenkinsList) DeepCopy() *JenkinsList {
if in == nil {
return nil
}
out := new(JenkinsList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *JenkinsList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsMaster) DeepCopyInto(out *JenkinsMaster) {
*out = *in
if in.Annotations != nil {
in, out := &in.Annotations, &out.Annotations
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Labels != nil {
in, out := &in.Labels, &out.Labels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.SecurityContext != nil {
in, out := &in.SecurityContext, &out.SecurityContext
*out = new(corev1.PodSecurityContext)
(*in).DeepCopyInto(*out)
}
if in.Containers != nil {
in, out := &in.Containers, &out.Containers
*out = make([]Container, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ImagePullSecrets != nil {
in, out := &in.ImagePullSecrets, &out.ImagePullSecrets
*out = make([]corev1.LocalObjectReference, len(*in))
copy(*out, *in)
}
if in.Volumes != nil {
in, out := &in.Volumes, &out.Volumes
*out = make([]corev1.Volume, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Tolerations != nil {
in, out := &in.Tolerations, &out.Tolerations
*out = make([]corev1.Toleration, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.BasePlugins != nil {
in, out := &in.BasePlugins, &out.BasePlugins
*out = make([]Plugin, len(*in))
copy(*out, *in)
}
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]Plugin, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsMaster.
func (in *JenkinsMaster) DeepCopy() *JenkinsMaster {
if in == nil {
return nil
}
out := new(JenkinsMaster)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsPlugin) DeepCopyInto(out *JenkinsPlugin) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsPlugin.
func (in *JenkinsPlugin) DeepCopy() *JenkinsPlugin {
if in == nil {
return nil
}
out := new(JenkinsPlugin)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsSpec) DeepCopyInto(out *JenkinsSpec) {
*out = *in
in.Master.DeepCopyInto(&out.Master)
if in.SeedJobs != nil {
in, out := &in.SeedJobs, &out.SeedJobs
*out = make([]SeedJob, len(*in))
copy(*out, *in)
}
if in.Notifications != nil {
in, out := &in.Notifications, &out.Notifications
*out = make([]Notification, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.Service.DeepCopyInto(&out.Service)
in.SlaveService.DeepCopyInto(&out.SlaveService)
in.Backup.DeepCopyInto(&out.Backup)
in.Restore.DeepCopyInto(&out.Restore)
in.GroovyScripts.DeepCopyInto(&out.GroovyScripts)
in.ConfigurationAsCode.DeepCopyInto(&out.ConfigurationAsCode)
if in.Roles != nil {
in, out := &in.Roles, &out.Roles
*out = make([]rbacv1.RoleRef, len(*in))
copy(*out, *in)
}
in.ServiceAccount.DeepCopyInto(&out.ServiceAccount)
out.JenkinsAPISettings = in.JenkinsAPISettings
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsSpec.
func (in *JenkinsSpec) DeepCopy() *JenkinsSpec {
if in == nil {
return nil
}
out := new(JenkinsSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JenkinsStatus) DeepCopyInto(out *JenkinsStatus) {
*out = *in
if in.ProvisionStartTime != nil {
in, out := &in.ProvisionStartTime, &out.ProvisionStartTime
*out = (*in).DeepCopy()
}
if in.BaseConfigurationCompletedTime != nil {
in, out := &in.BaseConfigurationCompletedTime, &out.BaseConfigurationCompletedTime
*out = (*in).DeepCopy()
}
if in.UserConfigurationCompletedTime != nil {
in, out := &in.UserConfigurationCompletedTime, &out.UserConfigurationCompletedTime
*out = (*in).DeepCopy()
}
if in.CreatedSeedJobs != nil {
in, out := &in.CreatedSeedJobs, &out.CreatedSeedJobs
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.AppliedGroovyScripts != nil {
in, out := &in.AppliedGroovyScripts, &out.AppliedGroovyScripts
*out = make([]AppliedGroovyScript, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsStatus.
func (in *JenkinsStatus) DeepCopy() *JenkinsStatus {
if in == nil {
return nil
}
out := new(JenkinsStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Mailgun) DeepCopyInto(out *Mailgun) {
*out = *in
out.APIKeySecretKeySelector = in.APIKeySecretKeySelector
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Mailgun.
func (in *Mailgun) DeepCopy() *Mailgun {
if in == nil {
return nil
}
out := new(Mailgun)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MicrosoftTeams) DeepCopyInto(out *MicrosoftTeams) {
*out = *in
out.WebHookURLSecretKeySelector = in.WebHookURLSecretKeySelector
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MicrosoftTeams.
func (in *MicrosoftTeams) DeepCopy() *MicrosoftTeams {
if in == nil {
return nil
}
out := new(MicrosoftTeams)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Notification) DeepCopyInto(out *Notification) {
*out = *in
if in.Slack != nil {
in, out := &in.Slack, &out.Slack
*out = new(Slack)
**out = **in
}
if in.Teams != nil {
in, out := &in.Teams, &out.Teams
*out = new(MicrosoftTeams)
**out = **in
}
if in.Mailgun != nil {
in, out := &in.Mailgun, &out.Mailgun
*out = new(Mailgun)
**out = **in
}
if in.SMTP != nil {
in, out := &in.SMTP, &out.SMTP
*out = new(SMTP)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Notification.
func (in *Notification) DeepCopy() *Notification {
if in == nil {
return nil
}
out := new(Notification)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Plugin) DeepCopyInto(out *Plugin) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plugin.
func (in *Plugin) DeepCopy() *Plugin {
if in == nil {
return nil
}
out := new(Plugin)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Restore) DeepCopyInto(out *Restore) {
*out = *in
in.Action.DeepCopyInto(&out.Action)
in.GetLatestAction.DeepCopyInto(&out.GetLatestAction)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Restore.
func (in *Restore) DeepCopy() *Restore {
if in == nil {
return nil
}
out := new(Restore)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SMTP) DeepCopyInto(out *SMTP) {
*out = *in
out.UsernameSecretKeySelector = in.UsernameSecretKeySelector
out.PasswordSecretKeySelector = in.PasswordSecretKeySelector
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SMTP.
func (in *SMTP) DeepCopy() *SMTP {
if in == nil {
return nil
}
out := new(SMTP)
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
out.LocalObjectReference = in.LocalObjectReference
}
// 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 *SecretRef) DeepCopyInto(out *SecretRef) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRef.
func (in *SecretRef) DeepCopy() *SecretRef {
if in == nil {
return nil
}
out := new(SecretRef)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SeedJob) DeepCopyInto(out *SeedJob) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SeedJob.
func (in *SeedJob) DeepCopy() *SeedJob {
if in == nil {
return nil
}
out := new(SeedJob)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Service) DeepCopyInto(out *Service) {
*out = *in
if in.Annotations != nil {
in, out := &in.Annotations, &out.Annotations
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Labels != nil {
in, out := &in.Labels, &out.Labels
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.LoadBalancerSourceRanges != nil {
in, out := &in.LoadBalancerSourceRanges, &out.LoadBalancerSourceRanges
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service.
func (in *Service) DeepCopy() *Service {
if in == nil {
return nil
}
out := new(Service)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceAccount) DeepCopyInto(out *ServiceAccount) {
*out = *in
if in.Annotations != nil {
in, out := &in.Annotations, &out.Annotations
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccount.
func (in *ServiceAccount) DeepCopy() *ServiceAccount {
if in == nil {
return nil
}
out := new(ServiceAccount)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Slack) DeepCopyInto(out *Slack) {
*out = *in
out.WebHookURLSecretKeySelector = in.WebHookURLSecretKeySelector
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Slack.
func (in *Slack) DeepCopy() *Slack {
if in == nil {
return nil
}
out := new(Slack)
in.DeepCopyInto(out)
return out
}