kubeutil

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 29 Imported by: 9

Documentation

Index

Constants

View Source
const InClusterObjectPrefix = "k8s://"

Variables

This section is empty.

Functions

func DryRunCreate

func DryRunCreate(objBytes []byte, namespace string) ([]byte, error)

func GetAPIResources

func GetAPIResources() ([]metav1.APIResource, error)

func GetAllPodsFromObject

func GetAllPodsFromObject(obj *unstructured.Unstructured) ([]*corev1.Pod, error)

func GetApplyPatchBytes

func GetApplyPatchBytes(manifestBytes []byte, objNamespace string) ([]byte, []byte, error)

func GetInClusterConfig

func GetInClusterConfig() (*rest.Config, error)

func GetKubeConfig

func GetKubeConfig() (*rest.Config, error)

func GetNamespaces

func GetNamespaces() ([]*corev1.Namespace, error)

func GetOutOfClusterConfig

func GetOutOfClusterConfig() (*rest.Config, error)

func GetResource

func GetResource(apiVersion, kind, namespace, name string) (*unstructured.Unstructured, error)

func GetSecret added in v0.3.0

func GetSecret(namespace, name string) (*corev1.Secret, error)

func IsInCluster

func IsInCluster() bool

func ListResources

func ListResources(apiVersion, kind, namespace string) ([]*unstructured.Unstructured, error)

func MatchLabels

func MatchLabels(obj metav1.Object, labelSelector *metav1.LabelSelector) (bool, error)

func ParseObjectRefInCluster added in v0.3.0

func ParseObjectRefInCluster(objRef string) (string, string, error)

func ParseObjectRefInClusterWithKind added in v0.3.0

func ParseObjectRefInClusterWithKind(objRef string) (string, string, string, error)

func SetKubeConfig

func SetKubeConfig(conf *rest.Config)

func StrategicMergePatch

func StrategicMergePatch(objBytes, patchBytes []byte, namespace string) ([]byte, error)

Types

type ImageObject

type ImageObject struct {
	PodName           string
	ContainerName     string
	ImageID           string
	ResourceBundleRef string
	Digest            string
}

func GetAllImagesFromObject

func GetAllImagesFromObject(obj *unstructured.Unstructured) ([]ImageObject, error)

Jump to

Keyboard shortcuts

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