Fix utility function uses the wrong flag text to get value (#1368)

The utility function GetMetadata uses wrong flag text to get the resource namespace and could cause the wrong results returned from the API server. This PR changes the function signature that allows users to pass in the flag text in order to get the correct value.
This commit is contained in:
Ta-Ching Chen
2019-11-01 00:59:50 +08:00
committed by GitHub
parent 3d32d9614e
commit b84b494280
6 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ func (opts *CreateSubCommand) complete(flags cli.Input) error {
// run write the resource to a spec file or create a fission CRD with remote fission server.
// It also prints warning/error if necessary.
func (opts *CreateSubCommand) run(flags cli.Input) error {
m, err := cmd.GetMetadata(flags)
m, err := cmd.GetMetadata(cmd.RESOURCE_NAME, cmd.ENVIRONMENT_NAMESPACE, flags)
if err != nil {
return err
}