Revert "#190 Fix run Jenkins master on top of OpenShift"
This reverts commit 09b9972f
This commit is contained in:
parent
82f058a7e7
commit
9b5672ebcd
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue