Fix metadata loading by config module
In this fix, we make sure that targetPath is taken into the account when forming path to metadata file Change-Id: Ie94c3508161b8c3b9254db08f4bf809348ff54f0 Relates-To: #295 Closes: #295
This commit is contained in:
parent
f4f107ac53
commit
66fc562667
@ -1088,7 +1088,7 @@ func (c *Config) CurrentContextManifestMetadata() (*Metadata, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
meta := &Metadata{}
|
meta := &Metadata{}
|
||||||
err = util.ReadYAMLFile(manifest.MetadataPath, meta)
|
err = util.ReadYAMLFile(filepath.Join(manifest.TargetPath, manifest.MetadataPath), meta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -594,7 +594,7 @@ func TestCurrentContextManifestMetadata(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "default metadata",
|
name: "default metadata",
|
||||||
metaPath: "testdata/metadata.yaml",
|
metaPath: "metadata.yaml",
|
||||||
expectErr: false,
|
expectErr: false,
|
||||||
currentContext: "testContext",
|
currentContext: "testContext",
|
||||||
meta: &config.Metadata{
|
meta: &config.Metadata{
|
||||||
@ -630,7 +630,7 @@ func TestCurrentContextManifestMetadata(t *testing.T) {
|
|||||||
}
|
}
|
||||||
manifest := &config.Manifest{
|
manifest := &config.Manifest{
|
||||||
MetadataPath: tt.metaPath,
|
MetadataPath: tt.metaPath,
|
||||||
TargetPath: ".",
|
TargetPath: "testdata",
|
||||||
}
|
}
|
||||||
conf.Manifests = map[string]*config.Manifest{
|
conf.Manifests = map[string]*config.Manifest{
|
||||||
"testManifest": manifest,
|
"testManifest": manifest,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user