Merge pull request #6497 from thaJeztah/platform_keep_osversion_osfeatures
platforms.Normalize(): do not reset OSVersion and OSFeatures
This commit is contained in:
commit
604c462d7b
@ -257,10 +257,5 @@ func Format(platform specs.Platform) string {
|
|||||||
func Normalize(platform specs.Platform) specs.Platform {
|
func Normalize(platform specs.Platform) specs.Platform {
|
||||||
platform.OS = normalizeOS(platform.OS)
|
platform.OS = normalizeOS(platform.OS)
|
||||||
platform.Architecture, platform.Variant = normalizeArch(platform.Architecture, platform.Variant)
|
platform.Architecture, platform.Variant = normalizeArch(platform.Architecture, platform.Variant)
|
||||||
|
|
||||||
// these fields are deprecated, remove them
|
|
||||||
platform.OSFeatures = nil
|
|
||||||
platform.OSVersion = ""
|
|
||||||
|
|
||||||
return platform
|
return platform
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseSelector(t *testing.T) {
|
func TestParseSelector(t *testing.T) {
|
||||||
@ -364,3 +365,7 @@ func TestParseSelectorInvalid(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNormalize(t *testing.T) {
|
||||||
|
require.Equal(t, DefaultSpec(), Normalize(DefaultSpec()))
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user