rancher2

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MPL-2.0 Imports: 51 Imported by: 5

Documentation ¶

Index ¶

Constants ¶

View Source
const (
	DefaultProcMount  string = "Default"
	UnmaskedProcMount string = "Unmasked"
)
View Source
const (
	RunAsGroupStrategyMustRunAs        = "MustRunAs"
	RunAsGroupStrategyMustRunAsNonRoot = "MustRunAsNonRoot"
	RunAsGroupStrategyRunAsAny         = "RunAsAny"
)
View Source
const (
	RunAsUserStrategyMustRunAs        = "MustRunAs"
	RunAsUserStrategyMustRunAsNonRoot = "MustRunAsNonRoot"
	RunAsUserStrategyRunAsAny         = "RunAsAny"
)
View Source
const (
	SELinuxStrategyMustRunAs = "MustRunAs"
	SELinuxStrategyRunAsAny  = "RunAsAny"
)
View Source
const (
	SupplementalGroupsStrategyMayRunAs  = "MayRunAs"
	SupplementalGroupsStrategyMustRunAs = "MustRunAs"
	SupplementalGroupsStrategyRunAsAny  = "RunAsAny"
)
View Source
const (
	AzureFile             string = "azureFile"
	Flocker               string = "flocker"
	FlexVolume            string = "flexVolume"
	HostPath              string = "hostPath"
	EmptyDir              string = "emptyDir"
	GCEPersistentDisk     string = "gcePersistentDisk"
	AWSElasticBlockStore  string = "awsElasticBlockStore"
	GitRepo               string = "gitRepo"
	Secret                string = "secret"
	NFS                   string = "nfs"
	ISCSI                 string = "iscsi"
	Glusterfs             string = "glusterfs"
	PersistentVolumeClaim string = "persistentVolumeClaim"
	RBD                   string = "rbd"
	Cinder                string = "cinder"
	CephFS                string = "cephFS"
	DownwardAPI           string = "downwardAPI"
	FC                    string = "fc"
	ConfigMap             string = "configMap"
	VsphereVolume         string = "vsphereVolume"
	Quobyte               string = "quobyte"
	AzureDisk             string = "azureDisk"
	PhotonPersistentDisk  string = "photonPersistentDisk"
	StorageOS             string = "storageos"
	Projected             string = "projected"
	PortworxVolume        string = "portworxVolume"
	ScaleIO               string = "scaleIO"
	CSI                   string = "csi"
	All                   string = "*"
)
View Source
const (
	AppTemplateExternalIDPrefix  = "catalog://?"
	AppCatalogClusterLocalPrefix = "local"
	AppCatalogClusterPrefix      = "c-"
	AppCatalogProjectPrefix      = "p-"
)
View Source
const AuthConfigADFSName = "adfs"
View Source
const AuthConfigActiveDirectoryName = "activedirectory"
View Source
const AuthConfigAzureADName = "azuread"
View Source
const AuthConfigFreeIpaName = "freeipa"
View Source
const AuthConfigGithubName = "github"
View Source
const AuthConfigKeyCloakName = "keycloak"
View Source
const AuthConfigOKTAName = "okta"
View Source
const AuthConfigOpenLdapName = "openldap"
View Source
const AuthConfigPingName = "ping"
View Source
const (
	MultiClusterAppTemplatePrefix = "cattle-global-data:"
)

Variables ¶

View Source
var (
	ProcMountTypes = []string{
		DefaultProcMount,
		UnmaskedProcMount,
	}
)
View Source
var (
	// RKEConfigNodesRoles available RKE roles for nodes
	RKEConfigNodesRoles = []string{"controlplane", "etcd", "worker"}
)

Functions ¶

func AreEqual ¶

func AreEqual(o, n interface{}) bool

func Base64Decode ¶

func Base64Decode(s string) (string, error)

func Base64Encode ¶

func Base64Encode(s string) string

func DoGet ¶

func DoGet(url, username, password, token, cacert string, insecure bool) ([]byte, error)

func DoPost ¶

func DoPost(url, data, cacert string, insecure bool, headers map[string]string) (map[string]interface{}, error)

func DoUserLogin ¶

func DoUserLogin(url, user, pass, ttl, desc, cacert string, insecure bool) (string, string, error)

func FileExist ¶

func FileExist(path string) (bool, error)

func GetRandomPass ¶

func GetRandomPass(n int) string

func GlobalDNSFields ¶

func GlobalDNSFields() map[string]*schema.Schema

func HashPasswordString ¶

func HashPasswordString(password string) (string, error)

func IsBadGatewayError ¶

func IsBadGatewayError(err error) bool

IsBadGatewayError checks if the given APIError is a Bad Gateway Server Error HTTP statuscode

func IsBase64 ¶

func IsBase64(s string) bool

func IsConflict ¶

func IsConflict(err error) bool

IsConflict checks if the given APIError is a Conflict HTTP statuscode

func IsForbidden ¶

func IsForbidden(err error) bool

IsForbidden checks if the given APIError is a Forbidden HTTP statuscode

func IsNotAccessibleByID ¶ added in v1.24.0

func IsNotAccessibleByID(err error) bool

func IsNotAllowed ¶

func IsNotAllowed(err error) bool

IsNotAllowed checks if the given APIError is a Method Not Allowed HTTP statuscode

func IsNotFound ¶

func IsNotFound(err error) bool

func IsServerError ¶

func IsServerError(err error) bool

IsServerError checks if the given APIError is a Internal Server Error HTTP statuscode

func IsServiceUnavailableError ¶

func IsServiceUnavailableError(err error) bool

IsServiceUnavailableError checks if the given APIError is a Service Unavailable Server Error HTTP statuscode

func IsUnknownSchemaType ¶

func IsUnknownSchemaType(err error) bool

func IsVersionGreaterThanOrEqual ¶

func IsVersionGreaterThanOrEqual(ver1, ver2 string) (bool, error)

func IsVersionLessThan ¶

func IsVersionLessThan(ver1, ver2 string) (bool, error)

func JSONToYAML ¶

func JSONToYAML(in string) (string, error)

func NewListOpts ¶

func NewListOpts(filters map[string]interface{}) *types.ListOpts

func NormalizeURL ¶

func NormalizeURL(input string) (string, error)

func Provider ¶

func Provider() terraform.ResourceProvider

Provider returns a terraform.ResourceProvider.

func ToLower ¶

func ToLower(s string) string

func TrimSpace ¶

func TrimSpace(val interface{}) string

func YAMLToJSON ¶

func YAMLToJSON(in string) (string, error)

Types ¶

type AmazonElasticContainerServiceConfig ¶

type AmazonElasticContainerServiceConfig struct {
	AMI                         string   `json:"ami,omitempty" yaml:"ami,omitempty"`
	AccessKey                   string   `json:"accessKey,omitempty" yaml:"accessKey,omitempty"`
	AssociateWorkerNodePublicIP *bool    `json:"associateWorkerNodePublicIp,omitempty" yaml:"associateWorkerNodePublicIp,omitempty"`
	DesiredNodes                int64    `json:"desiredNodes,omitempty" yaml:"desiredNodes,omitempty"`
	DisplayName                 string   `json:"displayName,omitempty" yaml:"displayName,omitempty"`
	DriverName                  string   `json:"driverName,omitempty" yaml:"driverName,omitempty"`
	EBSEncryption               bool     `json:"ebsEncryption,omitempty" yaml:"ebsEncryption,omitempty"`
	InstanceType                string   `json:"instanceType,omitempty" yaml:"instanceType,omitempty"`
	KeyPairName                 string   `json:"keyPairName,omitempty" yaml:"keyPairName,omitempty"`
	KubernetesVersion           string   `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"`
	MaximumNodes                int64    `json:"maximumNodes,omitempty" yaml:"maximumNodes,omitempty"`
	MinimumNodes                int64    `json:"minimumNodes,omitempty" yaml:"minimumNodes,omitempty"`
	NodeVolumeSize              int64    `json:"nodeVolumeSize,omitempty" yaml:"nodeVolumeSize,omitempty"`
	Region                      string   `json:"region,omitempty" yaml:"region,omitempty"`
	SecretKey                   string   `json:"secretKey,omitempty" yaml:"secretKey,omitempty"`
	SecurityGroups              []string `json:"securityGroups,omitempty" yaml:"securityGroups,omitempty"`
	ServiceRole                 string   `json:"serviceRole,omitempty" yaml:"serviceRole,omitempty"`
	SessionToken                string   `json:"sessionToken,omitempty" yaml:"sessionToken,omitempty"`
	Subnets                     []string `json:"subnets,omitempty" yaml:"subnets,omitempty"`
	UserData                    string   `json:"userData,omitempty" yaml:"userData,omitempty"`
	VirtualNetwork              string   `json:"virtualNetwork,omitempty" yaml:"virtualNetwork,omitempty"`
}

type AppV2 ¶

type AppV2 struct {
	norman.Resource
	v1.App
}

type AppV2Operation ¶

type AppV2Operation struct {
	norman.Resource
	v1.Operation
}

type AzureKubernetesServiceConfig ¶

