Documentation
¶
Index ¶
- Constants
- Variables
- func AppendFinalizer(cheCtx *chetypes.CheContext, finalizer string) error
- func CleanUpAllFinalizers(cheCtx *chetypes.CheContext) error
- func ConfigureProxy(cheCtx *chetypes.CheContext, transport *http.Transport)
- func DeleteFinalizer(cheCtx *chetypes.CheContext, finalizer string) error
- func EnsurePodSecurityStandards(podSpec *corev1.PodSpec, userId int64, groupId int64)
- func FindCheClusterCRInNamespace(cl client.Client, namespace string) (*chev2.CheCluster, error)
- func GenerateProxyJavaOpts(proxy *chetypes.Proxy, noProxy string) (javaOpts string)
- func GetIngressSpec(cheCtx *chetypes.CheContext, name string, path string, serviceName string, ...) (ingressUrl string, i *networking.Ingress)
- func GetLabelKeys() []string
- func GetLabels(component string) map[string]string
- func GetLabelsAndAnnotations(obj client.Object) ([]string, []string)
- func GetLabelsAndSelector(component string) (map[string]string, map[string]string)
- func GetLegacyLabels(component string) map[string]string
- func GetManagedByLabel() string
- func GetRouteSpec(cheCtx *chetypes.CheContext, name string, path string, serviceName string, ...) (*routev1.Route, error)
- func GetSecretSpec(name string, namespace string, data map[string][]byte) *corev1.Secret
- func GetSecrets(cheCtx *chetypes.CheContext, labels map[string]string, ...) ([]corev1.Secret, error)
- func GetServiceSpec(cheCtx *chetypes.CheContext, name string, portName []string, ...) *corev1.Service
- func IsDevWorkspaceComponent(labels map[string]string) bool
- func IsOperatorManagedComponent(labels map[string]string, component string) bool
- func MergeNonProxy(noProxy1 string, noProxy2 string) string
- func MountConfigMaps(specDeployment *appsv1.Deployment, cheCtx *chetypes.CheContext) error
- func MountSecrets(specDeployment *appsv1.Deployment, cheCtx *chetypes.CheContext) error
- func OverrideContainer(namespace string, container *corev1.Container, ...) error
- func OverrideDeployment(cheCtx *chetypes.CheContext, deployment *appsv1.Deployment, ...) error
- func ReadCheClusterProxyConfiguration(cheCtx *chetypes.CheContext) (*chetypes.Proxy, error)
- func ReadClusterWideProxyConfiguration(clusterProxy *configv1.Proxy) (*chetypes.Proxy, error)
- func ReloadCheClusterCR(cheCtx *chetypes.CheContext) error
- func SetStatusDetails(cheCtx *chetypes.CheContext, reason string, message string) (err error)
- func SyncClusterRoleBindingToCluster(cheCtx *chetypes.CheContext, name string, serviceAccountName string, ...) error
- func SyncClusterRoleToCluster(cheCtx *chetypes.CheContext, name string, policyRule []rbac.PolicyRule) error
- func SyncDeploymentSpecToCluster(cheCtx *chetypes.CheContext, deploymentSpec *appsv1.Deployment, ...) (bool, error)
- func SyncIngressToCluster(cheCtx *chetypes.CheContext, name string, path string, serviceName string, ...) (endpointUrl string, err error)
- func SyncJobToCluster(cheCtx *chetypes.CheContext, name string, component string, image string, ...) error
- func SyncRoleBindingToCluster(cheCtx *chetypes.CheContext, name string, serviceAccountName string, ...) error
- func SyncRoleToCluster(cheCtx *chetypes.CheContext, name string, policyRule []rbac.PolicyRule) error
- func SyncRouteToCluster(cheCtx *chetypes.CheContext, name string, path string, serviceName string, ...) error
- func SyncSecretToCluster(cheCtx *chetypes.CheContext, name string, data map[string][]byte) error
- func SyncServiceAccountToCluster(cheCtx *chetypes.CheContext, name string) error
- func SyncServiceSpecToCluster(cheCtx *chetypes.CheContext, serviceSpec *corev1.Service) error
- func SyncServiceToCluster(cheCtx *chetypes.CheContext, name string, portName []string, ...) error
- func UpdateCheCRStatus(cheCtx *chetypes.CheContext, field string, value string) (err error)
Constants ¶
const (
CheServiceName = "che-host"
)
Variables ¶
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 }), }
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",
}
)
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] }), }
var ( JobDiffOpts = cmp.Options{ cmpopts.IgnoreFields(batchv1.Job{}, "TypeMeta", "ObjectMeta", "Status"), cmpopts.IgnoreFields(batchv1.JobSpec{}, "Selector", "TTLSecondsAfterFinished"), cmpopts.IgnoreFields(corev1.PodTemplateSpec{}, "ObjectMeta"), cmpopts.IgnoreFields(corev1.Container{}, "TerminationMessagePath", "TerminationMessagePolicy"), cmpopts.IgnoreFields(corev1.PodSpec{}, "DNSPolicy", "SchedulerName", "SecurityContext"), cmp.Comparer(func(x, y []corev1.EnvVar) bool { xMap := make(map[string]string) yMap := make(map[string]string) for _, env := range x { xMap[env.Name] = env.Value } for _, env := range y { yMap[env.Name] = env.Value } return reflect.DeepEqual(xMap, yMap) }), } )
var SecretDiffOpts = cmp.Options{ cmpopts.IgnoreFields(corev1.Secret{}, "TypeMeta", "ObjectMeta"), }
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 AppendFinalizer ¶
func AppendFinalizer(cheCtx *chetypes.CheContext, finalizer string) error
func CleanUpAllFinalizers ¶
func CleanUpAllFinalizers(cheCtx *chetypes.CheContext) error
func ConfigureProxy ¶
func ConfigureProxy(cheCtx *chetypes.CheContext, transport *http.Transport)
ConfigureProxy adds existing proxy configuration into provided transport object.
func DeleteFinalizer ¶
func DeleteFinalizer(cheCtx *chetypes.CheContext, finalizer string) error
func EnsurePodSecurityStandards ¶
EnsurePodSecurityStandards sets SecurityContext accordingly to standards https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
func FindCheClusterCRInNamespace ¶
FindCheClusterCRInNamespace returns CheCluster custom resource from given namespace. If namespace is empty then checluster will be found in any namespace. Only one instance of CheCluster custom resource is expected.
func GenerateProxyJavaOpts ¶
GenerateProxyJavaOpts converts given proxy configuration into Java format.
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 GetLabelsAndAnnotations ¶
GetLabelsAndAnnotations extracts label and annotation keys from an object. Note: key order is non-deterministic (map iteration order).
func GetLabelsAndSelector ¶
func GetLegacyLabels ¶
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 ¶
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 IsDevWorkspaceComponent ¶
func MergeNonProxy ¶
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 OverrideDeployment ¶
func OverrideDeployment( cheCtx *chetypes.CheContext, deployment *appsv1.Deployment, overrideDeploymentSettings *chev2.Deployment) error
OverrideDeployment with custom settings
func ReadCheClusterProxyConfiguration ¶
func ReadCheClusterProxyConfiguration(cheCtx *chetypes.CheContext) (*chetypes.Proxy, error)
func ReloadCheClusterCR ¶
func ReloadCheClusterCR(cheCtx *chetypes.CheContext) error
func SetStatusDetails ¶
func SetStatusDetails(cheCtx *chetypes.CheContext, reason string, message string) (err 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 SyncJobToCluster ¶
func SyncRoleToCluster ¶
func SyncRoleToCluster( cheCtx *chetypes.CheContext, name string, policyRule []rbac.PolicyRule) error
func SyncRouteToCluster ¶
func SyncSecretToCluster ¶
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 UpdateCheCRStatus ¶
func UpdateCheCRStatus(cheCtx *chetypes.CheContext, field string, value string) (err error)
Types ¶
This section is empty.