-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Observed Behavior
Platforms: Windows 11 x64, Ubuntu 24.04
➜ apigee-go-gen render apiproxy --template apiproxy.yaml --output ./out
Error: open ./jsc/addAccessTokenCookie.js: no such file or directoryResources are given relative to template file:
Resources:
- Resource:
Type: jsc
Path: ./jsc/addAccessTokenCookie.jsTemplate file was generated by loading a ZIP via the CLI.
Same behavior is observed for OAS.
Steps to reproduce:
- Load API Proxy zip bundle:
apigee-go-gen transform apiproxy-to-yaml \
--input ./bundle.zip \
--output ./apiproxy.yaml- Execute template render
apigee-go-gen render apiproxy --template apiproxy.yaml --output ./out- Observe error.
Suspected cause
Function "GenerateBundle" copies the rendered YAML into a temporary directory which does not contain any of the resources:
func GenerateBundle(createModelFunc func(string) (v1.Model, error), cFlags *CommonFlags, validate bool, dryRun string, debug bool) error {
var err error
bundleOutputFile := cFlags.OutputFile
//create a temporary location for rendering into
tmpDir, err := os.MkdirTemp("", "render-*")
if err != nil {
return errors.New(err)
}
// render the template to a temporary location
// THIS PRODUCES WRONG OUTCOME
cFlags.OutputFile = flags.String(filepath.Join(tmpDir, "model.yaml"))
err = RenderGenericTemplate(cFlags, false)
if err != nil {
return errors.New(err)
}Debug state in Line 60:
Note the discrepancy between TemplateFile and OutputFile
Suggested solution
Render the model.yaml into the current base directory and remove it after the bundle is generated.
aweberlopes
Metadata
Metadata
Assignees
Labels
No labels