type AzureKubernetesServiceConfig struct {
	AADClientAppID                     string   `json:"addClientAppId,omitempty" yaml:"addClientAppId,omitempty"`
	AADServerAppID                     string   `json:"addServerAppId,omitempty" yaml:"addServerAppId,omitempty"`
	AADServerAppSecret                 string   `json:"addServerAppSecret,omitempty" yaml:"addServerAppSecret,omitempty"`
	AADTenantID                        string   `json:"addTenantId,omitempty" yaml:"addTenantId,omitempty"`
	AdminUsername                      string   `json:"adminUsername,omitempty" yaml:"adminUsername,omitempty"`
	AgentDNSPrefix                     string   `json:"agentDnsPrefix,omitempty" yaml:"agentDnsPrefix,omitempty"`
	AgentOsdiskSizeGB                  int64    `json:"agentOsdiskSize,omitempty" yaml:"agentOsdiskSize,omitempty"`
	AgentPoolName                      string   `json:"agentPoolName,omitempty" yaml:"agentPoolName,omitempty"`
	AgentStorageProfile                string   `json:"agentStorageProfile,omitempty" yaml:"agentStorageProfile,omitempty"`
	AgentVMSize                        string   `json:"agentVmSize,omitempty" yaml:"agentVmSize,omitempty"`
	AuthBaseURL                        string   `json:"authBaseUrl" yaml:"authBaseUrl"`
	BaseURL                            string   `json:"baseUrl,omitempty" yaml:"baseUrl,omitempty"`
	ClientID                           string   `json:"clientId,omitempty" yaml:"clientId,omitempty"`
	ClientSecret                       string   `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"`
	Count                              int64    `json:"count,omitempty" yaml:"count,omitempty"`
	DisplayName                        string   `json:"displayName,omitempty" yaml:"displayName,omitempty"`
	DriverName                         string   `json:"driverName,omitempty" yaml:"driverName,omitempty"`
	DNSServiceIP                       string   `json:"dnsServiceIp,omitempty" yaml:"dnsServiceIp,omitempty"`
	DockerBridgeCIDR                   string   `json:"dockerBridgeCidr,omitempty" yaml:"dockerBridgeCidr,omitempty"`
	EnableHTTPApplicationRouting       bool     `json:"enableHttpApplicationRouting,omitempty" yaml:"enableHttpApplicationRouting,omitempty"`
	EnableMonitoring                   *bool    `json:"enableMonitoring,omitempty" yaml:"enableMonitoring,omitempty"`
	KubernetesVersion                  string   `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"`
	LoadBalancerSku                    string   `json:"loadBalancerSku,omitempty" yaml:"loadBalancerSku,omitempty"`
	Location                           string   `json:"location,omitempty" yaml:"location,omitempty"`
	LogAnalyticsWorkspace              string   `json:"logAnalyticsWorkspace,omitempty" yaml:"logAnalyticsWorkspace,omitempty"`
	LogAnalyticsWorkspaceResourceGroup string   `json:"logAnalyticsWorkspaceResourceGroup,omitempty" yaml:"logAnalyticsWorkspaceResourceGroup,omitempty"`
	MasterDNSPrefix                    string   `json:"masterDnsPrefix,omitempty" yaml:"masterDnsPrefix,omitempty"`
	MaxPods                            int64    `json:"maxPods,omitempty" yaml:"maxPods,omitempty"`
	Name                               string   `json:"name,omitempty" yaml:"name,omitempty"`
	NetworkPlugin                      string   `json:"networkPlugin,omitempty" yaml:"networkPlugin,omitempty"`
	NetworkPolicy                      string   `json:"networkPolicy,omitempty" yaml:"networkPolicy,omitempty"`
	PodCIDR                            string   `json:"podCidr,omitempty" yaml:"podCidr,omitempty"`
	ResourceGroup                      string   `json:"resourceGroup,omitempty" yaml:"resourceGroup,omitempty"`
	SSHPublicKeyContents               string   `json:"sshPublicKeyContents,omitempty" yaml:"sshPublicKeyContents,omitempty"`
	ServiceCIDR                        string   `json:"serviceCidr,omitempty" yaml:"serviceCidr,omitempty"`
	Subnet                             string   `json:"subnet,omitempty" yaml:"subnet,omitempty"`
	SubscriptionID                     string   `json:"subscriptionId,omitempty" yaml:"subscriptionId,omitempty"`
	Tags                               []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	TenantID                           string   `json:"tenantId,omitempty" yaml:"tenantId,omitempty"`
	VirtualNetwork                     string   `json:"virtualNetwork,omitempty" yaml:"virtualNetwork,omitempty"`
	VirtualNetworkResourceGroup        string   `json:"virtualNetworkResourceGroup,omitempty" yaml:"virtualNetworkResourceGroup,omitempty"`
}

type ByNameClusterTemplateRevisions ¶

type ByNameClusterTemplateRevisions []managementClient.ClusterTemplateRevision

func (ByNameClusterTemplateRevisions) Len ¶

func (ByNameClusterTemplateRevisions) Less ¶

func (ByNameClusterTemplateRevisions) Swap ¶

func (a ByNameClusterTemplateRevisions) Swap(i, j int)

type CLIConfig ¶

type CLIConfig struct {
	AdminPass string `json:"adminpass"`
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
	TokenKey  string `json:"tokenKey"`
	CACerts   string `json:"caCerts"`
	Insecure  bool   `json:"insecure,omitempty"`
	URL       string `json:"url"`
	Project   string `json:"project"`
	Path      string `json:"path,omitempty"`
}

CLIConfig used to store data from file.

type Client ¶

type Client struct {
	Management *managementClient.Client
	CatalogV2  map[string]*clientbase.APIBaseClient
	Cluster    map[string]*clusterClient.Client
	Project    map[string]*projectClient.Client
}

Client are the client kind for a Rancher v3 API

type CloudCredential ¶

type CloudCredential struct {
	managementClient.CloudCredential
	Amazonec2CredentialConfig     *amazonec2CredentialConfig     `json:"amazonec2credentialConfig,omitempty" yaml:"amazonec2credentialConfig,omitempty"`
	AzureCredentialConfig         *azureCredentialConfig         `json:"azurecredentialConfig,omitempty" yaml:"azurecredentialConfig,omitempty"`
	DigitaloceanCredentialConfig  *digitaloceanCredentialConfig  `json:"digitaloceancredentialConfig,omitempty" yaml:"digitaloceancredentialConfig,omitempty"`
	GoogleCredentialConfig        *googleCredentialConfig        `json:"googlecredentialConfig,omitempty" yaml:"googlecredentialConfig,omitempty"`
	HarvesterCredentialConfig     *harvesterCredentialConfig     `json:"harvestercredentialConfig,omitempty" yaml:"harvestercredentialConfig,omitempty"`
	LinodeCredentialConfig        *linodeCredentialConfig        `json:"linodecredentialConfig,omitempty" yaml:"linodecredentialConfig,omitempty"`
	OpenstackCredentialConfig     *openstackCredentialConfig     `json:"openstackcredentialConfig,omitempty" yaml:"openstackcredentialConfig,omitempty"`
	VmwarevsphereCredentialConfig *vmwarevsphereCredentialConfig `json:"vmwarevspherecredentialConfig,omitempty" yaml:"vmwarevspherecredentialConfig,omitempty"`
}

type Cluster ¶

type Cluster struct {
	managementClient.Cluster
	AmazonElasticContainerServiceConfig *AmazonElasticContainerServiceConfig `json:"amazonElasticContainerServiceConfig,omitempty" yaml:"amazonElasticContainerServiceConfig,omitempty"`
	AzureKubernetesServiceConfig        *AzureKubernetesServiceConfig        `json:"azureKubernetesServiceConfig,omitempty" yaml:"azureKubernetesServiceConfig,omitempty"`
	GoogleKubernetesEngineConfig        *GoogleKubernetesEngineConfig        `json:"googleKubernetesEngineConfig,omitempty" yaml:"googleKubernetesEngineConfig,omitempty"`
	OracleKubernetesEngineConfig        *OracleKubernetesEngineConfig        `json:"okeEngineConfig,omitempty" yaml:"okeEngineConfig,omitempty"`
}

type ClusterRepo ¶

type ClusterRepo struct {
	norman.Resource
	v1.ClusterRepo
}

type ClusterRepoCollection ¶

type ClusterRepoCollection struct {
	norman.Collection
	Data []ClusterRepo `json:"data,omitempty"`
}

type ClusterV2 ¶

type ClusterV2 struct {
	norman.Resource
	provisioningV1.Cluster
}

type Config ¶

type Config struct {
	TokenKey             string `json:"tokenKey"`
	URL                  string `json:"url"`
	CACerts              string `json:"cacert"`
	Insecure             bool   `json:"insecure"`
	Bootstrap            bool   `json:"bootstrap"`
	ClusterID            string `json:"clusterId"`
	ProjectID            string `json:"projectId"`
	Timeout              time.Duration
	RancherVersion       string
	K8SDefaultVersion    string
	K8SSupportedVersions []string
	Sync                 sync.Mutex
	Client               Client
}

Config is the configuration parameters for a Rancher v3 API

func (*Config) CatalogV2Client ¶

func (c *Config) CatalogV2Client(id string) (*clientbase.APIBaseClient, error)

CatalogV2Client creates a Rancher client scoped to a Cluster API

func (*Config) CheckAuthConfigEnabled ¶

func (c *Config) CheckAuthConfigEnabled(id string) error

func (*Config) ClusterClient ¶

func (c *Config) ClusterClient(id string) (*clusterClient.Client, error)

ClusterClient creates a Rancher client scoped to a Cluster API

func (*Config) ClusterExist ¶

func (c *Config) ClusterExist(id string) error

func (*Config) ClusterRegistrationTokenExist ¶

func (c *Config) ClusterRegistrationTokenExist(id string) error

func (*Config) CreateCatalog ¶

func (c *Config) CreateCatalog(scope string, catalog interface{}) (interface{}, error)

func (*Config) CreateCertificate ¶

func (c *Config) CreateCertificate(cert interface{}) (interface{}, error)

func (*Config) CreateClientOpts ¶

func (c *Config) CreateClientOpts() *clientbase.ClientOpts

func (*Config) CreateRegistry ¶

func (c *Config) CreateRegistry(registry interface{}) (interface{}, error)

func (*Config) CreateSecret ¶

func (c *Config) CreateSecret(secret interface{}) (interface{}, error)

func (*Config) DeleteCatalog ¶

func (c *Config) DeleteCatalog(scope string, catalog interface{}) error

func (*Config) DeleteCertificate ¶

func (c *Config) DeleteCertificate(cert interface{}) error

func (*Config) DeleteRegistry ¶

func (c *Config) DeleteRegistry(registry interface{}) error

func (*Config) DeleteSecret ¶

func (c *Config) DeleteSecret(secret interface{}) error

func (*Config) DeleteToken ¶

func (c *Config) DeleteToken(id string) error

func (*Config) GenerateUserToken ¶

func (c *Config) GenerateUserToken(username, desc string, ttl int) (string, string, error)

GenerateUserToken generates token with ttl measured in seconds

func (*Config) GetAuthConfig ¶

func (c *Config) GetAuthConfig(in *managementClient.AuthConfig) (interface{}, error)

func (*Config) GetCatalog ¶

func (c *Config) GetCatalog(id, scope string) (interface{}, error)

func (*Config) GetCatalogByName ¶

func (c *Config) GetCatalogByName(name, scope string) (interface{}, error)

func (*Config) GetCertificate ¶

func (c *Config) GetCertificate(id, projectID, namespaceID string) (interface{}, error)

func (*Config) GetCertificateByFilters ¶

func (c *Config) GetCertificateByFilters(filters map[string]interface{}) (interface{}, error)

func (*Config) GetClusterByID ¶

func (c *Config) GetClusterByID(id string) (*managementClient.Cluster, error)

func (*Config) GetClusterByName ¶

func (c *Config) GetClusterByName(name string) (*managementClient.Cluster, error)

func (*Config) GetClusterIDByName ¶

func (c *Config) GetClusterIDByName(name string) (string, error)

