rancher

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name        string
	Catalog     string
	Chart       string
	Version     string
	Namespace   string
	SkipUpgrade bool `yaml:"skip_upgrade,omitempty"`
	Answers     map[string]string
}

type Certificate

type Certificate struct {
	Name      string
	Key       string
	Certs     string
	Namespace string `yaml:"namespace,omitempty"`
}

type Client

type Client interface {
	HasClusterWithName(name string) (bool, string, error)
	SetCluster(clusterName, clusterId string) error
	HasProjectWithName(name string) (bool, string, error)
	SetProject(projectName, projectId string) error
	CreateProject(projectName string) (string, error)
	HasNamespace(namespace Namespace) (bool, error)
	CreateNamespace(namespace Namespace) error
	HasCertificate(certificate Certificate) (bool, error)
	CreateCertificate(certificate Certificate) error
	HasConfigMap(configMap ConfigMap) (bool, error)
	CreateConfigMap(configMap ConfigMap) error
	HasDockerCredential(dockerCredential DockerCredential) (bool, error)
	CreateDockerCredential(dockerCredential DockerCredential) error
	HasSecret(secret ConfigMap) (bool, error)
	CreateSecret(secret ConfigMap) error
	HasNamespacedSecret(secret ConfigMap) (bool, error)
	CreateNamespacedSecret(secret ConfigMap) error
	HasStorageClass(storageClass StorageClass) (bool, error)
	CreateStorageClass(storageClass StorageClass) error
	HasPersistentVolume(persistentVolume PersistentVolume) (bool, error)
	CreatePersistentVolume(persistentVolume PersistentVolume) error
	HasApp(app App) (bool, error)
	UpgradeApp(app App) error
	CreateApp(app App) error
}

func NewClient

func NewClient(clientConfig ClientConfig) (Client, error)

type ClientConfig

type ClientConfig struct {
	RancherURL string
	AccessKey  string
	SecretKey  string
}

type Cluster

type Cluster struct {
	ApiVersion        string `yaml:"api_version"`
	Kind              string
	Metadata          ClusterMetadata
	StorageClasses    []StorageClass     `yaml:"storage_classes,omitempty"`
	PersistentVolumes []PersistentVolume `yaml:"storage_class,omitempty"`
	Projects          []Project
}

type ClusterMetadata

type ClusterMetadata struct {
	Name       string
	ID         string `yaml:"id,omitempty"`
	RancherUrl string `yaml:"rancher_url,omitempty"`
	AccessKey  string `yaml:"access_key,omitempty"`
	SecretKey  string `yaml:"secret_key,omitempty"`
	TokenKey   string `yaml:"token_key,omitempty"`
}

type ConfigMap

type ConfigMap struct {
	Name      string
	Data      map[string]string
	Namespace string `yaml:"namespace,omitempty"`
}

type DockerCredential

type DockerCredential struct {
	Name       string               `yaml:"name,omitempty"`
	Namespace  string               `yaml:"namespace,omitempty"`
	Registries []RegistryCredential `yaml:"registries,omitempty"`
}

type Namespace

type Namespace struct {
	Name string
}

type PersistentVolume

type PersistentVolume struct {
	Name             string
	Type             string
	Path             string
	Node             string
	StorageClassName string   `yaml:"storage_class_name"`
	AccessModes      []string `yaml:"access_modes"`
	Capacity         string
	InitScript       string `yaml:"init_script"`
}

type Project

type Project struct {
	APIVersion        string `yaml:"api_version"`
	Kind              string
	Metadata          ProjectMetadata
	Namespaces        []Namespace        `yaml:"namespaces,omitempty"`
	Resources         Resources          `yaml:"resources,omitempty"`
	StorageClasses    []StorageClass     `yaml:"storage_classes,omitempty"`
	PersistentVolumes []PersistentVolume `yaml:"persistent_volumes,omitempty"`
	Apps              []App
}

type ProjectMetadata

type ProjectMetadata struct {
	Name        string
	ID          string `yaml:"id,omitempty"`
	RancherURL  string `yaml:"rancher_url,omitempty"`
	AccessKey   string `yaml:"access_key,omitempty"`
	SecretKey   string `yaml:"secret_key,omitempty"`
	TokenKey    string `yaml:"token_key,omitempty"`
	ClusterName string `yaml:"cluster_name,omitempty"`
	ClusterID   string `yaml:"cluster_id,omitempty"`
}

type RegistryCredential

type RegistryCredential struct {
	Name     string `yaml:"name,omitempty"`
	Password string `yaml:"password,omitempty"`
	Username string `yaml:"username,omitempty"`
}

type Resources

type Resources struct {
	Certificates      []Certificate      `yaml:"certificates,omitempty"`
	ConfigMaps        []ConfigMap        `yaml:"config_maps,omitempty"`
	DockerCredentials []DockerCredential `yaml:"docker_credentials,omitempty"`
	Secrets           []ConfigMap        `yaml:"secrets,omitempty"`
}

type StorageClass

type StorageClass struct {
	Name           string
	Provisioner    string
	ReclaimPolicy  string            `yaml:"reclaim_policy"`
	VolumeBindMode string            `yaml:"volume_bind_mode"`
	Parameters     map[string]string `yaml:"parameters,omitempty"`
	MountOptions   []string          `yaml:"mount_options,omitempty"`
}

Directories

Path Synopsis
Package stubs to do unit tests for package github.com/bitgrip/cattlectl/internal/pkg/rancher uses github.com/bitgrip/cattlectl/internal/pkg/rancher uses: * clusterClient "github.com/rancher/types/client/cluster/v3" * managementClient "github.com/rancher/types/client/management/v3" * projectClient "github.com/rancher/types/client/project/v3"
Package stubs to do unit tests for package github.com/bitgrip/cattlectl/internal/pkg/rancher uses github.com/bitgrip/cattlectl/internal/pkg/rancher uses: * clusterClient "github.com/rancher/types/client/cluster/v3" * managementClient "github.com/rancher/types/client/management/v3" * projectClient "github.com/rancher/types/client/project/v3"

Jump to

Keyboard shortcuts

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