Skip to content

Commit dd7a460

Browse files
authored
feat:wasm deploy support istiodDeployName arg in command (#248)
* feat:wasm deploy support istiodDeployName arg in command
1 parent 3f95fc5 commit dd7a460

17 files changed

+1937
-1875
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
- type: NEW_FEATURE
3+
description: >
4+
Add istiod deployment name support in wasme deploy istio command
5+
issueLink: https://github.com/solo-io/wasm/issues/245

tools/wasme/cli/docs/content/reference/cli/wasme_deploy_istio.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ wasme deploy istio <image> --id=<unique name> [--config=<inline string>] [--root
3535
-h, --help help for istio
3636
--ignore-version-check set to disable abi version compatability check.
3737
--istio-namespace string the namespace where the Istio control plane is installed (default "istio-system")
38+
--istiod-name string deployment name of the istiod (default "istiod")
3839
-l, --labels stringToString labels of the deployment or daemonset into which to inject the filter. if not set, will apply to all workloads in the target namespace (default [])
3940
-n, --namespace string namespace of the workload(s) to inject the filter. (default "default")
4041
--patch-context string patch context of the filter. possible values are any, inbound, outbound, gateway (default "inbound")

tools/wasme/cli/docs/content/reference/cli/wasme_undeploy_istio.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ wasme undeploy istio --id=<unique name> --namespace=<deployment namespace> [--na
2727
-h, --help help for istio
2828
--ignore-version-check set to disable abi version compatability check.
2929
--istio-namespace string the namespace where the Istio control plane is installed (default "istio-system")
30+
--istiod-name string deployment name of the istiod (default "istiod")
3031
-l, --labels stringToString labels of the deployment or daemonset into which to inject the filter. if not set, will apply to all workloads in the target namespace (default [])
3132
-n, --namespace string namespace of the workload(s) to inject the filter. (default "default")
3233
--patch-context string patch context of the filter. possible values are any, inbound, outbound, gateway (default "inbound")

tools/wasme/cli/example/tinygo/go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ module main
22

33
go 1.15
44

5-
require (
6-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.8
7-
)
5+
require github.com/tetratelabs/proxy-wasm-go-sdk v0.0.8

tools/wasme/cli/example/tinygo/go.sum

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
4+
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
5+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.8/go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY=
6+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

tools/wasme/cli/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
1515
github.com/gogo/protobuf v1.3.1
1616
github.com/golang/mock v1.4.4
17-
github.com/golang/protobuf v1.4.2
17+
github.com/golang/protobuf v1.5.2
1818
github.com/hashicorp/go-multierror v1.0.0
1919
github.com/lyft/protoc-gen-star v0.4.15 // indirect
2020
github.com/manifoldco/promptui v0.7.0

tools/wasme/cli/pkg/cmd/deploy/options.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,20 @@ func (opts *glooOpts) addToFlags(flags *pflag.FlagSet) {
8282
}
8383

8484
type istioOpts struct {
85-
workload istio.Workload
86-
patchContext string
87-
istioNamespace string
88-
cacheTimeout time.Duration
89-
ignoreVersionCheck bool
85+
workload istio.Workload
86+
patchContext string
87+
istioNamespace string
88+
istiodDeploymentName string
89+
cacheTimeout time.Duration
90+
ignoreVersionCheck bool
9091

9192
puller pull.ImagePuller // set by load
9293
}
9394

9495
func (opts *istioOpts) addToFlags(flags *pflag.FlagSet) {
9596
flags.StringToStringVarP(&opts.workload.Labels, "labels", "l", nil, "labels of the deployment or daemonset into which to inject the filter. if not set, will apply to all workloads in the target namespace")
9697
flags.StringVarP(&opts.workload.Namespace, "namespace", "n", "default", "namespace of the workload(s) to inject the filter.")
98+
flags.StringVar(&opts.istiodDeploymentName, "istiod-name", "istiod", "deployment name of the istiod")
9799
flags.StringVarP(&opts.workload.Kind, "workload-type", "t", istio.WorkloadTypeDeployment, "type of workload into which the filter should be injected. possible values are "+strings.Join(SupportedWorkloadTypes, ", "))
98100
flags.StringVar(&opts.patchContext, "patch-context", istio.PatchContextInbound, "patch context of the filter. possible values are "+strings.Join(istio.SupportedPatchContexts, ", "))
99101
flags.StringVar(&opts.istioNamespace, "istio-namespace", "istio-system", "the namespace where the Istio control plane is installed")
@@ -216,6 +218,7 @@ func (opts *options) makeProvider(ctx context.Context) (deploy.Provider, error)
216218
nil, // no parent object when using CLI
217219
nil, // no callback when using CLI
218220
opts.istioOpts.istioNamespace,
221+
opts.istioOpts.istiodDeploymentName,
219222
opts.istioOpts.cacheTimeout,
220223
opts.istioOpts.ignoreVersionCheck,
221224
)

0 commit comments

Comments
 (0)