From 71eb15345f4cc8b731b612e5714aedea4913f89c Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 18 Oct 2024 14:11:10 +0000 Subject: [PATCH] using correct svc again Signed-off-by: Austin Abro --- src/pkg/cluster/injector.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pkg/cluster/injector.go b/src/pkg/cluster/injector.go index c873d575ef..9f2e3f3b42 100644 --- a/src/pkg/cluster/injector.go +++ b/src/pkg/cluster/injector.go @@ -76,7 +76,7 @@ func (c *Cluster) StartInjection(ctx context.Context, tmpDir, imagesDir string, return err } - svc := v1ac.Service("zarf-injector", ZarfNamespaceName). + svcAc := v1ac.Service("zarf-injector", ZarfNamespaceName). WithSpec(v1ac.ServiceSpec(). WithType(corev1.ServiceTypeNodePort). WithPorts( @@ -84,12 +84,12 @@ func (c *Cluster) StartInjection(ctx context.Context, tmpDir, imagesDir string, ).WithSelector(map[string]string{ "app": "zarf-injector", })) - _, err = c.Clientset.CoreV1().Services(*svc.Namespace).Apply(ctx, svc, metav1.ApplyOptions{Force: true, FieldManager: "zarf"}) + svc, err := c.Clientset.CoreV1().Services(*svcAc.Namespace).Apply(ctx, svcAc, metav1.ApplyOptions{Force: true, FieldManager: "zarf"}) if err != nil { return err } - // TODO: Remove use of passing data through global variables. - config.ZarfSeedPort = fmt.Sprintf("%d", *svc.Spec.Ports[0].NodePort) + + config.ZarfSeedPort = fmt.Sprintf("%d", svc.Spec.Ports[0].NodePort) pod := buildInjectionPod(injectorNodeName, injectorImage, payloadCmNames, shasum, resReq) _, err = c.Clientset.CoreV1().Pods(*pod.Namespace).Apply(ctx, pod, metav1.ApplyOptions{Force: true, FieldManager: "zarf"})