Documentation ¶
Index ¶
- Constants
- Variables
- func IsAKS() bool
- func IsEKS(config *clientcmdapi.Config) bool
- func IsGKE(config *clientcmdapi.Config) bool
- func IsTypeDescriptiveInfoFromCloudProvider(object map[string]interface{}) bool
- type AKSSupport
- func (AKSSupport *AKSSupport) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*armcontainerservice.ManagedCluster, error)
- func (AKSSupport *AKSSupport) GetContextName(managedCluster *armcontainerservice.ManagedCluster) string
- func (AKSSupport *AKSSupport) GetGroupIdsRoleBindings(kapi *k8sinterface.KubernetesApi, namespace string) ([]string, error)
- func (AKSSupport *AKSSupport) GetResourceGroup() (string, error)
- func (AKSSupport *AKSSupport) GetSubscriptionID() (string, error)
- func (AKSSupport *AKSSupport) ListAllRoleDefinitions(subscriptionId string, scope string) (*ListRoleDefinition, error)
- func (AKSSupport *AKSSupport) ListAllRolesForScope(subscriptionId string, scope string) (*ListRoleAssignment, error)
- type AKSSupportMock
- func (AKSSupportM *AKSSupportMock) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*armcontainerservice.ManagedCluster, error)
- func (AKSSupportM *AKSSupportMock) GetContextName(managedCluster *armcontainerservice.ManagedCluster) string
- func (AKSSupportM *AKSSupportMock) GetGroupIdsRoleBindings(kapi *k8sinterface.KubernetesApi, namespace string) ([]string, error)
- func (AKSSupportM *AKSSupportMock) GetResourceGroup() (string, error)
- func (AKSSupportM *AKSSupportMock) GetSubscriptionID() (string, error)
- func (AKSSupportM *AKSSupportMock) ListAllRoleDefinitions(subscriptionId string, scope string) (*ListRoleDefinition, error)
- func (AKSSupportM *AKSSupportMock) ListAllRolesForScope(subscriptionId string, scope string) (*ListRoleAssignment, 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 CloudProviderDescribeRepositories
- func (description *CloudProviderDescribeRepositories) GetApiVersion() string
- func (description *CloudProviderDescribeRepositories) GetData() map[string]interface{}
- func (description *CloudProviderDescribeRepositories) GetID() string
- func (description *CloudProviderDescribeRepositories) GetKind() string
- func (description *CloudProviderDescribeRepositories) GetName() string
- func (description *CloudProviderDescribeRepositories) GetNamespace() string
- func (description *CloudProviderDescribeRepositories) GetObject() map[string]interface{}
- func (description *CloudProviderDescribeRepositories) GetObjectType() workloadinterface.ObjectType
- func (description *CloudProviderDescribeRepositories) GetProvider() string
- func (description *CloudProviderDescribeRepositories) GetWorkload() map[string]interface{}
- func (description *CloudProviderDescribeRepositories) SetApiVersion(apiVersion string)
- func (description *CloudProviderDescribeRepositories) SetData(data map[string]interface{})
- func (description *CloudProviderDescribeRepositories) SetKind(kind string)
- func (description *CloudProviderDescribeRepositories) SetName(name string)
- func (description *CloudProviderDescribeRepositories) SetNamespace(namespace string)
- func (description *CloudProviderDescribeRepositories) SetObject(object map[string]interface{})
- func (description *CloudProviderDescribeRepositories) SetProvider(provider string)
- func (description *CloudProviderDescribeRepositories) SetWorkload(object map[string]interface{})
- type CloudProviderListEntitiesForPolicies
- func (description *CloudProviderListEntitiesForPolicies) GetApiVersion() string
- func (description *CloudProviderListEntitiesForPolicies) GetData() map[string]interface{}
- func (description *CloudProviderListEntitiesForPolicies) GetID() string
- func (description *CloudProviderListEntitiesForPolicies) GetKind() string
- func (description *CloudProviderListEntitiesForPolicies) GetName() string
- func (description *CloudProviderListEntitiesForPolicies) GetNamespace() string
- func (description *CloudProviderListEntitiesForPolicies) GetObject() map[string]interface{}
- func (description *CloudProviderListEntitiesForPolicies) GetObjectType() workloadinterface.ObjectType
- func (description *CloudProviderListEntitiesForPolicies) GetProvider() string
- func (description *CloudProviderListEntitiesForPolicies) GetWorkload() map[string]interface{}
- func (description *CloudProviderListEntitiesForPolicies) SetApiVersion(apiVersion string)
- func (description *CloudProviderListEntitiesForPolicies) SetData(data map[string]interface{})
- func (description *CloudProviderListEntitiesForPolicies) SetKind(kind string)
- func (description *CloudProviderListEntitiesForPolicies) SetName(name string)
- func (description *CloudProviderListEntitiesForPolicies) SetNamespace(namespace string)
- func (description *CloudProviderListEntitiesForPolicies) SetObject(object map[string]interface{})
- func (description *CloudProviderListEntitiesForPolicies) SetProvider(provider string)
- func (description *CloudProviderListEntitiesForPolicies) SetWorkload(object map[string]interface{})
- type CloudProviderMetadata
- type CloudProviderPolicyVersion
- func (description *CloudProviderPolicyVersion) GetApiVersion() string
- func (description *CloudProviderPolicyVersion) GetData() map[string]interface{}
- func (description *CloudProviderPolicyVersion) GetID() string
- func (description *CloudProviderPolicyVersion) GetKind() string
- func (description *CloudProviderPolicyVersion) GetName() string
- func (description *CloudProviderPolicyVersion) GetNamespace() string
- func (description *CloudProviderPolicyVersion) GetObject() map[string]interface{}
- func (description *CloudProviderPolicyVersion) GetObjectType() workloadinterface.ObjectType
- func (description *CloudProviderPolicyVersion) GetProvider() string
- func (description *CloudProviderPolicyVersion) GetWorkload() map[string]interface{}
- func (description *CloudProviderPolicyVersion) SetApiVersion(apiVersion string)
- func (description *CloudProviderPolicyVersion) SetData(data map[string]interface{})
- func (description *CloudProviderPolicyVersion) SetKind(kind string)
- func (description *CloudProviderPolicyVersion) SetName(name string)
- func (description *CloudProviderPolicyVersion) SetNamespace(namespace string)
- func (description *CloudProviderPolicyVersion) SetObject(object map[string]interface{})
- func (description *CloudProviderPolicyVersion) SetProvider(provider string)
- func (description *CloudProviderPolicyVersion) SetWorkload(object map[string]interface{})
- type EKSSupport
- func (eksSupport *EKSSupport) GetClusterDescribe(cluster string, region string) (*eks.DescribeClusterOutput, error)
- func (eksSupport *EKSSupport) GetContextName(cluster string) string
- func (eksSupport *EKSSupport) GetDescribeRepositories(region string) (*ecr.DescribeRepositoriesOutput, error)
- func (EKSSupport *EKSSupport) GetEKSCfgMap(kapi *k8sinterface.KubernetesApi, namespace string) (*v1.ConfigMap, error)
- func (eksSupport *EKSSupport) GetListEntitiesForPolicies(region string) (*ListEntitiesForPolicies, error)
- func (eksSupport *EKSSupport) GetName(describe *eks.DescribeClusterOutput) string
- func (eksSupport *EKSSupport) GetPolicyVersion(region string) (*ListPolicyVersion, error)
- 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) GetDescribeRepositories(region string) (*ecr.DescribeRepositoriesOutput, error)
- func (eksSupportM *EKSSupportMock) GetListEntitiesForPolicies(region string) (*ListEntitiesForPolicies, error)
- func (eksSupportM *EKSSupportMock) GetName(describe *eks.DescribeClusterOutput) string
- func (eksSupportM *EKSSupportMock) GetPolicyVersion(region string) (*ListPolicyVersion, error)
- 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
- type ListEntitiesForPolicies
- type ListPolicyVersion
- type ListRoleAssignment
- type ListRoleDefinition
- type PolicyVersionDocument
- type Statement
Constants ¶
const ( TypeCloudProviderDescribe workloadinterface.ObjectType = "CloudProviderDescribe" TypeCloudProviderDescribeRepositories workloadinterface.ObjectType = "CloudProviderDescribeRepositories" TypeCloudProviderListEntitiesForPolicies workloadinterface.ObjectType = "CloudProviderListEntitiesForPolicies" TypeCloudProviderPolicyVersion workloadinterface.ObjectType = "CloudProviderPolicyVersion" )
const ( Version = "v1" AKS = "aks" GKE = "gke" EKS = "eks" NotSupportedMsg = "Not supported" )
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 IsAKS ¶ added in v0.0.131
func IsAKS() bool
check if the server is AKS. e.g. https://XXX.XX.XXX.azmk8s.io:443
func IsEKS ¶ added in v0.0.131
func IsEKS(config *clientcmdapi.Config) bool
check if the server is EKS. e.g. arn:aws:eks:eu-west-1:xxx:cluster/xxxx
func IsGKE ¶ added in v0.0.131
func IsGKE(config *clientcmdapi.Config) bool
check if the server is GKE. e.g. gke_xxx-xx-0000_us-central1-c_xxxx-1
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) (*armcontainerservice.ManagedCluster, error)
Get descriptive info about cluster running in AKS.
func (*AKSSupport) GetContextName ¶
func (AKSSupport *AKSSupport) GetContextName(managedCluster *armcontainerservice.ManagedCluster) string
func (*AKSSupport) GetGroupIdsRoleBindings ¶ added in v0.0.101
func (AKSSupport *AKSSupport) GetGroupIdsRoleBindings(kapi *k8sinterface.KubernetesApi, namespace string) ([]string, error)
Rolebindings contains the group-object-ids
func (*AKSSupport) GetResourceGroup ¶
func (AKSSupport *AKSSupport) GetResourceGroup() (string, error)
func (*AKSSupport) GetSubscriptionID ¶
func (AKSSupport *AKSSupport) GetSubscriptionID() (string, error)
func (*AKSSupport) ListAllRoleDefinitions ¶ added in v0.0.116
func (AKSSupport *AKSSupport) ListAllRoleDefinitions(subscriptionId string, scope string) (*ListRoleDefinition, error)
ListAllRoleDefinitions - List all role definitions that are assigned in this scope
func (*AKSSupport) ListAllRolesForScope ¶ added in v0.0.92
func (AKSSupport *AKSSupport) ListAllRolesForScope(subscriptionId string, scope string) (*ListRoleAssignment, error)
List all role assignments that apply to a scope scope - The scope of the operation or resource. Valid scopes are: subscriptionID (format: '/subscriptions/{subscriptionId}'), resource group ID (format:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource ID (format:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
type AKSSupportMock ¶
type AKSSupportMock struct { }
func NewAKSSupportMock ¶
func NewAKSSupportMock() *AKSSupportMock
func (*AKSSupportMock) GetClusterDescribe ¶
func (AKSSupportM *AKSSupportMock) GetClusterDescribe(subscriptionId string, clusterName string, resourceGroup string) (*armcontainerservice.ManagedCluster, error)
Get descriptive info about cluster running in AKS.
func (*AKSSupportMock) GetContextName ¶
func (AKSSupportM *AKSSupportMock) GetContextName(managedCluster *armcontainerservice.ManagedCluster) string
func (*AKSSupportMock) GetGroupIdsRoleBindings ¶ added in v0.0.101
func (AKSSupportM *AKSSupportMock) GetGroupIdsRoleBindings(kapi *k8sinterface.KubernetesApi, namespace string) ([]string, error)
func (*AKSSupportMock) GetResourceGroup ¶
func (AKSSupportM *AKSSupportMock) GetResourceGroup() (string, error)
func (*AKSSupportMock) GetSubscriptionID ¶
func (AKSSupportM *AKSSupportMock) GetSubscriptionID() (string, error)
func (*AKSSupportMock) ListAllRoleDefinitions ¶ added in v0.0.116
func (AKSSupportM *AKSSupportMock) ListAllRoleDefinitions(subscriptionId string, scope string) (*ListRoleDefinition, error)
func (*AKSSupportMock) ListAllRolesForScope ¶ added in v0.0.92
func (AKSSupportM *AKSSupportMock) ListAllRolesForScope(subscriptionId string, scope string) (*ListRoleAssignment, 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 CloudProviderDescribeRepositories ¶ added in v0.0.95
type CloudProviderDescribeRepositories struct { ApiVersion string `json:"apiVersion"` Kind string `json:"kind"` Metadata CloudProviderMetadata `json:"metadata"` Data map[string]interface{} `json:"data"` }
CloudProviderDescribeRepositories: =========================
CloudProviderDescribeRepositories has a list of the image repositories in the cloud provider
func GetDescribeRepositoriesEKS ¶ added in v0.0.95
func GetDescribeRepositoriesEKS(eksSupport IEKSSupport, cluster string, region string) (*CloudProviderDescribeRepositories, error)
func (*CloudProviderDescribeRepositories) GetApiVersion ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetApiVersion() string
func (*CloudProviderDescribeRepositories) GetData ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetData() map[string]interface{}
func (*CloudProviderDescribeRepositories) GetID ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetID() string
ApiVersion/Kind/Name
func (*CloudProviderDescribeRepositories) GetKind ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetKind() string
func (*CloudProviderDescribeRepositories) GetName ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetName() string
func (*CloudProviderDescribeRepositories) GetNamespace ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetNamespace() string
Compatible with the IMetadata interface
func (*CloudProviderDescribeRepositories) GetObject ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetObject() map[string]interface{}
func (*CloudProviderDescribeRepositories) GetObjectType ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetObjectType() workloadinterface.ObjectType
func (*CloudProviderDescribeRepositories) GetProvider ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetProvider() string
provider -> eks/gke/etc.
func (*CloudProviderDescribeRepositories) GetWorkload ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) GetWorkload() map[string]interface{}
func (*CloudProviderDescribeRepositories) SetApiVersion ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetApiVersion(apiVersion string)
func (*CloudProviderDescribeRepositories) SetData ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetData(data map[string]interface{})
func (*CloudProviderDescribeRepositories) SetKind ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetKind(kind string)
func (*CloudProviderDescribeRepositories) SetName ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetName(name string)
func (*CloudProviderDescribeRepositories) SetNamespace ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetNamespace(namespace string)
========================================================================================================== ============================== CloudProviderDescribeRepositories ================================================== ========================================================================================================== Setters
func (*CloudProviderDescribeRepositories) SetObject ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetObject(object map[string]interface{})
func (*CloudProviderDescribeRepositories) SetProvider ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetProvider(provider string)
func (*CloudProviderDescribeRepositories) SetWorkload ¶ added in v0.0.95
func (description *CloudProviderDescribeRepositories) SetWorkload(object map[string]interface{})
type CloudProviderListEntitiesForPolicies ¶ added in v0.0.97
type CloudProviderListEntitiesForPolicies struct { ApiVersion string `json:"apiVersion"` Kind string `json:"kind"` Metadata CloudProviderMetadata `json:"metadata"` Data map[string]interface{} `json:"data"` }
CloudProviderListEntitiesForPolicies: =========================
CloudProviderListEntitiesForPolicies has a list of the RolePolicies in the cloud provider (EKS)
func GetListEntitiesForPoliciesAKS ¶ added in v0.0.116
func GetListEntitiesForPoliciesAKS(aksSupport IAKSSupport, cluster string, subscriptionId string, resourceGroup string) (*CloudProviderListEntitiesForPolicies, error)
GetListEntitiesForPoliciesAKS gets a list of entities for policies (role assignments)
func GetListEntitiesForPoliciesEKS ¶ added in v0.0.97
func GetListEntitiesForPoliciesEKS(eksSupport IEKSSupport, cluster string, region string) (*CloudProviderListEntitiesForPolicies, error)
func (*CloudProviderListEntitiesForPolicies) GetApiVersion ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetApiVersion() string
func (*CloudProviderListEntitiesForPolicies) GetData ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetData() map[string]interface{}
func (*CloudProviderListEntitiesForPolicies) GetID ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetID() string
ApiVersion/Kind/Name
func (*CloudProviderListEntitiesForPolicies) GetKind ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetKind() string
func (*CloudProviderListEntitiesForPolicies) GetName ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetName() string
func (*CloudProviderListEntitiesForPolicies) GetNamespace ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetNamespace() string
Compatible with the IMetadata interface
func (*CloudProviderListEntitiesForPolicies) GetObject ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetObject() map[string]interface{}
func (*CloudProviderListEntitiesForPolicies) GetObjectType ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetObjectType() workloadinterface.ObjectType
func (*CloudProviderListEntitiesForPolicies) GetProvider ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetProvider() string
provider -> eks/gke/etc.
func (*CloudProviderListEntitiesForPolicies) GetWorkload ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) GetWorkload() map[string]interface{}
func (*CloudProviderListEntitiesForPolicies) SetApiVersion ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) SetApiVersion(apiVersion string)
func (*CloudProviderListEntitiesForPolicies) SetData ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) SetData(data map[string]interface{})
func (*CloudProviderListEntitiesForPolicies) SetKind ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) SetKind(kind string)
func (*CloudProviderListEntitiesForPolicies) SetName ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) SetName(name string)
func (*CloudProviderListEntitiesForPolicies) SetNamespace ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) SetNamespace(namespace string)
========================================================================================================== ============================== CloudProviderListEntitiesForPolicies ================================================== ========================================================================================================== Setters
func (*CloudProviderListEntitiesForPolicies) SetObject ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) SetObject(object map[string]interface{})
func (*CloudProviderListEntitiesForPolicies) SetProvider ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) SetProvider(provider string)
func (*CloudProviderListEntitiesForPolicies) SetWorkload ¶ added in v0.0.97
func (description *CloudProviderListEntitiesForPolicies) 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 CloudProviderPolicyVersion ¶ added in v0.0.103
type CloudProviderPolicyVersion struct { ApiVersion string `json:"apiVersion"` Kind string `json:"kind"` Metadata CloudProviderMetadata `json:"metadata"` Data map[string]interface{} `json:"data"` }
CloudProviderPolicyVersion: =========================
CloudProviderPolicyVersion has a list of the PolicyVersion in the cloud provider (EKS)
func GetPolicyVersionAKS ¶ added in v0.0.116
func GetPolicyVersionAKS(aksSupport IAKSSupport, cluster string, subscriptionId string, resourceGroup string) (*CloudProviderPolicyVersion, error)
GetPolicyVersionAKS returns a list of all the role definitions that are assigned in this scope.
func GetPolicyVersionEKS ¶ added in v0.0.103
func GetPolicyVersionEKS(eksSupport IEKSSupport, cluster string, region string) (*CloudProviderPolicyVersion, error)
func (*CloudProviderPolicyVersion) GetApiVersion ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetApiVersion() string
func (*CloudProviderPolicyVersion) GetData ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetData() map[string]interface{}
func (*CloudProviderPolicyVersion) GetID ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetID() string
ApiVersion/Kind/Name
func (*CloudProviderPolicyVersion) GetKind ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetKind() string
func (*CloudProviderPolicyVersion) GetName ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetName() string
func (*CloudProviderPolicyVersion) GetNamespace ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetNamespace() string
Compatible with the IMetadata interface
func (*CloudProviderPolicyVersion) GetObject ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetObject() map[string]interface{}
func (*CloudProviderPolicyVersion) GetObjectType ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetObjectType() workloadinterface.ObjectType
func (*CloudProviderPolicyVersion) GetProvider ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetProvider() string
provider -> eks/gke/etc.
func (*CloudProviderPolicyVersion) GetWorkload ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) GetWorkload() map[string]interface{}
func (*CloudProviderPolicyVersion) SetApiVersion ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetApiVersion(apiVersion string)
func (*CloudProviderPolicyVersion) SetData ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetData(data map[string]interface{})
func (*CloudProviderPolicyVersion) SetKind ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetKind(kind string)
func (*CloudProviderPolicyVersion) SetName ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetName(name string)
func (*CloudProviderPolicyVersion) SetNamespace ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetNamespace(namespace string)
========================================================================================================== ============================== CloudProviderPolicyVersion ================================================== ========================================================================================================== Setters
func (*CloudProviderPolicyVersion) SetObject ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetObject(object map[string]interface{})
func (*CloudProviderPolicyVersion) SetProvider ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetProvider(provider string)
func (*CloudProviderPolicyVersion) SetWorkload ¶ added in v0.0.103
func (description *CloudProviderPolicyVersion) SetWorkload(object map[string]interface{})
type EKSSupport ¶
type EKSSupport struct { }
func (*EKSSupport) GetClusterDescribe ¶
func (eksSupport *EKSSupport) GetClusterDescribe(cluster string, region string) (*eks.DescribeClusterOutput, error)
GetClusterDescribe returns the descriptive info about the cluster running in EKS.
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) GetDescribeRepositories ¶ added in v0.0.95
func (eksSupport *EKSSupport) GetDescribeRepositories(region string) (*ecr.DescribeRepositoriesOutput, error)
GetDescribeRepositories returns the descriptive info about the repositories in EKS.
func (*EKSSupport) GetEKSCfgMap ¶ added in v0.0.87
func (EKSSupport *EKSSupport) GetEKSCfgMap(kapi *k8sinterface.KubernetesApi, namespace string) (*v1.ConfigMap, error)
GetEKSCfgMap returns the ConfigMap containing mappings of iam-roles/groups or iam-users/groups
func (*EKSSupport) GetListEntitiesForPolicies ¶ added in v0.0.97
func (eksSupport *EKSSupport) GetListEntitiesForPolicies(region string) (*ListEntitiesForPolicies, error)
GetListEntitiesForPolicies returns the list of roles in EKS.
func (*EKSSupport) GetName ¶
func (eksSupport *EKSSupport) GetName(describe *eks.DescribeClusterOutput) string
GetName returns the name of the eks cluster
func (*EKSSupport) GetPolicyVersion ¶ added in v0.0.103
func (eksSupport *EKSSupport) GetPolicyVersion(region string) (*ListPolicyVersion, error)
GetPolicyVersion retrieves policy contents based on their default version. It returns a struct that contains a map where the key is the policy Arn, and the value is its content.
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) GetDescribeRepositories ¶ added in v0.0.95
func (eksSupportM *EKSSupportMock) GetDescribeRepositories(region string) (*ecr.DescribeRepositoriesOutput, error)
GetDescribeRepositories
func (*EKSSupportMock) GetListEntitiesForPolicies ¶ added in v0.0.97
func (eksSupportM *EKSSupportMock) GetListEntitiesForPolicies(region string) (*ListEntitiesForPolicies, error)
GetListEntitiesForPolicies
func (*EKSSupportMock) GetName ¶
func (eksSupportM *EKSSupportMock) GetName(describe *eks.DescribeClusterOutput) string
getName get cluster name from describe
func (*EKSSupportMock) GetPolicyVersion ¶ added in v0.0.103
func (eksSupportM *EKSSupportMock) GetPolicyVersion(region string) (*ListPolicyVersion, error)
GetPolicyVersion
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) (*armcontainerservice.ManagedCluster, error) GetContextName(*armcontainerservice.ManagedCluster) string GetSubscriptionID() (string, error) GetResourceGroup() (string, error) ListAllRolesForScope(subscriptionId string, scope string) (*ListRoleAssignment, error) GetGroupIdsRoleBindings(kapi *k8sinterface.KubernetesApi, namespace string) ([]string, error) ListAllRoleDefinitions(subscriptionId string, scope string) (*ListRoleDefinition, 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 GetDescribeRepositories(region string) (*ecr.DescribeRepositoriesOutput, error) GetListEntitiesForPolicies(region string) (*ListEntitiesForPolicies, error) GetPolicyVersion(region string) (*ListPolicyVersion, error) }
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 }
type ListEntitiesForPolicies ¶ added in v0.0.97
type ListEntitiesForPolicies struct {
EntitiesForPolicies map[string]*iam.ListEntitiesForPolicyOutput `json:"rolesPolicies"`
}
type ListPolicyVersion ¶ added in v0.0.103
type ListPolicyVersion struct {
PolicyVersion map[string]*PolicyVersionDocument `json:"policiesDocuments"`
}
type ListRoleAssignment ¶ added in v0.0.116
type ListRoleAssignment struct {
RoleAssignments []*armauthorizationv2.RoleAssignment `json:"roleAssignments"`
}
type ListRoleDefinition ¶ added in v0.0.116
type ListRoleDefinition struct {
RoleDefinitions []*armauthorization.RoleDefinition `json:"roleDefinitions"`
}