From cb2dfdd28a1cedd54b47411d981e1aa5b14ed96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20S=C4=99k?= Date: Wed, 16 Jan 2019 22:33:00 +0100 Subject: [PATCH] [WIP] AWS S3 backup - mount backup credentials secret into Jenkins pod --- .../jenkins/configuration/base/resources/pod.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/controller/jenkins/configuration/base/resources/pod.go b/pkg/controller/jenkins/configuration/base/resources/pod.go index 57ef94f0..9937ee02 100644 --- a/pkg/controller/jenkins/configuration/base/resources/pod.go +++ b/pkg/controller/jenkins/configuration/base/resources/pod.go @@ -33,6 +33,9 @@ const ( // this scripts are provided by user JenkinsUserConfigurationVolumePath = "/var/jenkins/user-configuration" + jenkinsBackupCredentialsVolumeName = "backup-credentials" + jenkinsBackupCredentialsVolumePath = "/var/jenkins/backup-credentials" + httpPortName = "http" slavePortName = "slavelistener" // HTTPPortInt defines Jenkins master HTTP port @@ -152,6 +155,11 @@ func NewJenkinsMasterPod(objectMeta metav1.ObjectMeta, jenkins *virtuslabv1alpha MountPath: jenkinsOperatorCredentialsVolumePath, ReadOnly: true, }, + { + Name: jenkinsBackupCredentialsVolumeName, + MountPath: jenkinsBackupCredentialsVolumePath, + ReadOnly: true, + }, }, }, }, @@ -210,6 +218,14 @@ func NewJenkinsMasterPod(objectMeta metav1.ObjectMeta, jenkins *virtuslabv1alpha }, }, }, + { + Name: jenkinsBackupCredentialsVolumeName, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: GetBackupCredentialsSecretName(jenkins), + }, + }, + }, }, }, }