I am trying to integrate carvel ytt module with my app. So far I am trying some basic stuff I have previously tested in playground. When I try to do the same thing in code, it always returns no match.
filesToProcess := yttfiles.NewSortedFiles([]*yttfiles.File{
yttfiles.MustNewFileFromSource(yttfiles.NewBytesSource(yttPath, readByteFile(yttPath))),
})
opts.DataValuesFlags = yttcmd.DataValuesFlags{
FromFiles: []string{filePath},
ReadFilesFunc: func(path string) ([]*yttfiles.File, error) {
return []*yttfiles.File{yttfiles.MustNewFileFromSource(yttfiles.NewBytesSource(path, readByteFile(path)))}, nil
},
}
output := opts.RunWithFiles( yttcmd.Input{Files: filesToProcess}, yttui.NewTTY(false))
yttPath is path to yaml containing overlay. Path is path to file I want to edit. readByteFile is just wrapped ioutil.ReadFile.
I am not sure if using overlays in code like this is possible, because there is no example on overlays on their github.
Is this code completely wrong? Thanks in advance to anyone experienced who looks into this.