-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deprecated docker field leads to failure of nydusify check
`NydusImage.Config.Config.ArgsEscaped` is present only for legacy compatibility with Docker and should not be used by new image builders. Nydusify (1.6 and above) ignores it, which is an expected behavior. This pr ignores comparision of it in nydusify checking, which leads to failure. Signed-off-by: 泰友 <cuichengxu.ccx@antgroup.com>
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package rule | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/dragonflyoss/image-service/contrib/nydusify/pkg/parser" | ||
"github.com/stretchr/testify/assert" | ||
|
||
v1 "github.com/opencontainers/image-spec/specs-go/v1" | ||
) | ||
|
||
func TestManifestRuleValidate_IgnoreDeprecatedField(t *testing.T) { | ||
source := &parser.Parsed{ | ||
NydusImage: &parser.Image{ | ||
Config: v1.Image{ | ||
Config: v1.ImageConfig{ | ||
ArgsEscaped: true, // deprecated field | ||
}, | ||
}, | ||
}, | ||
} | ||
target := &parser.Parsed{ | ||
NydusImage: &parser.Image{ | ||
Config: v1.Image{ | ||
Config: v1.ImageConfig{ | ||
ArgsEscaped: false, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
rule := ManifestRule{ | ||
SourceParsed: source, | ||
TargetParsed: target, | ||
} | ||
|
||
assert.Nil(t, rule.Validate()) | ||
} |