Documentation ¶
Index ¶
- Variables
- func AddFinalizer(o *v1.ObjectMeta, finalizer string)
- func ApplyDeployment(c kubernetes.Interface, d *appsv1.Deployment) (*appsv1.Deployment, error)
- func ApplySecret(c kubernetes.Interface, s *corev1.Secret) (*corev1.Secret, error)
- func ApplyService(c kubernetes.Interface, s *corev1.Service) (*corev1.Service, error)
- func GenerateHex(dataLen int) (string, error)
- func GenerateName(base string) string
- func GeneratePassword(dataLen int) (string, error)
- func HasFinalizer(o *v1.ObjectMeta, finalizer string) bool
- func IfEmptyString(s, r string) string
- func LatestDeploymentCondition(conditions []appsv1.DeploymentCondition) appsv1.DeploymentCondition
- func ObjectReference(o metav1.ObjectMeta, apiVersion, kind string) *corev1.ObjectReference
- func ObjectToOwnerReference(r *corev1.ObjectReference) *metav1.OwnerReference
- func RemoveFinalizer(o *v1.ObjectMeta, finalizer string)
- func SecretData(client kubernetes.Interface, namespace string, ks corev1.SecretKeySelector) ([]byte, error)
- func ToLowerRemoveSpaces(input string) string
Constants ¶
This section is empty.
Variables ¶
var DefaultUpdateRetry = wait.Backoff{ Steps: 10, Duration: 500 * time.Millisecond, Factor: 1.0, Jitter: 0.1, }
DefaultUpdateRetry is the recommended retry for a failure to update a resource or ensuring that the changes from an update have been committed and have become consistent.
Functions ¶
func AddFinalizer ¶
func AddFinalizer(o *v1.ObjectMeta, finalizer string)
AddFinalizer - add finalizer (if it wasn't added before)
func ApplyDeployment ¶
func ApplyDeployment(c kubernetes.Interface, d *appsv1.Deployment) (*appsv1.Deployment, error)
ApplyDeployment creates or updates existing deployment
func ApplySecret ¶
ApplySecret creates or updates if exist kubernetes secret
func ApplyService ¶
ApplyService creates or updates existing service
func GenerateHex ¶
GenerateHex generates a hex string using random data of the given length.
func GenerateName ¶
GenerateName returns the given base name plus a random suffix of five alphanumerics and a hyphen separator. The string is guaranteed to not exceed the length of a standard Kubernetes name (253 characters). e.g., GenerateName("foo") would return a value similar to: "foo-a1b2c".
If base string length exceeds 247 (253 - 6) characters, it will be truncated to 247 characters before adding random suffix e.g., GenerateName("foo...ververylongstringof253chars") would return value similar to:
"foo...ververylongstringof25-x8y9z"
func GeneratePassword ¶
GeneratePassword generates a password using random data of the given length, then encodes to a base64 string.
func HasFinalizer ¶
func HasFinalizer(o *v1.ObjectMeta, finalizer string) bool
HasFinalizer - check if given instance has a given finalizer
func IfEmptyString ¶
IfEmptyString test input string and if empty, i.e = "", return a replacement string
func LatestDeploymentCondition ¶
func LatestDeploymentCondition(conditions []appsv1.DeploymentCondition) appsv1.DeploymentCondition
LatestDeploymentCondition
func ObjectReference ¶
func ObjectReference(o metav1.ObjectMeta, apiVersion, kind string) *corev1.ObjectReference
ObjectReference from provided ObjectMeta, apiVersion and kind
func ObjectToOwnerReference ¶
func ObjectToOwnerReference(r *corev1.ObjectReference) *metav1.OwnerReference
ObjectToOwnerReference converts core ObjectReference to meta OwnerReference
func RemoveFinalizer ¶
func RemoveFinalizer(o *v1.ObjectMeta, finalizer string)
RemoveFinalizer - from the list of kubernetes object finalizers
func SecretData ¶
func SecretData(client kubernetes.Interface, namespace string, ks corev1.SecretKeySelector) ([]byte, error)
SecretData returns secret data value for a given secret/key combination or error if secret or key is not found
func ToLowerRemoveSpaces ¶
Types ¶
This section is empty.