Skip to content

Commit

Permalink
using correct svc again
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Oct 18, 2024
1 parent 905711d commit 71eb153
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pkg/cluster/injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ 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(
v1ac.ServicePort().WithPort(int32(5000)),
).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"})
Expand Down

0 comments on commit 71eb153

Please sign in to comment.