tls

package
v0.0.0-...-14d2540 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: EPL-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// The ConfigMap name for merged CA bundle certificates
	CheMergedCABundleCertsCMName = "ca-certs-merged"
	OIDCIssuerCACMName           = "oidc-issuer-ca"
)
View Source
const (
	CheTLSJobServiceAccountName = "che-tls-job-service-account"
	CheTLSJobRoleName           = "che-tls-job-role"
	CheTLSJobRoleBindingName    = "che-tls-job-role-binding"
	CheTLSJobName               = "che-tls-job"
	CheTLSJobComponentName      = "che-create-tls-secret-job"
)

TLS related constants

Variables

This section is empty.

Functions

func CreateTLSSecret

func CreateTLSSecret(cheCtx *chetypes.CheContext, name string) (err error)

CreateTLSSecret creates TLS secret with given name. Does nothing if secret with given name already exists.

func GetAdditionalCACertsConfigMapVersion

func GetAdditionalCACertsConfigMapVersion(cheCtx *chetypes.CheContext) string

GetAdditionalCACertsConfigMapVersion returns revision of merged additional CA certs config map

func GetCheCABundles

func GetCheCABundles(client k8sclient.Client, namespace string) ([]corev1.ConfigMap, error)

GetCheCABundles returns list of config maps with additional CA certificates that should be trusted by Che The selection is based on the specific label

func GetTLSCrtBytes

func GetTLSCrtBytes(cheCtx *chetypes.CheContext) (certificates []byte, err error)

GetTLSCrtBytes extracts certificate chain of trust from the test route/ingress.

func GetTLSCrtChain

func GetTLSCrtChain(cheCtx *chetypes.CheContext) ([]*x509.Certificate, error)

GetTLSCrtChain retrieves TLS certificates chain from a test route/ingress.

func IsSelfSignedCASecretExists

func IsSelfSignedCASecretExists(cheCtx *chetypes.CheContext) (bool, error)

IsSelfSignedCASecretExists checks if CheTLSSelfSignedCertificateSecretName exists so depending components can mount it

func IsSelfSignedCertificateUsed

func IsSelfSignedCertificateUsed(cheCtx *chetypes.CheContext) (bool, error)

IsSelfSignedCertificateUsed detects whether endpoints are/should be secured by self-signed certificate.

func K8sHandleCheTLSSecrets

func K8sHandleCheTLSSecrets(cheCtx *chetypes.CheContext) (reconcile.Result, error)

K8sHandleCheTLSSecrets handles TLS secrets required for Che deployment on Kubernetes infrastructure.

func RegisterSecurityProfileWatcher

func RegisterSecurityProfileWatcher(mgr manager.Manager, serverTLS ServerTLS, onCancel context.CancelFunc, log logr.Logger) error

RegisterSecurityProfileWatcher sets up watcher to restart operator when profile/policy changes. Always registers on OpenShift so that changes (or late availability) trigger a restart.

func SyncTLSRoleToCluster

func SyncTLSRoleToCluster(cheCtx *chetypes.CheContext) error

Types

type CertificatesReconciler

type CertificatesReconciler struct {
	reconciler.Reconcilable
	// contains filtered or unexported fields
}

func NewCertificatesReconciler

func NewCertificatesReconciler() *CertificatesReconciler

func (*CertificatesReconciler) Finalize

func (c *CertificatesReconciler) Finalize(cheCtx *chetypes.CheContext) bool

func (*CertificatesReconciler) Reconcile

type ServerTLS

type ServerTLS struct {
	TLSOpts                   []func(*cryptotls.Config)
	InitialTLSProfileSpec     configv1.TLSProfileSpec
	InitialTLSAdherencePolicy configv1.TLSAdherencePolicy
}

ServerTLS holds TLS options and initial profile/policy for watcher

func BuildServerTLSOptions

func BuildServerTLSOptions(ctx context.Context, cfg *rest.Config, scheme *k8sruntime.Scheme, log logr.Logger) (ServerTLS, error)

BuildServerTLSOptions fetches TLS profile and adherence policy from cluster. Returns TLS config functions when adherence policy requires strict compliance. Falls back to the library-go default TLS profile on transient API server errors or when adherence policy does not require strict compliance. Returns empty ServerTLS on non-OpenShift clusters.

type TlsSecretReconciler

type TlsSecretReconciler struct {
	reconciler.Reconcilable
}

func NewTlsSecretReconciler

func NewTlsSecretReconciler() *TlsSecretReconciler

func (*TlsSecretReconciler) Finalize

func (t *TlsSecretReconciler) Finalize(cheCtx *chetypes.CheContext) bool

func (*TlsSecretReconciler) Reconcile

func (t *TlsSecretReconciler) Reconcile(cheCtx *chetypes.CheContext) (reconcile.Result, bool, error)

Jump to

Keyboard shortcuts

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