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 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 NewStatusPatch(status interface{}) *statusPatch
- func NewViper() (*viper.Viper, error)
- func RemoveFinalizer(ctx context.Context, obj runtime.Object, cl client.Client) 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
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" // 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 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 NewStatusPatch ¶
func NewStatusPatch(status interface{}) *statusPatch
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 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