File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change 1515package v1
1616
1717import (
18- "strings"
19-
2018 "github.com/pkg/errors"
2119 "k8s.io/apimachinery/pkg/runtime"
2220 "k8s.io/apimachinery/pkg/util/version"
@@ -88,27 +86,5 @@ func (r *QatDevicePlugin) ValidateDelete() error {
8886}
8987
9088func (r * QatDevicePlugin ) validatePlugin () error {
91- parts := strings .SplitN (r .Spec .Image , ":" , 2 )
92- if len (parts ) != 2 {
93- return errors .Errorf ("incorrect image field %q" , r .Spec .Image )
94- }
95- namespacedName := parts [0 ]
96- versionStr := parts [1 ]
97-
98- parts = strings .Split (namespacedName , "/" )
99- name := parts [len (parts )- 1 ]
100- if name != "intel-qat-plugin" {
101- return errors .Errorf ("incorrect image name %q. Make sure you use '<vendor>/intel-qat-plugin:<version>'" , name )
102- }
103-
104- ver , err := version .ParseSemantic (versionStr )
105- if err != nil {
106- return errors .Wrapf (err , "unable to parse version %q" , versionStr )
107- }
108-
109- if ! ver .AtLeast (qatMinVersion ) {
110- return errors .Errorf ("version %q is too low. Should be at least %q" , ver , qatMinVersion )
111- }
112-
113- return nil
89+ return validatePluginImage (r .Spec .Image , "intel-qat-plugin" , qatMinVersion )
11490}
You can’t perform that action at this time.
0 commit comments