Documentation ¶
Index ¶
- Constants
- Variables
- func AddFinalizer(ctx context.Context, obj runtime.Object, cl client.Client) error
- func BoolToConditionStatus(b bool) core.ConditionStatus
- func ConvertObjectToConfigMap(obj runtime.Object) (*core.ConfigMap, error)
- func ConvertObjectToDeployment(obj runtime.Object) (*appsv1.Deployment, error)
- func ConvertUserInfoExtra(extra map[string]authenticationv1.ExtraValue) map[string]authorizationv1.ExtraValue
- func DeleteAnnotation(resource metav1.Object, annotation string)
- func DeleteLabel(resource metav1.Object, label string)
- func GetAnnotation(resource metav1.Object, annotation string) (value string, ok bool)
- func GetLabel(resource metav1.Object, label string) (value string, ok bool)
- func GetMeshNamespaces(controlPlaneNamespace string, smmr *v1.ServiceMeshMemberRoll) sets.String
- func GetOperatorNamespace() string
- func HasAnnotation(resource metav1.Object, annotation string) bool
- func HasFinalizer(obj runtime.Object) bool
- func HasLabel(resource metav1.Object, label string) bool
- func IndexOf(l []string, s string) int
- func InjectCABundle(config *v1.WebhookClientConfig, caBundle []byte) bool
- func IsConflict(err error) bool
- func LogFromContext(ctx context.Context) logr.Logger
- func NameSet(list runtime.Object) sets.String
- func NewConflictHandlingReconciler(reconciler reconcile.Reconciler) reconcile.Reconciler
- func NewContext() context.Context
- func NewContextWithLog(ctx context.Context, logger logr.Logger) context.Context
- func NewContextWithLogValues(ctx context.Context, logKeysAndValues ...interface{}) context.Context
- func NewReconcileContext(logger logr.Logger) context.Context
- func NewViper() (*viper.Viper, error)
- func Reconciled() (reconcile.Result, error)
- func RemoveFinalizer(ctx context.Context, obj runtime.Object, cl client.Client) error
- func RequeueAfter(time time.Duration) (reconcile.Result, error)
- func RequeueWithError(err error) (reconcile.Result, error)
- func SetAnnotation(resource metav1.Object, annotation, value string)
- func SetLabel(resource metav1.Object, label, value string)
- func SetLabels(resource metav1.Object, labels map[string]string)
- func ToNamespacedName(obj metav1.Object) types.NamespacedName
- func UpdateField(helmValues *v1.HelmValues, path string, value interface{}) error
- type ContextValueKey
- type ControllerResources
- type DiscoveryClientProvider
- type EnhancedManager
- func (m EnhancedManager) Add(runnable manager.Runnable) error
- func (m EnhancedManager) AddHealthzCheck(name string, check healthz.Checker) error
- func (m EnhancedManager) AddMetricsExtraHandler(path string, handler http.Handler) error
- func (m EnhancedManager) AddReadyzCheck(name string, check healthz.Checker) error
- func (m EnhancedManager) Elected() <-chan struct{}
- func (m EnhancedManager) GetAPIReader() client.Reader
- func (m EnhancedManager) GetCache() cache.Cache
- func (m EnhancedManager) GetClient() client.Client
- func (m EnhancedManager) GetConfig() *rest.Config
- func (m EnhancedManager) GetDiscoveryClient() discovery.DiscoveryInterface
- func (m EnhancedManager) GetEventRecorderFor(name string) record.EventRecorder
- func (m EnhancedManager) GetFieldIndexer() client.FieldIndexer
- func (m EnhancedManager) GetLogger() logr.Logger
- func (m EnhancedManager) GetRESTMapper() meta.RESTMapper
- func (m EnhancedManager) GetScheme() *runtime.Scheme
- func (m EnhancedManager) GetWebhookServer() *webhook.Server
- func (m EnhancedManager) SetFields(fields interface{}) error
- func (m EnhancedManager) Start(ch <-chan struct{}) error
- type StatusPatch
Constants ¶
const ( // MetadataNamespace is the namespace for service mesh metadata (labels, annotations) MetadataNamespace = "maistra.io" // CreatedByKey is used in annotations to mark ServiceMeshMemberRolls created by the ServiceMeshMember controller CreatedByKey = MetadataNamespace + "/created-by" // OwnerKey represents the mesh (namespace) to which the resource relates OwnerKey = MetadataNamespace + "/owner" // OwnerNameKey represents the name of the SMCP to which the resource relates OwnerNameKey = MetadataNamespace + "/owner-name" // MemberOfKey represents the mesh (namespace) to which the resource relates MemberOfKey = MetadataNamespace + "/member-of" // IgnoreNamespaceKey indicates that sidecar injection should be disabled for the namespace IgnoreNamespaceKey = MetadataNamespace + "/ignore-namespace" // GenerationKey represents the generation to which the resource was last reconciled GenerationKey = MetadataNamespace + "/generation" // MeshGenerationKey represents the generation of the service mesh to which the resource was last reconciled. // This uniquely identifies an installation, incorporating the operator version and the smcp resource generation. MeshGenerationKey = MetadataNamespace + "/mesh-generation" // InternalKey is used to identify the resource as being internal to the mesh itself (i.e. should not be applied to members) InternalKey = MetadataNamespace + "/internal" // FinalizerName is the finalizer name the controllers add to any resources that need to be finalized during deletion FinalizerName = MetadataNamespace + "/istio-operator" // KubernetesAppNamespace is the common namespace for application information KubernetesAppNamespace = "app.kubernetes.io" KubernetesAppNameKey = KubernetesAppNamespace + "/name" KubernetesAppInstanceKey = KubernetesAppNamespace + "/instance" KubernetesAppVersionKey = KubernetesAppNamespace + "/version" KubernetesAppComponentKey = KubernetesAppNamespace + "/component" KubernetesAppPartOfKey = KubernetesAppNamespace + "/part-of" KubernetesAppManagedByKey = KubernetesAppNamespace + "/managed-by" // KubernetesAppPartOfValue is the KubernetesAppPartOfKey label value the operator sets on all objects it creates KubernetesAppPartOfValue = "istio" // KubernetesAppManagedByValue is the KubernetesAppManagedByKey label value the operator sets on all objects it creates KubernetesAppManagedByValue = "maistra-istio-operator" // MemberRollName is the only name we allow for ServiceMeshMemberRoll objects MemberRollName = "default" // MemberName is the only name we allow for ServiceMeshMember objects MemberName = "default" )
Variables ¶
var ( // IstioRootCertKey name of Secret entry Istio uses for the cert IstioRootCertKey = "root-cert.pem" // IstiodCertKey name of Secret entry Istiod uses for the cert IstiodCertKey = "ca-cert.pem" // IstiodTLSSecretCertKey name of Secret entry containing intermediate certificate for Istio provided by cert-manager IstiodTLSSecretCertKey = "tls.crt" // ServiceCABundleKey name of config map entry service-ca operator uses for the CA bundle ServiceCABundleKey = "service-ca.crt" )
var Config = &config{}
Config is the config used to drive the operator
Functions ¶
func AddFinalizer ¶
func BoolToConditionStatus ¶
func BoolToConditionStatus(b bool) core.ConditionStatus
func ConvertObjectToConfigMap ¶
ConvertObjectToConfigMap tries to convert an runtime.Object into a ConfigMap
func ConvertObjectToDeployment ¶
func ConvertObjectToDeployment(obj runtime.Object) (*appsv1.Deployment, error)
ConvertObjectToDeployment tries to convert an runtime.Object into a Deployment
func ConvertUserInfoExtra ¶
func ConvertUserInfoExtra(extra map[string]authenticationv1.ExtraValue) map[string]authorizationv1.ExtraValue
func DeleteAnnotation ¶
func DeleteLabel ¶
func GetAnnotation ¶
func GetMeshNamespaces ¶
func GetMeshNamespaces(controlPlaneNamespace string, smmr *v1.ServiceMeshMemberRoll) sets.String
GetMeshNamespaces returns all namespaces that are part of a mesh.
func GetOperatorNamespace ¶
func GetOperatorNamespace() string
GetOperatorNamespace initializes and caches this operator's namespace; panics on error
func HasFinalizer ¶
func InjectCABundle ¶
func InjectCABundle(config *v1.WebhookClientConfig, caBundle []byte) bool
InjectCABundle updates the CABundle in a WebhookClientConfig. It returns true if the value has changed, false otherwise
func IsConflict ¶
func LogFromContext ¶
LogFromContext returns the Logger bound to the context or panics if none exists
func NewConflictHandlingReconciler ¶
func NewConflictHandlingReconciler(reconciler reconcile.Reconciler) reconcile.Reconciler
func NewContext ¶
NewContext creates a new context without an associated Logger
func NewContextWithLog ¶
NewContextWithLog returns a copy of the parent context and associates it with a Logger.
func NewContextWithLogValues ¶
NewContextWithLogValues returns a copy of the parent context and adds the given keys and values to its logger
func NewReconcileContext ¶
NewReconcileContext creates a new context and associates it with a Logger.
func NewViper ¶
NewViper returns a new viper.Viper configured with all the common.Config keys Note, environment variables cannot be used to override command line defaults.
func Reconciled ¶
func RemoveFinalizer ¶
func SetAnnotation ¶
func ToNamespacedName ¶
func ToNamespacedName(obj metav1.Object) types.NamespacedName
func UpdateField ¶
func UpdateField(helmValues *v1.HelmValues, path string, value interface{}) error
UpdateField updates a nested field at the specified path, e.g. UpdateField(smcp.Spec.Istio, "global.proxy.image", "docker.io/maistra/proxyv2-ubi8:1.1.0")
Types ¶
type ContextValueKey ¶
type ContextValueKey string
type ControllerResources ¶
type ControllerResources struct { Client client.Client Scheme *runtime.Scheme EventRecorder record.EventRecorder OperatorNamespace string DiscoveryClient discovery.DiscoveryInterface }
type DiscoveryClientProvider ¶
type DiscoveryClientProvider interface {
GetDiscoveryClient() discovery.DiscoveryInterface
}
type EnhancedManager ¶
type EnhancedManager struct {
// contains filtered or unexported fields
}
func NewEnhancedManager ¶
func NewEnhancedManager(mgr manager.Manager, dc discovery.DiscoveryInterface) EnhancedManager
func (EnhancedManager) AddHealthzCheck ¶
func (m EnhancedManager) AddHealthzCheck(name string, check healthz.Checker) error
func (EnhancedManager) AddMetricsExtraHandler ¶
func (m EnhancedManager) AddMetricsExtraHandler(path string, handler http.Handler) error
func (EnhancedManager) AddReadyzCheck ¶
func (m EnhancedManager) AddReadyzCheck(name string, check healthz.Checker) error
func (EnhancedManager) Elected ¶
func (m EnhancedManager) Elected() <-chan struct{}
func (EnhancedManager) GetAPIReader ¶
func (m EnhancedManager) GetAPIReader() client.Reader
func (EnhancedManager) GetCache ¶
func (m EnhancedManager) GetCache() cache.Cache
func (EnhancedManager) GetClient ¶
func (m EnhancedManager) GetClient() client.Client
func (EnhancedManager) GetConfig ¶
func (m EnhancedManager) GetConfig() *rest.Config
func (EnhancedManager) GetDiscoveryClient ¶
func (m EnhancedManager) GetDiscoveryClient() discovery.DiscoveryInterface
func (EnhancedManager) GetEventRecorderFor ¶
func (m EnhancedManager) GetEventRecorderFor(name string) record.EventRecorder
func (EnhancedManager) GetFieldIndexer ¶
func (m EnhancedManager) GetFieldIndexer() client.FieldIndexer
func (EnhancedManager) GetLogger ¶
func (m EnhancedManager) GetLogger() logr.Logger
func (EnhancedManager) GetRESTMapper ¶
func (m EnhancedManager) GetRESTMapper() meta.RESTMapper
func (EnhancedManager) GetScheme ¶
func (m EnhancedManager) GetScheme() *runtime.Scheme
func (EnhancedManager) GetWebhookServer ¶
func (m EnhancedManager) GetWebhookServer() *webhook.Server
func (EnhancedManager) SetFields ¶
func (m EnhancedManager) SetFields(fields interface{}) error
func (EnhancedManager) Start ¶
func (m EnhancedManager) Start(ch <-chan struct{}) error
type StatusPatch ¶
type StatusPatch struct {
// contains filtered or unexported fields
}
func NewStatusPatch ¶
func NewStatusPatch(status interface{}) *StatusPatch
func (*StatusPatch) Type ¶
func (p *StatusPatch) Type() types.PatchType