nativekubernetesoo

package
v0.448.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

README

nativekubernetesoo package

Object oriented implementation using the official client-go library to interact with kubernetes.

For the non object oriented implmenetation see nativekubernetes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventMatchesOptions

func EventMatchesOptions(event *corev1.Event, options *kubernetesutils.WatchEventOptions) bool

func EventToString

func EventToString(event *corev1.Event) string

func IsConfigMapContentEqual

func IsConfigMapContentEqual(configMap1 map[string]string, configMap2 map[string]string) bool

func IsConfigMapLabelsEqual

func IsConfigMapLabelsEqual(labels1 map[string]string, labels2 map[string]string) bool

func ListNodeNames

func ListNodeNames(ctx context.Context, clientset *kubernetes.Clientset) ([]string, error)

func ReadSecret

func ReadSecret(ctx context.Context, clientset *kubernetes.Clientset, namespaceName string, secretName string) (map[string][]byte, error)

func WatchEvents

func WatchEvents(ctx context.Context, options *kubernetesutils.WatchEventOptions, onCreate func(*corev1.Event), onUpdate func(*corev1.Event), onDelete func(*corev1.Event)) error

Types

type NativeConfigMap

type NativeConfigMap struct {
	// contains filtered or unexported fields
}

func (*NativeConfigMap) Exists

func (n *NativeConfigMap) Exists(ctx context.Context) (bool, error)

func (*NativeConfigMap) GetAllData

func (n *NativeConfigMap) GetAllData(ctx context.Context) (map[string]string, error)

func (*NativeConfigMap) GetAllLabels

func (n *NativeConfigMap) GetAllLabels(ctx context.Context) (map[string]string, error)

func (*NativeConfigMap) GetData

func (n *NativeConfigMap) GetData(ctx context.Context, fieldName string) (string, error)

func (*NativeConfigMap) GetName

func (n *NativeConfigMap) GetName() (string, error)

func (*NativeConfigMap) GetNamespace

func (n *NativeConfigMap) GetNamespace() (*NativeNamespace, error)

func (*NativeConfigMap) GetNamespaceName

func (n *NativeConfigMap) GetNamespaceName() (string, error)

func (*NativeConfigMap) GetRawResponse

func (n *NativeConfigMap) GetRawResponse(ctx context.Context) (*v1.ConfigMap, error)

type NativeKubernetesCluster

type NativeKubernetesCluster struct {
	// contains filtered or unexported fields
}

func GetClusterByName

func GetClusterByName(ctx context.Context, clusterName string) (*NativeKubernetesCluster, error)

func GetDefaultCluster

func GetDefaultCluster(ctx context.Context) (*NativeKubernetesCluster, error)

func (*NativeKubernetesCluster) CheckAccessible

func (n *NativeKubernetesCluster) CheckAccessible(ctx context.Context) error

func (*NativeKubernetesCluster) ConfigMapByNameExists

func (n *NativeKubernetesCluster) ConfigMapByNameExists(ctx context.Context, namespaceName string, configmapName string) (exists bool, err error)

func (*NativeKubernetesCluster) CreateConfigMap

func (n *NativeKubernetesCluster) CreateConfigMap(ctx context.Context, namespaceName string, configMapName string, options *kubernetesparameteroptions.CreateConfigMapOptions) (createdSecret kubernetesinterfaces.ConfigMap, err error)

func (*NativeKubernetesCluster) CreateNamespaceByName

func (n *NativeKubernetesCluster) CreateNamespaceByName(ctx context.Context, namespaceName string) (createdNamespace kubernetesinterfaces.Namespace, err error)

func (*NativeKubernetesCluster) CreateSecret

func (n *NativeKubernetesCluster) CreateSecret(ctx context.Context, namespaceName string, secretName string, options *kubernetesparameteroptions.CreateSecretOptions) (createdSecret kubernetesinterfaces.Secret, err error)

func (*NativeKubernetesCluster) DeleteConfigMapByName

func (n *NativeKubernetesCluster) DeleteConfigMapByName(ctx context.Context, namespaceName string, configmapName string) (err error)

