Documentation ¶
Index ¶
- Constants
- Variables
- func CreateServiceAccountFromToken(ctx context.Context, kubeClient client.Client, ...) error
- func CreateSignedToken(pk *ecdsa.PrivateKey, sa mondooclient.ServiceAccountCredentials, ...) (string, error)
- func FindMondooAuditConditions(conditions []mondoov1alpha2.MondooAuditConfigCondition, ...) *mondoov1alpha2.MondooAuditConfigCondition
- func FindMondooOperatorConfigCondition(conditions []mondoov1alpha2.MondooOperatorConfigCondition, ...) *mondoov1alpha2.MondooOperatorConfigCondition
- func GenerateTokenFromServiceAccount(serviceAccount mondooclient.ServiceAccountCredentials, logger logr.Logger) (string, error)
- func IntegrationCheckIn(ctx context.Context, integrationMrn string, ...) error
- func SetMondooAuditCondition(conditions []mondoov1alpha2.MondooAuditConfigCondition, ...) []mondoov1alpha2.MondooAuditConfigCondition
- func SetMondooOperatorConfigCondition(conditions []mondoov1alpha2.MondooOperatorConfigCondition, ...) []mondoov1alpha2.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 ContainerImageResolver
- type MondooClientBuilder
- type UpdateConditionCheck
Constants ¶
const ( MondooClientImage = "docker.io/mondoo/client" MondooClientTag = "6-rootless" OpenShiftMondooClientTag = "6-ubi-rootless" MondooOperatorImage = "ghcr.io/mondoohq/mondoo-operator" )
Variables ¶
var MondooOperatorTag = version.Version
On a normal mondoo-operator build, the Version variable will be set at build time to match the $VERSION being built (or default to the git SHA). In the event that someone did a manual build of mondoo-operator and failed to set the Version variable it will get a default value of "latest".
Functions ¶
func CreateServiceAccountFromToken ¶ added in v0.7.1
func CreateServiceAccountFromToken(ctx context.Context, kubeClient client.Client, mondooClientBuilder MondooClientBuilder, withConsoleIntegration bool, serviceAccountSecret types.NamespacedName, tokenSecretData string, log logr.Logger) error
CreateServiceAccountFromToken will take the provided Mondoo token and exchange it with the Mondoo API for a long lived Mondoo ServiceAccount
func CreateSignedToken ¶ added in v0.6.0
func CreateSignedToken(pk *ecdsa.PrivateKey, sa mondooclient.ServiceAccountCredentials, logger logr.Logger) (string, error)
func FindMondooAuditConditions ¶
func FindMondooAuditConditions(conditions []mondoov1alpha2.MondooAuditConfigCondition, conditionType mondoov1alpha2.MondooAuditConfigConditionType) *mondoov1alpha2.MondooAuditConfigCondition
func FindMondooOperatorConfigCondition ¶
func FindMondooOperatorConfigCondition(conditions []mondoov1alpha2.MondooOperatorConfigCondition, conditionType mondoov1alpha2.MondooOperatorConfigConditionType) *mondoov1alpha2.MondooOperatorConfigCondition
FindMondooOperatorConfigCondition iterates all conditions on a MondooOperatorConfig looking for the specified condition type. If none exists nil will be returned.
func GenerateTokenFromServiceAccount ¶ added in v0.6.0
func GenerateTokenFromServiceAccount(serviceAccount mondooclient.ServiceAccountCredentials, logger logr.Logger) (string, error)
func IntegrationCheckIn ¶ added in v0.7.1
func IntegrationCheckIn( ctx context.Context, integrationMrn string, sa mondooclient.ServiceAccountCredentials, mondooClientBuilder func(mondooclient.ClientOptions) mondooclient.Client, logger logr.Logger, ) error
func SetMondooAuditCondition ¶
func SetMondooAuditCondition( conditions []mondoov1alpha2.MondooAuditConfigCondition, conditionType mondoov1alpha2.MondooAuditConfigConditionType, status corev1.ConditionStatus, reason string, message string, updateConditionCheck UpdateConditionCheck, ) []mondoov1alpha2.MondooAuditConfigCondition
func SetMondooOperatorConfigCondition ¶
func SetMondooOperatorConfigCondition( conditions []mondoov1alpha2.MondooOperatorConfigCondition, conditionType mondoov1alpha2.MondooOperatorConfigConditionType, status corev1.ConditionStatus, reason string, message string, updateConditionCheck UpdateConditionCheck, ) []mondoov1alpha2.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 ¶
UpdateConditionAlways returns true. The condition will always be updated.
func UpdateConditionIfReasonOrMessageChange ¶
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 ¶
UpdateConditionNever return false. The condition will never be updated, unless there is a change in the status of the condition.
func UpdateMondooAuditStatus ¶
func UpdateMondooAuditStatus(ctx context.Context, client client.Client, origMOC, newMOC *mondoov1alpha2.MondooAuditConfig, log logr.Logger) error
func UpdateMondooOperatorConfigStatus ¶
func UpdateMondooOperatorConfigStatus(ctx context.Context, client client.Client, origMOC, newMOC *mondoov1alpha2.MondooOperatorConfig, log logr.Logger) error
Types ¶
type ContainerImageResolver ¶
type ContainerImageResolver interface { // MondooClientImage return the Mondoo client image. If skipResolveImage is false, then the image tag is replaced // by a digest. If userImage or userTag are empty strings, default values are used. MondooClientImage(userImage, userTag string, skipImageResolution bool) (string, error) // MondooOperatorImage return the Mondoo operator image. If skipResolveImage is false, then the image tag is replaced // by a digest. If userImage or userTag are empty strings, default values are used. MondooOperatorImage(userImage, userTag string, skipImageResolution bool) (string, error) }
func NewContainerImageResolver ¶
func NewContainerImageResolver(isOpenShift bool) ContainerImageResolver
type MondooClientBuilder ¶ added in v0.7.1
type MondooClientBuilder func(mondooclient.ClientOptions) mondooclient.Client
type UpdateConditionCheck ¶
UpdateConditionCheck tests whether a condition should be updated from the old condition to the new condition. Returns true if the condition should be updated.