Skip to content

Commit 689a103

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 8c38975 commit 689a103

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
@@ -505,7 +505,8 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
505505
config.Auth = &auth
506506
c.Registry.Configs[endpoint] = config
507507
}
508-
log.G(ctx).Warning("`auths` is deprecated, please use `configs` instead")
508+
warnings = append(warnings, deprecation.CRIRegistryAuths)
509+
log.G(ctx).Warning("`auths` is deprecated, please use `ImagePullSecrets` instead")
509510
}
510511

511512
// 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
@@ -317,6 +317,7 @@ func TestValidateConfig(t *testing.T) {
317317
},
318318
},
319319
},
320+
warnings: []deprecation.Warning{deprecation.CRIRegistryAuths},
320321
},
321322
"invalid stream_idle_timeout": {
322323
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 will be deprecated in 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)