#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
 | 	// +optional
 | ||||||
| 	Volumes []corev1.Volume `json:"volumes,omitempty"` | 	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
 | 	// BasePlugins contains plugins required by operator
 | ||||||
| 	// Defaults to :
 | 	// Defaults to :
 | ||||||
| 	// - name: kubernetes
 | 	// - name: kubernetes
 | ||||||
|  |  | ||||||
|  | @ -317,6 +317,13 @@ func (in *JenkinsMaster) DeepCopyInto(out *JenkinsMaster) { | ||||||
| 			(*in)[i].DeepCopyInto(&(*out)[i]) | 			(*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 { | 	if in.BasePlugins != nil { | ||||||
| 		in, out := &in.BasePlugins, &out.BasePlugins | 		in, out := &in.BasePlugins, &out.BasePlugins | ||||||
| 		*out = make([]Plugin, len(*in)) | 		*out = make([]Plugin, len(*in)) | ||||||
|  |  | ||||||
|  | @ -38,8 +38,6 @@ const ( | ||||||
| 
 | 
 | ||||||
| 	httpPortName  = "http" | 	httpPortName  = "http" | ||||||
| 	slavePortName = "slavelistener" | 	slavePortName = "slavelistener" | ||||||
| 	// HTTPPortInt defines Jenkins master HTTP port
 |  | ||||||
| 	HTTPPortInt = 8080 |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func buildPodTypeMeta() metav1.TypeMeta { | func buildPodTypeMeta() metav1.TypeMeta { | ||||||
|  | @ -309,6 +307,7 @@ func NewJenkinsMasterPod(objectMeta metav1.ObjectMeta, jenkins *v1alpha2.Jenkins | ||||||
| 			Volumes:            append(GetJenkinsMasterPodBaseVolumes(jenkins), jenkins.Spec.Master.Volumes...), | 			Volumes:            append(GetJenkinsMasterPodBaseVolumes(jenkins), jenkins.Spec.Master.Volumes...), | ||||||
| 			SecurityContext:    jenkins.Spec.Master.SecurityContext, | 			SecurityContext:    jenkins.Spec.Master.SecurityContext, | ||||||
| 			ImagePullSecrets:   jenkins.Spec.Master.ImagePullSecrets, | 			ImagePullSecrets:   jenkins.Spec.Master.ImagePullSecrets, | ||||||
|  | 			Tolerations:        jenkins.Spec.Master.Tolerations, | ||||||
| 		}, | 		}, | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue