Skip to content

Commit

Permalink
op-deployer: Marshal tag-based ArtifactsLocator with correct scheme (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
mslipper authored and samlaf committed Nov 10, 2024
1 parent 4bac1d2 commit 3dc3a74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion op-deployer/pkg/deployer/opcm/artifacts_locator.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (a *ArtifactsLocator) MarshalText() ([]byte, error) {
}

if a.Tag != "" {
return []byte(a.Tag), nil
return []byte("tag://" + a.Tag), nil
}

return nil, fmt.Errorf("no URL, path or tag set")
Expand Down
4 changes: 4 additions & 0 deletions op-deployer/pkg/deployer/opcm/artifacts_locator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ func TestArtifactsLocator_Marshaling(t *testing.T) {
}
require.NoError(t, err)
require.Equal(t, tt.out, &a)

marshalled, err := a.MarshalText()
require.NoError(t, err)
require.Equal(t, tt.in, string(marshalled))
})
}
}
Expand Down

0 comments on commit 3dc3a74

Please sign in to comment.