k8s

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright © 2021 The LitmusChaos Authors

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 ApplyYaml

func ApplyYaml(params ApplyYamlPrams, kubeconfig string, isLocal bool) (output string, err error)

func CheckSAPermissions

func CheckSAPermissions(params CheckSAPermissionsParams, kubeconfig *string) (bool, error)

func ClientSet

func ClientSet(kubeconfig *string) (*kubernetes.Clientset, error)

Returns a new kubernetes client set

func GetConfigMap added in v0.5.0

func GetConfigMap(c context.Context, name string, namespace string) (map[string]string, error)

GetConfigMap returns config map for a given name and namespace

func NsExists

func NsExists(namespace string, kubeconfig *string) (bool, error)

NsExists checks if the given namespace already exists

func SAExists

func SAExists(params SAExistsParams, kubeconfig *string) bool

SAExists checks if the given service account exists in the given namespace

func ValidNs

func ValidNs(mode string, label string, kubeconfig *string) (string, bool)

ValidNs takes a valid namespace as input from user

func ValidSA

func ValidSA(namespace string, kubeconfig *string) (string, bool)

ValidSA gets a valid service account as input

func WatchPod

func WatchPod(params WatchPodParams, kubeconfig *string)

WatchPod watches for the pod status

Types

type ApplyYamlPrams

type ApplyYamlPrams struct {
	Token    string
	Endpoint string
	YamlPath string
}

Token: Authorization token EndPoint: Endpoint in .litmusconfig YamlPath: Path of yaml file

type CanIOptions

type CanIOptions struct {
	NoHeaders       bool
	Namespace       string
	AuthClient      authorizationv1client.AuthorizationV1Interface
	DiscoveryClient discovery.DiscoveryInterface

	Verb         string
	Resource     schema.GroupVersionResource
	Subresource  string
	ResourceName string
}

type CheckSAPermissionsParams

type CheckSAPermissionsParams struct {
	Verb      string
	Resource  string
	Print     bool
	Namespace string
}

type PodList

type PodList struct {
	Items []string
}

type SAExistsParams

type SAExistsParams struct {
	Namespace      string
	Serviceaccount string
}

type WatchPodParams

type WatchPodParams struct {
	Namespace string
	Label     string
}

Jump to

Keyboard shortcuts

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