k8s

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright © 2019 Banzai Cloud

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyResources

func ApplyResources(client k8sclient.Client, labelManager LabelManager, objects object.K8sObjects, log logger.Logger, waitFuncs ...WaitForResourceConditionsFunc) (object.K8sObjects, error)

func CRDEstablishedConditionCheck

func CRDEstablishedConditionCheck(obj *unstructured.Unstructured, k8serror error) bool

func ConvertRuntimeObjectToK8sObjects

func ConvertRuntimeObjectToK8sObjects(objects []runtime.Object) (object.K8sObjects, error)

func DeleteResources

func DeleteResources(client k8sclient.Client, labelManager LabelManager, objects object.K8sObjects, log logger.Logger, waitFuncs ...WaitForResourceConditionsFunc) (object.K8sObjects, error)

func ExistsConditionCheck

func ExistsConditionCheck(obj *unstructured.Unstructured, k8serror error) bool

func GetFormattedName

func GetFormattedName(object Object) string

func GetFormattedName2

func GetFormattedName2(object runtime.Object) string

func GetTokenForServiceAccountName

func GetTokenForServiceAccountName(client k8sclient.Client, key types.NamespacedName) (string, error)

GetTokenForServiceAccountName retrieves an auth token of service account from the related secret

func NonExistsConditionCheck

func NonExistsConditionCheck(obj *unstructured.Unstructured, k8serror error) bool

func ReadyReplicasConditionCheck

func ReadyReplicasConditionCheck(obj *unstructured.Unstructured, k8serror error) bool

func WaitForResourcesConditions

func WaitForResourcesConditions(client k8sclient.Client, objects []NamespacedNameWithGVK, backoff wait.Backoff, log logger.Logger, checkFuncs ...ResourceConditionCheck) error

Types

type LabelManager

type LabelManager interface {
	CheckLabelsBeforeUpdate(actual, desired runtime.Object) (bool, error)
	CheckLabelsBeforeCreate(actual runtime.Object) (bool, error)
	CheckLabelsBeforeDelete(actual runtime.Object) (bool, error)
}

type NamespacedNameWithGVK

type NamespacedNameWithGVK struct {
	types.NamespacedName
	schema.GroupVersionKind
}

func NamesWithGVKFromK8sObjects

func NamesWithGVKFromK8sObjects(objects object.K8sObjects, kind ...string) []NamespacedNameWithGVK

func (NamespacedNameWithGVK) String

func (o NamespacedNameWithGVK) String() string

func (NamespacedNameWithGVK) Unstructured

type Object

type Object interface {
	metav1.Object
	metav1.Type
	schema.ObjectKind
}

type PostResourceApplyFunc

type PostResourceApplyFunc func(k8sclient.Client, Object) error

type PostResourceDeleteFunc

type PostResourceDeleteFunc func(k8sclient.Client, Object) error

type ResourceConditionCheck

type ResourceConditionCheck func(*unstructured.Unstructured, error) bool

type WaitForResourceConditionsFunc

type WaitForResourceConditionsFunc func(k8sclient.Client, *unstructured.Unstructured) error

func WaitForResourceConditions

func WaitForResourceConditions(backoff wait.Backoff, log logger.Logger, checkFuncs ...ResourceConditionCheck) WaitForResourceConditionsFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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