Skip to content
Snippets Groups Projects
Commit c97220f4 authored by Jessica Yuen's avatar Jessica Yuen
Browse files

Provide access to ExtCodes when the '-f' flag is provided

Currently, ExtCodes are only provided when the 'env' flag is present in
commands. The result is errors occuring when we run commands such as `ks
show default -f components/guestbook-ui.jsonnet`, where the params
ExtVar is needed. This commit fixes that scenario.
parent 9c2d0a2d
No related branches found
No related tags found
No related merge requests found
......@@ -407,15 +407,17 @@ func expandEnvCmdObjs(cmd *cobra.Command, envSpec *envSpec, cwd metadata.AbsPath
libPath, vendorPath, envLibPath, envComponentPath, envParamsPath := manager.LibPaths(*envSpec.env)
expander.FlagJpath = append([]string{string(libPath), string(vendorPath), string(envLibPath)}, expander.FlagJpath...)
componentPaths, err := manager.ComponentPaths()
if err != nil {
return nil, err
}
baseObj := constructBaseObj(componentPaths)
params := importParams(string(envParamsPath))
expander.ExtCodes = append([]string{baseObj, params}, expander.ExtCodes...)
if !filesPresent {
componentPaths, err := manager.ComponentPaths()
if err != nil {
return nil, err
}
baseObj := constructBaseObj(componentPaths)
params := importParams(string(envParamsPath))
expander.ExtCodes = append([]string{baseObj, params}, expander.ExtCodes...)
fileNames = []string{string(envComponentPath)}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment