v1

package
v0.0.79 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

README



AKS

AZURE_SUBSCRIPTION_ID
AZURE_RESOURCE_GROUP



EKS

KS_CLOUD_REGION


GKE

KS_GKE_PROJECT
KS_CLOUD_REGION


General

KS_CLOUD_PROVIDER
KS_KUBE_CLUSTER

Documentation

Index

Constants

View Source
const (
	TypeCloudProviderDescribe workloadinterface.ObjectType = "CloudProviderDescribe"
	Version                                                = "v1"
	AKS                                                    = "aks"
	GKE                                                    = "gke"
	EKS                                                    = "eks"
)
View Source
const (
	KS_CLOUD_REGION_ENV_VAR = "KS_CLOUD_REGION"
)

Variables

View Source
var (
	AZURE_SUBSCRIPTION_ID_ENV_VAR = "AZURE_SUBSCRIPTION_ID"
	AZURE_RESOURCE_GROUP_ENV_VAR  = "AZURE_RESOURCE_GROUP"
)
View Source
var (
	KS_GKE_PROJECT_ENV_VAR = "KS_GKE_PROJECT"
)

Functions

func IsTypeDescriptiveInfoFromCloudProvider

func IsTypeDescriptiveInfoFromCloudProvider(object map[string]interface{}) bool

DEPRECATED - Use apis.IsTypeDescriptiveInfoFromCloudProvider instead

Types

type AKSSupport added in v0.0.69

type AKSSupport struct {
}

func NewAKSSupport added in v0.0.69

func NewAKSSupport() *AKSSupport

func (*AKSSupport) GetClusterDescribe added in v0.0.69

func (AKSSupport *AKSSupport) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*containerservice.ManagedCluster, error)

Get descriptive info about cluster running in AKS.

func (*AKSSupport) GetContextName added in v0.0.69

func (AKSSupport *AKSSupport) GetContextName(managedCluster *containerservice.ManagedCluster) string

func (*AKSSupport) GetResourceGroup added in v0.0.69

func (AKSSupport *AKSSupport) GetResourceGroup() (string, error)

func (*AKSSupport) GetSubscriptionID added in v0.0.69

func (AKSSupport *AKSSupport) GetSubscriptionID() (string, error)

type AKSSupportMock added in v0.0.69

type AKSSupportMock struct {
}

func NewAKSSupportMock added in v0.0.69

func NewAKSSupportMock() *AKSSupportMock

func (*AKSSupportMock) GetClusterDescribe added in v0.0.69

func (AKSSupportM *AKSSupportMock) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*containerservice.ManagedCluster, error)

Get descriptive info about cluster running in AKS.

func (*AKSSupportMock) GetContextName added in v0.0.69

func (AKSSupportM *AKSSupportMock) GetContextName(managedCluster *containerservice.ManagedCluster) string

func (*AKSSupportMock) GetResourceGroup added in v0.0.69

func (AKSSupportM *AKSSupportMock) GetResourceGroup() (string, error)

func (*AKSSupportMock) GetSubscriptionID added in v0.0.69

func (AKSSupportM *AKSSupportMock) GetSubscriptionID() (string, error)

type CloudProviderDescribe

type CloudProviderDescribe struct {
	ApiVersion string                 `json:"apiVersion"`
	Kind       string                 `json:"kind"`
	Metadata   CloudProviderMetadata  `json:"metadata"`
	Data       map[string]interface{} `json:"data"`
}

CloudProviderDescribe: =========================

CloudProviderDescribe is the desc

func GetClusterDescribeAKS added in v0.0.69

func GetClusterDescribeAKS(aksSupport IAKSSupport, cluster string, subscriptionId string, resourceGroup string) (*CloudProviderDescribe, error)

Get descriptive info about cluster running in AKS.

func GetClusterDescribeEKS

func GetClusterDescribeEKS(eksSupport IEKSSupport, cluster string, region string) (*CloudProviderDescribe, error)

Get descriptive info about cluster running in EKS.

func GetClusterDescribeGKE

func GetClusterDescribeGKE(gkeSupport IGKESupport, clusterName string, region string, project string) (*CloudProviderDescribe, error)