func (*Config) GetClusterNodes ¶

func (c *Config) GetClusterNodes(id string) ([]managementClient.Node, error)

func (*Config) GetClusterProjects ¶

func (c *Config) GetClusterProjects(id string) ([]managementClient.Project, error)

func (*Config) GetClusterRegistrationTokenByID ¶

func (c *Config) GetClusterRegistrationTokenByID(id string) (*managementClient.ClusterRegistrationToken, error)

func (*Config) GetClusterSpecialProjectsID ¶

func (c *Config) GetClusterSpecialProjectsID(id string) (string, string, error)

func (*Config) GetGlobalRoleByID ¶

func (c *Config) GetGlobalRoleByID(id string) (*managementClient.GlobalRole, error)

func (*Config) GetProjectByID ¶

func (c *Config) GetProjectByID(id string) (*managementClient.Project, error)

func (*Config) GetProjectByName ¶

func (c *Config) GetProjectByName(name, clusterID string) (*managementClient.Project, error)

func (*Config) GetProjectIDByName ¶

func (c *Config) GetProjectIDByName(name, clusterID string) (string, error)

func (*Config) GetProjectNameByID ¶

func (c *Config) GetProjectNameByID(id string) (string, error)

func (*Config) GetProjectRoleTemplateBindingsByProjectID ¶

func (c *Config) GetProjectRoleTemplateBindingsByProjectID(projectID string) ([]managementClient.ProjectRoleTemplateBinding, error)

func (*Config) GetRancherVersion ¶

func (c *Config) GetRancherVersion() (string, error)

GetRancherVersion get Rancher server version

func (*Config) GetRecipientByNotifier ¶

func (c *Config) GetRecipientByNotifier(id string) (*managementClient.Recipient, error)

func (*Config) GetRegistry ¶

func (c *Config) GetRegistry(id, projectID, namespaceID string) (interface{}, error)

func (*Config) GetRegistryByFilters ¶

func (c *Config) GetRegistryByFilters(filters map[string]interface{}) (interface{}, error)

func (*Config) GetRoleTemplateByID ¶

func (c *Config) GetRoleTemplateByID(id string) (*managementClient.RoleTemplate, error)

func (*Config) GetSecret ¶

func (c *Config) GetSecret(id, projectID, namespaceID string) (interface{}, error)

func (*Config) GetSecretByFilters ¶

func (c *Config) GetSecretByFilters(filters map[string]interface{}) (interface{}, error)

func (*Config) GetSetting ¶

func (c *Config) GetSetting(name string) (*managementClient.Setting, error)

func (*Config) GetSettingV2ByID ¶

func (c *Config) GetSettingV2ByID(id string) (*SettingV2, error)

func (*Config) GetSettingValue ¶

func (c *Config) GetSettingValue(name string) (string, error)

func (*Config) GetUserByName ¶

func (c *Config) GetUserByName(name string) (*managementClient.User, error)

func (*Config) GetUserIDByName ¶

func (c *Config) GetUserIDByName(name string) (string, error)

func (*Config) GlobalRoleExist ¶

func (c *Config) GlobalRoleExist(id string) error

func (*Config) IsProjectDefault ¶

func (c *Config) IsProjectDefault(project *managementClient.Project) bool

func (*Config) IsProjectSystem ¶

func (c *Config) IsProjectSystem(project *managementClient.Project) bool

func (*Config) IsRancherVersionGreaterThanOrEqual ¶

func (c *Config) IsRancherVersionGreaterThanOrEqual(ver string) (bool, error)

func (*Config) IsRancherVersionGreaterThanOrEqualAndLessThan ¶

func (c *Config) IsRancherVersionGreaterThanOrEqualAndLessThan(ver1, ver2 string) (bool, error)

func (*Config) IsRancherVersionLessThan ¶

func (c *Config) IsRancherVersionLessThan(ver string) (bool, error)

func (*Config) IsTokenExpired ¶

func (c *Config) IsTokenExpired(id string) (bool, error)

func (*Config) ManagementClient ¶

func (c *Config) ManagementClient() (*managementClient.Client, error)

ManagementClient creates a Rancher client scoped to the management API

func (*Config) NormalizeURL ¶

func (c *Config) NormalizeURL() error

func (*Config) ProjectClient ¶

func (c *Config) ProjectClient(id string) (*projectClient.Client, error)

ProjectClient creates a Rancher client scoped to a Project API

func (*Config) ProjectExist ¶

func (c *Config) ProjectExist(id string) error

func (*Config) RefreshCatalog ¶

func (c *Config) RefreshCatalog(scope string, catalog interface{}) (*managementClient.CatalogRefresh, error)

func (*Config) RestartClients ¶

func (c *Config) RestartClients() error

RestartClients connections

func (*Config) RoleTemplateExist ¶

func (c *Config) RoleTemplateExist(id string) error

func (*Config) SetSetting ¶

func (c *Config) SetSetting(name, value string) error

func (*Config) SetUserPassword ¶

func (c *Config) SetUserPassword(user *managementClient.User, pass string) (bool, *managementClient.User, error)

func (*Config) SetUserPasswordByName ¶

func (c *Config) SetUserPasswordByName(username, pass string) (bool, string, *managementClient.User, error)

func (*Config) UpdateAuthConfig ¶

func (c *Config) UpdateAuthConfig(url string, createObj interface{}, respObject interface{}) error

func (*Config) UpdateCatalog ¶

