describe

package
v0.7.68 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Service = iota
	Pod
	Namespace
	Job
	CronJob
	Deployment
	DaemonSet
	ReplicaSet
	StatefulSet
	Secret
	ServiceAccount
	Node
	LimitRange
	ResourceQuota
	PersistentVolume
	PersistentVolumeClaim
	Endpoints
	ConfigMap
	PriorityClass
	Ingress
	Role
	ClusterRole
	RoleBinding
	ClusterRoleBinding
	NetworkPolicy
	ReplicationController
	CertificateSigningRequest
	EndpointSlice
)

Variables

View Source
var (
	ErrGetDescriberFuncCode = "meshkit-11189"
)
View Source
var ResourceMap = map[DescribeType]schema.GroupKind{
	Pod:                       {Group: corev1.GroupName, Kind: "Pod"},
	Deployment:                {Group: appsv1.GroupName, Kind: "Deployment"},
	Job:                       {Group: batchv1.GroupName, Kind: "Job"},
	CronJob:                   {Group: batchv1.GroupName, Kind: "CronJob"},
	StatefulSet:               {Group: appsv1.GroupName, Kind: "StatefulSet"},
	DaemonSet:                 {Group: appsv1.GroupName, Kind: "DaemonSet"},
	ReplicaSet:                {Group: appsv1.GroupName, Kind: "ReplicaSet"},
	Secret:                    {Group: corev1.GroupName, Kind: "Secret"},
	Service:                   {Group: corev1.GroupName, Kind: "Service"},
	ServiceAccount:            {Group: corev1.GroupName, Kind: "ServiceAccount"},
	Node:                      {Group: corev1.GroupName, Kind: "Node"},
	LimitRange:                {Group: corev1.GroupName, Kind: "LimitRange"},
	ResourceQuota:             {Group: corev1.GroupName, Kind: "ResourceQuota"},
	PersistentVolume:          {Group: corev1.GroupName, Kind: "PersistentVolume"},
	PersistentVolumeClaim:     {Group: corev1.GroupName, Kind: "PersistentVolumeClaim"},
	Namespace:                 {Group: corev1.GroupName, Kind: "Namespace"},
	Endpoints:                 {Group: corev1.GroupName, Kind: "Endpoints"},
	ConfigMap:                 {Group: corev1.GroupName, Kind: "ConfigMap"},
	PriorityClass:             {Group: corev1.GroupName, Kind: "PriorityClass"},
	Ingress:                   {Group: networkingv1.GroupName, Kind: "Ingress"},
	Role:                      {Group: rbacv1.GroupName, Kind: "Role"},
	ClusterRole:               {Group: rbacv1.GroupName, Kind: "ClusterRole"},
	RoleBinding:               {Group: rbacv1.GroupName, Kind: "RoleBinding"},
	ClusterRoleBinding:        {Group: rbacv1.GroupName, Kind: "ClusterRoleBinding"},
	NetworkPolicy:             {Group: networkingv1.GroupName, Kind: "NetworkPolicy"},
	ReplicationController:     {Group: corev1.GroupName, Kind: "ReplicationController"},
	CertificateSigningRequest: {Group: certificatesv1beta1.GroupName, Kind: "CertificateSigningRequest"},
	EndpointSlice:             {Group: discoveryv1.GroupName, Kind: "EndpointSlice"},
}

The ResourceMap variable contains the GroupKind information of all the Kubernetes resources that can be described.

Functions

func Describe

func Describe(client *meshkitkube.Client, options DescriberOptions) (string, error)

The Describe() function takes a meshkitkube.Client object and a DescriberOptions object as input. And it returns the description of the specified Kubernetes resource as a string.

func ErrGetDescriberFunc

func ErrGetDescriberFunc() error

Types

type DescribeType

type DescribeType int

DescribeType is an integer value that represents the Kubernetes resource that needs to be described.

type DescriberOptions

type DescriberOptions struct {
	Name       string       // Name of the kubernetes obj
	Namespace  string       // Namespace of the kubernetes obj
	ShowEvents bool         // A boolean flag indicating whether to show events associated with the Kubernetes object or not.
	ChunkSize  int64        //Size of the chunk in which the Kubernetes object's output is written.
	Type       DescribeType //an integer value that represents the Kubernetes source that needs to be described
}

DescriberOptions give control of which kubernetes object to describe.

Jump to

Keyboard shortcuts

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