diff --git a/src/internal/agent/http/server.go b/src/internal/agent/http/server.go index 49fa5a6e7e..2bf93f4d7f 100644 --- a/src/internal/agent/http/server.go +++ b/src/internal/agent/http/server.go @@ -18,7 +18,7 @@ import ( ) // NewAdmissionServer creates a http.Server for the mutating webhook admission handler. -func NewAdmissionServer(port string) *http.Server { +func NewAdmissionServer(ctx context.Context, port string) *http.Server { message.Debugf("http.NewAdmissionServer(%s)", port) c, err := cluster.NewCluster() @@ -26,8 +26,6 @@ func NewAdmissionServer(port string) *http.Server { message.Fatalf(err, err.Error()) } - ctx := context.Background() - // Instances hooks podsMutation := hooks.NewPodMutationHook(ctx, c) fluxGitRepositoryMutation := hooks.NewGitRepositoryMutationHook(ctx, c) diff --git a/src/internal/agent/start.go b/src/internal/agent/start.go index 12ee3bcc8b..83172d2e95 100644 --- a/src/internal/agent/start.go +++ b/src/internal/agent/start.go @@ -30,7 +30,7 @@ const ( // StartWebhook launches the Zarf agent mutating webhook in the cluster. func StartWebhook(ctx context.Context) error { message.Debug("agent.StartWebhook()") - return startServer(ctx, agentHttp.NewAdmissionServer(httpPort)) + return startServer(ctx, agentHttp.NewAdmissionServer(ctx, httpPort)) } // StartHTTPProxy launches the zarf agent proxy in the cluster.