func (c *Config) UpdateCatalog(scope string, catalog interface{}, update map[string]interface{}) (interface{}, error)

func (*Config) UpdateCertificate ¶

func (c *Config) UpdateCertificate(cert interface{}, update interface{}) (interface{}, error)

func (*Config) UpdateClusterByID ¶

func (c *Config) UpdateClusterByID(cluster *managementClient.Cluster, update map[string]interface{}) (*managementClient.Cluster, error)

func (*Config) UpdateRegistry ¶

func (c *Config) UpdateRegistry(registry interface{}, update map[string]interface{}) (interface{}, error)

func (*Config) UpdateSecret ¶

func (c *Config) UpdateSecret(secret interface{}, update map[string]interface{}) (interface{}, error)

func (*Config) UpdateToken ¶

func (c *Config) UpdateToken(token string) error

UpdateToken update tokenkey and restart client connections

func (*Config) UserPasswordChanged ¶

func (c *Config) UserPasswordChanged(user *managementClient.User, pass string) bool

func (*Config) WaitForClusterState ¶

func (c *Config) WaitForClusterState(clusterID, state string, interval time.Duration) (*managementClient.Cluster, error)

type ConfigMapV2 ¶

type ConfigMapV2 struct {
	norman.Resource
	v1.ConfigMap
}

type GoogleKubernetesEngineConfig ¶

type GoogleKubernetesEngineConfig struct {
	ClusterIpv4Cidr                    string            `json:"clusterIpv4Cidr,omitempty" yaml:"clusterIpv4Cidr,omitempty"`
	Credential                         string            `json:"credential,omitempty" yaml:"credential,omitempty"`
	Description                        string            `json:"description,omitempty" yaml:"description,omitempty"`
	DiskSizeGb                         int64             `json:"diskSizeGb,omitempty" yaml:"diskSizeGb,omitempty"`
	DiskType                           string            `json:"diskType,omitempty" yaml:"diskType,omitempty"`
	DisplayName                        string            `json:"displayName,omitempty" yaml:"displayName,omitempty"`
	DriverName                         string            `json:"driverName,omitempty" yaml:"driverName,omitempty"`
	EnableAlphaFeature                 bool              `json:"enableAlphaFeature,omitempty" yaml:"enableAlphaFeature,omitempty"`
	EnableAutoRepair                   bool              `json:"enableAutoRepair,omitempty" yaml:"enableAutoRepair,omitempty"`
	EnableAutoUpgrade                  bool              `json:"enableAutoUpgrade,omitempty" yaml:"enableAutoUpgrade,omitempty"`
	EnableHorizontalPodAutoscaling     *bool             `json:"enableHorizontalPodAutoscaling,omitempty" yaml:"enableHorizontalPodAutoscaling,omitempty"`
	EnableHTTPLoadBalancing            *bool             `json:"enableHttpLoadBalancing,omitempty" yaml:"enableHttpLoadBalancing,omitempty"`
	EnableKubernetesDashboard          bool              `json:"enableKubernetesDashboard,omitempty" yaml:"enableKubernetesDashboard,omitempty"`
	EnableLegacyAbac                   bool              `json:"enableLegacyAbac,omitempty" yaml:"enableLegacyAbac,omitempty"`
	EnableMasterAuthorizedNetwork      bool              `json:"enableMasterAuthorizedNetwork,omitempty" yaml:"enableMasterAuthorizedNetwork,omitempty"`
	EnableNetworkPolicyConfig          *bool             `json:"enableNetworkPolicyConfig,omitempty" yaml:"enableNetworkPolicyConfig,omitempty"`
	EnableNodepoolAutoscaling          bool              `json:"enableNodepoolAutoscaling,omitempty" yaml:"enableNodepoolAutoscaling,omitempty"`
	EnablePrivateEndpoint              bool              `json:"enablePrivateEndpoint,omitempty" yaml:"enablePrivateEndpoint,omitempty"`
	EnablePrivateNodes                 bool              `json:"enablePrivateNodes,omitempty" yaml:"enablePrivateNodes,omitempty"`
	EnableStackdriverLogging           *bool             `json:"enableStackdriverLogging,omitempty" yaml:"enableStackdriverLogging,omitempty"`
	EnableStackdriverMonitoring        *bool             `json:"enableStackdriverMonitoring,omitempty" yaml:"enableStackdriverMonitoring,omitempty"`
	ImageType                          string            `json:"imageType,omitempty" yaml:"imageType,omitempty"`
	IPPolicyClusterIpv4CidrBlock       string            `json:"ipPolicyClusterIpv4CidrBlock,omitempty" yaml:"ipPolicyClusterIpv4CidrBlock,omitempty"`
	IPPolicyClusterSecondaryRangeName  string            `json:"ipPolicyClusterSecondaryRangeName,omitempty" yaml:"ipPolicyClusterSecondaryRangeName,omitempty"`
	IPPolicyCreateSubnetwork           bool              `json:"ipPolicyCreateSubnetwork,omitempty" yaml:"ipPolicyCreateSubnetwork,omitempty"`
	IPPolicyNodeIpv4CidrBlock          string            `json:"ipPolicyNodeIpv4CidrBlock,omitempty" yaml:"ipPolicyNodeIpv4CidrBlock,omitempty"`
	IPPolicyServicesIpv4CidrBlock      string            `json:"ipPolicyServicesIpv4CidrBlock,omitempty" yaml:"ipPolicyServicesIpv4CidrBlock,omitempty"`
	IPPolicyServicesSecondaryRangeName string            `json:"ipPolicyServicesSecondaryRangeName,omitempty" yaml:"ipPolicyServicesSecondaryRangeName,omitempty"`
	IPPolicySubnetworkName             string            `json:"ipPolicySubnetworkName,omitempty" yaml:"ipPolicySubnetworkName,omitempty"`
	IssueClientCertificate             bool              `json:"issueClientCertificate,omitempty" yaml:"issueClientCertificate,omitempty"`
	KubernetesDashboard                bool              `json:"kubernetesDashboard,omitempty" yaml:"kubernetesDashboard,omitempty"`
	Labels                             map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	LocalSsdCount                      int64             `json:"localSsdCount,omitempty" yaml:"localSsdCount,omitempty"`
	Locations                          []string          `json:"locations,omitempty" yaml:"locations,omitempty"`
	MachineType                        string            `json:"machineType,omitempty" yaml:"machineType,omitempty"`
	MaintenanceWindow                  string            `json:"maintenanceWindow,omitempty" yaml:"maintenanceWindow,omitempty"`
	MasterAuthorizedNetworkCidrBlocks  []string          `json:"masterAuthorizedNetworkCidrBlocks,omitempty" yaml:"masterAuthorizedNetworkCidrBlocks,omitempty"`
	MasterIpv4CidrBlock                string            `json:"masterIpv4CidrBlock,omitempty" yaml:"masterIpv4CidrBlock,omitempty"`
	MasterVersion                      string            `json:"masterVersion,omitempty" yaml:"masterVersion,omitempty"`
	MaxNodeCount                       int64             `json:"maxNodeCount,omitempty" yaml:"maxNodeCount,omitempty"`
	MinNodeCount                       int64             `json:"minNodeCount,omitempty" yaml:"minNodeCount,omitempty"`
	Name                               string            `json:"name,omitempty" yaml:"name,omitempty"`
	Network                            string            `json:"network,omitempty" yaml:"network,omitempty"`
	NodeCount                          int64             `json:"nodeCount,omitempty" yaml:"nodeCount,omitempty"`
	NodePool                           string            `json:"nodePool,omitempty" yaml:"nodePool,omitempty"`
	NodeVersion                        string            `json:"nodeVersion,omitempty" yaml:"nodeVersion,omitempty"`
	OauthScopes                        []string          `json:"oauthScopes,omitempty" yaml:"oauthScopes,omitempty"`
	Preemptible                        bool              `json:"preemptible,omitempty" yaml:"preemptible,omitempty"`
	ProjectID                          string            `json:"projectId,omitempty" yaml:"projectId,omitempty"`
	Region                             string            `json:"region,omitempty" yaml:"region,omitempty"`
	ResourceLabels                     map[string]string `json:"resourceLabels,omitempty" yaml:"resourceLabels,omitempty"`
	ServiceAccount                     string            `json:"serviceAccount,omitempty" yaml:"serviceAccount,omitempty"`
	SubNetwork                         string            `json:"subNetwork,omitempty" yaml:"subNetwork,omitempty"`
	UseIPAliases                       bool              `json:"useIpAliases,omitempty" yaml:"useIpAliases,omitempty"`
	Taints                             []string          `json:"taints,omitempty" yaml:"taints,omitempty"`
	Zone                               string            `json:"zone,omitempty" yaml:"zone,omitempty"`
}

