kube

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigClient

func CreateConfigClient(kubeconfigPath string) clientcmd.ClientConfig

Create a Configclient

func GenerateTemporaryKubeconfig

func GenerateTemporaryKubeconfig(context string) (string, error)

Generate a temporary kubeconfig file

func GetRawAPIConfig

func GetRawAPIConfig(kubeconfigPath string) (*api.Config, error)

Create a Rawconfig

func GetServerVersion

func GetServerVersion(clientConfig *rest.Config) string

func List

func List(kubeContext string) (*[]KubeResource, string, error)

List all resources

Types

type DeprecatedResource

type DeprecatedResource struct {
	GroupVersion       string `json:"groupVersion" yaml:"groupVersion"`
	APIResource        string `json:"apiResource" yaml:"apiResource"`
	NewGroupVersion    string `json:"newGroupVersion" yaml:"newGroupVersion"`
	DeprecationVersion string `json:"deprecationVersion" yaml:"deprecationVersion"`
	RemovalVersion     string `json:"removalVersion" yaml:"removalVersion"`
	BreakingChange     bool   `json:"breakingChange" yaml:"breakingChange"`
	Details            string `json:"details,omitempty" yaml:"details,omitempty"`
}

type DeprecatedResources

type DeprecatedResources struct {
	DeprecatedResources map[string][]DeprecatedResource `json:"resources" yaml:"resources"`
}

func (*DeprecatedResources) GVRSBuilder

func (d *DeprecatedResources) GVRSBuilder() []schema.GroupVersionResource

func (*DeprecatedResources) GVRSParser

func (d *DeprecatedResources) GVRSParser(r KubeResource) bool

Parse GVRS

func (*DeprecatedResources) Load

func (d *DeprecatedResources) Load()

Load the deprecated API resources from YAML file

func (*DeprecatedResources) ManifestParser

func (d *DeprecatedResources) ManifestParser(m string) []*Resource

Parse a release to get its Kubernetes resources and verify if any are deprecated

type Kube

type Kube struct {
	Config          api.Config
	ClientConfig    *rest.Config
	Contexts        []string
	SelectedContext string
	ClusterVersion  string
}

type KubeResource

type KubeResource struct {
	Namespace    string `json:"namespace" yaml:"namespace"`
	Name         string `json:"name" yaml:"name"`
	Kind         string `json:"kind" yaml:"kind"`
	GroupVersion string `json:"groupVersion" yaml:"groupVersion"`
}

nolint: revive

type Resource

type Resource struct {
	Kind       string `json:"kind" yaml:"kind"`
	APIVersion string `json:"apiVersion" yaml:"apiVersion"`
	Metadata   struct {
		Name string `json:"name" yaml:"name"`
	} `json:"metadata" yaml:"metadata"`
	DeprecatedResource DeprecatedResource `json:"deprecatedResource,omitempty" yaml:"deprecatedResource,omitempty"`
	Error              string             `json:"error,omitempty" yaml:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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