As we have now multiple options which are of map type we should use a common codebase to guarantee that they are all handled the same
The options I have in mind are (but maybe more):
- --env, --annotations and --label for services
- --filter for triggers
--traffic for services (see comments below why --traffic is special)
The behaviour should be (using --env as an example):
--env a1=b1 --env a2=b2 should add both env variables
--env a1 should set a1 to empty string
--env a1- should remove the environment variable for update and an error for create
--env a1=b1 --env a1=b2 should be an error as the same key can not be specified on the same command line
I could imagine to have a function signature like
parseMapOptions(key string, options []string) (map[string]string, error)
and a usage
filters, err := parseMapOptions("filter", f.Filters)
As we have now multiple options which are of map type we should use a common codebase to guarantee that they are all handled the same
The options I have in mind are (but maybe more):
--traffic for services(see comments below why--trafficis special)The behaviour should be (using
--envas an example):--env a1=b1 --env a2=b2should add both env variables--env a1should set a1 to empty string--env a1-should remove the environment variable for update and an error for create--env a1=b1 --env a1=b2should be an error as the same key can not be specified on the same command lineI could imagine to have a function signature like
and a usage