Documentation ¶
Overview ¶
Copyright 2022 Mondoo, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func FindMondooAuditConditions(conditions []mondoov1alpha1.MondooAuditConfigCondition, ...) *mondoov1alpha1.MondooAuditConfigCondition
- func FindMondooOperatorConfigCondition(conditions []mondoov1alpha1.MondooOperatorConfigCondition, ...) *mondoov1alpha1.MondooOperatorConfigCondition
- func SetMondooAuditCondition(conditions []mondoov1alpha1.MondooAuditConfigCondition, ...) []mondoov1alpha1.MondooAuditConfigCondition
- func SetMondooOperatorConfigCondition(conditions []mondoov1alpha1.MondooOperatorConfigCondition, ...) []mondoov1alpha1.MondooOperatorConfigCondition
- func UpdateConditionAlways(_, _, _, _ string) bool
- func UpdateConditionIfReasonOrMessageChange(oldReason, oldMessage, newReason, newMessage string) bool
- func UpdateConditionNever(_, _, _, _ string) bool
- func UpdateMondooAuditStatus(ctx context.Context, client client.Client, ...) error
- func UpdateMondooOperatorConfigStatus(ctx context.Context, client client.Client, ...) error
- type CertManagerHandler
- type MondooAuditConfigReconciler
- type MondooOperatorConfigReconciler
- type Nodes
- type ServiceMonitor
- type UpdateConditionCheck
- type Webhooks
- type Workloads
Constants ¶
const ( WebhookLabelKey = "control-plane" WebhookLabelValue = "webhook-manager" )
const (
NodeDaemonSetNameTemplate = `%s-node`
)
const (
WorkloadDeploymentNameTemplate = `%s-workload`
)
Variables ¶
var (
Version string
)
Functions ¶
func FindMondooAuditConditions ¶ added in v0.2.2
func FindMondooAuditConditions(conditions []mondoov1alpha1.MondooAuditConfigCondition, conditionType mondoov1alpha1.MondooAuditConfigConditionType) *mondoov1alpha1.MondooAuditConfigCondition
func FindMondooOperatorConfigCondition ¶ added in v0.2.0
func FindMondooOperatorConfigCondition(conditions []mondoov1alpha1.MondooOperatorConfigCondition, conditionType mondoov1alpha1.MondooOperatorConfigConditionType) *mondoov1alpha1.MondooOperatorConfigCondition
FindMondooOperatorConfigCondition iterates all conditions on a MondooOperatorConfig looking for the specified condition type. If none exists nil will be returned.
func SetMondooAuditCondition ¶ added in v0.2.2
func SetMondooAuditCondition( conditions []mondoov1alpha1.MondooAuditConfigCondition, conditionType mondoov1alpha1.MondooAuditConfigConditionType, status corev1.ConditionStatus, reason string, message string, updateConditionCheck UpdateConditionCheck, ) []mondoov1alpha1.MondooAuditConfigCondition
func SetMondooOperatorConfigCondition ¶ added in v0.2.0
func SetMondooOperatorConfigCondition( conditions []mondoov1alpha1.MondooOperatorConfigCondition, conditionType mondoov1alpha1.MondooOperatorConfigConditionType, status corev1.ConditionStatus, reason string, message string, updateConditionCheck UpdateConditionCheck, ) []mondoov1alpha1.MondooOperatorConfigCondition
SetMondooOperatorConfigCondition sets the condition for the MondooOperatorConfig and returns the new slice of conditions. If the MondooAuditCOnfi does not already have a condition with the specified type, a condition will be added to the slice if and only if the specified status is True. If the MondooAuditConfig does already have a condition with the specified type, the condition will be updated if either of the following are true. 1) Requested status is different than existing status. 2) The updateConditionCheck function returns true.
func UpdateConditionAlways ¶ added in v0.2.0
UpdateConditionAlways returns true. The condition will always be updated.
func UpdateConditionIfReasonOrMessageChange ¶ added in v0.2.0
func UpdateConditionIfReasonOrMessageChange(oldReason, oldMessage, newReason, newMessage string) bool
UpdateConditionIfReasonOrMessageChange returns true if there is a change in the reason or the message of the condition.
func UpdateConditionNever ¶ added in v0.2.0
UpdateConditionNever return false. The condition will never be updated, unless there is a change in the status of the condition.
func UpdateMondooAuditStatus ¶ added in v0.2.2
func UpdateMondooAuditStatus(ctx context.Context, client client.Client, origMOC, newMOC *mondoov1alpha1.MondooAuditConfig, log logr.Logger) error
func UpdateMondooOperatorConfigStatus ¶ added in v0.2.0
func UpdateMondooOperatorConfigStatus(ctx context.Context, client client.Client, origMOC, newMOC *mondoov1alpha1.MondooOperatorConfig, log logr.Logger) error
Types ¶
type CertManagerHandler ¶ added in v0.0.11
type CertManagerHandler struct { Mondoo *v1alpha1.MondooAuditConfig KubeClient client.Client TargetNamespace string Scheme *runtime.Scheme }
type MondooAuditConfigReconciler ¶
MondooAuditConfigReconciler reconciles a MondooAuditConfig object
func (*MondooAuditConfigReconciler) Reconcile ¶
func (r *MondooAuditConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the MondooAuditConfig object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile
func (*MondooAuditConfigReconciler) SetupWithManager ¶
func (r *MondooAuditConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MondooOperatorConfigReconciler ¶ added in v0.2.0
MondooOperatorConfigReconciler reconciles a MondooOperatorConfig object
func (*MondooOperatorConfigReconciler) Reconcile ¶ added in v0.2.0
func (r *MondooOperatorConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile will check for a valid MondooOperatorConfig resource (only "mondoo-operator-config" allowed), and set up the mondoo-operator as indicated in the resource.
func (*MondooOperatorConfigReconciler) SetupWithManager ¶ added in v0.2.0
func (r *MondooOperatorConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type Nodes ¶
type Nodes struct { Enable bool Mondoo *v1alpha1.MondooAuditConfig Updated bool Image string MondooOperatorConfig *v1alpha1.MondooOperatorConfig }
type ServiceMonitor ¶ added in v0.2.0
type ServiceMonitor struct { Config *mondoov1alpha1.MondooOperatorConfig TargetNamespace string }
type UpdateConditionCheck ¶ added in v0.2.0
UpdateConditionCheck tests whether a condition should be updated from the old condition to the new condition. Returns true if the condition should be updated.
type Webhooks ¶ added in v0.0.11
type Webhooks struct { Mondoo *mondoov1alpha1.MondooAuditConfig KubeClient client.Client TargetNamespace string Scheme *runtime.Scheme Image string MondooOperatorConfig *mondoov1alpha1.MondooOperatorConfig }
type Workloads ¶
type Workloads struct { Enable bool Mondoo *v1alpha1.MondooAuditConfig Updated bool Image string MondooOperatorConfig *v1alpha1.MondooOperatorConfig }