Documentation ¶
Index ¶
- Constants
- func CallerName() string
- func CreateControllerDeploymentContainers(existingContainers []corev1.Container, instance *kappnavv1.Kappnav) []corev1.Container
- func CreateUIDeploymentContainers(existingContainers []corev1.Container, instance *kappnavv1.Kappnav) []corev1.Container
- func CreateUIVolumes(instance *kappnavv1.Kappnav) []corev1.Volume
- func CustomizeApplication(app *appv1beta1.Application, instance *kappnavv1.Kappnav, ...)
- func CustomizeBuiltinConfigMap(logger Logger, builtinConfig *corev1.ConfigMap, r *ReconcilerBase, ...)
- func CustomizeClusterRoleBinding(crb *rbacv1.ClusterRoleBinding, sa *corev1.ServiceAccount, ...)
- func CustomizeConfigMap(configMap *corev1.ConfigMap, instance *kappnavv1.Kappnav, mapType string)
- func CustomizeDeployment(deploy *appsv1.Deployment, instance *kappnavv1.Kappnav)
- func CustomizeIngress(ingress *extensionsv1beta1.Ingress, instance *kappnavv1.Kappnav)
- func CustomizeKAM(kam *kamv1.KindActionMapping, default_kam *kamv1.KindActionMapping, ...)
- func CustomizeKappnavConfigMap(kappnavConfig *corev1.ConfigMap, kappnavURL string, ...)
- func CustomizePodSpec(pts *corev1.PodTemplateSpec, parentComponent *metav1.ObjectMeta, ...)
- func CustomizeRoute(route *routev1.Route, instance *kappnavv1.Kappnav)
- func CustomizeSecret(secret *corev1.Secret, instance *kappnavv1.Kappnav)
- func CustomizeService(service *corev1.Service, instance *kappnavv1.Kappnav, ...)
- func CustomizeServiceAccount(logger Logger, sa *corev1.ServiceAccount, uiService *metav1.ObjectMeta, ...)
- func CustomizeUIIngressSpec(ingressSpec *extensionsv1beta1.IngressSpec, uiService *corev1.Service, ...)
- func CustomizeUIRouteSpec(routeSpec *routev1.RouteSpec, routeName *metav1.ObjectMeta, ...)
- func CustomizeUIServiceSpec(serviceSpec *corev1.ServiceSpec, instance *kappnavv1.Kappnav)
- func ErrorWithStack(msg string) string
- func FormatTimestamp(t time.Time) float64
- func GetCondition(conditionType kappnavv1.StatusConditionType, status *kappnavv1.KappnavStatus) *kappnavv1.StatusCondition
- func GetLabels(instance *kappnavv1.Kappnav, existingLabels map[string]string, ...) map[string]string
- func IsMinikubeEnv(kubeEnv string) bool
- func IsOCP(kubeEnv string) bool
- func IsOpenShift(kubeEnv string) bool
- func RepositoryContains(r kappnavv1.Repository, substr string) bool
- func RepositoryHasPrefix(r kappnavv1.Repository, prefix string) bool
- func RepositoryHasSuffix(r kappnavv1.Repository, suffix string) bool
- func SetCondition(condition kappnavv1.StatusCondition, status *kappnavv1.KappnavStatus)
- func SetKAMDefaults(instance_kam *kamv1.KindActionMapping) error
- func SetKappnavDefaults(instance *kappnavv1.Kappnav) error
- func TagContains(t kappnavv1.Tag, substr string) bool
- func TagHasPrefix(t kappnavv1.Tag, prefix string) bool
- func TagHasSuffix(t kappnavv1.Tag, suffix string) bool
- type KappnavExtension
- type LogLevel
- type LogType
- type Logger
- type Message
- type OCPClusterInfo
- type OCPConsoleConfig
- type OKDClusterInfo
- type OKDConsoleConfig
- type ReconcilerBase
- func (r *ReconcilerBase) CreateOrUpdate(logger Logger, 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) GetDiscoveryClient() (discovery.DiscoveryInterface, error)
- func (r *ReconcilerBase) GetOperatorConfigMap(logger Logger, name string, ns string) (*corev1.ConfigMap, error)
- func (r *ReconcilerBase) GetRecorder() record.EventRecorder
- func (r *ReconcilerBase) GetScheme() *runtime.Scheme
- func (r *ReconcilerBase) IsGroupVersionSupported(groupVersion string) (bool, error)
- func (r *ReconcilerBase) ManageError(logger Logger, issue error, conditionType kappnavv1.StatusConditionType, ...) (reconcile.Result, error)
- func (r *ReconcilerBase) ManageSuccess(logger Logger, conditionType kappnavv1.StatusConditionType, ...) (reconcile.Result, error)
- func (r *ReconcilerBase) SetDiscoveryClient(discovery discovery.DiscoveryInterface)
Constants ¶
const ( // APIContainerName ... APIContainerName string = "kappnav-api" // UIContainerName ... UIContainerName string = "kappnav-ui" // ControllerContainerName ... ControllerContainerName string = "kappnav-controller" // OAuthProxyContainerName ... OAuthProxyContainerName string = "oauth-proxy" // OAuthProxyContainerConfigKey ... OAuthProxyContainerConfigKey string = "oauthProxy" // ServiceAccountNameSuffix ... ServiceAccountNameSuffix string = "sa" )
const ( // OAuthRedirectAnnotationName ... OAuthRedirectAnnotationName string = "serviceaccounts.openshift.io/oauth-redirectreference.primary" // OAuthVolumeName ... OAuthVolumeName string = "ui-service-tls" // OAuthVolumeMountPath ... OAuthVolumeMountPath string = "/etc/tls/private" )
Variables ¶
This section is empty.
Functions ¶
func CallerName ¶ added in v0.8.0
func CallerName() string
CallerName get the caller program file name, line number and function name in "fileName:line# funcName"
func CreateControllerDeploymentContainers ¶
func CreateControllerDeploymentContainers(existingContainers []corev1.Container, instance *kappnavv1.Kappnav) []corev1.Container
CreateControllerDeploymentContainers ...
func CreateUIDeploymentContainers ¶
func CreateUIDeploymentContainers(existingContainers []corev1.Container, instance *kappnavv1.Kappnav) []corev1.Container
CreateUIDeploymentContainers ...
func CreateUIVolumes ¶
CreateUIVolumes ...
func CustomizeApplication ¶ added in v0.8.0
func CustomizeApplication(app *appv1beta1.Application, instance *kappnavv1.Kappnav, annotations map[string]string)
CustomizeApplication ...
func CustomizeBuiltinConfigMap ¶
func CustomizeBuiltinConfigMap(logger Logger, builtinConfig *corev1.ConfigMap, r *ReconcilerBase, instance *kappnavv1.Kappnav)
CustomizeBuiltinConfigMap ...
func CustomizeClusterRoleBinding ¶
func CustomizeClusterRoleBinding(crb *rbacv1.ClusterRoleBinding, sa *corev1.ServiceAccount, instance *kappnavv1.Kappnav)
CustomizeClusterRoleBinding ...
func CustomizeConfigMap ¶
CustomizeConfigMap ...
func CustomizeDeployment ¶
func CustomizeDeployment(deploy *appsv1.Deployment, instance *kappnavv1.Kappnav)
CustomizeDeployment ...
func CustomizeIngress ¶
func CustomizeIngress(ingress *extensionsv1beta1.Ingress, instance *kappnavv1.Kappnav)
CustomizeIngress ...
func CustomizeKAM ¶ added in v0.8.0
func CustomizeKAM(kam *kamv1.KindActionMapping, default_kam *kamv1.KindActionMapping, instance *kappnavv1.Kappnav)
CustomizeKAM ...
func CustomizeKappnavConfigMap ¶
func CustomizeKappnavConfigMap(kappnavConfig *corev1.ConfigMap, kappnavURL string, instance *kappnavv1.Kappnav)
CustomizeKappnavConfigMap ...
func CustomizePodSpec ¶
func CustomizePodSpec(pts *corev1.PodTemplateSpec, parentComponent *metav1.ObjectMeta, containers []corev1.Container, volumes []corev1.Volume, instance *kappnavv1.Kappnav)
CustomizePodSpec ...
func CustomizeRoute ¶
CustomizeRoute ...
func CustomizeSecret ¶
CustomizeSecret ...
func CustomizeService ¶
func CustomizeService(service *corev1.Service, instance *kappnavv1.Kappnav, annotations map[string]string)
CustomizeService ...
func CustomizeServiceAccount ¶
func CustomizeServiceAccount(logger Logger, sa *corev1.ServiceAccount, uiService *metav1.ObjectMeta, instance *kappnavv1.Kappnav)
CustomizeServiceAccount ...
func CustomizeUIIngressSpec ¶
func CustomizeUIIngressSpec(ingressSpec *extensionsv1beta1.IngressSpec, uiService *corev1.Service, instance *kappnavv1.Kappnav)
CustomizeUIIngressSpec ...
func CustomizeUIRouteSpec ¶
func CustomizeUIRouteSpec(routeSpec *routev1.RouteSpec, routeName *metav1.ObjectMeta, instance *kappnavv1.Kappnav)
CustomizeUIRouteSpec ...
func CustomizeUIServiceSpec ¶
func CustomizeUIServiceSpec(serviceSpec *corev1.ServiceSpec, instance *kappnavv1.Kappnav)
CustomizeUIServiceSpec ...
func ErrorWithStack ¶ added in v0.8.0
ErrorWithStack print stack trace for error message
func FormatTimestamp ¶ added in v0.8.0
FormatTimeStamp format with unix seconds in float
func GetCondition ¶
func GetCondition(conditionType kappnavv1.StatusConditionType, status *kappnavv1.KappnavStatus) *kappnavv1.StatusCondition
GetCondition ...
func GetLabels ¶
func GetLabels(instance *kappnavv1.Kappnav, existingLabels map[string]string, component *metav1.ObjectMeta, mapType string) map[string]string
GetLabels ...
func RepositoryContains ¶ added in v0.10.0
func RepositoryContains(r kappnavv1.Repository, substr string) bool
RepositoryContains ... For use in ConfigMap templates.
func RepositoryHasPrefix ¶ added in v0.10.0
func RepositoryHasPrefix(r kappnavv1.Repository, prefix string) bool
RepositoryHasPrefix ... For use in ConfigMap templates.
func RepositoryHasSuffix ¶ added in v0.10.0
func RepositoryHasSuffix(r kappnavv1.Repository, suffix string) bool
RepositoryHasSuffix ... For use in ConfigMap templates.
func SetCondition ¶
func SetCondition(condition kappnavv1.StatusCondition, status *kappnavv1.KappnavStatus)
SetCondition ...
func SetKAMDefaults ¶ added in v0.8.0
func SetKAMDefaults(instance_kam *kamv1.KindActionMapping) error
SetKAMDefaults sets default kam values on the CR instance
func SetKappnavDefaults ¶
SetKappnavDefaults sets default values on the CR instance
func TagContains ¶ added in v0.10.0
TagContains ... For use in ConfigMap templates.
func TagHasPrefix ¶ added in v0.10.0
TagHasPrefix ... For use in ConfigMap templates.
Types ¶
type KappnavExtension ¶
type KappnavExtension interface {
}KappnavExtension extends the reconciler to manage additional resources.
type LogLevel ¶ added in v0.8.0
type LogLevel int
LogLevel values of LogLevel. LogLevel is what user requests
const ( // LogLevelNone request no trace LogLevelNone LogLevel = 0 // LogLevelWarning request warning trace LogLevelWarning LogLevel = 1 // LogLevelError request error trace LogLevelError LogLevel = 2 // LogLevelInfo request info trace LogLevelInfo LogLevel = 3 // LogLevelDebug request debug trace LogLevelDebug LogLevel = 4 // LogLevelEntry request entry trace LogLevelEntry LogLevel = 5 // LogLevelAll request all traces LogLevelAll LogLevel = 6 )
type LogType ¶ added in v0.8.0
type LogType int
LogType values of LogType. LogType is how code categorizes log message
const ( // LogTypeEntry entry trace type LogTypeEntry LogType = 0 // LogTypeExit exit trace type LogTypeExit LogType = 1 // LogTypeInfo info trace type LogTypeInfo LogType = 2 // LogTypeWarning warning trace type LogTypeWarning LogType = 3 // LogTypeError error trace type LogTypeError LogType = 4 // LogTypeDebug debug trace type LogTypeDebug LogType = 5 )
type Logger ¶ added in v0.8.0
type Logger interface { SetLogLevel(logLevel LogLevel) Log(callerName string, logType LogType, logData string, loggerName string) IsEnabled(logType LogType) bool }
Logger interfaces
type Message ¶ added in v0.8.0
type Message struct { Level string `json:"level"` Timestamp float64 `json:"ts"` Logger string `json:"logger"` Caller string `json:"caller"` Msg string `json:"msg"` }
Message JSON structure
type OCPClusterInfo ¶
type OCPClusterInfo struct {
ConsoleBaseAddress string `yaml:"consoleBaseAddress,omitempty"`
}
OCPClusterInfo ...
type OCPConsoleConfig ¶
type OCPConsoleConfig struct {
ClusterInfo OCPClusterInfo `yaml:"clusterInfo,omitempty"`
}
OCPConsoleConfig ...
type OKDClusterInfo ¶
type OKDClusterInfo struct { ConsolePublicURL string `yaml:"consolePublicURL,omitempty"` AdminConsolePublicURL string `yaml:"adminConsolePublicURL,omitempty"` }
OKDClusterInfo ...
type OKDConsoleConfig ¶
type OKDConsoleConfig struct {
ClusterInfo OKDClusterInfo `yaml:"clusterInfo,omitempty"`
}
OKDConsoleConfig ...
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) CreateOrUpdate ¶
func (r *ReconcilerBase) CreateOrUpdate(logger Logger, 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) GetDiscoveryClient ¶
func (r *ReconcilerBase) GetDiscoveryClient() (discovery.DiscoveryInterface, error)
GetDiscoveryClient ...
func (*ReconcilerBase) GetOperatorConfigMap ¶
func (r *ReconcilerBase) GetOperatorConfigMap(logger Logger, name string, ns string) (*corev1.ConfigMap, error)
GetOperatorConfigMap ...
func (*ReconcilerBase) GetRecorder ¶
func (r *ReconcilerBase) GetRecorder() record.EventRecorder
GetRecorder returns the underlying recorder
func (*ReconcilerBase) GetScheme ¶
func (r *ReconcilerBase) GetScheme() *runtime.Scheme
GetScheme retuns scheme
func (*ReconcilerBase) IsGroupVersionSupported ¶
func (r *ReconcilerBase) IsGroupVersionSupported(groupVersion string) (bool, error)
IsGroupVersionSupported ...
func (*ReconcilerBase) ManageError ¶
func (r *ReconcilerBase) ManageError(logger Logger, issue error, conditionType kappnavv1.StatusConditionType, cr *kappnavv1.Kappnav) (reconcile.Result, error)
ManageError ...
func (*ReconcilerBase) ManageSuccess ¶
func (r *ReconcilerBase) ManageSuccess(logger Logger, conditionType kappnavv1.StatusConditionType, cr *kappnavv1.Kappnav) (reconcile.Result, error)
ManageSuccess ...
func (*ReconcilerBase) SetDiscoveryClient ¶
func (r *ReconcilerBase) SetDiscoveryClient(discovery discovery.DiscoveryInterface)
SetDiscoveryClient ...