deploy

package
v0.0.0-...-fe5a0a6 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: EPL-2.0 Imports: 33 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CheServiceName = "che-host"
)

Variables

View Source
var DefaultDeploymentDiffOpts = cmp.Options{
	cmpopts.IgnoreFields(appsv1.Deployment{}, "TypeMeta", "ObjectMeta", "Status"),
	cmpopts.IgnoreFields(appsv1.DeploymentSpec{}, "Replicas", "RevisionHistoryLimit", "ProgressDeadlineSeconds"),
	cmpopts.IgnoreFields(appsv1.DeploymentStrategy{}, "RollingUpdate"),
	cmpopts.IgnoreFields(corev1.Container{}, "ReadinessProbe", "LivenessProbe", "TerminationMessagePath", "TerminationMessagePolicy"),
	cmpopts.IgnoreFields(corev1.PodSpec{}, "DNSPolicy", "SchedulerName", "DeprecatedServiceAccount"),
	cmpopts.IgnoreFields(corev1.ConfigMapVolumeSource{}, "DefaultMode"),
	cmpopts.IgnoreFields(corev1.SecretVolumeSource{}, "DefaultMode"),
	cmp.Comparer(func(x, y resource.Quantity) bool {
		return x.Cmp(y) == 0
	}),
}
View Source
var (
	DefaultIngressAnnotations = map[string]string{
		"kubernetes.io/ingress.class":                       "nginx",
		"nginx.ingress.kubernetes.io/proxy-read-timeout":    "3600",
		"nginx.ingress.kubernetes.io/proxy-connect-timeout": "3600",
		"nginx.ingress.kubernetes.io/ssl-redirect":          "true",
	}
)
View Source
var IngressDiffOpts = cmp.Options{
	cmpopts.IgnoreFields(networking.Ingress{}, "TypeMeta", "Status"),
	cmpopts.IgnoreFields(networking.HTTPIngressPath{}, "PathType"),
	cmp.Comparer(func(x, y metav1.ObjectMeta) bool {
		return reflect.DeepEqual(x.Labels, y.Labels) &&
			x.Annotations[constants.CheEclipseOrgManagedAnnotationsDigest] == y.Annotations[constants.CheEclipseOrgManagedAnnotationsDigest]
	}),
}
View Source
var SecretDiffOpts = cmp.Options{
	cmpopts.IgnoreFields(corev1.Secret{}, "TypeMeta", "ObjectMeta"),
}
View Source
var ServiceDefaultDiffOpts = cmp.Options{
	cmpopts.IgnoreFields(corev1.Service{}, "TypeMeta", "ObjectMeta"),
	cmp.Comparer(func(x, y corev1.ServiceSpec) bool {
		return cmp.Equal(x.Ports, y.Ports, cmpopts.IgnoreFields(corev1.ServicePort{}, "TargetPort", "NodePort")) &&
			reflect.DeepEqual(x.Selector, y.Selector)
	}),
}

Functions

func GetIngressSpec

func GetIngressSpec(
	cheCtx *chetypes.CheContext,
	name string,
	path string,
	serviceName string,
	servicePort int32,
	component string) (ingressUrl string, i *networking.Ingress)

GetIngressSpec returns expected ingress config for given parameters host and path are evaluated if they are empty

func GetLabelKeys

func GetLabelKeys() []string

func GetLabels

func GetLabels(component string) map[string]string

func GetLabelsAndAnnotations

func GetLabelsAndAnnotations(obj client.Object) ([]string, []string)

GetLabelsAndAnnotations extracts label and annotation keys from an object. Note: key order is non-deterministic (map iteration order).

func GetLabelsAndSelector

func GetLabelsAndSelector(component string) (map[string]string, map[string]string)

func GetLegacyLabels

func GetLegacyLabels(component string) map[string]string

func GetManagedByLabel

func GetManagedByLabel() string

func GetRouteSpec

func GetRouteSpec(
	cheCtx *chetypes.CheContext,
	name string,
	path string,
	serviceName string,
	servicePort int32,
	component string) (*routev1.Route, error)

GetRouteSpec returns default configuration of a route in Che namespace.

func GetSecretSpec

func GetSecretSpec(name string, namespace string, data map[string][]byte) *corev1.Secret

GetSecretSpec return default secret config for given data

func GetSecrets

func GetSecrets(cheCtx *chetypes.CheContext, labels map[string]string, annotations map[string]string) ([]corev1.Secret, error)

Get all secrets by labels and annotations

func GetServiceSpec

func GetServiceSpec(
	cheCtx *chetypes.CheContext,
	name string,
	portName []string,
	portNumber []int32,
	component string) *corev1.Service

func IsOperatorManagedComponent

func IsOperatorManagedComponent(labels map[string]string, component string) bool

func MountConfigMaps

func MountConfigMaps(specDeployment *appsv1.Deployment, cheCtx *chetypes.CheContext) error

MountConfigMaps mounts configmaps into a container as a file or as environment variable. Configmaps are selected by the following labels: - app.kubernetes.io/part-of=che.eclipse.org - app.kubernetes.io/component=<DEPLOYMENT-NAME>-configmap

func MountSecrets

func MountSecrets(specDeployment *appsv1.Deployment, cheCtx *chetypes.CheContext) error

MountSecrets mounts secrets into a container as a file or as environment variable. Secrets are selected by the following labels: - app.kubernetes.io/part-of=che.eclipse.org - app.kubernetes.io/component=<DEPLOYMENT-NAME>-secret

func OverrideContainer

func OverrideContainer(
	namespace string,
	container *corev1.Container,
	overrideSettings *chev2.Container) error

func OverrideDeployment

func OverrideDeployment(
	cheCtx *chetypes.CheContext,
	deployment *appsv1.Deployment,
	overrideDeploymentSettings *chev2.Deployment) error

OverrideDeployment with custom settings

func SyncClusterRoleBindingToCluster

func SyncClusterRoleBindingToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	serviceAccountName string,
	clusterRoleName string) error

func SyncClusterRoleToCluster

func SyncClusterRoleToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	policyRule []rbac.PolicyRule) error

func SyncDeploymentSpecToCluster

func SyncDeploymentSpecToCluster(
	cheCtx *chetypes.CheContext,
	deploymentSpec *appsv1.Deployment,
	deploymentDiffOpts cmp.Options) (bool, error)

func SyncIngressToCluster

func SyncIngressToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	path string,
	serviceName string,
	servicePort int32,
	component string) (endpointUrl string, err error)

SyncIngressToCluster creates ingress to expose service with the set settings host and path are evaluated if they are empty

func SyncRoleBindingToCluster

func SyncRoleBindingToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	serviceAccountName string,
	roleName string,
	roleKind string) error

func SyncRoleToCluster

func SyncRoleToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	policyRule []rbac.PolicyRule) error

func SyncRouteToCluster

func SyncRouteToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	path string,
	serviceName string,
	servicePort int32,
	component string) error

func SyncSecretToCluster

func SyncSecretToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	data map[string][]byte) error

SyncSecretToCluster applies secret into cluster or external namespace

func SyncServiceAccountToCluster

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

func SyncServiceSpecToCluster

func SyncServiceSpecToCluster(cheCtx *chetypes.CheContext, serviceSpec *corev1.Service) error

func SyncServiceToCluster

func SyncServiceToCluster(
	cheCtx *chetypes.CheContext,
	name string,
	portName []string,
	portNumber []int32,
	component string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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