diff --git a/pkg/controller/jenkins/configuration/base/resources/pod.go b/pkg/controller/jenkins/configuration/base/resources/pod.go index 0f5f2133..80538fd2 100644 --- a/pkg/controller/jenkins/configuration/base/resources/pod.go +++ b/pkg/controller/jenkins/configuration/base/resources/pod.go @@ -29,11 +29,6 @@ const ( jenkinsInitConfigurationVolumeName = "init-configuration" jenkinsInitConfigurationVolumePath = jenkinsPath + "/init-configuration" - refEnvironmentName = "REF" - // RefVolumeName is the Jenkins volume with preinstalled plugins volume name - RefVolumeName = "ref" - refVolumePath = "/usr/share/jenkins/ref/plugins" - // GroovyScriptsSecretVolumePath is a path where are groovy scripts used to configure Jenkins // This script is provided by user GroovyScriptsSecretVolumePath = jenkinsPath + "/groovy-scripts-secrets" @@ -65,10 +60,6 @@ func GetJenkinsMasterContainerBaseCommand() []string { // GetJenkinsMasterContainerBaseEnvs returns Jenkins master pod envs required by operator func GetJenkinsMasterContainerBaseEnvs(jenkins *v1alpha2.Jenkins) []corev1.EnvVar { envVars := []corev1.EnvVar{ - { - Name: refEnvironmentName, - Value: refVolumePath, - }, { Name: "COPY_REFERENCE_FILE_LOG", Value: fmt.Sprintf("%s/%s", getJenkinsHomePath(jenkins), "copy_reference_file.log"), @@ -183,11 +174,6 @@ func GetJenkinsMasterContainerBaseVolumeMounts(jenkins *v1alpha2.Jenkins) []core MountPath: getJenkinsHomePath(jenkins), ReadOnly: false, }, - { - Name: RefVolumeName, - MountPath: refVolumePath, - ReadOnly: false, - }, { Name: jenkinsScriptsVolumeName, MountPath: JenkinsScriptsVolumePath, diff --git a/pkg/controller/jenkins/jenkins_controller.go b/pkg/controller/jenkins/jenkins_controller.go index 8c6b93cb..c9e5b884 100644 --- a/pkg/controller/jenkins/jenkins_controller.go +++ b/pkg/controller/jenkins/jenkins_controller.go @@ -496,32 +496,12 @@ func (r *ReconcileJenkins) setDefaults(jenkins *v1alpha2.Jenkins, logger logr.Lo jenkins.Spec.Master.SecurityContext = &securityContext } - if !refVolumeSet(*jenkins) { - logger.Info("Setting default Jenkins master volume with preinstalled plugins") - changed = true - jenkins.Spec.Master.Volumes = append(jenkins.Spec.Master.Volumes, corev1.Volume{ - Name: resources.RefVolumeName, - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - }) - } - if changed { return changed, errors.WithStack(r.client.Update(context.TODO(), jenkins)) } return changed, nil } -func refVolumeSet(jenkins v1alpha2.Jenkins) bool { - for _, volume := range jenkins.Spec.Master.Volumes { - if volume.Name == resources.RefVolumeName { - return true - } - } - return false -} - func isJavaOpsVariableNotSet(container v1alpha2.Container) bool { for _, env := range container.Env { if env.Name == constants.JavaOpsVariableName {