mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
cri_hook: remove annotation check
This commit is contained in:
parent
8eac8b5edd
commit
ca6f8f3020
@ -32,9 +32,6 @@ const (
|
||||
configJSON = "config.json"
|
||||
fpgaRegionEnvPrefix = "FPGA_REGION_"
|
||||
fpgaAfuEnvPrefix = "FPGA_AFU_"
|
||||
|
||||
annotationName = "com.intel.fpga.mode"
|
||||
annotationValue = "fpga.intel.com/region"
|
||||
)
|
||||
|
||||
// Stdin defines structure for standard JSONed input of the OCI platform hook.
|
||||
@ -220,16 +217,6 @@ func getStdin(reader io.Reader) (*Stdin, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Check if device plugin annotation is set
|
||||
if stdinJ.Annotations.ComIntelFpgaMode == "" {
|
||||
return nil, errors.Errorf("annotation %s is not set", annotationName)
|
||||
}
|
||||
|
||||
// Check if device plugin annotation is set
|
||||
if stdinJ.Annotations.ComIntelFpgaMode != annotationValue {
|
||||
return nil, errors.Errorf("annotation %s has incorrect value '%s'", annotationName, stdinJ.Annotations.ComIntelFpgaMode)
|
||||
}
|
||||
|
||||
if stdinJ.Bundle == "" {
|
||||
return nil, errors.New("'bundle' field is not set in the stdin JSON")
|
||||
}
|
||||
|
@ -73,16 +73,6 @@ func TestGetStdin(t *testing.T) {
|
||||
stdinJSON: "stdin-incorrect-JSON.json",
|
||||
expectedErr: true,
|
||||
},
|
||||
{
|
||||
name: "no annotations",
|
||||
stdinJSON: "stdin-no-annotations.json",
|
||||
expectedErr: true,
|
||||
},
|
||||
{
|
||||
name: "annotation is not set",
|
||||
stdinJSON: "stdin-incorrect-intel-annotation.json",
|
||||
expectedErr: true,
|
||||
},
|
||||
}
|
||||
for _, tc := range tcases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"annotations": {
|
||||
"io.kubernetes.container.hash": "b202a1fa",
|
||||
"io.kubernetes.container.name": "test-container",
|
||||
"io.kubernetes.container.restartCount": "0",
|
||||
"io.kubernetes.pod.name": "test-fpga-region",
|
||||
"io.kubernetes.pod.namespace": "default",
|
||||
"io.kubernetes.pod.terminationGracePeriod": "30",
|
||||
"io.kubernetes.pod.uid": "942e94c1-72d3-11e8-b221-c81f66f62fcc",
|
||||
"com.intel.fpga.mode": "incorrect value"
|
||||
},
|
||||
"bundle": "testdata",
|
||||
"id": "1c40dd8efd268a47d7fb9f75d00f50c20af49d07d8d3c5fb948e68abb6d5ecf9",
|
||||
"ociVersion": "1.0.0",
|
||||
"pid": 39638,
|
||||
"status": ""
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"bundle": "testdata",
|
||||
"id": "1c40dd8efd268a47d7fb9f75d00f50c20af49d07d8d3c5fb948e68abb6d5ecf9",
|
||||
"ociVersion": "1.0.0",
|
||||
"pid": 39638,
|
||||
"status": ""
|
||||
}
|
Loading…
Reference in New Issue
Block a user