config

package
v0.33.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const GroupName = "kubectl.config.k8s.io"

GroupName is the group name used in this package

Variables

View Source
var (
	// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

SchemeGroupVersion is group version used to register these objects

Functions

This section is empty.

Types

type AliasOverride

type AliasOverride struct {
	// Name is the name of alias that can only include alphabetical characters
	// If the alias name conflicts with the built-in command,
	// built-in command will be used.
	Name string
	// Command is the single or set of commands to execute, such as "set env" or "create"
	Command string
	// PrependArgs stores the arguments such as resource names, etc.
	// These arguments are inserted after the alias name.
	PrependArgs []string
	// AppendArgs stores the arguments such as resource names, etc.
	// These arguments are appended to the USER_ARGS.
	AppendArgs []string
	// Flag is allocated to store the flag definitions of alias
	Flags []CommandOverrideFlag
}

AliasOverride stores the alias definitions.

func (*AliasOverride) DeepCopy

func (in *AliasOverride) DeepCopy() *AliasOverride

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AliasOverride.

func (*AliasOverride) DeepCopyInto

func (in *AliasOverride) DeepCopyInto(out *AliasOverride)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CommandOverride

type CommandOverride struct {
	// Command refers to a command whose flag's default value is changed.
	Command string
	// Flags is a list of flags storing different default values.
	Flags []CommandOverrideFlag
}

CommandOverride stores the commands and their associated flag's default values.

func (*CommandOverride) DeepCopy

func (in *CommandOverride) DeepCopy() *CommandOverride

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommandOverride.

func (*CommandOverride) DeepCopyInto

func (in *CommandOverride) DeepCopyInto(out *CommandOverride)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CommandOverrideFlag

type CommandOverrideFlag struct {
	// Flag name (long form, without dashes).
	Name string `json:"name"`

	// In a string format of a default value. It will be parsed
	// by kubectl to the compatible value of the flag.
	Default string `json:"default"`
}

CommandOverrideFlag stores the name and the specified default value of the flag.

func (*CommandOverrideFlag) DeepCopy

func (in *CommandOverrideFlag) DeepCopy() *CommandOverrideFlag

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommandOverrideFlag.

func (*CommandOverrideFlag) DeepCopyInto

func (in *CommandOverrideFlag) DeepCopyInto(out *CommandOverrideFlag)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Preference

type Preference struct {
	metav1.TypeMeta

	// overrides allows changing default flag values of commands.
	// This is especially useful, when user doesn't want to explicitly
	// set flags each time.
	// +optional
	Overrides []CommandOverride

	// aliases allows defining command aliases for existing kubectl commands, with optional default flag values.
	// If the alias name collides with a built-in command, built-in command always takes precedence.
	// Flag overrides defined in the overrides section do NOT apply to aliases for the same command.
	// kubectl [ALIAS NAME] [USER_FLAGS] [USER_EXPLICIT_ARGS] expands to
	// kubectl [COMMAND] # built-in command alias points to
	//         [KUBERC_PREPEND_ARGS]
	//         [USER_FLAGS]
	//         [KUBERC_FLAGS] # rest of the flags that are not passed by user in [USER_FLAGS]
	//         [USER_EXPLICIT_ARGS]
	//         [KUBERC_APPEND_ARGS]
	// e.g.
	// - name: runx
	//   command: run
	//   flags:
	//   - name: image
	//     default: nginx
	//   appendArgs:
	//   - --
	//   - custom-arg1
	// For example, if user invokes "kubectl runx test-pod" command,
	// this will be expanded to "kubectl run --image=nginx test-pod -- custom-arg1"
	// - name: getn
	//   command: get
	//   flags:
	//   - name: output
	//     default: wide
	//   prependArgs:
	//   - node
	// "kubectl getn control-plane-1" expands to "kubectl get node control-plane-1 --output=wide"
	// "kubectl getn control-plane-1 --output=json" expands to "kubectl get node --output=json control-plane-1"
	// +optional
	Aliases []AliasOverride
}

Preference stores elements of KubeRC configuration file

func (*Preference) DeepCopy

func (in *Preference) DeepCopy() *Preference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Preference.

func (*Preference) DeepCopyInto

func (in *Preference) DeepCopyInto(out *Preference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Preference) DeepCopyObject

func (in *Preference) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

Directories

Path Synopsis
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery.
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