client

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Overview

Copyright © 2019 Banzai Cloud

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.

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.

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.

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.

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

This section is empty.

Functions

func GetConfigWithContext

func GetConfigWithContext(kubeconfigPath, kubeContext string) (*rest.Config, error)

GetConfig returns kubernetes config based on the current environment. If fpath is provided, loads configuration from that file. Otherwise, GetConfig uses default strategy to load configuration from $KUBECONFIG, .kube/config, or just returns in-cluster config.

func GetRawConfig

func GetRawConfig(kubeconfigPath, kubeContext string) (api.Config, error)

GetRawConfig creates a raw clientcmd api config

func GetScheme

func GetScheme() *runtime.Scheme

GetScheme gets an initialized runtime.Scheme with k8s core added by default

Types

type Client

type Client interface {
	client.Client
}

Client knows how to perform CRUD operations on Kubernetes objects

func NewClient

func NewClient(config *rest.Config, options Options) (Client, error)

New returns a new Client using the provided config and Options. The returned client reads *and* writes directly from the server (it doesn't use object caches). It understands how to work with normal types (both custom resources and aggregated/built-in resources), as well as unstructured types.

In the case of normal types, the scheme will be used to look up the corresponding group, version, and kind for the given type. In the case of unstrctured types, the group, version, and kind will be extracted from the corresponding fields on the object.

func NewClientFromKubeconfigAndContext

func NewClientFromKubeconfigAndContext(kubeconfigPath, kubeContext string) (Client, error)

type Manager

type Manager = manager.Manager

Manager initializes Caches and Clients

func NewManager

func NewManager(config *rest.Config, quit <-chan struct{}, options ManagerOptions) (Manager, error)

New returns a new Manager with initialized client caches

type ManagerOptions

type ManagerOptions = manager.Options

type Options

type Options struct {
	// Scheme, if provided, will be used to map go structs to GroupVersionKinds
	Scheme *runtime.Scheme

	// Mapper, if provided, will be used to map GroupVersionKinds to Resources
	Mapper meta.RESTMapper
}

Options are creation options for a Client

Jump to

Keyboard shortcuts

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