Added support to enable and disable enableServiceLinks. (#628)
This option expose internally some `KUBERNETES_*` environment variables that doesn't allow the runner to use KinD (Kubernetes in Docker) since it will try to connect to the Kubernetes cluster where the runner it's running. This option it's set by default to `true` in any Kubernetes deployment. Signed-off-by: Jonathan Gonzalez V <jonathan.gonzalez@enterprisedb.com>
This commit is contained in:
		
							parent
							
								
									1084a37174
								
							
						
					
					
						commit
						a277489003
					
				| 
						 | 
					@ -100,6 +100,9 @@ type RunnerPodSpec struct {
 | 
				
			||||||
	// +optional
 | 
						// +optional
 | 
				
			||||||
	Volumes []corev1.Volume `json:"volumes,omitempty"`
 | 
						Volumes []corev1.Volume `json:"volumes,omitempty"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// +optional
 | 
				
			||||||
 | 
						EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// +optional
 | 
						// +optional
 | 
				
			||||||
	InitContainers []corev1.Container `json:"initContainers,omitempty"`
 | 
						InitContainers []corev1.Container `json:"initContainers,omitempty"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -624,6 +624,11 @@ func (in *RunnerPodSpec) DeepCopyInto(out *RunnerPodSpec) {
 | 
				
			||||||
			(*in)[i].DeepCopyInto(&(*out)[i])
 | 
								(*in)[i].DeepCopyInto(&(*out)[i])
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if in.EnableServiceLinks != nil {
 | 
				
			||||||
 | 
							in, out := &in.EnableServiceLinks, &out.EnableServiceLinks
 | 
				
			||||||
 | 
							*out = new(bool)
 | 
				
			||||||
 | 
							**out = **in
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if in.InitContainers != nil {
 | 
						if in.InitContainers != nil {
 | 
				
			||||||
		in, out := &in.InitContainers, &out.InitContainers
 | 
							in, out := &in.InitContainers, &out.InitContainers
 | 
				
			||||||
		*out = make([]v1.Container, len(*in))
 | 
							*out = make([]v1.Container, len(*in))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -632,6 +632,8 @@ spec:
 | 
				
			||||||
                          type: object
 | 
					                          type: object
 | 
				
			||||||
                        dockerdWithinRunnerContainer:
 | 
					                        dockerdWithinRunnerContainer:
 | 
				
			||||||
                          type: boolean
 | 
					                          type: boolean
 | 
				
			||||||
 | 
					                        enableServiceLinks:
 | 
				
			||||||
 | 
					                          type: boolean
 | 
				
			||||||
                        enterprise:
 | 
					                        enterprise:
 | 
				
			||||||
                          pattern: ^[^/]+$
 | 
					                          pattern: ^[^/]+$
 | 
				
			||||||
                          type: string
 | 
					                          type: string
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -629,6 +629,8 @@ spec:
 | 
				
			||||||
                          type: object
 | 
					                          type: object
 | 
				
			||||||
                        dockerdWithinRunnerContainer:
 | 
					                        dockerdWithinRunnerContainer:
 | 
				
			||||||
                          type: boolean
 | 
					                          type: boolean
 | 
				
			||||||
 | 
					                        enableServiceLinks:
 | 
				
			||||||
 | 
					                          type: boolean
 | 
				
			||||||
                        enterprise:
 | 
					                        enterprise:
 | 
				
			||||||
                          pattern: ^[^/]+$
 | 
					                          pattern: ^[^/]+$
 | 
				
			||||||
                          type: string
 | 
					                          type: string
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -577,6 +577,8 @@ spec:
 | 
				
			||||||
                  type: object
 | 
					                  type: object
 | 
				
			||||||
                dockerdWithinRunnerContainer:
 | 
					                dockerdWithinRunnerContainer:
 | 
				
			||||||
                  type: boolean
 | 
					                  type: boolean
 | 
				
			||||||
 | 
					                enableServiceLinks:
 | 
				
			||||||
 | 
					                  type: boolean
 | 
				
			||||||
                enterprise:
 | 
					                enterprise:
 | 
				
			||||||
                  pattern: ^[^/]+$
 | 
					                  pattern: ^[^/]+$
 | 
				
			||||||
                  type: string
 | 
					                  type: string
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -632,6 +632,8 @@ spec:
 | 
				
			||||||
                          type: object
 | 
					                          type: object
 | 
				
			||||||
                        dockerdWithinRunnerContainer:
 | 
					                        dockerdWithinRunnerContainer:
 | 
				
			||||||
                          type: boolean
 | 
					                          type: boolean
 | 
				
			||||||
 | 
					                        enableServiceLinks:
 | 
				
			||||||
 | 
					                          type: boolean
 | 
				
			||||||
                        enterprise:
 | 
					                        enterprise:
 | 
				
			||||||
                          pattern: ^[^/]+$
 | 
					                          pattern: ^[^/]+$
 | 
				
			||||||
                          type: string
 | 
					                          type: string
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -629,6 +629,8 @@ spec:
 | 
				
			||||||
                          type: object
 | 
					                          type: object
 | 
				
			||||||
                        dockerdWithinRunnerContainer:
 | 
					                        dockerdWithinRunnerContainer:
 | 
				
			||||||
                          type: boolean
 | 
					                          type: boolean
 | 
				
			||||||
 | 
					                        enableServiceLinks:
 | 
				
			||||||
 | 
					                          type: boolean
 | 
				
			||||||
                        enterprise:
 | 
					                        enterprise:
 | 
				
			||||||
                          pattern: ^[^/]+$
 | 
					                          pattern: ^[^/]+$
 | 
				
			||||||
                          type: string
 | 
					                          type: string
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -577,6 +577,8 @@ spec:
 | 
				
			||||||
                  type: object
 | 
					                  type: object
 | 
				
			||||||
                dockerdWithinRunnerContainer:
 | 
					                dockerdWithinRunnerContainer:
 | 
				
			||||||
                  type: boolean
 | 
					                  type: boolean
 | 
				
			||||||
 | 
					                enableServiceLinks:
 | 
				
			||||||
 | 
					                  type: boolean
 | 
				
			||||||
                enterprise:
 | 
					                enterprise:
 | 
				
			||||||
                  pattern: ^[^/]+$
 | 
					                  pattern: ^[^/]+$
 | 
				
			||||||
                  type: string
 | 
					                  type: string
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -622,6 +622,7 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	template.Spec.SecurityContext = runner.Spec.SecurityContext
 | 
						template.Spec.SecurityContext = runner.Spec.SecurityContext
 | 
				
			||||||
 | 
						template.Spec.EnableServiceLinks = runner.Spec.EnableServiceLinks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	registrationOnly := metav1.HasAnnotation(runner.ObjectMeta, annotationKeyRegistrationOnly)
 | 
						registrationOnly := metav1.HasAnnotation(runner.ObjectMeta, annotationKeyRegistrationOnly)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue