Skip to content

Commit ed43a18

Browse files
committed
feat: add extra-identity-to-resource
Signed-off-by: Gergely Brautigam <[email protected]> On-behalf-of: @SAP [email protected]
1 parent c4e8b85 commit ed43a18

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

shared/oci.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ const (
2828
)
2929

3030
type Resource struct {
31-
Name string
32-
Version string
33-
Data string
34-
Type string
31+
Name string
32+
Version string
33+
Data string
34+
Type string
35+
ExtraIdentity map[string]string
3536
}
3637

3738
type ComponentRef struct {
@@ -66,8 +67,9 @@ func BlobResource(resource Resource) ComponentModification {
6667
return compvers.SetResourceBlob(
6768
&compdesc.ResourceMeta{
6869
ElementMeta: compdesc.ElementMeta{
69-
Name: resource.Name,
70-
Version: resource.Version,
70+
Name: resource.Name,
71+
Version: resource.Version,
72+
ExtraIdentity: resource.ExtraIdentity,
7173
},
7274
Type: resource.Type,
7375
Relation: ocmmetav1.LocalRelation,
@@ -83,8 +85,9 @@ func ImageRefResource(ref string, resource Resource) ComponentModification {
8385
return func(compvers ocm.ComponentVersionAccess) error {
8486
return compvers.SetResource(&compdesc.ResourceMeta{
8587
ElementMeta: compdesc.ElementMeta{
86-
Name: resource.Name,
87-
Version: resource.Version,
88+
Name: resource.Name,
89+
Version: resource.Version,
90+
ExtraIdentity: resource.ExtraIdentity,
8891
},
8992
Type: resource.Type,
9093
Relation: ocmmetav1.ExternalRelation,

shared/steps/setup/add_file_to_git_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func AddFilesToGitRepository(files ...File) features.Func {
4444
Content: base64.StdEncoding.EncodeToString(data),
4545
})
4646
if err != nil {
47-
t.Fatal(fmt.Errorf("failed to add file to repository: %w", err))
47+
t.Fatal(fmt.Errorf("failed to add file to repository %s: %w", file, err))
4848
}
4949

5050
t.Logf("successfully added %s to repository %s", file.DestFilepath, file.RepoName)

shared/steps/teardown/dump_repository_content.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ func DumpRepositoryContent(owner, repo string) features.Func {
2121
t.Fatal(fmt.Errorf("failed to create gitea client: %w", err))
2222
}
2323

24-
r, _, err := gclient.GetTrees(owner, repo, "main", true)
24+
r, _, err := gclient.GetTrees(owner, repo, gitea.ListTreeOptions{
25+
ListOptions: gitea.ListOptions{
26+
PageSize: 100,
27+
Page: 0,
28+
},
29+
Ref: "main",
30+
Recursive: true,
31+
})
2532
if err != nil {
2633
t.Fatal(fmt.Errorf("failed to find repo for %s/%s: %w", owner, repo, err))
2734
}

0 commit comments

Comments
 (0)