cli

package
v0.0.0-...-adcd0ef Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	KubernetesConfigFlags *genericclioptions.ConfigFlags
)

Functions

func NewDumpCmd

func NewDumpCmd(ctx context.Context, in io.Reader, out io.Writer, err io.Writer) *cobra.Command

func NewLoadCmd

func NewLoadCmd(ctx context.Context, in io.Reader, out io.Writer, err io.Writer) *cobra.Command

Types

type MetaData

type MetaData struct {
	Annotations map[string]string `yaml:"annotations,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
}

func (MetaData) NotEmpty

func (m MetaData) NotEmpty() bool

type Options

type Options struct {
	genericclioptions.IOStreams

	Name      string
	Namespace string

	// Kind is the kind of object we are operating on.
	Kind string

	Directory string

	Data map[string][]byte

	MetaData MetaData

	Printer printers.ResourcePrinter
	// contains filtered or unexported fields
}

func (*Options) EnsureDirectory

func (o *Options) EnsureDirectory() error

func (*Options) GetConfigMap

func (o *Options) GetConfigMap() *v1.ConfigMap

func (*Options) GetSecret

func (o *Options) GetSecret() *v1.Secret

func (*Options) ReadData

func (o *Options) ReadData() error

func (*Options) SetData

func (o *Options) SetData(data interface{}) error

func (*Options) SetDirectory

func (o *Options) SetDirectory(pathComponents ...string)

func (*Options) Setup

func (o *Options) Setup(f cmdutil.Factory) error

Setup initialises the RestConfig, Clientset, and Namespace fields.

func (*Options) ValidateArguments

func (o *Options) ValidateArguments(cmd *cobra.Command, args []string) error

ValidateArguments validates the arguments passed to a command. It meets the requirements for the cobra.Command Args field, so it can be passed in directly. Note that all the commands here take the same argument set.

func (*Options) ValidateArgumentsRoot

func (o *Options) ValidateArgumentsRoot(cmd *cobra.Command, args []string) error

ValidateArguments validates the arguments passed to a command. It meets the requirements for the cobra.Command Args field, so it can be passed in directly. Note that all the commands here take the same argument set.

func (*Options) WriteData

func (o *Options) WriteData() error

Jump to

Keyboard shortcuts

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