func (*NativeKubernetesCluster) DeleteNamespaceByName

func (n *NativeKubernetesCluster) DeleteNamespaceByName(ctx context.Context, namespaceName string) (err error)

func (*NativeKubernetesCluster) DeleteSecretByName

func (n *NativeKubernetesCluster) DeleteSecretByName(ctx context.Context, namespaceName string, secretName string) (err error)

func (*NativeKubernetesCluster) GetClientSet

func (n *NativeKubernetesCluster) GetClientSet() (*kubernetes.Clientset, error)

func (*NativeKubernetesCluster) GetConfig

func (n *NativeKubernetesCluster) GetConfig() (*rest.Config, error)

func (*NativeKubernetesCluster) GetDiscoveryClient

func (n *NativeKubernetesCluster) GetDiscoveryClient() (discovery.DiscoveryInterface, error)

func (*NativeKubernetesCluster) GetDynamicClient

func (n *NativeKubernetesCluster) GetDynamicClient() (*dynamic.DynamicClient, error)

func (*NativeKubernetesCluster) GetKubectlContext

func (n *NativeKubernetesCluster) GetKubectlContext(ctx context.Context) (contextName string, err error)

func (*NativeKubernetesCluster) GetName

func (n *NativeKubernetesCluster) GetName() (name string, err error)

func (*NativeKubernetesCluster) GetNamespaceByName

func (n *NativeKubernetesCluster) GetNamespaceByName(name string) (namespace kubernetesinterfaces.Namespace, err error)

func (*NativeKubernetesCluster) GetNamespaceByYamlString

func (n *NativeKubernetesCluster) GetNamespaceByYamlString(yaml string) (kubernetesinterfaces.Namespace, error)

func (*NativeKubernetesCluster) GetObjectByNames

func (n *NativeKubernetesCluster) GetObjectByNames(objectName string, objectType string, namespaceName string) (object kubernetesinterfaces.Object, err error)

func (*NativeKubernetesCluster) GetUserNameByContextName

func (n *NativeKubernetesCluster) GetUserNameByContextName(ctx context.Context, kubeContext string) (string, error)

func (*NativeKubernetesCluster) ListKindNames

func (n *NativeKubernetesCluster) ListKindNames(ctx context.Context) ([]string, error)

func (*NativeKubernetesCluster) ListNamespaceNames

func (n *NativeKubernetesCluster) ListNamespaceNames(ctx context.Context) (namespaceNames []string, err error)

func (*NativeKubernetesCluster) ListNamespaces

func (n *NativeKubernetesCluster) ListNamespaces(ctx context.Context) (namespaces []kubernetesinterfaces.Namespace, err error)

func (*NativeKubernetesCluster) ListNodeNames

func (n *NativeKubernetesCluster) ListNodeNames(ctx context.Context) ([]string, error)

func (*NativeKubernetesCluster) ListObjectNames

func (n *NativeKubernetesCluster) ListObjectNames(options *kubernetesparameteroptions.ListKubernetesObjectsOptions) (objectNames []string, err error)

func (*NativeKubernetesCluster) ListObjects

func (*NativeKubernetesCluster) NamespaceByNameExists

func (n *NativeKubernetesCluster) NamespaceByNameExists(ctx context.Context, namespaceName string) (exist bool, err error)

func (*NativeKubernetesCluster) ReadSecret

func (n *NativeKubernetesCluster) ReadSecret(ctx context.Context, namespaceName string, secretName string) (map[string][]byte, error)

func (*NativeKubernetesCluster) RunCommandInTemporaryPod

func (*NativeKubernetesCluster) SecretByNameExists

func (n *NativeKubernetesCluster) SecretByNameExists(ctx context.Context, namespaceName string, secretName string) (exists bool, err error)

func (*NativeKubernetesCluster) WaitUntilAllPodsInNamespaceAreRunning

func (n *NativeKubernetesCluster) WaitUntilAllPodsInNamespaceAreRunning(ctx context.Context, namespaceName string, options *kubernetesparameteroptions.WaitForPodsOptions) error

