Skip to content

[v1.6.0-beta.1] platforms.Normalize should not alter platforms.DefaultSpec #6168

@crazy-max

Description

@crazy-max

Description

Since containerd 1.6.0-beta.0, default platform spec is now correct for Windows with OSVersion (#5914) but platforms.Normalize unsets OSVersion and OSFeatures which altered the original platforms.DefaultSpec.

Steps to reproduce the issue

require.Equal(t, platforms.DefaultSpec(), platforms.Normalize(platforms.DefaultSpec()))

Describe the results you received and expected

--- FAIL: TestDefaultPlatform (0.00s)
    platform_test.go:65: 
        	Error Trace:	platform_test.go:65
        	Error:      	Not equal: 
        	            	expected: v1.Platform{Architecture:"amd64", OS:"windows", OSVersion:"10.0.17763", OSFeatures:[]string(nil), Variant:""}
        	            	actual  : v1.Platform{Architecture:"amd64", OS:"windows", OSVersion:"", OSFeatures:[]string(nil), Variant:""}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -3,3 +3,3 @@
        	            	  OS: (string) (len=7) "windows",
        	            	- OSVersion: (string) (len=10) "10.0.17763",
        	            	+ OSVersion: (string) "",
        	            	  OSFeatures: ([]string) <nil>,
        	Test:       	TestDefaultPlatform

What version of containerd are you using?

1.6.0-beta.1

Any other relevant information

moby/buildkit#2427 (comment)

cc @tonistiigi @thaJeztah

Show configuration if it is related to CRI plugin.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions