Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAndInstallCRD(crdconfig *rest.Config, pathname string) error
- func ConvertLabels(labelSelector *metav1.LabelSelector) (labels.Selector, error)
- func DetectClusterRegistry(clReader client.Reader, s <-chan struct{})
- func EnterFnString() string
- func ExitFuString(s string)
- func FilteClustersByIdentity(authClient kubernetes.Interface, object runtime.Object, ...) error
- func GetFnName() string
- func InstanceDeepCopy(a, b interface{}) error
- func IsReadyACMClusterRegistry(clReader client.Reader) bool
- func PlaceByGenericPlacmentFields(kubeclient client.Client, placement appv1alpha1.GenericPlacementFields, ...) (map[string]*clusterv1alpha1.Cluster, error)
- func ToPlaceLocal(placement *appv1alpha1.Placement) bool
- type EventRecorder
Constants ¶
const NoiseLogLel = 5
NoiseLogLel - information inside "important functions"
const QuiteLogLel = 4
QuiteLogLel - "important" information
const VeryNoisy = 10
VeryNoisy = show call stack, routine and everything
Variables ¶
var ClusterPredicateFunc = predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { oldcl := e.ObjectOld.(*clusterv1alpha1.Cluster) newcl := e.ObjectNew.(*clusterv1alpha1.Cluster) if !reflect.DeepEqual(oldcl.Labels, newcl.Labels) { return true } oldcondMap := make(map[clusterv1alpha1.ClusterConditionType]corev1.ConditionStatus) for _, cond := range oldcl.Status.Conditions { oldcondMap[cond.Type] = cond.Status } for _, cond := range newcl.Status.Conditions { oldcondst, ok := oldcondMap[cond.Type] if !ok || oldcondst != cond.Status { return true } delete(oldcondMap, cond.Type) } if len(oldcondMap) > 0 { return true } klog.V(10).Info("Out Cluster Predicate Func ", oldcl.Name, " with false possitive") return false }, }
ClusterPredicateFunc defines predicate function for cluster related watch, main purpose is to ignore heartbeat without change
Functions ¶
func CheckAndInstallCRD ¶
CheckAndInstallCRD checks if deployable belongs to this cluster managed cluster annotation matches or no managed cluster annotation (local)
func ConvertLabels ¶
func ConvertLabels(labelSelector *metav1.LabelSelector) (labels.Selector, error)
ConvertLabels coverts label selector to lables.Selector
func DetectClusterRegistry ¶
DetectClusterRegistry - Detect the ACM cluster API service every 10 seconds. the controller will be exited when it is ready The controller will be auto restarted by the multicluster-operators-application deployment CR later.
func FilteClustersByIdentity ¶
func FilteClustersByIdentity(authClient kubernetes.Interface, object runtime.Object, clmap map[string]*clusterv1alpha1.Cluster) error
func InstanceDeepCopy ¶
func InstanceDeepCopy(a, b interface{}) error
func IsReadyACMClusterRegistry ¶
IsReadyACMClusterRegistry check if ACM Cluster API service is ready or not.
func PlaceByGenericPlacmentFields ¶
func PlaceByGenericPlacmentFields(kubeclient client.Client, placement appv1alpha1.GenericPlacementFields, authclient kubernetes.Interface, object runtime.Object) (map[string]*clusterv1alpha1.Cluster, error)
PlaceByGenericPlacmentFields search with basic placement criteria Top priority: clusterNames, ignore selector Bottomline: Use label selector
func ToPlaceLocal ¶
func ToPlaceLocal(placement *appv1alpha1.Placement) bool
Types ¶
type EventRecorder ¶
type EventRecorder struct {
record.EventRecorder
}
EventRecorder - record kubernetes event
func NewEventRecorder ¶
func NewEventRecorder(cfg *rest.Config, scheme *apiruntime.Scheme) (*EventRecorder, error)
NewEventRecorder - create new event recorder from rect config
func (*EventRecorder) RecordEvent ¶
func (rec *EventRecorder) RecordEvent(obj apiruntime.Object, reason, msg string, err error)
RecordEvent - record kuberentes event