From f007834e53322503557adb802079c108aaed96db Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 18 Feb 2020 12:22:39 -0600 Subject: [PATCH 1/2] fix: comments for flags --- cmd/vela-kubernetes/main.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/vela-kubernetes/main.go b/cmd/vela-kubernetes/main.go index 82560ce..23a5cf9 100644 --- a/cmd/vela-kubernetes/main.go +++ b/cmd/vela-kubernetes/main.go @@ -65,17 +65,22 @@ func main() { cli.StringFlag{ EnvVar: "PARAMETER_CONFIG,CONFIG_FILE,KUBE_CONFIG", Name: "config.file", - Usage: "kubernetes cluster configuration", + Usage: "kubectl configuration for interacting with Kubernetes", + }, + cli.StringFlag{ + EnvVar: "PARAMETER_CLUSTER,CONFIG_CLUSTER,KUBE_CLUSTER", + Name: "config.cluster", + Usage: "kubectl cluster for interacting with Kubernetes", }, cli.StringFlag{ EnvVar: "PARAMETER_CONTEXT,CONFIG_CONTEXT,KUBE_CONTEXT", Name: "config.context", - Usage: "kubernetes cluster context to interact with", + Usage: "kubectl context for interacting with Kubernetes", }, cli.StringFlag{ EnvVar: "PARAMETER_NAMESPACE,CONFIG_NAMESPACE,KUBE_NAMESPACE", Name: "config.namespace", - Usage: "kubernetes cluster namespace to interact with", + Usage: "kubectl namespace for interacting with Kubernetes", }, // Patch Flags @@ -156,6 +161,7 @@ func run(c *cli.Context) error { // config configuration Config: &Config{ File: c.String("config.file"), + Cluster: c.String("config.cluster"), Context: c.String("config.context"), Namespace: c.String("config.namespace"), }, From b63458de14205d3b97cd62cab326d940dcc5f034 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Tue, 18 Feb 2020 12:22:45 -0600 Subject: [PATCH 2/2] feat: add plugin template --- .vela/template.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .vela/template.yml diff --git a/.vela/template.yml b/.vela/template.yml new file mode 100644 index 0000000..e8524bb --- /dev/null +++ b/.vela/template.yml @@ -0,0 +1,36 @@ +# Copyright (c) 2020 Target Brands, Inc. All rights reserved. +# +# Use of this source code is governed by the LICENSE file in this repository. + +## Template Variables +# - .image (default: "target/vela-kubernetes:latest") +# - .pull (default: true) +# - .log_level (default: "info") +# - .cluster: (default: "") +# - .context: (default: "") +# - .namespace: (default: "") +# - .files: (default: "[]") +# - .containers: (default: "{}") +# - .output: (default: "json") +# - .resources: (default: "[]") +# - .timeout: (default: "5m") +# - .watch: (default: true) + +metadata: + template: true + +steps: + - name: kubernetes_plugin_template + image: {{ default "target/vela-kubernetes:latest" .image }} + pull: {{ default "true" .pull }} + parameters: + log_level: {{ default "info" .log_level }} + cluster: {{ default "" .cluster }} + context: {{ default "" .context }} + namespace: {{ default "" .namespace }} + files: {{ default "[]" .files }} + containers: {{ default "{}" .containers }} + output: {{ default "json" .output }} + resources: {{ default "[]" .resources }} + timeout: {{ default "5m" .timeout }} + watch: {{ default "true" .watch }}