type MachineConfigV2 ¶

type MachineConfigV2 struct {
	norman.Resource
	// contains filtered or unexported fields
}

type MachineConfigV2Amazonec2 ¶

type MachineConfigV2Amazonec2 struct {
	norman.Resource
	// contains filtered or unexported fields
}

type MachineConfigV2Azure ¶

type MachineConfigV2Azure struct {
	norman.Resource
	// contains filtered or unexported fields
}

type MachineConfigV2Digitalocean ¶

type MachineConfigV2Digitalocean struct {
	norman.Resource
	// contains filtered or unexported fields
}

type MachineConfigV2Harvester ¶ added in v1.23.0

type MachineConfigV2Harvester struct {
	norman.Resource
	// contains filtered or unexported fields
}

type MachineConfigV2Linode ¶

type MachineConfigV2Linode struct {
	norman.Resource
	// contains filtered or unexported fields
}

type MachineConfigV2Openstack ¶

type MachineConfigV2Openstack struct {
	norman.Resource
	// contains filtered or unexported fields
}

type MachineConfigV2Vmwarevsphere ¶

type MachineConfigV2Vmwarevsphere struct {
	norman.Resource
	// contains filtered or unexported fields
}

type NodeTemplate ¶

type NodeTemplate struct {
	managementClient.NodeTemplate
	Amazonec2Config     *amazonec2Config     `json:"amazonec2Config,omitempty" yaml:"amazonec2Config,omitempty"`
	AzureConfig         *azureConfig         `json:"azureConfig,omitempty" yaml:"azureConfig,omitempty"`
	DigitaloceanConfig  *digitaloceanConfig  `json:"digitaloceanConfig,omitempty" yaml:"digitaloceanConfig,omitempty"`
	HarvesterConfig     *harvesterConfig     `json:"harvesterConfig,omitempty" yaml:"harvesterConfig,omitempty"`
	HetznerConfig       *hetznerConfig       `json:"hetznerConfig,omitempty" yaml:"hetznerConfig,omitempty"`
	LinodeConfig        *linodeConfig        `json:"linodeConfig,omitempty" yaml:"linodeConfig,omitempty"`
	OpennebulaConfig    *opennebulaConfig    `json:"opennebulaConfig,omitempty" yaml:"opennebulaConfig,omitempty"`
	OpenstackConfig     *openstackConfig     `json:"openstackConfig,omitempty" yaml:"openstackConfig,omitempty"`
	VmwarevsphereConfig *vmwarevsphereConfig `json:"vmwarevsphereConfig,omitempty" yaml:"vmwarevsphereConfig,omitempty"`
	OutscaleConfig      *outscaleConfig      `json:"outscaleConfig,omitempty" yaml:"outscaleConfig,omitempty"`
}

