Documentation ¶
Index ¶
- Constants
- Variables
- func IsTypeDescriptiveInfoFromCloudProvider(object map[string]interface{}) bool
- type AKSSupport
- func (AKSSupport *AKSSupport) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*containerservice.ManagedCluster, error)
- func (AKSSupport *AKSSupport) GetContextName(managedCluster *containerservice.ManagedCluster) string
- func (AKSSupport *AKSSupport) GetResourceGroup() (string, error)
- func (AKSSupport *AKSSupport) GetSubscriptionID() (string, error)
- type AKSSupportMock
- func (AKSSupportM *AKSSupportMock) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*containerservice.ManagedCluster, error)
- func (AKSSupportM *AKSSupportMock) GetContextName(managedCluster *containerservice.ManagedCluster) string
- func (AKSSupportM *AKSSupportMock) GetResourceGroup() (string, error)
- func (AKSSupportM *AKSSupportMock) GetSubscriptionID() (string, error)
- type CloudProviderDescribe
- func GetClusterDescribeAKS(aksSupport IAKSSupport, cluster string, subscriptionId string, ...) (*CloudProviderDescribe, error)
- func GetClusterDescribeEKS(eksSupport IEKSSupport, cluster string, region string) (*CloudProviderDescribe, error)
- func GetClusterDescribeGKE(gkeSupport IGKESupport, clusterName string, region string, project string) (*CloudProviderDescribe, error)
- func NewDescriptiveInfoFromCloudProvider(object map[string]interface{}) *CloudProviderDescribe
- func (description *CloudProviderDescribe) GetApiVersion() string
- func (description *CloudProviderDescribe) GetData() map[string]interface{}
- func (description *CloudProviderDescribe) GetID() string
- func (description *CloudProviderDescribe) GetKind() string
- func (description *CloudProviderDescribe) GetName() string
- func (description *CloudProviderDescribe) GetNamespace() string
- func (description *CloudProviderDescribe) GetObject() map[string]interface{}
- func (description *CloudProviderDescribe) GetObjectType() workloadinterface.ObjectType
- func (description *CloudProviderDescribe) GetProvider() string
- func (description *CloudProviderDescribe) GetWorkload() map[string]interface{}
- func (description *CloudProviderDescribe) SetApiVersion(apiVersion string)
- func (description *CloudProviderDescribe) SetData(data map[string]interface{})
- func (description *CloudProviderDescribe) SetKind(kind string)
- func (description *CloudProviderDescribe) SetName(name string)
- func (description *CloudProviderDescribe) SetNamespace(namespace string)
- func (description *CloudProviderDescribe) SetObject(object map[string]interface{})
- func (description *CloudProviderDescribe) SetProvider(provider string)
- func (description *CloudProviderDescribe) SetWorkload(object map[string]interface{})
- type CloudProviderMetadata
- type EKSSupport
- func (eksSupport *EKSSupport) GetClusterDescribe(cluster string, region string) (*eks.DescribeClusterOutput, error)
- func (eksSupport *EKSSupport) GetContextName(cluster string) string
- func (eksSupport *EKSSupport) GetName(describe *eks.DescribeClusterOutput) string
- func (eksSupport *EKSSupport) GetRegion(cluster string) (string, error)
- type EKSSupportMock
- func (eksSupportM *EKSSupportMock) GetClusterDescribe(currContext string, region string) (*eks.DescribeClusterOutput, error)
- func (eksSupport *EKSSupportMock) GetContextName(cluster string) string
- func (eksSupportM *EKSSupportMock) GetName(describe *eks.DescribeClusterOutput) string
- func (eksSupportM *EKSSupportMock) GetRegion(cluster string) (string, error)
- type GKESupport
- func (gkeSupport *GKESupport) GetAuthorizationKey() (string, error)
- func (gkeSupport *GKESupport) GetClusterDescribe(cluster string, region string, project string) (*containerpb.Cluster, error)
- func (gkeSupport *GKESupport) GetContextName(cluster string) string
- func (gkeSupport *GKESupport) GetName(clusterDescribe *containerpb.Cluster) string
- func (gkeSupport *GKESupport) GetProject(cluster string) (string, error)
- func (gkeSupport *GKESupport) GetRegion(cluster string) (string, error)
- type GKESupportMock
- func (gkeSupportM *GKESupportMock) GetClusterDescribe(cluster string, region string, project string) (*containerpb.Cluster, error)
- func (gkeSupportM *GKESupportMock) GetContextName(cluster string) string
- func (gkeSupportM *GKESupportMock) GetName(clusterDescribe *containerpb.Cluster) string
- func (gkeSupportM *GKESupportMock) GetProject(cluster string) (string, error)
- func (gkeSupportM *GKESupportMock) GetRegion(cluster string) (string, error)
- type IAKSSupport
- type IEKSSupport
- type IGKESupport
Constants ¶
const ( TypeCloudProviderDescribe workloadinterface.ObjectType = "CloudProviderDescribe" Version = "v1" AKS = "aks" GKE = "gke" EKS = "eks" )
const (
KS_CLOUD_REGION_ENV_VAR = "KS_CLOUD_REGION"
)
Variables ¶
var ( AZURE_SUBSCRIPTION_ID_ENV_VAR = "AZURE_SUBSCRIPTION_ID" AZURE_RESOURCE_GROUP_ENV_VAR = "AZURE_RESOURCE_GROUP" )
var (
KS_GKE_PROJECT_ENV_VAR = "KS_GKE_PROJECT"
)
Functions ¶
func IsTypeDescriptiveInfoFromCloudProvider ¶
DEPRECATED - Use apis.IsTypeDescriptiveInfoFromCloudProvider instead
Types ¶
type AKSSupport ¶
type AKSSupport struct { }
func NewAKSSupport ¶
func NewAKSSupport() *AKSSupport
func (*AKSSupport) GetClusterDescribe ¶
func (AKSSupport *AKSSupport) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*containerservice.ManagedCluster, error)
Get descriptive info about cluster running in AKS.
func (*AKSSupport) GetContextName ¶
func (AKSSupport *AKSSupport) GetContextName(managedCluster *containerservice.ManagedCluster) string
func (*AKSSupport) GetResourceGroup ¶
func (AKSSupport *AKSSupport) GetResourceGroup() (string, error)
func (*AKSSupport) GetSubscriptionID ¶
func (AKSSupport *AKSSupport) GetSubscriptionID() (string, error)
type AKSSupportMock ¶
type AKSSupportMock struct { }
func NewAKSSupportMock ¶
func NewAKSSupportMock() *AKSSupportMock
func (*AKSSupportMock) GetClusterDescribe ¶
func (AKSSupportM *AKSSupportMock) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*containerservice.ManagedCluster, error)
Get descriptive info about cluster running in AKS.
func (*AKSSupportMock) GetContextName ¶
func (AKSSupportM *AKSSupportMock) GetContextName(managedCluster *containerservice.ManagedCluster) string
func (*AKSSupportMock) GetResourceGroup ¶
func (AKSSupportM *AKSSupportMock) GetResourceGroup() (string, error)
func (*AKSSupportMock) GetSubscriptionID ¶
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 ¶
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 ¶
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 ¶
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
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 ¶
func (eksSupport *EKSSupportMock) GetContextName(cluster string) string
func (*EKSSupportMock) GetName ¶
func (eksSupportM *EKSSupportMock) GetName(describe *eks.DescribeClusterOutput) string
getName get cluster name from describe
type GKESupport ¶
type GKESupport struct { }
func NewGKESupport ¶
func NewGKESupport() *GKESupport
func (*GKESupport) GetAuthorizationKey ¶
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 ¶
func (gkeSupport *GKESupport) GetContextName(cluster string) string
func (*GKESupport) GetName ¶
func (gkeSupport *GKESupport) GetName(clusterDescribe *containerpb.Cluster) string
func (*GKESupport) GetProject ¶
func (gkeSupport *GKESupport) GetProject(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 ¶
func (gkeSupportM *GKESupportMock) GetContextName(cluster string) string
func (*GKESupportMock) GetName ¶
func (gkeSupportM *GKESupportMock) GetName(clusterDescribe *containerpb.Cluster) string
func (*GKESupportMock) GetProject ¶
func (gkeSupportM *GKESupportMock) GetProject(cluster string) (string, error)
type IAKSSupport ¶
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 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 }