k8s_config

package
v0.0.0-...-24f2d34 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// K8s config kinds.
	ClusterRoleKind        = "ClusterRole"
	ClusterRoleBindingKind = "ClusterRoleBinding"
	CronJobKind            = "CronJob"
	DaemonSetKind          = "DaemonSet"
	DeploymentKind         = "Deployment"
	NamespaceKind          = "Namespace"
	PodSecurityPolicyKind  = "PodSecurityPolicy"
	RoleBindingKind        = "RoleBinding"
	ServiceKind            = "Service"
	ServiceAccountKind     = "ServiceAccount"
	StatefulSetKind        = "StatefulSet"

	// Unsupported kinds.
	BackendConfigKind        = "BackendConfig"
	ClusterPodMonitoringKind = "ClusterPodMonitoring"
	ClusterRulesKind         = "ClusterRules"
	ConfigMapKind            = "ConfigMap"
	IngressKind              = "Ingress"
	OperatorConfigKind       = "OperatorConfig"
	PodDisruptionBudgetKind  = "PodDisruptionBudget"
	StorageClassKind         = "StorageClass"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteRange

type ByteRange struct {
	Start int
	End   int
}

func SplitYAMLDocs

func SplitYAMLDocs(contents []byte) ([][]byte, []*ByteRange)

SplitYAMLDocs splits the given YAML file contents into its component YAML documents. Returns the documents and their line ranges within the file.

type K8sConfigFile

type K8sConfigFile struct {
	ClusterRole        []*rbac.ClusterRole
	ClusterRoleBinding []*rbac.ClusterRoleBinding
	CronJob            []*batch.CronJob
	DaemonSet          []*apps.DaemonSet
	Deployment         []*apps.Deployment
	Namespace          []*core.Namespace
	PodSecurityPolicy  []*policy.PodSecurityPolicy
	RoleBinding        []*rbac.RoleBinding
	Service            []*core.Service
	ServiceAccount     []*core.ServiceAccount
	StatefulSet        []*apps.StatefulSet
}

func ParseK8sConfigFile

func ParseK8sConfigFile(contents []byte) (*K8sConfigFile, map[interface{}]*ByteRange, error)

ParseK8sConfigFile parses the given config file contents and returns the configs it contains.

func ParseYamlDoc

func ParseYamlDoc(yamlDoc []byte) (*K8sConfigFile, error)

ParseYamlDoc parses a single YAML document and returns the configs it contains.

Jump to

Keyboard shortcuts

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