Get descriptive info about cluster running in GKE.

func NewDescriptiveInfoFromCloudProvider

func NewDescriptiveInfoFromCloudProvider(object map[string]interface{}) *CloudProviderDescribe

NewDescriptiveInfoFromCloudProvider construct a CloudProviderDescribe from map[string]interface{}. If the map does not match the object, will return nil

func (*CloudProviderDescribe) GetApiVersion

func (description *CloudProviderDescribe) GetApiVersion() string

func (*CloudProviderDescribe) GetData

func (description *CloudProviderDescribe) GetData() map[string]interface{}

func (*CloudProviderDescribe) GetID

func (description *CloudProviderDescribe) GetID() string

ApiVersion/Kind/Name

func (*CloudProviderDescribe) GetKind

func (description *CloudProviderDescribe) GetKind() string

func (*CloudProviderDescribe) GetName

func (description *CloudProviderDescribe) GetName() string

func (*CloudProviderDescribe) GetNamespace

func (description *CloudProviderDescribe) GetNamespace() string

Compatible with the IMetadata interface

func (*CloudProviderDescribe) GetObject

func (description *CloudProviderDescribe) GetObject() map[string]interface{}

func (*CloudProviderDescribe) GetObjectType

func (description *CloudProviderDescribe) GetObjectType() workloadinterface.ObjectType

func (*CloudProviderDescribe) GetProvider

func (description *CloudProviderDescribe) GetProvider() string

provider -> eks/gke/etc.

func (*CloudProviderDescribe) GetWorkload

func (description *CloudProviderDescribe) GetWorkload() map[string]interface{}

func (*CloudProviderDescribe) SetApiVersion

func (description *CloudProviderDescribe) SetApiVersion(apiVersion string)

func (*CloudProviderDescribe) SetData

func (description *CloudProviderDescribe) SetData(data map[string]interface{})

func (*CloudProviderDescribe) SetKind

func (description *CloudProviderDescribe) SetKind(kind string)

func (*CloudProviderDescribe) SetName

func (description *CloudProviderDescribe) SetName(name string)

func (*CloudProviderDescribe) SetNamespace

func (description *CloudProviderDescribe) SetNamespace(namespace string)

========================================================================================================== ============================== CloudProviderDescribe ================================================== ========================================================================================================== Setters

func (*CloudProviderDescribe) SetObject

func (description *CloudProviderDescribe) SetObject(object map[string]interface{})

func (*CloudProviderDescribe) SetProvider

func (description *CloudProviderDescribe) SetProvider(provider string)

func (*CloudProviderDescribe) SetWorkload

func (description *CloudProviderDescribe) SetWorkload(object map[string]interface{})

type CloudProviderMetadata

type CloudProviderMetadata struct {
	Name     string `json:"name"`
	Provider string `json:"provider"`
}

CloudProviderMetadata: ===================== Metadata of a cloud provider object. This object may be any configuration object supported by the cloud provider

Name: Object name Provider: CloudProvider name eks/gke/etc.

func (*CloudProviderMetadata) GetName

func (cloudProviderMetadata *CloudProviderMetadata) GetName() string

getters

func (*CloudProviderMetadata) GetProvider

func (cloudProviderMetadata *CloudProviderMetadata) GetProvider() string

func (*CloudProviderMetadata) SetName

func (cloudProviderMetadata *CloudProviderMetadata) SetName(name string)

setters

func (*CloudProviderMetadata) SetProvider

func (cloudProviderMetadata *CloudProviderMetadata) SetProvider(provider string)

type EKSSupport

type EKSSupport struct {
}

func NewEKSSupport

func NewEKSSupport() *EKSSupport

func (*EKSSupport) GetClusterDescribe

func (eksSupport *EKSSupport) GetClusterDescribe(cluster string, region string) (*eks.DescribeClusterOutput, error)

func (*EKSSupport) GetContextName added in v0.0.69

func (eksSupport *EKSSupport) GetContextName(cluster string) string

Context can be in one of 2 ways: 1. arn:aws:eks:<region>:<id>:cluster/<cluster_name> --> Usually this will be in context 2. arn:aws:eks:<region>:<id>:cluster-<cluster_name> --> Usually we will get 'cluster' param like this