func (*NativeKubernetesCluster) WaitUntilNamespaceCreated

func (n *NativeKubernetesCluster) WaitUntilNamespaceCreated(ctx context.Context, namepaceName string) (err error)

func (*NativeKubernetesCluster) WaitUntilNamespaceDeleted

func (n *NativeKubernetesCluster) WaitUntilNamespaceDeleted(ctx context.Context, namepaceName string) (err error)

func (*NativeKubernetesCluster) WhoAmI

type NativeNamespace

type NativeNamespace struct {
	// contains filtered or unexported fields
}

func (*NativeNamespace) ConfigMapByNameExists

func (n *NativeNamespace) ConfigMapByNameExists(ctx context.Context, configmapName string) (bool, error)

func (*NativeNamespace) Create

func (n *NativeNamespace) Create(ctx context.Context) (err error)

func (*NativeNamespace) CreateConfigMap

func (n *NativeNamespace) CreateConfigMap(ctx context.Context, configMapName string, options *kubernetesparameteroptions.CreateConfigMapOptions) (createdConfigMap kubernetesinterfaces.ConfigMap, err error)

func (*NativeNamespace) CreateRole

func (n *NativeNamespace) CreateRole(ctx context.Context, createOptions *kubernetesparameteroptions.CreateRoleOptions) (createdRole kubernetesinterfaces.Role, err error)

func (*NativeNamespace) CreateSecret

func (n *NativeNamespace) CreateSecret(ctx context.Context, secretName string, options *kubernetesparameteroptions.CreateSecretOptions) (createdSecret kubernetesinterfaces.Secret, err error)

func (*NativeNamespace) DeleteConfigMapByName

func (n *NativeNamespace) DeleteConfigMapByName(ctx context.Context, configmapName string) (err error)

func (*NativeNamespace) DeleteRoleByName

func (n *NativeNamespace) DeleteRoleByName(ctx context.Context, name string) (err error)

func (*NativeNamespace) DeleteSecretByName

func (n *NativeNamespace) DeleteSecretByName(ctx context.Context, secretName string) (err error)

func (*NativeNamespace) Exists

func (n *NativeNamespace) Exists(ctx context.Context) (bool, error)

func (*NativeNamespace) GetClientSet

func (n *NativeNamespace) GetClientSet() (*kubernetes.Clientset, error)

func (*NativeNamespace) GetClusterName

func (n *NativeNamespace) GetClusterName() (clusterName string, err error)

func (*NativeNamespace) GetConfigMapByName

func (n *NativeNamespace) GetConfigMapByName(name string) (configMap kubernetesinterfaces.ConfigMap, err error)

func (*NativeNamespace) GetDiscoveryClient

func (n *NativeNamespace) GetDiscoveryClient() (discovery.DiscoveryInterface, error)

func (*NativeNamespace) GetDynamicClient

func (n *NativeNamespace) GetDynamicClient() (*dynamic.DynamicClient, error)

func (*NativeNamespace) GetKubectlContext

func (n *NativeNamespace) GetKubectlContext(ctx context.Context) (contextName string, err error)

func (*NativeNamespace) GetKubernetesCluster

func (n *NativeNamespace) GetKubernetesCluster() (*NativeKubernetesCluster, error)

func (*NativeNamespace) GetName

func (n *NativeNamespace) GetName() (name string, err error)

func (*NativeNamespace) GetObjectByNames

func (n *NativeNamespace) GetObjectByNames(objectName string, objectKind string) (object kubernetesinterfaces.Object, err error)

func (*NativeNamespace) GetObjectByYamlString

func (n *NativeNamespace) GetObjectByYamlString(yaml string) (kubernetesinterfaces.Object, error)

func (*NativeNamespace) GetRoleByName

func (n *NativeNamespace) GetRoleByName(name string) (role kubernetesinterfaces.Role, err error)

func (*NativeNamespace) GetSecretByName

func (n *NativeNamespace) GetSecretByName(name string) (secret kubernetesinterfaces.Secret, err error)

func (*NativeNamespace) ListRoleNames

func (n *NativeNamespace) ListRoleNames(ctx context.Context) (roleNames []string, err error)

