Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 416bde4

Browse files
authored
Merge pull request #1373 from Random-Liu/cherrypick-#1363-release-1.3
[release/1.3] Validate and update the right config
2 parents 945cb97 + e6304e9 commit 416bde4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cri.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
6363
ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion}
6464
ctx := ic.Context
6565
pluginConfig := ic.Config.(*criconfig.PluginConfig)
66+
if err := criconfig.ValidatePluginConfig(ctx, pluginConfig); err != nil {
67+
return nil, errors.Wrap(err, "invalid plugin config")
68+
}
69+
6670
c := criconfig.Config{
6771
PluginConfig: *pluginConfig,
6872
ContainerdRootDir: filepath.Dir(ic.Root),
@@ -72,10 +76,6 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
7276
}
7377
log.G(ctx).Infof("Start cri plugin with config %+v", c)
7478

75-
if err := criconfig.ValidatePluginConfig(ctx, pluginConfig); err != nil {
76-
return nil, errors.Wrap(err, "invalid plugin config")
77-
}
78-
7979
if err := setGLogLevel(); err != nil {
8080
return nil, errors.Wrap(err, "failed to set glog level")
8181
}

0 commit comments

Comments
 (0)