Skip to content

Commit 35924bc

Browse files
committed
cri: add deprecation warning for auths
Signed-off-by: Samuel Karp <[email protected]>
1 parent d7cb25d commit 35924bc

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/cri/config/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
420420
config.Auth = &auth
421421
c.Registry.Configs[endpoint] = config
422422
}
423-
log.G(ctx).Warning("`auths` is deprecated, please use `configs` instead")
423+
warnings = append(warnings, deprecation.CRIRegistryAuths)
424+
log.G(ctx).Warning("`auths` is deprecated, please use `ImagePullSecrets` instead")
424425
}
425426

426427
// Validation for stream_idle_timeout

pkg/cri/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func TestValidateConfig(t *testing.T) {
8181
},
8282
},
8383
},
84+
warnings: []deprecation.Warning{deprecation.CRIRegistryAuths},
8485
},
8586
"invalid stream_idle_timeout": {
8687
config: &PluginConfig{

pkg/deprecation/deprecation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const (
2727
GoPluginLibrary Warning = Prefix + "go-plugin-library"
2828
// CRIRegistryMirrors is a warning for the use of the `mirrors` property
2929
CRIRegistryMirrors Warning = Prefix + "cri-registry-mirrors"
30+
// CRIRegistryAuths is a warning for the use of the `auths` property
31+
CRIRegistryAuths Warning = Prefix + "cri-registry-auths"
3032
)
3133

3234
var messages = map[Warning]string{
@@ -35,6 +37,8 @@ var messages = map[Warning]string{
3537
GoPluginLibrary: "Dynamically-linked Go plugins as containerd runtimes are deprecated since containerd v2.0 and removed in containerd v2.1.",
3638
CRIRegistryMirrors: "The `mirrors` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0." +
3739
"Use `config_path` instead.",
40+
CRIRegistryAuths: "The `auths` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.3 and will be removed in containerd v2.0." +
41+
"Use `ImagePullSecrets` instead.",
3842
}
3943

4044
// Valid checks whether a given Warning is valid

0 commit comments

Comments
 (0)