agent

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 11 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 ConfirmInstallation

func ConfirmInstallation()

func CreateRandomProject

func CreateRandomProject(userID string, cred types.Credentials) string

func DiscoverPlatform

func DiscoverPlatform(kubeconfig *string) string

discoverPlatform determines the host platform and returns it

func GetAgentDetails

func GetAgentDetails(mode string, pid string, c types.Credentials, kubeconfig *string) (types.Agent, error)

GetAgentDetails take details of chaos delegate as input

func GetModeType

func GetModeType() string

GetModeType gets mode of chaos delegate installation as input

func GetPlatformName

func GetPlatformName(kubeconfig *string) string

- Entering any character other than numbers returns 0. Input validation need to be done. - If input is given as "123abc", "abc" will be used for next user input. Buffer need to be read completely. - String literals like "AWS" are used at multiple places. Need to be changed to constants.

func GetProjectID

func GetProjectID(u apis.ProjectDetails) string

GetProjectID display list of projects and returns the project id based on input

func IsAWSPlatform

func IsAWSPlatform(kubeconfig *string) (bool, error)

IsAWSPlatform determines if the host platform is AWS by checking the ProviderID inside node spec

Sample node custom resource of an AWS node

{
    "apiVersion": "v1",
    "kind": "Node",
    ....
    "spec": {
        "providerID": "aws:///us-east-2b/i-0bf24d83f4b993738"
    }
  }
}

func IsGKEPlatform

func IsGKEPlatform(kubeconfig *string) (bool, error)

IsGKEPlatform determines if the host platform is GKE by checking the ProviderID inside node spec

Sample node custom resource of an GKE node

{
    "apiVersion": "v1",
    "kind": "Node",
    ....
    "spec": {
        "providerID": ""
    }
  }
}

func IsOpenshiftPlatform

func IsOpenshiftPlatform(kubeconfig *string) (bool, error)

IsOpenshiftPlatform determines if the host platform is Openshift by checking "node.openshift.io/os_id" label on the nodes

Sample node custom resource of an Openshift node

{
    "apiVersion": "v1",
    "kind": "Node",
    "metadata": {
        "labels": {
            "node.openshift.io/os_id": "rhcos"
        }
   }
   ....
}

func Summary

func Summary(agent types.Agent, kubeconfig *string)

Summary display the chaos delegate details based on input

func ValidateSAPermissions

func ValidateSAPermissions(namespace string, mode string, kubeconfig *string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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