cri: add deprecation warning for mirrors
Signed-off-by: Samuel Karp <samuelkarp@google.com>
This commit is contained in:
@@ -397,6 +397,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
|
||||
if useConfigPath {
|
||||
return warnings, errors.New("`mirrors` cannot be set when `config_path` is provided")
|
||||
}
|
||||
warnings = append(warnings, deprecation.CRIRegistryMirrors)
|
||||
log.G(ctx).Warning("`mirrors` is deprecated, please use `config_path` instead")
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,37 @@ func TestValidateConfig(t *testing.T) {
|
||||
},
|
||||
expectedErr: "`mirrors` cannot be set when `config_path` is provided",
|
||||
},
|
||||
"deprecated mirrors": {
|
||||
config: &PluginConfig{
|
||||
ContainerdConfig: ContainerdConfig{
|
||||
DefaultRuntimeName: RuntimeDefault,
|
||||
Runtimes: map[string]Runtime{
|
||||
RuntimeDefault: {},
|
||||
},
|
||||
},
|
||||
Registry: Registry{
|
||||
Mirrors: map[string]Mirror{
|
||||
"example.com": {},
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &PluginConfig{
|
||||
ContainerdConfig: ContainerdConfig{
|
||||
DefaultRuntimeName: RuntimeDefault,
|
||||
Runtimes: map[string]Runtime{
|
||||
RuntimeDefault: {
|
||||
Sandboxer: string(ModePodSandbox),
|
||||
},
|
||||
},
|
||||
},
|
||||
Registry: Registry{
|
||||
Mirrors: map[string]Mirror{
|
||||
"example.com": {},
|
||||
},
|
||||
},
|
||||
},
|
||||
warnings: []deprecation.Warning{deprecation.CRIRegistryMirrors},
|
||||
},
|
||||
"privileged_without_host_devices_all_devices_allowed without privileged_without_host_devices": {
|
||||
config: &PluginConfig{
|
||||
ContainerdConfig: ContainerdConfig{
|
||||
|
||||
Reference in New Issue
Block a user