Populate the platform information when calling the References() method of manifest list
Populate the platform information when calling the References() method of manifest list Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
parent
90e62ac24c
commit
1a059fe78d
2 changed files with 31 additions and 0 deletions
|
@ -110,6 +110,18 @@ func TestManifestList(t *testing.T) {
|
|||
t.Fatalf("unexpected number of references: %d", len(references))
|
||||
}
|
||||
for i := range references {
|
||||
platform := manifestDescriptors[i].Platform
|
||||
expectedPlatform := &v1.Platform{
|
||||
Architecture: platform.Architecture,
|
||||
OS: platform.OS,
|
||||
OSFeatures: platform.OSFeatures,
|
||||
OSVersion: platform.OSVersion,
|
||||
Variant: platform.Variant,
|
||||
}
|
||||
if !reflect.DeepEqual(references[i].Platform, expectedPlatform) {
|
||||
t.Fatalf("unexpected value %d returned by References: %v", i, references[i])
|
||||
}
|
||||
references[i].Platform = nil
|
||||
if !reflect.DeepEqual(references[i], manifestDescriptors[i].Descriptor) {
|
||||
t.Fatalf("unexpected value %d returned by References: %v", i, references[i])
|
||||
}
|
||||
|
@ -247,6 +259,18 @@ func TestOCIImageIndex(t *testing.T) {
|
|||
t.Fatalf("unexpected number of references: %d", len(references))
|
||||
}
|
||||
for i := range references {
|
||||
platform := manifestDescriptors[i].Platform
|
||||
expectedPlatform := &v1.Platform{
|
||||
Architecture: platform.Architecture,
|
||||
OS: platform.OS,
|
||||
OSFeatures: platform.OSFeatures,
|
||||
OSVersion: platform.OSVersion,
|
||||
Variant: platform.Variant,
|
||||
}
|
||||
if !reflect.DeepEqual(references[i].Platform, expectedPlatform) {
|
||||
t.Fatalf("unexpected value %d returned by References: %v", i, references[i])
|
||||
}
|
||||
references[i].Platform = nil
|
||||
if !reflect.DeepEqual(references[i], manifestDescriptors[i].Descriptor) {
|
||||
t.Fatalf("unexpected value %d returned by References: %v", i, references[i])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue