Documentation ¶
Index ¶
- Constants
- func Config(kubeconfig, kubecontext, baseName string, qps float32, burst int) (*rest.Config, error)
- func LoadConfig() (map[string]string, error)
- func SaveConfig(config map[string]string) error
- type Creator
- type Dynamic
- type DynamicFactory
- type Factory
- type Getter
- type Lister
- type Patcher
- type Watcher
Constants ¶
const (
ConfigKeyNamespace = "namespace"
)
Variables ¶
This section is empty.
Functions ¶
func Config ¶
Config returns a *rest.Config, using either the kubeconfig (if specified) or an in-cluster configuration.
func LoadConfig ¶ added in v0.7.0
LoadConfig loads the Velero client configuration file and returns it as a map[string]string. If the file does not exist, an empty map is returned.
func SaveConfig ¶ added in v0.7.0
SaveConfig saves the passed in config map to the Velero client configuration file.
Types ¶
type Creator ¶ added in v0.5.0
type Creator interface { // Create creates an object. Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error) }
Creator creates an object.
type Dynamic ¶
Dynamic contains client methods that Velero needs for backing up and restoring resources.
type DynamicFactory ¶
type DynamicFactory interface { // ClientForGroupVersionResource returns a Dynamic client for the given group/version // and resource for the given namespace. ClientForGroupVersionResource(gv schema.GroupVersion, resource metav1.APIResource, namespace string) (Dynamic, error) }
DynamicFactory contains methods for retrieving dynamic clients for GroupVersionResources and GroupVersionKinds.
func NewDynamicFactory ¶
func NewDynamicFactory(dynamicClient dynamic.Interface) DynamicFactory
NewDynamicFactory returns a new ClientPool-based dynamic factory.
type Factory ¶
type Factory interface { // BindFlags binds common flags (--kubeconfig, --namespace) to the passed-in FlagSet. BindFlags(flags *pflag.FlagSet) // Client returns a VeleroClient. It uses the following priority to specify the cluster // configuration: --kubeconfig flag, KUBECONFIG environment variable, in-cluster configuration. Client() (clientset.Interface, error) // KubeClient returns a Kubernetes client. It uses the following priority to specify the cluster // configuration: --kubeconfig flag, KUBECONFIG environment variable, in-cluster configuration. KubeClient() (kubernetes.Interface, error) // DynamicClient returns a Kubernetes dynamic client. It uses the following priority to specify the cluster // configuration: --kubeconfig flag, KUBECONFIG environment variable, in-cluster configuration. DynamicClient() (dynamic.Interface, error) // SetBasename changes the basename for an already-constructed client. // This is useful for generating clients that require a different user-agent string below the root `velero` // command, such as the server subcommand. SetBasename(string) // SetClientQPS sets the Queries Per Second for a client. SetClientQPS(float32) // SetClientBurst sets the Burst for a client. SetClientBurst(int) // ClientConfig returns a rest.Config struct used for client-go clients. ClientConfig() (*rest.Config, error) // Namespace returns the namespace which the Factory will create clients for. Namespace() string }
Factory knows how to create a VeleroClient and Kubernetes client.
type Getter ¶ added in v0.5.0
type Getter interface { // Get fetches an object by name. Get(name string, opts metav1.GetOptions) (*unstructured.Unstructured, error) }
Getter gets an object.
type Lister ¶ added in v0.5.0
type Lister interface { // List lists all the objects of a given resource. List(metav1.ListOptions) (runtime.Object, error) }
Lister lists objects.
type Patcher ¶ added in v0.9.0
type Patcher interface {
Patch(name string, data []byte) (*unstructured.Unstructured, error)
}
Patcher patches an object.