Skip to content

Commit ae8c583

Browse files
committed
cri: add deprecation warning for auths
Signed-off-by: Samuel Karp <[email protected]> (cherry picked from commit 35924bc) Signed-off-by: Samuel Karp <[email protected]>
1 parent 455edca commit ae8c583

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
@@ -439,7 +439,8 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
439439
config.Auth = &auth
440440
c.Registry.Configs[endpoint] = config
441441
}
442-
log.G(ctx).Warning("`auths` is deprecated, please use `configs` instead")
442+
warnings = append(warnings, deprecation.CRIRegistryAuths)
443+
log.G(ctx).Warning("`auths` is deprecated, please use `ImagePullSecrets` instead")
443444
}
444445

445446
// 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
@@ -308,6 +308,7 @@ func TestValidateConfig(t *testing.T) {
308308
},
309309
},
310310
},
311+
warnings: []deprecation.Warning{deprecation.CRIRegistryAuths},
311312
},
312313
"invalid stream_idle_timeout": {
313314
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)