add namespace param for fn and env (#2556)

This PR moves fission CLI as closer as possible to kubectl command behaviour.  We have improved namespace handling behaviour across CLI.

* add namespace param for fn and env
* use common fn for ns check
* update validation
* default namespace for httpTrigger, env and package, config and triggers
* use default ns
* add namespace filter to spec
* add forceNamespace flag
* set current namespace
* add default namespace in config
* add namespace specific destroy
* add all namespace in the list of resources
* add namespace as global tag
* use %s instead of %v
* add test cases for namespace
* use ns in get all functions
This commit is contained in:
neha_gupta
2022-10-11 13:23:47 +05:30
committed by GitHub
parent 0739aca920
commit b9513868ed
74 changed files with 1289 additions and 304 deletions
+6 -1
View File
@@ -40,6 +40,11 @@ func Log(input cli.Input) error {
}
func (opts *LogSubCommand) do(input cli.Input) error {
_, namespace, err := util.GetResourceNamespace(input, flagkey.NamespaceFunction)
if err != nil {
return errors.Wrap(err, "error in logs for function ")
}
dbType := input.String(flagkey.FnLogDBType)
fnPod := input.String(flagkey.FnLogPod)
kubeContext := input.String(flagkey.KubeContext)
@@ -53,7 +58,7 @@ func (opts *LogSubCommand) do(input cli.Input) error {
f, err := opts.Client().V1().Function().Get(&metav1.ObjectMeta{
Name: input.String(flagkey.FnName),
Namespace: input.String(flagkey.NamespaceFunction),
Namespace: namespace,
})
if err != nil {
return errors.Wrap(err, "error getting function")