Documentation
¶
Index ¶
- Constants
- func AppendIfNotSubstring(a, s string) string
- func BuildServiceBindingSecretName(name, namespace string) string
- func ContainsString(slice []string, s string) bool
- func CustomizeAffinity(affinity *corev1.Affinity, ba common.BaseComponent)
- func CustomizeConsumedServices(podSpec *corev1.PodSpec, ba common.BaseComponent)
- func CustomizeDeployment(deploy *appsv1.Deployment, ba common.BaseComponent)
- func CustomizeHPA(hpa *autoscalingv1.HorizontalPodAutoscaler, ba common.BaseComponent)
- func CustomizeIngress(ing *networkingv1beta1.Ingress, ba common.BaseComponent)
- func CustomizeKnativeService(ksvc *servingv1alpha1.Service, ba common.BaseComponent)
- func CustomizePersistence(statefulSet *appsv1.StatefulSet, ba common.BaseComponent)
- func CustomizePodSpec(pts *corev1.PodTemplateSpec, ba common.BaseComponent)
- func CustomizeRoute(route *routev1.Route, ba common.BaseComponent, key string, crt string, ...)
- func CustomizeService(svc *corev1.Service, ba common.BaseComponent)
- func CustomizeServiceAccount(sa *corev1.ServiceAccount, ba common.BaseComponent)
- func CustomizeServiceBinding(secret *corev1.Secret, podSpec *corev1.PodSpec, ba common.BaseComponent)
- func CustomizeServiceBindingSecret(secret *corev1.Secret, auth map[string]string, ba common.BaseComponent)
- func CustomizeServiceMonitor(sm *prometheusv1.ServiceMonitor, ba common.BaseComponent)
- func CustomizeStatefulSet(statefulSet *appsv1.StatefulSet, ba common.BaseComponent)
- func EnsureOwnerRef(metadata metav1.Object, newOwnerRef metav1.OwnerReference) bool
- func ErrorIsNoMatchesForKind(err error, kind string, version string) bool
- func GetAppContainer(containerList []corev1.Container) *corev1.Container
- func GetCondition(conditionType appstacksv1beta1.StatusConditionType, ...) *appstacksv1beta1.StatusCondition
- func GetConnectToAnnotation(ba common.BaseComponent) map[string]string
- func GetOpenShiftAnnotations(ba common.BaseComponent) map[string]string
- func GetWatchNamespaces() ([]string, error)
- func IsClusterWide(watchNamespaces []string) bool
- func MergeMaps(maps ...map[string]string) map[string]string
- func SetCondition(condition appstacksv1beta1.StatusCondition, ...)
- func UpdateAppDefinition(labels map[string]string, annotations map[string]string, ...)
- func Validate(ba common.BaseComponent) (bool, error)
- type EnqueueRequestsForServiceBinding
- func (e *EnqueueRequestsForServiceBinding) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestsForServiceBinding) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestsForServiceBinding) Update(evt event.UpdateEvent, q workqueue.RateLimitingInterface)
- type ReconcilerBase
- func (r *ReconcilerBase) AsOwner(rObj runtime.Object, controller bool) (metav1.OwnerReference, error)
- func (r *ReconcilerBase) CreateOrUpdate(obj metav1.Object, owner metav1.Object, reconcile func() error) error
- func (r *ReconcilerBase) DeleteResource(obj runtime.Object) error
- func (r *ReconcilerBase) DeleteResources(resources []runtime.Object) error
- func (r *ReconcilerBase) GetClient() client.Client
- func (r *ReconcilerBase) GetController() controller.Controller
- func (r *ReconcilerBase) GetDiscoveryClient() (discovery.DiscoveryInterface, error)
- func (r *ReconcilerBase) GetOpConfigMap(name string, ns string) (*corev1.ConfigMap, error)
- func (r *ReconcilerBase) GetRecorder() record.EventRecorder
- func (r *ReconcilerBase) GetResolvedBindingSecret(ba common.BaseComponent) (*corev1.Secret, error)
- func (r *ReconcilerBase) GetRouteTLSValues(ba common.BaseComponent) (key string, cert string, ca string, destCa string, err error)
- func (r *ReconcilerBase) GetSelectorLabelsFromApplications(ba common.BaseComponent) (map[string]string, error)
- func (r *ReconcilerBase) GetServiceBindingCreds(ba common.BaseComponent) (map[string]string, error)
- func (r *ReconcilerBase) IsApplicationSupported() bool
- func (r *ReconcilerBase) IsGroupVersionSupported(groupVersion string, kind string) (bool, error)
- func (r *ReconcilerBase) IsOpenShift() bool
- func (r *ReconcilerBase) IsServiceBindingSupported() bool
- func (r *ReconcilerBase) ManageError(issue error, conditionType common.StatusConditionType, ba common.BaseComponent) (reconcile.Result, error)
- func (r *ReconcilerBase) ManageSuccess(conditionType common.StatusConditionType, ba common.BaseComponent) (reconcile.Result, error)
- func (r *ReconcilerBase) ReconcileBindings(ba common.BaseComponent) (reconcile.Result, error)
- func (r *ReconcilerBase) ReconcileCertificate(ba common.BaseComponent) (reconcile.Result, error)
- func (r *ReconcilerBase) ReconcileConsumes(ba common.BaseComponent) (reconcile.Result, error)
- func (r *ReconcilerBase) ReconcileProvides(ba common.BaseComponent) (_ reconcile.Result, err error)
- func (r *ReconcilerBase) SetController(c controller.Controller)
- func (r *ReconcilerBase) SetDiscoveryClient(discovery discovery.DiscoveryInterface)
- func (r *ReconcilerBase) SyncSecretAcrossNamespace(fromSecret *corev1.Secret, namespace string) error
- func (r *ReconcilerBase) UpdateStatus(obj runtime.Object) error
Constants ¶
const ( APIVersion = "apiVersion" Kind = "kind" Metadata = "metadata" Spec = "spec" ExposeBindingOverrideSecretSuffix = "-expose-binding-override" ExposeBindingSecretSuffix = "-expose-binding" )
String constants
Variables ¶
This section is empty.
Functions ¶
func AppendIfNotSubstring ¶
AppendIfNotSubstring appends `a` to comma-separated list of strings in `s`
func BuildServiceBindingSecretName ¶
BuildServiceBindingSecretName returns secret name of a consumable service
func ContainsString ¶
ContainsString returns true if `s` is in the slice. Otherwise, returns false
func CustomizeAffinity ¶
func CustomizeAffinity(affinity *corev1.Affinity, ba common.BaseComponent)
CustomizeAffinity ...
func CustomizeConsumedServices ¶
func CustomizeConsumedServices(podSpec *corev1.PodSpec, ba common.BaseComponent)
CustomizeConsumedServices ...
func CustomizeDeployment ¶
func CustomizeDeployment(deploy *appsv1.Deployment, ba common.BaseComponent)
CustomizeDeployment ...
func CustomizeHPA ¶
func CustomizeHPA(hpa *autoscalingv1.HorizontalPodAutoscaler, ba common.BaseComponent)
CustomizeHPA ...
func CustomizeIngress ¶ added in v0.5.0
func CustomizeIngress(ing *networkingv1beta1.Ingress, ba common.BaseComponent)
CustomizeIngress customizes ingress resource
func CustomizeKnativeService ¶
func CustomizeKnativeService(ksvc *servingv1alpha1.Service, ba common.BaseComponent)
CustomizeKnativeService ...
func CustomizePersistence ¶
func CustomizePersistence(statefulSet *appsv1.StatefulSet, ba common.BaseComponent)
CustomizePersistence ...
func CustomizePodSpec ¶
func CustomizePodSpec(pts *corev1.PodTemplateSpec, ba common.BaseComponent)
CustomizePodSpec ...
func CustomizeRoute ¶
func CustomizeRoute(route *routev1.Route, ba common.BaseComponent, key string, crt string, ca string, destCACert string)
CustomizeRoute ...
func CustomizeService ¶
func CustomizeService(svc *corev1.Service, ba common.BaseComponent)
CustomizeService ...
func CustomizeServiceAccount ¶
func CustomizeServiceAccount(sa *corev1.ServiceAccount, ba common.BaseComponent)
CustomizeServiceAccount ...
func CustomizeServiceBinding ¶ added in v0.5.0
func CustomizeServiceBinding(secret *corev1.Secret, podSpec *corev1.PodSpec, ba common.BaseComponent)
CustomizeServiceBinding ...
func CustomizeServiceBindingSecret ¶ added in v0.4.1
func CustomizeServiceBindingSecret(secret *corev1.Secret, auth map[string]string, ba common.BaseComponent)
CustomizeServiceBindingSecret ...
func CustomizeServiceMonitor ¶
func CustomizeServiceMonitor(sm *prometheusv1.ServiceMonitor, ba common.BaseComponent)
CustomizeServiceMonitor ...
func CustomizeStatefulSet ¶
func CustomizeStatefulSet(statefulSet *appsv1.StatefulSet, ba common.BaseComponent)
CustomizeStatefulSet ...
func EnsureOwnerRef ¶
func EnsureOwnerRef(metadata metav1.Object, newOwnerRef metav1.OwnerReference) bool
EnsureOwnerRef adds the ownerref if needed. Removes ownerrefs with conflicting UIDs. Returns true if the input is mutated. Copied from "https://github.com/openshift/library-go/blob/release-4.5/pkg/controller/ownerref.go"
func ErrorIsNoMatchesForKind ¶
ErrorIsNoMatchesForKind ...
func GetAppContainer ¶
GetAppContainer returns the container that is running the app
func GetCondition ¶
func GetCondition(conditionType appstacksv1beta1.StatusConditionType, status *appstacksv1beta1.RuntimeComponentStatus) *appstacksv1beta1.StatusCondition
GetCondition ...
func GetConnectToAnnotation ¶
func GetConnectToAnnotation(ba common.BaseComponent) map[string]string
GetConnectToAnnotation returns a map containing a key-value annotatio. The key is `app.openshift.io/connects-to`. The value is a comma-seperated list of applications `ba` is connectiong to based on `spec.service.consumes`.
func GetOpenShiftAnnotations ¶ added in v0.4.1
func GetOpenShiftAnnotations(ba common.BaseComponent) map[string]string
GetOpenShiftAnnotations returns OpenShift specific annotations
func GetWatchNamespaces ¶
GetWatchNamespaces returns a slice of namespaces the operator should watch based on WATCH_NAMESPSCE value WATCH_NAMESPSCE value could be empty for watching the whole cluster or a comma-separated list of namespaces
func IsClusterWide ¶
IsClusterWide returns true if watchNamespaces is set to [""]
func MergeMaps ¶
MergeMaps returns a map containing the union of al the key-value pairs from the input maps. The order of the maps passed into the func, defines the importance. e.g. if (keyA, value1) is in map1, and (keyA, value2) is in map2, mergeMaps(map1, map2) would contain (keyA, value2). If the input map is nil, it is treated as empty map.
func SetCondition ¶
func SetCondition(condition appstacksv1beta1.StatusCondition, status *appstacksv1beta1.RuntimeComponentStatus)
SetCondition ...
func UpdateAppDefinition ¶
func UpdateAppDefinition(labels map[string]string, annotations map[string]string, ba common.BaseComponent)
UpdateAppDefinition adds or removes kAppNav auto-create related annotations/labels
Types ¶
type EnqueueRequestsForServiceBinding ¶
type EnqueueRequestsForServiceBinding struct {
handler.Funcs
WatchNamespaces []string
GroupName string
Client client.Client
}
EnqueueRequestsForServiceBinding enqueues reconcile Requests for applications affected by the secrets that EventHandler is called for
func (*EnqueueRequestsForServiceBinding) Delete ¶
func (e *EnqueueRequestsForServiceBinding) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete implements EventHandler
func (*EnqueueRequestsForServiceBinding) Generic ¶
func (e *EnqueueRequestsForServiceBinding) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface)
Generic implements EventHandler
func (*EnqueueRequestsForServiceBinding) Update ¶
func (e *EnqueueRequestsForServiceBinding) Update(evt event.UpdateEvent, q workqueue.RateLimitingInterface)
Update implements EventHandler
type ReconcilerBase ¶
type ReconcilerBase struct {
// contains filtered or unexported fields
}
ReconcilerBase base reconciler with some common behaviour
func NewReconcilerBase ¶
func NewReconcilerBase(client client.Client, scheme *runtime.Scheme, restConfig *rest.Config, recorder record.EventRecorder) ReconcilerBase
NewReconcilerBase creates a new ReconcilerBase
func (*ReconcilerBase) AsOwner ¶
func (r *ReconcilerBase) AsOwner(rObj runtime.Object, controller bool) (metav1.OwnerReference, error)
AsOwner returns an owner reference object based on the input object. Also can set controller field on the owner ref.
func (*ReconcilerBase) CreateOrUpdate ¶
func (r *ReconcilerBase) CreateOrUpdate(obj metav1.Object, owner metav1.Object, reconcile func() error) error
CreateOrUpdate ...
func (*ReconcilerBase) DeleteResource ¶
func (r *ReconcilerBase) DeleteResource(obj runtime.Object) error
DeleteResource deletes kubernetes resource
func (*ReconcilerBase) DeleteResources ¶
func (r *ReconcilerBase) DeleteResources(resources []runtime.Object) error
DeleteResources ...
func (*ReconcilerBase) GetClient ¶
func (r *ReconcilerBase) GetClient() client.Client
GetClient returns client
func (*ReconcilerBase) GetController ¶ added in v0.6.0
func (r *ReconcilerBase) GetController() controller.Controller
GetController returns controller
func (*ReconcilerBase) GetDiscoveryClient ¶
func (r *ReconcilerBase) GetDiscoveryClient() (discovery.DiscoveryInterface, error)
GetDiscoveryClient ...
func (*ReconcilerBase) GetOpConfigMap ¶
GetOpConfigMap ...
func (*ReconcilerBase) GetRecorder ¶
func (r *ReconcilerBase) GetRecorder() record.EventRecorder
GetRecorder returns the underlying recorder
func (*ReconcilerBase) GetResolvedBindingSecret ¶ added in v0.5.0
func (r *ReconcilerBase) GetResolvedBindingSecret(ba common.BaseComponent) (*corev1.Secret, error)
GetResolvedBindingSecret returns the secret referenced in .status.resolvedBindings
func (*ReconcilerBase) GetRouteTLSValues ¶
func (r *ReconcilerBase) GetRouteTLSValues(ba common.BaseComponent) (key string, cert string, ca string, destCa string, err error)
GetRouteTLSValues returns certificate an key values to be used in the route
func (*ReconcilerBase) GetSelectorLabelsFromApplications ¶
func (r *ReconcilerBase) GetSelectorLabelsFromApplications(ba common.BaseComponent) (map[string]string, error)
GetSelectorLabelsFromApplications finds application CRs with the specified name in the BaseComponent's namespace and returns labels in `selector.matchLabels`. If it fails to find in the current namespace, it looks up in the whole cluster and aggregates all labels in `selector.matchLabels`.
func (*ReconcilerBase) GetServiceBindingCreds ¶
func (r *ReconcilerBase) GetServiceBindingCreds(ba common.BaseComponent) (map[string]string, error)
GetServiceBindingCreds returns a map containing username/password string values based on 'cr.spec.service.provides.auth'
func (*ReconcilerBase) IsApplicationSupported ¶
func (r *ReconcilerBase) IsApplicationSupported() bool
IsApplicationSupported checks if Application
func (*ReconcilerBase) IsGroupVersionSupported ¶
func (r *ReconcilerBase) IsGroupVersionSupported(groupVersion string, kind string) (bool, error)
IsGroupVersionSupported ...
func (*ReconcilerBase) IsOpenShift ¶
func (r *ReconcilerBase) IsOpenShift() bool
IsOpenShift returns true if the operator is running on an OpenShift platform
func (*ReconcilerBase) IsServiceBindingSupported ¶ added in v0.6.0
func (r *ReconcilerBase) IsServiceBindingSupported() bool
IsServiceBindingSupported returns true if at least one GVK in the operator ConfigMap's serviceBinding.groupVersionKinds is installed
func (*ReconcilerBase) ManageError ¶
func (r *ReconcilerBase) ManageError(issue error, conditionType common.StatusConditionType, ba common.BaseComponent) (reconcile.Result, error)
ManageError ...
func (*ReconcilerBase) ManageSuccess ¶
func (r *ReconcilerBase) ManageSuccess(conditionType common.StatusConditionType, ba common.BaseComponent) (reconcile.Result, error)
ManageSuccess ...
func (*ReconcilerBase) ReconcileBindings ¶ added in v0.5.0
func (r *ReconcilerBase) ReconcileBindings(ba common.BaseComponent) (reconcile.Result, error)
ReconcileBindings goes through the reconcile logic for service binding
func (*ReconcilerBase) ReconcileCertificate ¶
func (r *ReconcilerBase) ReconcileCertificate(ba common.BaseComponent) (reconcile.Result, error)
ReconcileCertificate used to manage cert-manager integration
func (*ReconcilerBase) ReconcileConsumes ¶
func (r *ReconcilerBase) ReconcileConsumes(ba common.BaseComponent) (reconcile.Result, error)
ReconcileConsumes ...
func (*ReconcilerBase) ReconcileProvides ¶
func (r *ReconcilerBase) ReconcileProvides(ba common.BaseComponent) (_ reconcile.Result, err error)
ReconcileProvides ...
func (*ReconcilerBase) SetController ¶ added in v0.6.0
func (r *ReconcilerBase) SetController(c controller.Controller)
SetController sets controller
func (*ReconcilerBase) SetDiscoveryClient ¶
func (r *ReconcilerBase) SetDiscoveryClient(discovery discovery.DiscoveryInterface)
SetDiscoveryClient ...
func (*ReconcilerBase) SyncSecretAcrossNamespace ¶
func (r *ReconcilerBase) SyncSecretAcrossNamespace(fromSecret *corev1.Secret, namespace string) error
SyncSecretAcrossNamespace syncs up the secret data across a namespace
func (*ReconcilerBase) UpdateStatus ¶
func (r *ReconcilerBase) UpdateStatus(obj runtime.Object) error
UpdateStatus updates the fields corresponding to the status subresource for the object