handler

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Copyright 2020 IBM Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	AppName            string = "management-ingress"
	ServiceName        string = "icp-management-ingress"
	ConfigName         string = "management-ingress-config"
	IAMTokenService    string = "iam-token-service"
	ServiceAccountName string = "management-ingress"
	CertName           string = "management-ingress-cert"
	TLSSecretName      string = "icp-management-ingress-tls-secret"
	ConsoleRouteName   string = "cp-console"
	RouteCert          string = "route-cert"
	RouteSecret        string = "route-tls-secret"
	// csPriorityClassName       string = "cs-priority-class"
	ConfigUpdateAnnotationKey string = "management-ingress.operator.k8s.io/config-updated"
	SCCName                   string = "management-ingress-scc"
	BindInfoConfigMap         string = "management-ingress-info"

	DefaultCAIssuerName string = "cs-ca-issuer"
	DefaultCAIssuerKind string = "Issuer"

	// name for namespace scope configmap
	NamespaceScopeConfigMap string = "namespace-scope"

	// Dependency from IAM service
	PlatformAuthConfigmap string = "platform-auth-idp"
	PlatformAuthSecret    string = "platform-oidc-credentials"

	// Product info required by metering
	ProductName   string = "IBM Cloud Platform Common Services"
	ProductID     string = "068a62892a1e4db39641342e592daa25"
	ProductMetric string = "FREE"

	// ClusterConfigName ... ibmcloud-cluster-info
	ClusterConfigName string = "ibmcloud-cluster-info"
	ClusterAddr       string = "cluster_address"
	ClusterCADomain   string = "cluster_ca_domain"
	RouteBaseDomain   string = "openshift_router_base_domain"
	ClusterEP         string = "cluster_endpoint"

	RouteHTTPPort      string = "cluster_router_http_port"
	RouteHTTPPortValue string = "80"
	RouteHTTPPortEnv   string = "ROUTE_HTTP_PORT"

	RouteHTTPSPort      string = "cluster_router_https_port"
	RouteHTTPSPortValue string = "443"
	RouteHTTPSPortEnv   string = "ROUTE_HTTPS_PORT"

	ClusterName      string = "cluster_name"
	ClusterNameValue string = "mycluster"
	ClusterNameEnv   string = "CLUSTER_NAME"

	CSVersion      string = "version"
	CSVersionValue string = "3.8.0"
	CSVersionEnv   string = "VERSION"

	PODNAMESPACE string = "POD_NAMESPACE"

	ClusterSecretName string = "ibmcloud-cluster-ca-cert"

	ClusterAPIServerHost string = "cluster_kube_apiserver_host"
	ClusterAPIServerPort string = "cluster_kube_apiserver_port"
	ConsoleCfg           string = "console-config"
	ConsoleNS            string = "openshift-console"
	ConsoleCfgYaml       string = "console-config.yaml"
	ConsoleClusterInfo   string = "clusterInfo"
	ConsoleMasterURL     string = "masterPublicURL"
	ProxyAddress         string = "proxy_address"
	ProxyHTTPPort        string = "proxy_ingress_http_port"
	ProxyHTTPSPort       string = "proxy_ingress_https_port"
	ProxyRouteName       string = "cp-proxy"
	ProxyServiceName     string = "nginx-ingress-controller"
)

Variables

View Source
var (
	ConfigMapSchemeGroupVersion = schema.GroupVersion{Group: "", Version: "v1"}
	OperatorSchemeGroupVersion  = schema.GroupVersion{Group: "operator.openshift.io", Version: "v1"}
)

Functions

func GetCommonAnnotations

func GetCommonAnnotations() map[string]string

func GetCommonLabels

func GetCommonLabels() map[string]string

func NewCertificate

func NewCertificate(name, namespace, secret string, hosts, ips []string, issuer *operatorv1alpha1.CertIssuer) *certmanager.Certificate

NewCertificate stubs an instance of Certificate

func NewClusterRoleBinding

func NewClusterRoleBinding(bindingName, roleName string, subjects []rbac.Subject) *rbac.ClusterRoleBinding

NewClusterRoleBinding stubs a cluster role binding

func NewConfigMap

func NewConfigMap(name string, namespace string, data map[string]string) *core.ConfigMap

NewConfigMap stubs an instance of Configmap

func NewDeployment

func NewDeployment(name string, namespace string, replicas int32, podSpec core.PodSpec) *apps.Deployment

NewDeployment stubs an instance of a deployment

func NewPolicyRule

func NewPolicyRule(apiGroups, resources, resourceNames, verbs []string) rbac.PolicyRule

NewPolicyRule stubs policy rule

func NewPolicyRules

func NewPolicyRules(rules ...rbac.PolicyRule) []rbac.PolicyRule

NewPolicyRules stubs policy rules

func NewRole

func NewRole(roleName, namespace string, rules []rbac.PolicyRule) *rbac.Role

NewRole stubs a role

func NewRoleBinding

func NewRoleBinding(bindingName, namespace, roleName string, subjects []rbac.Subject) *rbac.RoleBinding

NewRoleBinding stubs a role binding

func NewRoute

func NewRoute(name, namespace, serviceName, routeHost string, cert, key, caCert, destinationCAcert []byte) *route.Route

NewRoute stubs an instance of a Route

func NewSecret

func NewSecret(name, namespace string, caCert []byte) *core.Secret

func NewSecurityContextConstraint

func NewSecurityContextConstraint(serviceaccount, name, namespace string) *scc.SecurityContextConstraints

NewSecurityContextConstraint stubs an instance of a SecurityContextConstraint

func NewService

func NewService(name string, namespace string, servicePorts []core.ServicePort) *core.Service

NewService stubs an instance of a Service

func NewServiceAccount

func NewServiceAccount(name string, namespace string) *core.ServiceAccount

func NewSubject

func NewSubject(kind, name string) rbac.Subject

NewSubject stubs a new subect

func NewSubjects

func NewSubjects(subjects ...rbac.Subject) []rbac.Subject

NewSubjects stubs subjects

func Reconcile

func Reconcile(ingressRequest *IngressRequest) (err error)

func WaitForTimeout

func WaitForTimeout(timeout time.Duration) <-chan struct{}

waitForTimeout returns a stop channel that closes when the specified timeout is reached

Types

type IngressRequest

type IngressRequest struct {
	// contains filtered or unexported fields
}

func (*IngressRequest) Create

func (ingressRequest *IngressRequest) Create(object runtime.Object) (err error)

func (*IngressRequest) CreateClusterRole

func (ingressRequest *IngressRequest) CreateClusterRole(name string, rules []rbac.PolicyRule) (*rbac.ClusterRole, error)

CreateClusterRole creates a cluser role or returns error

func (*IngressRequest) CreateClusterRoleBinding

func (ingressRequest *IngressRequest) CreateClusterRoleBinding(binding *rbac.ClusterRoleBinding) error

func (*IngressRequest) CreateOrUpdateCert

func (ingressRequest *IngressRequest) CreateOrUpdateCert(cert *certmanager.Certificate) error

func (*IngressRequest) CreateOrUpdateCertificates

func (ingressRequest *IngressRequest) CreateOrUpdateCertificates() error

func (*IngressRequest) CreateOrUpdateConfigMap

func (ingressRequest *IngressRequest) CreateOrUpdateConfigMap() error

func (*IngressRequest) CreateOrUpdateDeployment

func (ingressRequest *IngressRequest) CreateOrUpdateDeployment() error

func (*IngressRequest) CreateOrUpdateRoute

func (ingressRequest *IngressRequest) CreateOrUpdateRoute() error

func (*IngressRequest) CreateOrUpdateService

func (ingressRequest *IngressRequest) CreateOrUpdateService() error

func (*IngressRequest) CreateSecurityContextConstraint

func (ingressRequest *IngressRequest) CreateSecurityContextConstraint() error

func (*IngressRequest) CreateServiceAccount

func (ingressRequest *IngressRequest) CreateServiceAccount() error

func (*IngressRequest) Delete

func (ingressRequest *IngressRequest) Delete(object runtime.Object) (err error)

func (*IngressRequest) Get

func (ingressRequest *IngressRequest) Get(objectName, objectNamespace string, object runtime.Object) error

func (*IngressRequest) GetConfigmap

func (ingressRequest *IngressRequest) GetConfigmap(name, namespace string) (*core.ConfigMap, error)

func (*IngressRequest) GetDeploymentList

func (ingressRequest *IngressRequest) GetDeploymentList(selector map[string]string) (*apps.DeploymentList, error)

GetDeploymentList lists DS in namespace with given selector

func (*IngressRequest) GetDeploymentPods

func (ingressRequest *IngressRequest) GetDeploymentPods(selector map[string]string) (*core.PodList, error)

func (*IngressRequest) GetProxyRouteHost added in v1.4.4

func (ingressRequest *IngressRequest) GetProxyRouteHost() (string, error)

Get the host for the cp-proxy route

func (*IngressRequest) GetRouteAppDomain

func (ingressRequest *IngressRequest) GetRouteAppDomain() (string, error)

GetRouteAppDomain ... auto detect route application domain of OCP cluster.

func (*IngressRequest) GetRouteURL

func (ingressRequest *IngressRequest) GetRouteURL(name string) (string, error)

GetRouteURL retrieves the route URL from a given route and namespace

func (*IngressRequest) List

func (ingressRequest *IngressRequest) List(selector map[string]string, object runtime.Object) error

func (*IngressRequest) Patch

func (ingressRequest *IngressRequest) Patch(object runtime.Object, mergePatch []byte) (err error)

Patch the runtime Object or return error

func (*IngressRequest) RemoveClusterRole

func (ingressRequest *IngressRequest) RemoveClusterRole(name string) error

RemoveClusterRole removes a cluster role binding

func (*IngressRequest) RemoveClusterRoleBinding

func (ingressRequest *IngressRequest) RemoveClusterRoleBinding(name string) error

RemoveClusterRoleBinding removes a cluster role binding

func (*IngressRequest) RemoveSecurityContextConstraint

func (ingressRequest *IngressRequest) RemoveSecurityContextConstraint(name string) error

RemoveSecurityContextConstraint with given name

func (*IngressRequest) Update

func (ingressRequest *IngressRequest) Update(object runtime.Object) (err error)

Update the runtime Object or return error

func (*IngressRequest) UpdateStatus

func (ingressRequest *IngressRequest) UpdateStatus(object runtime.Object) (err error)

Update the runtime Object status or return error

Jump to

Keyboard shortcuts

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