func (*EKSSupport) GetName

func (eksSupport *EKSSupport) GetName(describe *eks.DescribeClusterOutput) string

getName get cluster name from describe

func (*EKSSupport) GetRegion added in v0.0.69

func (eksSupport *EKSSupport) GetRegion(cluster string) (string, error)

type EKSSupportMock

type EKSSupportMock struct {
}

func NewEKSSupportMock

func NewEKSSupportMock() *EKSSupportMock

func (*EKSSupportMock) GetClusterDescribe

func (eksSupportM *EKSSupportMock) GetClusterDescribe(currContext string, region string) (*eks.DescribeClusterOutput, error)

Get descriptive info about cluster running in EKS.

func (*EKSSupportMock) GetContextName added in v0.0.69

func (eksSupport *EKSSupportMock) GetContextName(cluster string) string

func (*EKSSupportMock) GetName

func (eksSupportM *EKSSupportMock) GetName(describe *eks.DescribeClusterOutput) string

getName get cluster name from describe

func (*EKSSupportMock) GetRegion added in v0.0.69

func (eksSupportM *EKSSupportMock) GetRegion(cluster string) (string, error)

type GKESupport

type GKESupport struct {
}

func NewGKESupport

func NewGKESupport() *GKESupport

func (*GKESupport) GetAuthorizationKey added in v0.0.61

func (gkeSupport *GKESupport) GetAuthorizationKey() (string, error)

func (*GKESupport) GetClusterDescribe

func (gkeSupport *GKESupport) GetClusterDescribe(cluster string, region string, project string) (*containerpb.Cluster, error)

Get descriptive info about cluster running in GKE.

func (*GKESupport) GetContextName added in v0.0.69

func (gkeSupport *GKESupport) GetContextName(cluster string) string

func (*GKESupport) GetName

func (gkeSupport *GKESupport) GetName(clusterDescribe *containerpb.Cluster) string

func (*GKESupport) GetProject added in v0.0.69

func (gkeSupport *GKESupport) GetProject(cluster string) (string, error)

func (*GKESupport) GetRegion added in v0.0.69

func (gkeSupport *GKESupport) GetRegion(cluster string) (string, error)

type GKESupportMock

type GKESupportMock struct {
}

func NewGKESupportMock

func NewGKESupportMock() *GKESupportMock

func (*GKESupportMock) GetClusterDescribe

func (gkeSupportM *GKESupportMock) GetClusterDescribe(cluster string, region string, project string) (*containerpb.Cluster, error)

Get descriptive info about cluster running in GKE.

func (*GKESupportMock) GetContextName added in v0.0.69

func (gkeSupportM *GKESupportMock) GetContextName(cluster string) string

func (*GKESupportMock) GetName

func (gkeSupportM *GKESupportMock) GetName(clusterDescribe *containerpb.Cluster) string

func (*GKESupportMock) GetProject added in v0.0.69

func (gkeSupportM *GKESupportMock) GetProject(cluster string) (string, error)

func (*GKESupportMock) GetRegion added in v0.0.69

func (gkeSupportM *GKESupportMock) GetRegion(cluster string) (string, error)

type IAKSSupport added in v0.0.69

type IAKSSupport interface {
	GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*containerservice.ManagedCluster, error)
	GetContextName(*containerservice.ManagedCluster) string
	GetSubscriptionID() (string, error)
	GetResourceGroup() (string, error)
}

type IEKSSupport

type IEKSSupport interface {
	GetClusterDescribe(currContext string, region string) (*eks.DescribeClusterOutput, error)
	GetName(*eks.DescribeClusterOutput) string
	GetRegion(cluster string) (string, error)
	GetContextName(cluster string) string
}

type IGKESupport

type IGKESupport interface {
	GetClusterDescribe(cluster string, region string, project string) (*containerpb.Cluster, error)
	GetName(clusterDescribe *containerpb.Cluster) string
	GetProject(cluster string) (string, error)
	GetRegion(cluster string) (string, error)
	GetContextName(cluster string) string
}

Jump to

Keyboard shortcuts

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