annotations

package
v0.0.0-...-035f276 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL