#239 Allow to set tolerations for the Jenkins master pod
This commit is contained in:
		
							parent
							
								
									e1e21f92d6
								
							
						
					
					
						commit
						28a7c11f8c
					
				|  | @ -295,6 +295,10 @@ type JenkinsMaster struct { | |||
| 	// +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
 | ||||
| 	// Defaults to :
 | ||||
| 	// - name: kubernetes
 | ||||
|  |  | |||
|  | @ -317,6 +317,13 @@ func (in *JenkinsMaster) DeepCopyInto(out *JenkinsMaster) { | |||
| 			(*in)[i].DeepCopyInto(&(*out)[i]) | ||||
| 		} | ||||
| 	} | ||||
| 	if in.Tolerations != nil { | ||||
| 		in, out := &in.Tolerations, &out.Tolerations | ||||
| 		*out = make([]v1.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)) | ||||
|  |  | |||
|  | @ -38,8 +38,6 @@ const ( | |||
| 
 | ||||
| 	httpPortName  = "http" | ||||
| 	slavePortName = "slavelistener" | ||||
| 	// HTTPPortInt defines Jenkins master HTTP port
 | ||||
| 	HTTPPortInt = 8080 | ||||
| ) | ||||
| 
 | ||||
| func buildPodTypeMeta() metav1.TypeMeta { | ||||
|  | @ -309,6 +307,7 @@ func NewJenkinsMasterPod(objectMeta metav1.ObjectMeta, jenkins *v1alpha2.Jenkins | |||
| 			Volumes:            append(GetJenkinsMasterPodBaseVolumes(jenkins), jenkins.Spec.Master.Volumes...), | ||||
| 			SecurityContext:    jenkins.Spec.Master.SecurityContext, | ||||
| 			ImagePullSecrets:   jenkins.Spec.Master.ImagePullSecrets, | ||||
| 			Tolerations:        jenkins.Spec.Master.Tolerations, | ||||
| 		}, | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue