Documentation ¶
Overview ¶
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2020 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2021 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2018-2020 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
REMINDER: when updating versions below, see also pkg/apis/org/v1/che_types.go and deploy/crds/org_v1_che_cr.yaml
Copyright (c) 2012-2020 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2021 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2020 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2020-2021 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Index ¶
- Constants
- Variables
- func AppendFinalizer(deployContext *DeployContext, finalizer string) error
- func CheckNeededImagePullerApis(ctx *DeployContext) (bool, bool, bool, error)
- func CompareExpectedSubscription(ctx *DeployContext, packageManifest *packagesv1.PackageManifest) (bool, error)
- func ConfigureProxy(deployContext *DeployContext, transport *http.Transport)
- func Create(deployContext *DeployContext, blueprint metav1.Object) (bool, error)
- func CreateIfNotExists(deployContext *DeployContext, blueprint metav1.Object) (bool, error)
- func CreateImagePullerSubscription(ctx *DeployContext, packageManifest *packagesv1.PackageManifest) (bool, error)
- func CreateKubernetesImagePuller(ctx *DeployContext) (bool, error)
- func CreateOperatorGroupIfNotFound(ctx *DeployContext) (bool, error)
- func CreateTLSSecretFromEndpoint(deployContext *DeployContext, url string, name string) (err error)
- func DefaultCheFlavor(cr *orgv1.CheCluster) string
- func DefaultCheIdentityPostgresSecret() string
- func DefaultCheIdentitySecret() string
- func DefaultChePostgresSecret() string
- func DefaultCheServerImage(cr *orgv1.CheCluster) string
- func DefaultCheServerSecureExposerJwtProxyImage(cr *orgv1.CheCluster) string
- func DefaultCheTLSSecretsCreationJobImage() string
- func DefaultCheVersion() string
- func DefaultCheWorkspacePluginBrokerArtifactsImage(cr *orgv1.CheCluster) string
- func DefaultCheWorkspacePluginBrokerMetadataImage(cr *orgv1.CheCluster) string
- func DefaultConsoleLinkDisplayName() string
- func DefaultConsoleLinkImage() string
- func DefaultConsoleLinkName() string
- func DefaultConsoleLinkSection() string
- func DefaultDevfileRegistryImage(cr *orgv1.CheCluster) string
- func DefaultKeycloakImage(cr *orgv1.CheCluster) string
- func DefaultKubernetesImagePullerOperatorCSV() string
- func DefaultPluginRegistryImage(cr *orgv1.CheCluster) string
- func DefaultPostgresImage(cr *orgv1.CheCluster) string
- func DefaultPullPolicyFromDockerImage(dockerImage string) string
- func DefaultPvcJobsImage(cr *orgv1.CheCluster) string
- func DefaultServerTrustStoreConfigMapName() string
- func DefaultSingleHostGatewayConfigSidecarImage(cr *orgv1.CheCluster) string
- func DefaultSingleHostGatewayImage(cr *orgv1.CheCluster) string
- func Delete(deployContext *DeployContext, key client.ObjectKey, objectMeta metav1.Object) (bool, error)
- func DeleteClusterObject(deployContext *DeployContext, name string, objectMeta metav1.Object) (bool, error)
- func DeleteFinalizer(deployContext *DeployContext, finalizer string) error
- func DeleteImagePullerFinalizer(ctx *DeployContext) (err error)
- func DeleteIngressIfExists(name string, deployContext *DeployContext) error
- func DeleteNamespacedObject(deployContext *DeployContext, name string, objectMeta metav1.Object) (bool, error)
- func DeleteObjectWithFinalizer(deployContext *DeployContext, key client.ObjectKey, objectMeta metav1.Object, ...) error
- func DeleteRole(name string, namespace string, client runtimeClient.Client) error
- func DeleteRoleBinding(name string, namespace string, client runtimeClient.Client) error
- func DeleteRouteIfExists(name string, deployContext *DeployContext) error
- func DeleteSecret(secretName string, namespace string, runtimeClient client.Client) error
- func GenerateProxyJavaOpts(proxy *Proxy, noProxy string) (javaOpts string, err error)
- func Get(deployContext *DeployContext, key client.ObjectKey, actual metav1.Object) (bool, error)
- func GetAdditionalCACertsConfigMapVersion(deployContext *DeployContext) string
- func GetCheMultiUser(cr *orgv1.CheCluster) string
- func GetClusterDeployment(name string, namespace string, client runtimeClient.Client) (*appsv1.Deployment, error)
- func GetClusterIngress(name string, namespace string, client runtimeClient.Client) (*v1beta1.Ingress, error)
- func GetClusterObject(deployContext *DeployContext, name string, actual metav1.Object) (bool, error)
- func GetClusterRoute(name string, namespace string, client runtimeClient.Client) (*routev1.Route, error)
- func GetConfigMapSpec(deployContext *DeployContext, name string, data map[string]string, ...) *corev1.ConfigMap
- func GetEndpointTLSCrtBytes(deployContext *DeployContext, endpointURL string) (certificates []byte, err error)
- func GetEndpointTLSCrtChain(deployContext *DeployContext, endpointURL string) ([]*x509.Certificate, error)
- func GetExpectedKubernetesImagePuller(ctx *DeployContext) *chev1alpha1.KubernetesImagePuller
- func GetExpectedSubscription(ctx *DeployContext, packageManifest *packagesv1.PackageManifest) *operatorsv1alpha1.Subscription
- func GetFinalizerName(prefix string) string
- func GetLabels(cheCluster *orgv1.CheCluster, component string) map[string]string
- func GetLabelsAndSelector(cheCluster *orgv1.CheCluster, component string) (map[string]string, map[string]string)
- func GetLegacyLabels(cheCluster *orgv1.CheCluster, component string) map[string]string
- func GetNamespacedObject(deployContext *DeployContext, name string, actual metav1.Object) (bool, error)
- func GetPackageManifest(ctx *DeployContext) (*packagesv1.PackageManifest, error)
- func GetSecret(deployContext *DeployContext, name string, namespace string) (*corev1.Secret, error)
- func GetSecrets(deployContext *DeployContext, labels map[string]string, ...) ([]corev1.Secret, error)
- func GetSingleHostExposureType(cr *orgv1.CheCluster) string
- func GetSpecIngress(deployContext *DeployContext, name string, host string, serviceName string, ...) (*v1beta1.Ingress, error)
- func GetSpecRoute(deployContext *DeployContext, name string, host string, serviceName string, ...) (*routev1.Route, error)
- func GetSpecSecret(deployContext *DeployContext, name string, namespace string, ...) (*corev1.Secret, error)
- func GetSpecService(deployContext *DeployContext, name string, portName []string, ...) (*corev1.Service, error)
- func GetUniqueClusterRoleBindingName(deployContext *DeployContext, serviceAccount string, clusterRole string) string
- func HasImagePullerFinalizer(instance *orgv1.CheCluster) bool
- func InitDefaults(defaultsPath string)
- func InitDefaultsFromEnv()
- func InitDefaultsFromFile(defaultsPath string)
- func InitTestDefaultsFromDeployment(deploymentFile string) error
- func IsSelfSignedCertificateUsed(deployContext *DeployContext) (bool, error)
- func K8sHandleCheTLSSecrets(deployContext *DeployContext) (reconcile.Result, error)
- func MergeLabels(labels map[string]string, additionalLabels string)
- func MergeNonProxy(noProxy1 string, noProxy2 string) string
- func MigratingToCRW2_0(cr *orgv1.CheCluster) bool
- func MountSecrets(specDeployment *appsv1.Deployment, deployContext *DeployContext) error
- func NewOAuthClient(name string, oauthSecret string, keycloakURL string, keycloakRealm string, ...) *oauth.OAuthClient
- func ReconcileClusterRoleBindingFinalizer(deployContext *DeployContext, name string) error
- func ReconcileConsoleLink(deployContext *DeployContext) (bool, error)
- func ReconcileConsoleLinkFinalizer(deployContext *DeployContext) error
- func ReconcileImagePuller(ctx *DeployContext) (reconcile.Result, error)
- func ReconcileImagePullerFinalizer(ctx *DeployContext) (err error)
- func ReconcileOAuthClientFinalizer(deployContext *DeployContext) (err error)
- func SubscriptionsAreEqual(expected *operatorsv1alpha1.Subscription, ...) bool
- func Sync(deployContext *DeployContext, blueprint metav1.Object, diffOpts cmp.Option) (bool, error)
- func SyncAdditionalCACertsConfigMapToCluster(deployContext *DeployContext) (bool, error)
- func SyncAndAddFinalizer(deployContext *DeployContext, blueprint metav1.Object, diffOpts cmp.Option, ...) (bool, error)
- func SyncClusterRoleBindingAndAddFinalizerToCluster(deployContext *DeployContext, name string, serviceAccountName string, ...) (bool, error)
- func SyncClusterRoleBindingToCluster(deployContext *DeployContext, name string, serviceAccountName string, ...) (bool, error)
- func SyncClusterRoleToCluster(deployContext *DeployContext, name string, policyRule []rbac.PolicyRule) (bool, error)
- func SyncConfigMapDataToCluster(deployContext *DeployContext, name string, data map[string]string, ...) (bool, error)
- func SyncConfigMapSpecToCluster(deployContext *DeployContext, configMapSpec *corev1.ConfigMap) (bool, error)
- func SyncDeploymentToCluster(deployContext *DeployContext, specDeployment *appsv1.Deployment, ...) (bool, error)
- func SyncExecRoleToCluster(deployContext *DeployContext) (*rbac.Role, error)
- func SyncIngressToCluster(deployContext *DeployContext, name string, host string, serviceName string, ...) (*v1beta1.Ingress, error)
- func SyncJobToCluster(deployContext *DeployContext, name string, component string, image string, ...) (*batchv1.Job, error)
- func SyncPVCToCluster(deployContext *DeployContext, name string, claimSize string, component string) (bool, error)
- func SyncRoleBindingToCluster(deployContext *DeployContext, name string, serviceAccountName string, ...) (*rbac.RoleBinding, error)
- func SyncRoleToCluster(deployContext *DeployContext, name string, policyRule []rbac.PolicyRule) (*rbac.Role, error)
- func SyncRouteToCluster(deployContext *DeployContext, name string, host string, serviceName string, ...) (*routev1.Route, error)
- func SyncSecret(deployContext *DeployContext, name string, namespace string, ...) (*corev1.Secret, error)
- func SyncServiceAccountToCluster(deployContext *DeployContext, name string) (*corev1.ServiceAccount, error)
- func SyncTLSRoleToCluster(deployContext *DeployContext) (*rbac.Role, error)
- func SyncViewRoleToCluster(deployContext *DeployContext) (*rbac.Role, error)
- func UninstallImagePullerOperator(ctx *DeployContext) (bool, error)
- func Update(deployContext *DeployContext, actual runtime.Object, blueprint metav1.Object, ...) (bool, error)
- func UpdateCheCRSpec(deployContext *DeployContext, updatedField string, value string) (err error)
- func UpdateCheCRStatus(deployContext *DeployContext, updatedField string, value string) (err error)
- func UpdateImagePullerSpecIfEmpty(ctx *DeployContext) (orgv1.CheClusterSpecImagePuller, error)
- type ClusterAPI
- type DeployContext
- type InternalService
- type ProvisioningStatus
- type Proxy
- type ServiceProvisioningStatus
Constants ¶
const ( ConsoleLinkFinalizerName = "consolelink.finalizers.che.eclipse.org" ConsoleLinksResourceName = "consolelinks" )
const ( DefaultChePostgresUser = "pgche" DefaultChePostgresHostName = "postgres" DefaultChePostgresPort = "5432" DefaultChePostgresDb = "dbche" DefaultPvcStrategy = "common" DefaultPvcClaimSize = "1Gi" DefaultIngressClass = "nginx" DefaultKeycloakAdminUserName = "admin" DefaultCheLogLevel = "INFO" DefaultCheDebug = "false" DefaultCheMultiUser = "true" DefaultCheMetricsPort = int32(8087) DefaultCheDebugPort = int32(8000) DefaultCheVolumeMountPath = "/data" DefaultCheVolumeClaimName = "che-data-volume" DefaultPostgresVolumeClaimName = "postgres-data" DefaultJavaOpts = "-XX:MaxRAMPercentage=85.0" DefaultWorkspaceJavaOpts = "-XX:MaxRAM=150m -XX:MaxRAMFraction=2 -XX:+UseParallelGC " + "-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 " + "-Dsun.zip.disableMemoryMapping=true " + "-Xms20m -Djava.security.egd=file:/dev/./urandom" DefaultSecurityContextFsGroup = "1724" DefaultSecurityContextRunAsUser = "1724" KubernetesImagePullerOperatorCSV = "kubernetes-imagepuller-operator.v0.0.4" DefaultServerExposureStrategy = "multi-host" DefaultKubernetesSingleHostExposureType = "native" DefaultOpenShiftSingleHostExposureType = "gateway" // This is only to correctly manage defaults during the transition // from Upstream 7.0.0 GA to the next version // That fixed bug https://github.com/eclipse/che/issues/13714 OldDefaultKeycloakUpstreamImageToDetect = "eclipse/che-keycloak:7.0.0" OldDefaultPvcJobsUpstreamImageToDetect = "registry.access.redhat.com/ubi8-minimal:8.0-127" OldDefaultPostgresUpstreamImageToDetect = "centos/postgresql-96-centos7:9.6" OldDefaultCodeReadyServerImageRepo = "registry.redhat.io/codeready-workspaces/server-rhel8" OldDefaultCodeReadyServerImageTag = "1.2" OldCrwPluginRegistryUrl = "https://che-plugin-registry.openshift.io" // kubernetes default labels KubernetesComponentLabelKey = "app.kubernetes.io/component" KubernetesPartOfLabelKey = "app.kubernetes.io/part-of" KubernetesManagedByLabelKey = "app.kubernetes.io/managed-by" KubernetesInstanceLabelKey = "app.kubernetes.io/instance" KubernetesNameLabelKey = "app.kubernetes.io/name" CheEclipseOrg = "che.eclipse.org" OAuthScmConfiguration = "oauth-scm-configuration" // che.eclipse.org annotations CheEclipseOrgMountPath = "che.eclipse.org/mount-path" CheEclipseOrgMountAs = "che.eclipse.org/mount-as" CheEclipseOrgEnvName = "che.eclipse.org/env-name" CheEclipseOrgNamespace = "che.eclipse.org/namespace" CheEclipseOrgGithubOAuthCredentials = "che.eclipse.org/github-oauth-credentials" CheEclipseOrgOAuthScmServer = "che.eclipse.org/oauth-scm-server" CheEclipseOrgScmServerEndpoint = "che.eclipse.org/scm-server-endpoint" // components IdentityProviderName = "keycloak" DevfileRegistryName = "devfile-registry" PluginRegistryName = "plugin-registry" PostgresName = "postgres" // limits DefaultPluginRegistryMemoryLimit = "256Mi" DefaultPluginRegistryMemoryRequest = "32Mi" DefaultPluginRegistryCpuLimit = "500m" DefaultPluginRegistryCpuRequest = "100m" DefaultDevfileRegistryMemoryLimit = "256Mi" DefaultDevfileRegistryMemoryRequest = "32Mi" DefaultDevfileRegistryCpuLimit = "500m" DefaultDevfileRegistryCpuRequest = "100m" DefaultServerMemoryLimit = "1024Mi" DefaultServerMemoryRequest = "512Mi" DefaultServerCpuLimit = "1" DefaultServerCpuRequest = "100m" DefaultIdentityProviderMemoryLimit = "1536Mi" DefaultIdentityProviderMemoryRequest = "1024Mi" DefaultIdentityProviderCpuLimit = "2" DefaultIdentityProviderCpuRequest = "100m" DefaultPostgresMemoryLimit = "1024Mi" DefaultPostgresMemoryRequest = "512Mi" DefaultPostgresCpuLimit = "500m" DefaultPostgresCpuRequest = "100m" BitBucketOAuthConfigMountPath = "/che-conf/oauth/bitbucket" BitBucketOAuthConfigPrivateKey = "private.key" BitBucketOAuthConfigConsumerKey = "consumer.key" )
const ( // ViewRoleName role to get k8s object needed for Workspace components(metrics plugin, Che terminals, tasks etc.) ViewRoleName = "view" // ExecRoleName - role name to create Che terminals and tasks in the workspace. ExecRoleName = "exec" )
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" CheTLSSelfSignedCertificateSecretName = "self-signed-certificate" DefaultCheTLSSecretName = "che-tls" // CheCACertsConfigMapLabelKey is the label key which marks config map with additional CA certificates CheCACertsConfigMapLabelKey = "app.kubernetes.io/component" // CheCACertsConfigMapLabelKey is the label value which marks config map with additional CA certificates CheCACertsConfigMapLabelValue = "ca-bundle" // CheAllCACertsConfigMapName is the name of config map which contains all additional trusted by Che TLS CA certificates CheAllCACertsConfigMapName = "ca-certs-merged" // CheMergedCAConfigMapRevisionsAnnotationKey is annotation name which holds versions of included config maps in format: cm-name1=ver1,cm-name2=ver2 CheMergedCAConfigMapRevisionsAnnotationKey = "che.eclipse.org/included-configmaps" )
TLS related constants
const (
CheServiceName = "che-host"
)
const (
// host name template: `<route-name>-<route-namespace>.<domain>`
HostNameTemplate = "%s-%s.%s"
)
const (
OAuthFinalizerName = "oauthclients.finalizers.che.eclipse.org"
)
Variables ¶
var (
DefaultSingleHostGatewayConfigMapLabels = map[string]string{
"app": "che",
"component": "che-gateway-config",
}
)
var DeploymentDiffOpts = 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{}, "TerminationMessagePath", "TerminationMessagePolicy", "SecurityContext"), cmpopts.IgnoreFields(corev1.PodSpec{}, "DNSPolicy", "SchedulerName", "SecurityContext", "DeprecatedServiceAccount"), cmpopts.IgnoreFields(corev1.ConfigMapVolumeSource{}, "DefaultMode"), cmpopts.IgnoreFields(corev1.SecretVolumeSource{}, "DefaultMode"), cmpopts.IgnoreFields(corev1.VolumeSource{}, "EmptyDir"), cmp.Comparer(func(x, y resource.Quantity) bool { return x.Cmp(y) == 0 }), }
Functions ¶
func AppendFinalizer ¶
func AppendFinalizer(deployContext *DeployContext, finalizer string) error
func CheckNeededImagePullerApis ¶
func CheckNeededImagePullerApis(ctx *DeployContext) (bool, bool, bool, error)
Check if the API server can discover the API groups for packages.operators.coreos.com, operators.coreos.com, and che.eclipse.org. Returns: foundPackagesAPI - true if the server discovers the packages.operators.coreos.com API foundOperatorsAPI - true if the server discovers the operators.coreos.com API foundKubernetesImagePullerAPI - true if the server discovers the che.eclipse.org API error - any error returned by the call to discoveryClient.ServerGroups()
func CompareExpectedSubscription ¶
func CompareExpectedSubscription(ctx *DeployContext, packageManifest *packagesv1.PackageManifest) (bool, error)
func ConfigureProxy ¶
func ConfigureProxy(deployContext *DeployContext, transport *http.Transport)
ConfigureProxy adds existing proxy configuration into provided transport object.
func Create ¶
func Create(deployContext *DeployContext, blueprint metav1.Object) (bool, error)
Creates object. Return true if a new object is created otherwise returns false.
func CreateIfNotExists ¶
func CreateIfNotExists(deployContext *DeployContext, blueprint metav1.Object) (bool, error)
Creates object. Return true if a new object is created or has been already created otherwise returns false.
func CreateImagePullerSubscription ¶
func CreateImagePullerSubscription(ctx *DeployContext, packageManifest *packagesv1.PackageManifest) (bool, error)
func CreateKubernetesImagePuller ¶
func CreateKubernetesImagePuller(ctx *DeployContext) (bool, error)
func CreateOperatorGroupIfNotFound ¶
func CreateOperatorGroupIfNotFound(ctx *DeployContext) (bool, error)
Create an OperatorGroup in the CheCluster namespace if it does not exist. Returns true if the OperatorGroup was created, and any error returned during the List and Create operation
func CreateTLSSecretFromEndpoint ¶
func CreateTLSSecretFromEndpoint(deployContext *DeployContext, url string, name string) (err error)
CreateTLSSecretFromEndpoint creates TLS secret with given name which contains certificates obtained from the given url. If the url is empty string, then cluster default certificate will be obtained. Does nothing if secret with given name already exists.
func DefaultCheFlavor ¶
func DefaultCheFlavor(cr *orgv1.CheCluster) string
func DefaultCheIdentityPostgresSecret ¶
func DefaultCheIdentityPostgresSecret() string
func DefaultCheIdentitySecret ¶
func DefaultCheIdentitySecret() string
func DefaultChePostgresSecret ¶
func DefaultChePostgresSecret() string
func DefaultCheServerImage ¶
func DefaultCheServerImage(cr *orgv1.CheCluster) string
func DefaultCheServerSecureExposerJwtProxyImage ¶
func DefaultCheServerSecureExposerJwtProxyImage(cr *orgv1.CheCluster) string
func DefaultCheTLSSecretsCreationJobImage ¶
func DefaultCheTLSSecretsCreationJobImage() string
func DefaultCheVersion ¶
func DefaultCheVersion() string
func DefaultCheWorkspacePluginBrokerArtifactsImage ¶
func DefaultCheWorkspacePluginBrokerArtifactsImage(cr *orgv1.CheCluster) string
func DefaultCheWorkspacePluginBrokerMetadataImage ¶
func DefaultCheWorkspacePluginBrokerMetadataImage(cr *orgv1.CheCluster) string
func DefaultConsoleLinkDisplayName ¶
func DefaultConsoleLinkDisplayName() string
func DefaultConsoleLinkImage ¶
func DefaultConsoleLinkImage() string
func DefaultConsoleLinkName ¶
func DefaultConsoleLinkName() string
func DefaultConsoleLinkSection ¶
func DefaultConsoleLinkSection() string
func DefaultDevfileRegistryImage ¶
func DefaultDevfileRegistryImage(cr *orgv1.CheCluster) string
func DefaultKeycloakImage ¶
func DefaultKeycloakImage(cr *orgv1.CheCluster) string
func DefaultKubernetesImagePullerOperatorCSV ¶
func DefaultKubernetesImagePullerOperatorCSV() string
func DefaultPluginRegistryImage ¶
func DefaultPluginRegistryImage(cr *orgv1.CheCluster) string
func DefaultPostgresImage ¶
func DefaultPostgresImage(cr *orgv1.CheCluster) string
func DefaultPvcJobsImage ¶
func DefaultPvcJobsImage(cr *orgv1.CheCluster) string
func DefaultServerTrustStoreConfigMapName ¶
func DefaultServerTrustStoreConfigMapName() string
func DefaultSingleHostGatewayConfigSidecarImage ¶
func DefaultSingleHostGatewayConfigSidecarImage(cr *orgv1.CheCluster) string
func DefaultSingleHostGatewayImage ¶
func DefaultSingleHostGatewayImage(cr *orgv1.CheCluster) string
func Delete ¶
func Delete(deployContext *DeployContext, key client.ObjectKey, objectMeta metav1.Object) (bool, error)
Deletes object. Returns true if object deleted or not found otherwise returns false.
func DeleteClusterObject ¶
func DeleteFinalizer ¶
func DeleteFinalizer(deployContext *DeployContext, finalizer string) error
func DeleteImagePullerFinalizer ¶
func DeleteImagePullerFinalizer(ctx *DeployContext) (err error)
func DeleteIngressIfExists ¶
func DeleteIngressIfExists(name string, deployContext *DeployContext) error
DeleteIngressIfExists removes specified ingress if any
func DeleteNamespacedObject ¶
func DeleteRole ¶
func DeleteRole(name string, namespace string, client runtimeClient.Client) error
func DeleteRoleBinding ¶
func DeleteRoleBinding(name string, namespace string, client runtimeClient.Client) error
func DeleteRouteIfExists ¶
func DeleteRouteIfExists(name string, deployContext *DeployContext) error
func DeleteSecret ¶
DeleteSecret - delete secret by name and namespace
func GenerateProxyJavaOpts ¶
GenerateProxyJavaOpts converts given proxy configuration into Java format.
func GetAdditionalCACertsConfigMapVersion ¶
func GetAdditionalCACertsConfigMapVersion(deployContext *DeployContext) string
GetAdditionalCACertsConfigMapVersion returns revision of merged additional CA certs config map
func GetCheMultiUser ¶
func GetCheMultiUser(cr *orgv1.CheCluster) string
func GetClusterDeployment ¶
func GetClusterDeployment(name string, namespace string, client runtimeClient.Client) (*appsv1.Deployment, error)
func GetClusterIngress ¶
func GetClusterIngress(name string, namespace string, client runtimeClient.Client) (*v1beta1.Ingress, error)
GetClusterIngress returns actual ingress config by provided name and namespace
func GetClusterObject ¶
func GetClusterObject(deployContext *DeployContext, name string, actual metav1.Object) (bool, error)
Gets cluster scope object by name Returns true if object exists otherwise returns false
func GetClusterRoute ¶
func GetClusterRoute(name string, namespace string, client runtimeClient.Client) (*routev1.Route, error)
GetClusterRoute returns existing route.
func GetConfigMapSpec ¶
func GetEndpointTLSCrtBytes ¶
func GetEndpointTLSCrtBytes(deployContext *DeployContext, endpointURL string) (certificates []byte, err error)
GetEndpointTLSCrtBytes extracts certificate chain from given endpoint. Creates a test TLS route/ingress if endpoint url is empty. There's an easier way which is to read tls secret in default (3.11) or openshift-ingress (4.0) namespace which however requires extra privileges for operator service account
func GetEndpointTLSCrtChain ¶
func GetEndpointTLSCrtChain(deployContext *DeployContext, endpointURL string) ([]*x509.Certificate, error)
GetEndpointTLSCrtChain retrieves TLS certificates chain from given endpoint. If endpoint is not specified, then a test route/ingress will be created and used to get router certificates.
func GetExpectedKubernetesImagePuller ¶
func GetExpectedKubernetesImagePuller(ctx *DeployContext) *chev1alpha1.KubernetesImagePuller
func GetExpectedSubscription ¶
func GetExpectedSubscription(ctx *DeployContext, packageManifest *packagesv1.PackageManifest) *operatorsv1alpha1.Subscription
func GetFinalizerName ¶
func GetLabelsAndSelector ¶
func GetLegacyLabels ¶
func GetLegacyLabels(cheCluster *orgv1.CheCluster, component string) map[string]string
func GetNamespacedObject ¶
func GetNamespacedObject(deployContext *DeployContext, name string, actual metav1.Object) (bool, error)
Gets namespaced scope object by name Returns true if object exists otherwise returns false.
func GetPackageManifest ¶
func GetPackageManifest(ctx *DeployContext) (*packagesv1.PackageManifest, error)
Search for the kubernetes-imagepuller-operator PackageManifest
func GetSecrets ¶
func GetSecrets(deployContext *DeployContext, labels map[string]string, annotations map[string]string) ([]corev1.Secret, error)
Get all secrets by labels and annotations
func GetSingleHostExposureType ¶
func GetSingleHostExposureType(cr *orgv1.CheCluster) string
func GetSpecIngress ¶
func GetSpecIngress( deployContext *DeployContext, name string, host string, serviceName string, servicePort int, ingressCustomSettings orgv1.IngressCustomSettings, component string) (*v1beta1.Ingress, error)
GetSpecIngress returns expected ingress config for given parameters
func GetSpecRoute ¶
func GetSpecRoute( deployContext *DeployContext, name string, host string, serviceName string, servicePort int32, routeCustomSettings orgv1.RouteCustomSettings, component string) (*routev1.Route, error)
GetSpecRoute returns default configuration of a route in Che namespace.
func GetSpecSecret ¶
func GetSpecSecret(deployContext *DeployContext, name string, namespace string, data map[string][]byte) (*corev1.Secret, error)
GetSpecSecret return default secret config for given data
func GetSpecService ¶
func GetUniqueClusterRoleBindingName ¶
func GetUniqueClusterRoleBindingName(deployContext *DeployContext, serviceAccount string, clusterRole string) string
func HasImagePullerFinalizer ¶
func HasImagePullerFinalizer(instance *orgv1.CheCluster) bool
func InitDefaults ¶
func InitDefaults(defaultsPath string)
func InitDefaultsFromEnv ¶
func InitDefaultsFromEnv()
func InitDefaultsFromFile ¶
func InitDefaultsFromFile(defaultsPath string)
func IsSelfSignedCertificateUsed ¶
func IsSelfSignedCertificateUsed(deployContext *DeployContext) (bool, error)
IsSelfSignedCertificateUsed detects whether endpoints are/should be secured by self-signed certificate.
func K8sHandleCheTLSSecrets ¶
func K8sHandleCheTLSSecrets(deployContext *DeployContext) (reconcile.Result, error)
K8sHandleCheTLSSecrets handles TLS secrets required for Che deployment on Kubernetes infrastructure.
func MergeLabels ¶
func MergeNonProxy ¶
func MigratingToCRW2_0 ¶
func MigratingToCRW2_0(cr *orgv1.CheCluster) bool
func MountSecrets ¶
func MountSecrets(specDeployment *appsv1.Deployment, deployContext *DeployContext) 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 NewOAuthClient ¶
func ReconcileClusterRoleBindingFinalizer ¶
func ReconcileClusterRoleBindingFinalizer(deployContext *DeployContext, name string) error
func ReconcileConsoleLink ¶
func ReconcileConsoleLink(deployContext *DeployContext) (bool, error)
func ReconcileConsoleLinkFinalizer ¶
func ReconcileConsoleLinkFinalizer(deployContext *DeployContext) error
func ReconcileImagePuller ¶
func ReconcileImagePuller(ctx *DeployContext) (reconcile.Result, error)
Reconcile the imagePuller section of the CheCluster CR. If imagePuller.enable is set to true, install the Kubernetes Image Puller operator and create a KubernetesImagePuller CR. Add a finalizer to the CheCluster CR. If false, remove the KubernetesImagePuller CR, uninstall the operator, and remove the finalizer.
func ReconcileImagePullerFinalizer ¶
func ReconcileImagePullerFinalizer(ctx *DeployContext) (err error)
func ReconcileOAuthClientFinalizer ¶
func ReconcileOAuthClientFinalizer(deployContext *DeployContext) (err error)
func SubscriptionsAreEqual ¶
func SubscriptionsAreEqual(expected *operatorsv1alpha1.Subscription, actual *operatorsv1alpha1.Subscription) bool
Returns true if the expected and actual Subscription specs have the same fields during Image Puller installation
func Sync ¶
Sync syncs the blueprint to the cluster in a generic (as much as Go allows) manner. Returns true if object is up to date otherwiser returns false
func SyncAdditionalCACertsConfigMapToCluster ¶
func SyncAdditionalCACertsConfigMapToCluster(deployContext *DeployContext) (bool, error)
SyncAdditionalCACertsConfigMapToCluster makes sure that additional CA certs config map is up to date if any
func SyncAndAddFinalizer ¶
func SyncClusterRoleToCluster ¶
func SyncClusterRoleToCluster( deployContext *DeployContext, name string, policyRule []rbac.PolicyRule) (bool, error)
func SyncConfigMapSpecToCluster ¶
func SyncConfigMapSpecToCluster( deployContext *DeployContext, configMapSpec *corev1.ConfigMap) (bool, error)
func SyncDeploymentToCluster ¶
func SyncDeploymentToCluster( deployContext *DeployContext, specDeployment *appsv1.Deployment, clusterDeployment *appsv1.Deployment, additionalDeploymentDiffOpts cmp.Options, additionalDeploymentMerge func(*appsv1.Deployment, *appsv1.Deployment) *appsv1.Deployment) (bool, error)
func SyncExecRoleToCluster ¶
func SyncExecRoleToCluster(deployContext *DeployContext) (*rbac.Role, error)
func SyncIngressToCluster ¶
func SyncJobToCluster ¶
func SyncPVCToCluster ¶
func SyncRoleBindingToCluster ¶
func SyncRoleBindingToCluster( deployContext *DeployContext, name string, serviceAccountName string, roleName string, roleKind string) (*rbac.RoleBinding, error)
func SyncRoleToCluster ¶
func SyncRoleToCluster( deployContext *DeployContext, name string, policyRule []rbac.PolicyRule) (*rbac.Role, error)
func SyncRouteToCluster ¶
func SyncSecret ¶
func SyncSecret( deployContext *DeployContext, name string, namespace string, data map[string][]byte) (*corev1.Secret, error)
SyncSecret applies secret into cluster or external namespace
func SyncServiceAccountToCluster ¶
func SyncServiceAccountToCluster(deployContext *DeployContext, name string) (*corev1.ServiceAccount, error)
func SyncTLSRoleToCluster ¶
func SyncTLSRoleToCluster(deployContext *DeployContext) (*rbac.Role, error)
func SyncViewRoleToCluster ¶
func SyncViewRoleToCluster(deployContext *DeployContext) (*rbac.Role, error)
func UninstallImagePullerOperator ¶
func UninstallImagePullerOperator(ctx *DeployContext) (bool, error)
Unisntall the CSV, OperatorGroup, Subscription, KubernetesImagePuller, and update the CheCluster to remove the image puller spec. Returns true if the CheCluster was updated
func Update ¶
func Update(deployContext *DeployContext, actual runtime.Object, blueprint metav1.Object, diffOpts cmp.Option) (bool, error)
Updates object. Returns true if object is up to date otherwiser return false
func UpdateCheCRSpec ¶
func UpdateCheCRSpec(deployContext *DeployContext, updatedField string, value string) (err error)
func UpdateCheCRStatus ¶
func UpdateCheCRStatus(deployContext *DeployContext, updatedField string, value string) (err error)
func UpdateImagePullerSpecIfEmpty ¶
func UpdateImagePullerSpecIfEmpty(ctx *DeployContext) (orgv1.CheClusterSpecImagePuller, error)
Update the CheCluster ImagePuller spec if the default values are not set returns the updated spec and an error during update
Types ¶
type ClusterAPI ¶
type DeployContext ¶
type DeployContext struct { CheCluster *orgv1.CheCluster ClusterAPI ClusterAPI Proxy *Proxy InternalService InternalService DefaultCheHost string }
type InternalService ¶
type ProvisioningStatus ¶
type Proxy ¶
type Proxy struct { HttpProxy string HttpUser string HttpPassword string HttpHost string HttpPort string HttpsProxy string HttpsUser string HttpsPassword string HttpsHost string HttpsPort string NoProxy string TrustedCAMapName string }
func ReadCheClusterProxyConfiguration ¶
func ReadCheClusterProxyConfiguration(checluster *orgv1.CheCluster) (*Proxy, error)
type ServiceProvisioningStatus ¶
type ServiceProvisioningStatus struct {
ProvisioningStatus
}
func DoSyncServiceToCluster ¶
func DoSyncServiceToCluster(deployContext *DeployContext, specService *corev1.Service) ServiceProvisioningStatus
func SyncServiceToCluster ¶
func SyncServiceToCluster( deployContext *DeployContext, name string, portName []string, portNumber []int32, component string) ServiceProvisioningStatus
Source Files ¶
- checluster.go
- clusterrole.go
- clusterrolebinding.go
- configmap.go
- consolelink.go
- data_types.go
- defaults.go
- deployment.go
- finalizer.go
- ingress.go
- job.go
- kubernetes_image_puller.go
- labels.go
- oauthclient.go
- proxy.go
- pvc.go
- role.go
- rolebinding.go
- route.go
- secret.go
- service.go
- service_account.go
- sync.go
- tls.go