Documentation ¶
Index ¶
- func CreateAnnotationPatchToDeleteContainersVulnerabilityScanAnnotationIfNeeded(workloadResource *admisionrequest.WorkloadResource) (*jsonpatch.JsonPatchOperation, error)
- func CreateContainersVulnerabilityScanAnnotationPatchAdd(containersScanInfoList []*contracts.ContainerVulnerabilityScanInfo, ...) (*jsonpatch.JsonPatchOperation, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAnnotationPatchToDeleteContainersVulnerabilityScanAnnotationIfNeeded ¶
func CreateAnnotationPatchToDeleteContainersVulnerabilityScanAnnotationIfNeeded(workloadResource *admisionrequest.WorkloadResource) (*jsonpatch.JsonPatchOperation, error)
CreateAnnotationPatchToDeleteContainersVulnerabilityScanAnnotationIfNeeded create a patch to delete ContainersVulnerabilityScanAnnotation (stale annotations) if the WorkloadResource's annotations contain ContainersVulnerabilityScanAnnotation. Otherwise, no deletion is needed - return nil.
func CreateContainersVulnerabilityScanAnnotationPatchAdd ¶
func CreateContainersVulnerabilityScanAnnotationPatchAdd(containersScanInfoList []*contracts.ContainerVulnerabilityScanInfo, workloadResource *admisionrequest.WorkloadResource) (*jsonpatch.JsonPatchOperation, error)
CreateContainersVulnerabilityScanAnnotationPatchAdd returns an add type json patch in order to add to annotations map a new key value of ContainersVulnerabilityScanInfoAnnotationName. It does so by adding to the exiting map the new key value and setting the updated map as the json patch value. The function creates a scanInfoList from the provided containers scan info slice of type contracts.ContainerVulnerabilityScanInfoList serialize/marshal it and set it as a value string to the new key annotation Contracts.ContainersVulnerabilityScanInfoAnnotationName (azuredefender.io/containers.vulnerability.scan.info) If the annotations map doesn't exist, it creates a new map and add the key value before setting it as the json patch value. As a result, the annotations are updated with no override of the existing values.
Types ¶
This section is empty.