fixing staticcheck

This commit is contained in:
Akram Ben Aissi 2019-06-26 09:07:09 -04:00
parent f17a4c5dce
commit 4150b6c767
2 changed files with 6 additions and 9 deletions

View File

@ -155,13 +155,12 @@ type JenkinsMaster struct {
// +optional // +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// SecurityContext that applies to all the containers of the Jenkins // SecurityContext that applies to all the containers of the Jenkins
// Master. As per kubernetes specification, it can be overidden // Master. As per kubernetes specification, it can be overidden
// for each container individually. // for each container individually.
// +optional // +optional
// Defaults to: nil // Defaults to: nil
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// List of containers belonging to the pod. // List of containers belonging to the pod.
// Containers cannot currently be added or removed. // Containers cannot currently be added or removed.

View File

@ -46,8 +46,6 @@ const (
slavePortName = "slavelistener" slavePortName = "slavelistener"
// HTTPPortInt defines Jenkins master HTTP port // HTTPPortInt defines Jenkins master HTTP port
HTTPPortInt = 8080 HTTPPortInt = 8080
jenkinsUserUID = int64(1000) // build in Docker image jenkins user UID
) )
func buildPodTypeMeta() metav1.TypeMeta { func buildPodTypeMeta() metav1.TypeMeta {
@ -272,10 +270,10 @@ func NewJenkinsMasterPod(objectMeta metav1.ObjectMeta, jenkins *v1alpha2.Jenkins
Spec: corev1.PodSpec{ Spec: corev1.PodSpec{
ServiceAccountName: serviceAccountName, ServiceAccountName: serviceAccountName,
RestartPolicy: corev1.RestartPolicyNever, RestartPolicy: corev1.RestartPolicyNever,
SecurityContext: jenkins.Spec.Master.SecurityContext, SecurityContext: jenkins.Spec.Master.SecurityContext,
NodeSelector: jenkins.Spec.Master.NodeSelector, NodeSelector: jenkins.Spec.Master.NodeSelector,
Containers: newContainers(jenkins), Containers: newContainers(jenkins),
Volumes: append(GetJenkinsMasterPodBaseVolumes(jenkins), jenkins.Spec.Master.Volumes...), Volumes: append(GetJenkinsMasterPodBaseVolumes(jenkins), jenkins.Spec.Master.Volumes...),
}, },
} }
} }