Documentation ¶
Index ¶
- Variables
- func AreDeploymentsEqual(a, b appsv1.Deployment) bool
- func AreResouceRequirementsEqual(x corev1.ResourceRequirements, y corev1.ResourceRequirements) bool
- func AreServicesEqual(a, b corev1.Service) bool
- func CreateIfNotExist(ctx context.Context, kubeClient client.Client, ...) (bool, error)
- func DeleteIfExists(ctx context.Context, kubeClient client.Client, obj client.Object) error
- func ResourcesRequirementsWithDefaults(m corev1.ResourceRequirements) corev1.ResourceRequirements
- func UpdateDeployment(current *appsv1.Deployment, desired appsv1.Deployment)
- func UpdateService(current *corev1.Service, desired corev1.Service)
Constants ¶
This section is empty.
Variables ¶
var DefaultMondooClientResources corev1.ResourceRequirements = corev1.ResourceRequirements{ Limits: corev1.ResourceList{ corev1.ResourceMemory: resource.MustParse("1G"), corev1.ResourceCPU: resource.MustParse("500m"), }, Requests: corev1.ResourceList{ corev1.ResourceMemory: resource.MustParse("500M"), corev1.ResourceCPU: resource.MustParse("50m"), }, }
defaultMondooClientResources for Mondoo Client container
Functions ¶
func AreDeploymentsEqual ¶
func AreDeploymentsEqual(a, b appsv1.Deployment) bool
AreDeploymentsEqual returns a value indicating whether 2 deployments are equal. Note that it does not perform a full comparison but checks just some of the properties of a deployment (only the ones we are currently interested at).
func AreResouceRequirementsEqual ¶
func AreResouceRequirementsEqual(x corev1.ResourceRequirements, y corev1.ResourceRequirements) bool
AreResouceRequirementsEqual returns a value indicating whether 2 resource requirements are equal.
func AreServicesEqual ¶
AreServicesEqual return a value indicating whether 2 services are equal. Note that it does not perform a full comparison but checks just some of the properties of a deployment (only the ones we are currently interested at).
func CreateIfNotExist ¶
func CreateIfNotExist(ctx context.Context, kubeClient client.Client, retrieveObj, createObj client.Object) (bool, error)
CreateIfNotExist creates an object if it doesn't already exist. The returned boolean indicates whether the object has been created. If the object already existed or an error occurred, then "false" is returned. If the object exists, no AlreadyExists error is returned.
func DeleteIfExists ¶
DeleteIfExists deletes a Kubernetes object if it exists. Any errors that might pop up because the object does not exist are ignored.
func ResourcesRequirementsWithDefaults ¶
func ResourcesRequirementsWithDefaults(m corev1.ResourceRequirements) corev1.ResourceRequirements
ResourcesRequirementsWithDefaults will return the resource requirements from the parameter if such are specified. If not requirements are specified, default values will be returned.
func UpdateDeployment ¶
func UpdateDeployment(current *appsv1.Deployment, desired appsv1.Deployment)
UpdateDeployment updates a deployment such that it matches a desired state. The function does not replace all fields but only a set of fields that we are interested at.
Types ¶
This section is empty.