func (*NativeNamespace) RoleByNameExists

func (n *NativeNamespace) RoleByNameExists(ctx context.Context, name string) (exists bool, err error)

func (*NativeNamespace) SecretByNameExists

func (n *NativeNamespace) SecretByNameExists(ctx context.Context, secretName string) (bool, error)

func (*NativeNamespace) WaitUntilAllPodsInNamespaceAreRunning

func (n *NativeNamespace) WaitUntilAllPodsInNamespaceAreRunning(ctx context.Context, options *kubernetesparameteroptions.WaitForPodsOptions) error

func (*NativeNamespace) WatchConfigMap

func (n *NativeNamespace) WatchConfigMap(ctx context.Context, configMapName string, onCreate func(kubernetesinterfaces.ConfigMap), onUpdate func(kubernetesinterfaces.ConfigMap), onDelete func(kubernetesinterfaces.ConfigMap)) error

type NativeObject

type NativeObject struct {
	// contains filtered or unexported fields
}

func (*NativeObject) CreateByYamlString

func (n *NativeObject) CreateByYamlString(ctx context.Context, options *kubernetesparameteroptions.CreateObjectOptions) (err error)

func (*NativeObject) Delete

func (n *NativeObject) Delete(ctx context.Context) error

func (*NativeObject) EnsureNamespaceExists

func (n *NativeObject) EnsureNamespaceExists(ctx context.Context) error

func (*NativeObject) Exists

func (n *NativeObject) Exists(ctx context.Context) (bool, error)

func (*NativeObject) GetApiVersion

func (n *NativeObject) GetApiVersion(ctx context.Context) (string, error)

func (*NativeObject) GetAsYamlString

func (n *NativeObject) GetAsYamlString() (yamlString string, err error)

func (*NativeObject) GetDynamicClient

func (n *NativeObject) GetDynamicClient() (*dynamic.DynamicClient, error)

func (*NativeObject) GetGroupVersion

func (n *NativeObject) GetGroupVersion(ctx context.Context) (*schema.GroupVersion, error)

func (*NativeObject) GetGroupVersionKind

func (n *NativeObject) GetGroupVersionKind(ctx context.Context) (*schema.GroupVersionKind, error)

func (*NativeObject) GetGroupVersionObject

func (n *NativeObject) GetGroupVersionObject(ctx context.Context) (*schema.GroupVersionResource, error)

func (*NativeObject) GetKind

func (n *NativeObject) GetKind() (string, error)

func (*NativeObject) GetName

func (n *NativeObject) GetName() (string, error)

func (*NativeObject) GetNamespace

func (n *NativeObject) GetNamespace() (*NativeNamespace, error)

func (*NativeObject) GetNamespaceName

func (n *NativeObject) GetNamespaceName() (string, error)

func (*NativeObject) GetObjectInterface

func (n *NativeObject) GetObjectInterface(ctx context.Context) (dynamic.ResourceInterface, error)

func (*NativeObject) GetObjectPlural

func (n *NativeObject) GetObjectPlural() (string, error)

func (*NativeObject) SetApiVersion

func (n *NativeObject) SetApiVersion(apiVersion string) error

func (*NativeObject) SetKind

func (n *NativeObject) SetKind(kind string) error

type NativeSecret

type NativeSecret struct {
	// contains filtered or unexported fields
}

func (*NativeSecret) Exists

func (n *NativeSecret) Exists(ctx context.Context) (bool, error)

func (*NativeSecret) GetClientSet

func (n *NativeSecret) GetClientSet() (*kubernetes.Clientset, error)

func (*NativeSecret) GetName

func (n *NativeSecret) GetName() (string, error)

func (*NativeSecret) GetNamespace

func (n *NativeSecret) GetNamespace() (*NativeNamespace, error)

func (*NativeSecret) GetNamespaceName

func (n *NativeSecret) GetNamespaceName() (string, error)

func (*NativeSecret) Read

func (n *NativeSecret) Read(ctx context.Context) (map[string][]byte, error)

Jump to

Keyboard shortcuts

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