trustedcabundle

package
v2.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package trustedcabundle provides utility functions to create and check trusted CA bundle configmap from DSCI CRD

Index

Constants

View Source
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 ConfigureTrustedCABundle

func ConfigureTrustedCABundle(ctx context.Context, cli client.Client, log logr.Logger, dscInit *dsciv1.DSCInitialization, managementStateChanged bool) error

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 DeleteOdhTrustedCABundleConfigMap

func DeleteOdhTrustedCABundleConfigMap(ctx context.Context, cli client.Client, namespace string) error

func HasCABundleAnnotationDisabled

func HasCABundleAnnotationDisabled(ns client.Object) bool

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 application 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

func RemoveCABundleCMInAllNamespaces(ctx context.Context, cli client.Client) error

RemoveCABundleCMInAllNamespaces delete trustCABundle configmap from namespaces.

func ShouldInjectTrustedBundle

func ShouldInjectTrustedBundle(ns *corev1.Namespace) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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