Documentation ¶
Index ¶
- Constants
- func CheckResourceRevision(obj runtime.Object, revisionConstraint string) (bool, error)
- func DetachPodsFromDeployment(c client.Client, deployment *appsv1.Deployment, log logr.Logger, ...) error
- func GetHPAReplicaCountOrDefault(client client.Client, name types.NamespacedName, defaultReplicaCount int32) int32
- func GetResourceRevision(obj runtime.Object) (string, error)
- func GetServiceEndpointIPs(service corev1.Service) ([]string, bool, error)
- func GetWatchPredicateForIstio() predicate.Funcs
- func GetWatchPredicateForIstioIngressGateway() predicate.Funcs
- func GetWatchPredicateForIstioService(name string) predicate.Funcs
- func GetWatchPredicateForIstioServicePods() predicate.Funcs
- func GetWatchPredicateForMeshGateway() predicate.Funcs
- func GetWatchPredicateForOwnedResources(owner runtime.Object, isController bool, scheme *runtime.Scheme, ...) predicate.Funcs
- func GetWatchPredicateForRemoteIstio() predicate.Funcs
- func GetWatchPredicateForRemoteIstioAvailability() predicate.Funcs
- func IsObjectChanged(oldObj, newObj runtime.Object, ignoreStatusChange bool) (bool, error)
- func MergeEnvVars(envs []corev1.EnvVar, additionalEnvs []corev1.EnvVar) []corev1.EnvVar
- func NewCachedRESTMapper(config *rest.Config) (meta.RESTMapper, error)
- func Reconcile(log logr.Logger, client runtimeClient.Client, desired runtime.Object, ...) error
- func ReconcileNamespaceLabelsIgnoreNotFound(log logr.Logger, client runtimeClient.Client, namespace string, ...) error
- func ReconcileWithObjectModifiers(log logr.Logger, client runtimeClient.Client, desired runtime.Object, ...) error
- func RunObjectModifiers(o runtime.Object, objectModifiers []ObjectModifierFunc) (runtime.Object, error)
- func SetOwnerReferenceToObject(obj runtime.Object, owner runtime.Object) ([]metav1.OwnerReference, error)
- func SetResourceRevision(obj runtime.Object, revision string) error
- type Cached
- func (c *Cached) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (c *Cached) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
- func (c *Cached) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (c *Cached) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
- func (c *Cached) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
- func (c *Cached) ResourceSingularizer(resource string) (singular string, err error)
- func (c *Cached) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
- type DesiredState
- type DynamicObject
- type IngressSetupPendingError
- type MeshGatewayCreateOnlyDesiredState
- type ObjectModifierFunc
- type OwnerReferenceMatcher
- type RecreateAwareDeploymentDesiredState
- func (r RecreateAwareDeploymentDesiredState) AfterRecreate(current, desired runtime.Object) error
- func (r RecreateAwareDeploymentDesiredState) AfterUpdate(current, desired runtime.Object, inSync bool) error
- func (r RecreateAwareDeploymentDesiredState) BeforeRecreate(current, desired runtime.Object) error
- type StaticDesiredState
- func (s StaticDesiredState) AfterCreate(_ runtime.Object) error
- func (s StaticDesiredState) AfterDelete(_ runtime.Object) error
- func (s StaticDesiredState) AfterRecreate(_, _ runtime.Object) error
- func (s StaticDesiredState) AfterUpdate(_, _ runtime.Object, _ bool) error
- func (s StaticDesiredState) BeforeCreate(_ runtime.Object) error
- func (s StaticDesiredState) BeforeDelete(_ runtime.Object) error
- func (s StaticDesiredState) BeforeRecreate(_, _ runtime.Object) error
- func (s StaticDesiredState) BeforeUpdate(_, _ runtime.Object) error
- func (s StaticDesiredState) ShouldCreate(_ runtime.Object) (bool, error)
- func (s StaticDesiredState) ShouldDelete(_ runtime.Object) (bool, error)
- func (s StaticDesiredState) ShouldRecreate(_, _ runtime.Object) (bool, error)
- func (s StaticDesiredState) ShouldUpdate(_, _ runtime.Object) (bool, error)
Constants ¶
View Source
const (
ResourceRevisionLabel = "resource.alpha.banzaicloud.io/revision"
)
Variables ¶
This section is empty.
Functions ¶
func CheckResourceRevision ¶
func GetHPAReplicaCountOrDefault ¶
func GetHPAReplicaCountOrDefault(client client.Client, name types.NamespacedName, defaultReplicaCount int32) int32
GetHPAReplicaCountOrDefault get desired replica count from HPA if exists, returns the given default otherwise
func GetServiceEndpointIPs ¶
func IsObjectChanged ¶
IsObjectChanged checks whether there is an actual difference between the two objects
func MergeEnvVars ¶
MergeEnvVars merges env variables by name
func NewCachedRESTMapper ¶
func NewCachedRESTMapper(config *rest.Config) (meta.RESTMapper, error)
func Reconcile ¶
func Reconcile(log logr.Logger, client runtimeClient.Client, desired runtime.Object, desiredState DesiredState) error
func ReconcileNamespaceLabelsIgnoreNotFound ¶
func ReconcileNamespaceLabelsIgnoreNotFound(log logr.Logger, client runtimeClient.Client, namespace string, labels map[string]string, labelsToRemove []string, customLabelsToIgnoreReconcile ...string) error
ReconcileNamespaceLabelsIgnoreNotFound patches namespaces by adding/removing labels, returns without error if namespace is not found
func ReconcileWithObjectModifiers ¶
func ReconcileWithObjectModifiers(log logr.Logger, client runtimeClient.Client, desired runtime.Object, desiredState DesiredState, objectModifiers []ObjectModifierFunc) error
func RunObjectModifiers ¶
Types ¶
type Cached ¶
func (*Cached) KindFor ¶
func (c *Cached) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
func (*Cached) KindsFor ¶
func (c *Cached) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
func (*Cached) RESTMapping ¶
func (*Cached) RESTMappings ¶
func (*Cached) ResourceFor ¶
func (c *Cached) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
func (*Cached) ResourceSingularizer ¶
func (*Cached) ResourcesFor ¶
func (c *Cached) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
type DesiredState ¶
type DesiredState interface { AfterRecreate(current, desired runtime.Object) error BeforeRecreate(current, desired runtime.Object) error ShouldRecreate(current, desired runtime.Object) (bool, error) AfterCreate(desired runtime.Object) error BeforeCreate(desired runtime.Object) error ShouldCreate(desired runtime.Object) (bool, error) AfterUpdate(current, desired runtime.Object, inSync bool) error BeforeUpdate(current, desired runtime.Object) error ShouldUpdate(current, desired runtime.Object) (bool, error) AfterDelete(current runtime.Object) error BeforeDelete(current runtime.Object) error ShouldDelete(current runtime.Object) (bool, error) }
type DynamicObject ¶
type DynamicObject struct { Name string Namespace string Labels map[string]string Spec map[string]interface{} Gvr schema.GroupVersionResource Kind string Owner *istiov1beta1.Istio }
func (*DynamicObject) Reconcile ¶
func (d *DynamicObject) Reconcile(log logr.Logger, client dynamic.Interface, desiredState DesiredState) error
func (*DynamicObject) ReconcileWithObjectModifiers ¶
func (d *DynamicObject) ReconcileWithObjectModifiers(log logr.Logger, client dynamic.Interface, desiredState DesiredState, objectModifiers []ObjectModifierFunc) error
type IngressSetupPendingError ¶
type IngressSetupPendingError struct{}
func (IngressSetupPendingError) Error ¶
func (e IngressSetupPendingError) Error() string
type MeshGatewayCreateOnlyDesiredState ¶
type MeshGatewayCreateOnlyDesiredState struct {
StaticDesiredState
}
func (MeshGatewayCreateOnlyDesiredState) ShouldUpdate ¶
func (MeshGatewayCreateOnlyDesiredState) ShouldUpdate(current, desired runtime.Object) (bool, error)
type ObjectModifierFunc ¶
type ObjectModifierFunc = resources.ObjectModifierFunc
func CombineObjectModifiers ¶
func CombineObjectModifiers(modifiers ...[]ObjectModifierFunc) []ObjectModifierFunc
func GetGVKObjectModifier ¶
func GetGVKObjectModifier(scheme *runtime.Scheme) ObjectModifierFunc
func GetObjectModifiersForOverlays ¶
func GetObjectModifiersForOverlays(scheme *runtime.Scheme, overlays []resources.K8SResourceOverlay) ([]ObjectModifierFunc, error)
type OwnerReferenceMatcher ¶
type OwnerReferenceMatcher struct {
// contains filtered or unexported fields
}
func NewOwnerReferenceMatcher ¶
func NewOwnerReferenceMatcher(owner runtime.Object, ctrl bool, scheme *runtime.Scheme) *OwnerReferenceMatcher
NewOwnerReferenceMatcher initializes a new owner reference matcher
type RecreateAwareDeploymentDesiredState ¶
type RecreateAwareDeploymentDesiredState struct { StaticDesiredState // contains filtered or unexported fields }
func (RecreateAwareDeploymentDesiredState) AfterRecreate ¶
func (r RecreateAwareDeploymentDesiredState) AfterRecreate(current, desired runtime.Object) error
func (RecreateAwareDeploymentDesiredState) AfterUpdate ¶
func (r RecreateAwareDeploymentDesiredState) AfterUpdate(current, desired runtime.Object, inSync bool) error
func (RecreateAwareDeploymentDesiredState) BeforeRecreate ¶
func (r RecreateAwareDeploymentDesiredState) BeforeRecreate(current, desired runtime.Object) error
type StaticDesiredState ¶
type StaticDesiredState string
const ( DesiredStatePresent StaticDesiredState = "present" DesiredStateAbsent StaticDesiredState = "absent" DesiredStateExists StaticDesiredState = "exists" )
func (StaticDesiredState) AfterCreate ¶
func (s StaticDesiredState) AfterCreate(_ runtime.Object) error
func (StaticDesiredState) AfterDelete ¶
func (s StaticDesiredState) AfterDelete(_ runtime.Object) error
func (StaticDesiredState) AfterRecreate ¶
func (s StaticDesiredState) AfterRecreate(_, _ runtime.Object) error
func (StaticDesiredState) AfterUpdate ¶
func (s StaticDesiredState) AfterUpdate(_, _ runtime.Object, _ bool) error
func (StaticDesiredState) BeforeCreate ¶
func (s StaticDesiredState) BeforeCreate(_ runtime.Object) error
func (StaticDesiredState) BeforeDelete ¶
func (s StaticDesiredState) BeforeDelete(_ runtime.Object) error
func (StaticDesiredState) BeforeRecreate ¶
func (s StaticDesiredState) BeforeRecreate(_, _ runtime.Object) error
func (StaticDesiredState) BeforeUpdate ¶
func (s StaticDesiredState) BeforeUpdate(_, _ runtime.Object) error
func (StaticDesiredState) ShouldCreate ¶
func (s StaticDesiredState) ShouldCreate(_ runtime.Object) (bool, error)
func (StaticDesiredState) ShouldDelete ¶
func (s StaticDesiredState) ShouldDelete(_ runtime.Object) (bool, error)
func (StaticDesiredState) ShouldRecreate ¶
func (s StaticDesiredState) ShouldRecreate(_, _ runtime.Object) (bool, error)
func (StaticDesiredState) ShouldUpdate ¶
func (s StaticDesiredState) ShouldUpdate(_, _ runtime.Object) (bool, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.