Documentation ¶
Index ¶
- Constants
- func AddRandSuffix(name string) string
- func GenerateKey(ln int) []byte
- func GetOperatorNamespace() string
- func GetWatchNamespace() (string, error)
- func IsInCluster() bool
- func TimeoutWrap(timeout time.Duration, fn func() error) error
- type Kcli
- func (s *Kcli) CreateObject(obj runtime.Object) error
- func (s *Kcli) DeleteALLByLabel(obj ctrlcli.Object, namespace string, labels map[string]string) error
- func (s *Kcli) DeleteObject(obj ctrlcli.Object) error
- func (s *Kcli) Ensure(obj metav1.Object, found ctrlcli.Object) error
- func (s *Kcli) EnsureOrphan(obj metav1.Object, found ctrlcli.Object) error
- func (s *Kcli) EnsurePVC(obj *corev1.PersistentVolumeClaim) error
- func (s *Kcli) EnsureService(obj *corev1.Service) error
- func (s *Kcli) EnsureStatefulSet(obj *appsv1.StatefulSet) error
- func (s *Kcli) Find(name, namespace string, found ctrlcli.Object) error
- func (s *Kcli) IsExists(obj metav1.Object, found ctrlcli.Object) (exists bool, err error)
- func (s *Kcli) ListByLabel(namespace string, labels map[string]string, found ctrlcli.ObjectList) error
- func (s *Kcli) PatchObject(obj ctrlcli.Object, patch ctrlcli.Object) error
- func (s *Kcli) SetRefAndCreateObject(obj interface{}) error
- func (s *Kcli) UpdateObject(obj ctrlcli.Object) error
- func (s *Kcli) WriteStatus(obj ctrlcli.Object) error
Constants ¶
View Source
const ( RANDOM_SUFFIX_LEN = 10 // k8s object name has a maximum length MAX_NAME_LEN = 63 - RANDOM_SUFFIX_LEN - 1 )
View Source
const (
CtxTimeout = 10 * time.Second
)
View Source
const (
WatchNamespaceEnvVar = "WATCH_NAMESPACE"
)
Variables ¶
This section is empty.
Functions ¶
func AddRandSuffix ¶
func GenerateKey ¶
func GetOperatorNamespace ¶
func GetOperatorNamespace() string
GetOperatorNamespace returns the namespace the operator should be running in.
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
func IsInCluster ¶
func IsInCluster() bool
Types ¶
type Kcli ¶
type Kcli struct {
// contains filtered or unexported fields
}
func (*Kcli) DeleteALLByLabel ¶
func (*Kcli) EnsureOrphan ¶
not set ownerRef,用于公用资源
func (*Kcli) EnsureStatefulSet ¶
func (s *Kcli) EnsureStatefulSet(obj *appsv1.StatefulSet) error
func (*Kcli) ListByLabel ¶
func (*Kcli) PatchObject ¶
func (*Kcli) SetRefAndCreateObject ¶
Click to show internal directories.
Click to hide internal directories.