Documentation ¶
Overview ¶
Package trustedcabundle provides utility functions to create and check trusted CA bundle configmap from DSCI CRD
Index ¶
- Constants
- func AddCABundleCMInAllNamespaces(ctx context.Context, cli client.Client, log logr.Logger, ...) error
- func ConfigureTrustedCABundle(ctx context.Context, cli client.Client, log logr.Logger, ...) error
- func CreateOdhTrustedCABundleConfigMap(ctx context.Context, cli client.Client, namespace string, customCAData string) error
- func DeleteOdhTrustedCABundleConfigMap(ctx context.Context, cli client.Client, namespace string) error
- func HasCABundleAnnotationDisabled(ns client.Object) bool
- func IsTrustedCABundleUpdated(ctx context.Context, cli client.Client, dscInit *dsciv1.DSCInitialization) (bool, error)
- func RemoveCABundleCMInAllNamespaces(ctx context.Context, cli client.Client) error
- func ShouldInjectTrustedBundle(ns *corev1.Namespace) bool
Constants ¶
const ( CAConfigMapName = "odh-trusted-ca-bundle" CADataFieldName = "odh-ca-bundle.crt" )
Variables ¶
This section is empty.
Functions ¶
func AddCABundleCMInAllNamespaces ¶ added in v2.15.0
func AddCABundleCMInAllNamespaces(ctx context.Context, cli client.Client, log logr.Logger, dscInit *dsciv1.DSCInitialization) error
AddCABundleCMInAllNamespaces create or update trustCABundle configmap in namespaces.
func CreateOdhTrustedCABundleConfigMap ¶
func CreateOdhTrustedCABundleConfigMap(ctx context.Context, cli client.Client, namespace string, customCAData string) error
CreateOdhTrustedCABundleConfigMap creates a configMap 'odh-trusted-ca-bundle' in given namespace with labels and data or update existing odh-trusted-ca-bundle configmap if already exists with new content of .data.odh-ca-bundle.crt this is certificates for the cluster trusted CA Cert Bundle.
func HasCABundleAnnotationDisabled ¶
HasCABundleAnnotationDisabled checks if a namespace has the annotation "security.opendatahub.io/inject-trusted-ca-bundle" set to "false".
It returns false if the annotation is set to "true", not set, or cannot be parsed as a boolean.
func IsTrustedCABundleUpdated ¶
func IsTrustedCABundleUpdated(ctx context.Context, cli client.Client, dscInit *dsciv1.DSCInitialization) (bool, error)
IsTrustedCABundleUpdated check if data in CM "odh-trusted-ca-bundle" from applciation namespace matches DSCI's TrustedCABundle.CustomCABundle return false when these two are matching => skip update return true when not match => need upate.
func RemoveCABundleCMInAllNamespaces ¶ added in v2.15.0
RemoveCABundleCMInAllNamespaces delete trustCABundle configmap from namespaces.
Types ¶
This section is empty.