Skip to content

Commit ca6f8f3

Browse files
committed
cri_hook: remove annotation check
1 parent 8eac8b5 commit ca6f8f3

File tree

4 files changed

+0
-47
lines changed

4 files changed

+0
-47
lines changed

cmd/fpga_crihook/main.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ const (
3232
configJSON = "config.json"
3333
fpgaRegionEnvPrefix = "FPGA_REGION_"
3434
fpgaAfuEnvPrefix = "FPGA_AFU_"
35-
36-
annotationName = "com.intel.fpga.mode"
37-
annotationValue = "fpga.intel.com/region"
3835
)
3936

4037
// Stdin defines structure for standard JSONed input of the OCI platform hook.
@@ -220,16 +217,6 @@ func getStdin(reader io.Reader) (*Stdin, error) {
220217
return nil, err
221218
}
222219

223-
// Check if device plugin annotation is set
224-
if stdinJ.Annotations.ComIntelFpgaMode == "" {
225-
return nil, errors.Errorf("annotation %s is not set", annotationName)
226-
}
227-
228-
// Check if device plugin annotation is set
229-
if stdinJ.Annotations.ComIntelFpgaMode != annotationValue {
230-
return nil, errors.Errorf("annotation %s has incorrect value '%s'", annotationName, stdinJ.Annotations.ComIntelFpgaMode)
231-
}
232-
233220
if stdinJ.Bundle == "" {
234221
return nil, errors.New("'bundle' field is not set in the stdin JSON")
235222
}

cmd/fpga_crihook/main_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,6 @@ func TestGetStdin(t *testing.T) {
7373
stdinJSON: "stdin-incorrect-JSON.json",
7474
expectedErr: true,
7575
},
76-
{
77-
name: "no annotations",
78-
stdinJSON: "stdin-no-annotations.json",
79-
expectedErr: true,
80-
},
81-
{
82-
name: "annotation is not set",
83-
stdinJSON: "stdin-incorrect-intel-annotation.json",
84-
expectedErr: true,
85-
},
8676
}
8777
for _, tc := range tcases {
8878
t.Run(tc.name, func(t *testing.T) {

cmd/fpga_crihook/testdata/stdin-incorrect-intel-annotation.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

cmd/fpga_crihook/testdata/stdin-no-annotations.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)