type OracleKubernetesEngineConfig ¶

type OracleKubernetesEngineConfig struct {
	CompartmentID               string `json:"compartmentId,omitempty" yaml:"compartmentId,omitempty"`
	CustomBootVolumeSize        int64  `json:"customBootVolumeSize,omitempty" yaml:"customBootVolumeSize,omitempty"`
	Description                 string `json:"description,omitempty" yaml:"description,omitempty"`
	DisplayName                 string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
	EnableKubernetesDashboard   bool   `json:"enableKubernetesDashboard,omitempty" yaml:"enableKubernetesDashboard,omitempty"`
	Fingerprint                 string `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"`
	FlexOCPUs                   int64  `json:"flexOcpus,omitempty" yaml:"flexOcpus,omitempty"`
	KubernetesVersion           string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"`
	DriverName                  string `json:"driverName,omitempty" yaml:"driverName,omitempty"`
	KMSKeyID                    string `json:"kmsKeyId" yaml:"kmsKeyId"`
	LimitNodeCount              int64  `json:"limitNodeCount,omitempty" yaml:"limitNodeCount,omitempty"`
	Name                        string `json:"name,omitempty" yaml:"name,omitempty"`
	NodeImage                   string `json:"nodeImage,omitempty" yaml:"nodeImage,omitempty"`
	NodePoolSubnetDNSDomainName string `json:"nodePoolDnsDomainName,omitempty" yaml:"nodePoolDnsDomainName,omitempty"`
	NodePoolSubnetName          string `json:"nodePoolSubnetName,omitempty" yaml:"nodePoolSubnetName,omitempty"`
	NodePublicSSHKeyContents    string `json:"nodePublicKeyContents,omitempty" yaml:"nodePublicKeyContents,omitempty"`
	NodeShape                   string `json:"nodeShape,omitempty" yaml:"nodeShape,omitempty"`
	PrivateControlPlane         bool   `json:"enablePrivateControlPlane,omitempty" yaml:"enablePrivateControlPlane,omitempty"`
	PrivateKeyContents          string `json:"privateKeyContents,omitempty" yaml:"privateKeyContents,omitempty"`
	PrivateKeyPassphrase        string `json:"privateKeyPassphrase,omitempty" yaml:"privateKeyPassphrase,omitempty"`
	PrivateNodes                bool   `json:"enablePrivateNodes,omitempty" yaml:"enablePrivateNodes,omitempty"`
	PodCidr                     string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"`
	QuantityOfSubnets           int64  `json:"quantityOfNodeSubnets,omitempty" yaml:"quantityOfNodeSubnets,omitempty"`
	QuantityPerSubnet           int64  `json:"quantityPerSubnet,omitempty" yaml:"quantityPerSubnet,omitempty"`
	Region                      string `json:"region,omitempty" yaml:"region,omitempty"`
	ServiceCidr                 string `json:"serviceCidr,omitempty" yaml:"serviceCidr,omitempty"`
	ServiceLBSubnet1Name        string `json:"loadBalancerSubnetName1,omitempty" yaml:"loadBalancerSubnetName1,omitempty"`
	ServiceLBSubnet2Name        string `json:"loadBalancerSubnetName2,omitempty" yaml:"loadBalancerSubnetName2,omitempty"`
	ServiceSubnetDNSDomainName  string `json:"serviceDnsDomainName,omitempty" yaml:"serviceDnsDomainName,omitempty"`
	SkipVCNDelete               bool   `json:"skipVcnDelete,omitempty" yaml:"skipVcnDelete,omitempty"`
	TenancyID                   string `json:"tenancyId,omitempty" yaml:"tenancyId,omitempty"`
	UserOCID                    string `json:"userOcid,omitempty" yaml:"userOcid,omitempty"`
	VCNName                     string `json:"vcnName,omitempty" yaml:"vcnName,omitempty"`
	VcnCompartmentID            string `json:"vcnCompartmentId,omitempty" yaml:"vcnCompartmentId,omitempty"`
	WorkerNodeIngressCidr       string `json:"workerNodeIngressCidr,omitempty" yaml:"workerNodeIngressCidr,omitempty"`
}

type SecretV2 ¶

type SecretV2 struct {
	norman.Resource
	v1.Secret
	K8SType string `json:"_type,omitempty"`
}

type SettingV2 ¶

type SettingV2 struct {
	norman.Resource
	managementAPI.Setting
}

type StorageClassV2 ¶

type StorageClassV2 struct {
	norman.Resource
	storageV1.StorageClass
}

Source Files ¶

Jump to

Keyboard shortcuts

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