kubernetes

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2019 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(b bool) *bool

BoolPtr returns a pointer to a bool

func DeleteNestedField

func DeleteNestedField(obj map[string]interface{}, fields ...string)

func GetNestedArray

func GetNestedArray(obj map[string]interface{}, fields ...string) []interface{}

func GetNestedField

func GetNestedField(obj map[string]interface{}, fields ...string) interface{}

func GetNestedFieldInto

func GetNestedFieldInto(out interface{}, obj map[string]interface{}, fields ...string) error

func GetNestedInt64

func GetNestedInt64(obj map[string]interface{}, fields ...string) int64

func GetNestedInt64Pointer

func GetNestedInt64Pointer(obj map[string]interface{}, fields ...string) *int64

func GetNestedMap

func GetNestedMap(obj map[string]interface{}, fields ...string) map[string]string

func GetNestedObject

func GetNestedObject(obj map[string]interface{}, fields ...string) map[string]interface{}

func GetNestedSlice

func GetNestedSlice(obj map[string]interface{}, fields ...string) []string

func GetNestedString

func GetNestedString(obj map[string]interface{}, fields ...string) string

func RecheckDeletionTimestamp

func RecheckDeletionTimestamp(getObject func() (metav1.Object, error)) func() error

RecheckDeletionTimestamp returns a CanAdopt() function to recheck deletion.

The CanAdopt() function calls getObject() to fetch the latest value, and denies adoption attempts if that object has a non-nil DeletionTimestamp.

func SetNestedField

func SetNestedField(obj map[string]interface{}, value interface{}, fields ...string)

func SetNestedMap

func SetNestedMap(obj map[string]interface{}, value map[string]string, fields ...string)

func SetNestedSlice

func SetNestedSlice(obj map[string]interface{}, value []string, fields ...string)

func WaitForCacheSync

func WaitForCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs ...cache.InformerSynced) bool

WaitForCacheSync is a wrapper around cache.WaitForCacheSync that generates log messages indicating that the controller identified by controllerName is waiting for syncs, followed by either a successful or failed sync.

Types

type BaseControllerRefManager

type BaseControllerRefManager struct {
	Controller metav1.Object
	Selector   labels.Selector

	CanAdoptFunc func() error
	// contains filtered or unexported fields
}

func (*BaseControllerRefManager) CanAdopt

func (m *BaseControllerRefManager) CanAdopt() error

func (*BaseControllerRefManager) ClaimObject

func (m *BaseControllerRefManager) ClaimObject(obj metav1.Object, match func(metav1.Object) bool, adopt, release func(metav1.Object) error) (bool, error)

ClaimObject tries to take ownership of an object for this controller.

It will reconcile the following:

  • Adopt orphans if the match function returns true.
  • Release owned objects if the match function returns false.

A non-nil error is returned if some form of reconciliation was attempted and failed. Usually, controllers should try again later in case reconciliation is still needed.

If the error is nil, either the reconciliation succeeded, or no reconciliation was necessary. The returned boolean indicates whether you now own the object.

No reconciliation will be attempted if the controller is being deleted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL