diff --git a/main.go b/main.go index 591dcda..2ae4bce 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,10 @@ import ( ptypes "github.com/openfaas/faas-provider/types" ) +// topic is the value of the "topic" annotation to look for +// on functions, to decide to include them for invocation +const topic = "cron-function" + func main() { config, err := getControllerConfig() if err != nil { @@ -26,8 +30,8 @@ func main() { sha, ver := version.GetReleaseInfo() log.Printf("Version: %s\tCommit: %s\n", sha, ver) - log.Printf("Gateway URL: %s", config.GatewayURL) - log.Printf("Async Invocation: %v", config.AsyncFunctionInvocation) + log.Printf("Gateway URL: %s", config.GatewayURL) + log.Printf("Async Invocation: %v", config.AsyncFunctionInvocation) invoker := types.NewInvoker(gatewayRoute(config), types.MakeClient(config.UpstreamTimeout), @@ -35,7 +39,6 @@ func main() { config.PrintResponse) cronScheduler := cfunction.NewScheduler() - topic := "cron-function" interval := time.Second * 10 cronScheduler.Start() @@ -50,6 +53,7 @@ func gatewayRoute(config *types.ControllerConfig) string { if config.AsyncFunctionInvocation { return fmt.Sprintf("%s/%s", config.GatewayURL, "async-function") } + return fmt.Sprintf("%s/%s", config.GatewayURL, "function") } diff --git a/yaml/docker-compose.yml b/yaml/docker-compose.yml deleted file mode 100644 index 803e275..0000000 --- a/yaml/docker-compose.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: '3.2' -services: - cron-connector: - image: zeerorg/cron-connector:v0.2.2 - hostname: cron-connector - environment: - gateway_url: "http://gateway:8080" - basic_auth: "true" - secret_mount_path: "/run/secrets/" - secrets: - - basic-auth-password - - basic-auth-user - networks: - - func_functions - -networks: - func_functions: - external: true - -secrets: - basic-auth-user: - external: true - basic-auth-password: - external: true diff --git a/yaml/kubernetes/connector-dep.yml b/yaml/kubernetes/connector-dep.yml deleted file mode 100644 index 07e5d02..0000000 --- a/yaml/kubernetes/connector-dep.yml +++ /dev/null @@ -1,38 +0,0 @@ - -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: connector - component: cron-connector - name: sample-connector - namespace: openfaas -spec: - selector: - matchLabels: - app: connector - replicas: 1 - template: - metadata: - labels: - app: connector - component: cron-connector - spec: - containers: - - name: cron-connector - image: zeerorg/cron-connector:v0.2.2 - env: - - name: gateway_url - value: "http://gateway.openfaas:8080" - - name: basic_auth - value: "true" - - name: secret_mount_path - value: "/var/secrets/" - volumeMounts: - - name: auth - readOnly: true - mountPath: "/var/secrets/" - volumes: - - name: auth - secret: - secretName: basic-auth