Skip to content

Commit 2adc135

Browse files
committed
Fix import
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 5b633cc commit 2adc135

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

cmd/provider.go

+3-15
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/openfaas/faas-provider/logs"
1414
"github.com/openfaas/faas-provider/proxy"
1515
"github.com/openfaas/faas-provider/types"
16-
"github.com/openfaas/faasd/pkg"
1716
faasd "github.com/openfaas/faasd/pkg"
1817
"github.com/openfaas/faasd/pkg/cninetwork"
1918
faasdlogs "github.com/openfaas/faasd/pkg/logs"
@@ -30,8 +29,6 @@ func makeProviderCmd() *cobra.Command {
3029
Short: "Run the faasd-provider",
3130
}
3231

33-
command.Flags().String("pull-policy", "Always", `Set to "Always" to force a pull of images upon deployment, or "IfNotPresent" to try to use a cached image.`)
34-
3532
command.RunE = runProviderE
3633
command.PreRunE = preRunE
3734

@@ -40,16 +37,6 @@ func makeProviderCmd() *cobra.Command {
4037

4138
func runProviderE(cmd *cobra.Command, _ []string) error {
4239

43-
pullPolicy, flagErr := cmd.Flags().GetString("pull-policy")
44-
if flagErr != nil {
45-
return flagErr
46-
}
47-
48-
alwaysPull := false
49-
if pullPolicy == "Always" {
50-
alwaysPull = true
51-
}
52-
5340
config, providerConfig, err := config.ReadFromEnv(types.OsEnv{})
5441
if err != nil {
5542
return err
@@ -95,6 +82,7 @@ nameserver 8.8.4.4`), workingDirectoryPermission); err != nil {
9582
return err
9683
}
9784

85+
alwaysPull := true
9886
bootstrapHandlers := types.FaaSHandlers{
9987
FunctionProxy: httpHeaderMiddleware(proxy.NewHandlerFunc(*config, invokeResolver, false)),
10088
DeleteFunction: httpHeaderMiddleware(handlers.MakeDeleteHandler(client, cni)),
@@ -104,14 +92,14 @@ nameserver 8.8.4.4`), workingDirectoryPermission); err != nil {
10492
ScaleFunction: httpHeaderMiddleware(handlers.MakeReplicaUpdateHandler(client, cni)),
10593
UpdateFunction: httpHeaderMiddleware(handlers.MakeUpdateHandler(client, cni, baseUserSecretsPath, alwaysPull)),
10694
Health: httpHeaderMiddleware(func(w http.ResponseWriter, r *http.Request) {}),
107-
Info: httpHeaderMiddleware(handlers.MakeInfoHandler(pkg.Version, pkg.GitCommit)),
95+
Info: httpHeaderMiddleware(handlers.MakeInfoHandler(faasd.Version, faasd.GitCommit)),
10896
ListNamespaces: httpHeaderMiddleware(handlers.MakeNamespacesLister(client)),
10997
Secrets: httpHeaderMiddleware(handlers.MakeSecretHandler(client.NamespaceService(), baseUserSecretsPath)),
11098
Logs: httpHeaderMiddleware(logs.NewLogHandlerFunc(faasdlogs.New(), config.ReadTimeout)),
11199
MutateNamespace: httpHeaderMiddleware(handlers.MakeMutateNamespace(client)),
112100
}
113101

114-
log.Printf("Listening on: 0.0.0.0:%d\n", *config.TCPPort)
102+
log.Printf("Listening on: 0.0.0.0:%d", *config.TCPPort)
115103
bootstrap.Serve(cmd.Context(), &bootstrapHandlers, config)
116104
return nil
117105
}

0 commit comments

Comments
 (0)