@@ -68,10 +68,11 @@ type Controller struct {
6868 jobCache batchcontroller.JobCache
6969 apply apply.Apply
7070 recorder record.EventRecorder
71+ apiServerPort string
7172}
7273
7374func Register (ctx context.Context ,
74- systemNamespace , managedBy string ,
75+ systemNamespace , managedBy , apiServerPort string ,
7576 k8s kubernetes.Interface ,
7677 apply apply.Apply ,
7778 recorder record.EventRecorder ,
@@ -96,6 +97,7 @@ func Register(ctx context.Context,
9697 jobs : jobs ,
9798 jobCache : jobCache ,
9899 recorder : recorder ,
100+ apiServerPort : apiServerPort ,
99101 }
100102
101103 c .apply = apply .
@@ -309,7 +311,7 @@ func (c *Controller) getJobAndRelatedResources(chart *v1.HelmChart) (*batch.Job,
309311 }
310312
311313 // get the default job and configmaps
312- job , valuesSecret , contentConfigMap := job (chart )
314+ job , valuesSecret , contentConfigMap := job (chart , c . apiServerPort )
313315
314316 // check if a HelmChartConfig is registered for this Helm chart
315317 config , err := c .confCache .Get (chart .Namespace , chart .Name )
@@ -340,7 +342,7 @@ func (c *Controller) getJobAndRelatedResources(chart *v1.HelmChart) (*batch.Job,
340342 }, nil
341343}
342344
343- func job (chart * v1.HelmChart ) (* batch.Job , * corev1.Secret , * corev1.ConfigMap ) {
345+ func job (chart * v1.HelmChart , apiServerPort string ) (* batch.Job , * corev1.Secret , * corev1.ConfigMap ) {
344346 jobImage := strings .TrimSpace (chart .Spec .JobImage )
345347 if jobImage == "" {
346348 jobImage = DefaultJobImage
@@ -481,7 +483,7 @@ func job(chart *v1.HelmChart) (*batch.Job, *corev1.Secret, *corev1.ConfigMap) {
481483 Value : "127.0.0.1" },
482484 {
483485 Name : "KUBERNETES_SERVICE_PORT" ,
484- Value : "6443" },
486+ Value : apiServerPort },
485487 {
486488 Name : "BOOTSTRAP" ,
487489 Value : "true" },
0 commit comments