Skip to content

Commit

Permalink
Fix stefanprodan#364 - 1st solution
Browse files Browse the repository at this point in the history
  • Loading branch information
huguesalary committed Oct 2, 2024
1 parent cf22fe3 commit 11e5c99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/engine/bundle_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
type BundleBuilder struct {
ctx *cue.Context
files []string
workspaceFiles []string
mapSourceToOrigin map[string]string
injector *RuntimeInjector
}
Expand Down Expand Up @@ -116,13 +117,13 @@ func (b *BundleBuilder) InitWorkspace(workspace string, runtimeValues map[string
files = append(files, dstFile)
}

schemaFile := filepath.Join(workspace, fmt.Sprintf("%v.schema.cue", len(b.files)+1))
schemaFile := filepath.Join(workspace, fmt.Sprintf("%v.schema.cue", len(b.workspaceFiles)+1))
files = append(files, schemaFile)
if err := os.WriteFile(schemaFile, []byte(apiv1.BundleSchema), os.ModePerm); err != nil {
return err
}

b.files = files
b.workspaceFiles = files
return nil
}

Expand All @@ -135,7 +136,7 @@ func (b *BundleBuilder) Build() (cue.Value, error) {
DataFiles: true,
}

ix := load.Instances(b.files, cfg)
ix := load.Instances(b.workspaceFiles, cfg)
if len(ix) == 0 {
return value, fmt.Errorf("no instances found")
}
Expand Down

0 comments on commit 11e5c99

Please sign in to comment.