client

package
v0.0.0-...-43d0de1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(c *Config) field.ErrorList

ValidateConfig validates the OCI Volume Provisioner config file.

Types

type AuthConfig

type AuthConfig struct {
	TenancyOCID string `yaml:"tenancy"`
	UserOCID    string `yaml:"user"`
	// CompartmentOCID is DEPRECATED and should be set on the top level Config
	// struct.
	CompartmentOCID      string `yaml:"compartment"`
	PrivateKey           string `yaml:"key"`
	Fingerprint          string `yaml:"fingerprint"`
	Region               string `yaml:"region"`
	PrivateKeyPassphrase string `yaml:"passphrase"`
}

AuthConfig holds the configuration required for communicating with the OCI API.

type BlockStorage

type BlockStorage interface {
	CreateVolume(ctx context.Context, request core.CreateVolumeRequest) (response core.CreateVolumeResponse, err error)
	DeleteVolume(ctx context.Context, request core.DeleteVolumeRequest) (response core.DeleteVolumeResponse, err error)
	GetVolume(ctx context.Context, request core.GetVolumeRequest) (response core.GetVolumeResponse, err error)
}

BlockStorage specifies the subset of the OCI core API utilised by the provisioner.

type Config

type Config struct {
	Auth                  AuthConfig `yaml:"auth"`
	UseInstancePrincipals bool       `yaml:"useInstancePrincipals"`
	// CompartmentOCID is the OCID of the Compartment within which the cluster
	// resides.
	CompartmentOCID string `yaml:"compartment"`
}

Config holds the OCI cloud-provider config passed to Kubernetes compontents.

func LoadConfig

func LoadConfig(r io.Reader) (*Config, error)

LoadConfig consumes the config Reader and constructs a Config object.

func (*Config) Complete

func (c *Config) Complete()

Complete the config applying defaults / overrides.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the OCI config.

type FSS

FSS specifies the subset of the OCI filestorage API utilised by the provisioner.

type Identity

type Identity interface {
	ListAvailabilityDomains(ctx context.Context, request identity.ListAvailabilityDomainsRequest) (response identity.ListAvailabilityDomainsResponse, err error)
}

Identity specifies the subset of the OCI identity API utilised by the provisioner.

type ProvisionerClient

type ProvisionerClient interface {
	BlockStorage() BlockStorage
	Identity() Identity
	FSS() FSS
	VCN() VCN
	Timeout() time.Duration
	CompartmentOCID() string
	TenancyOCID() string
}

ProvisionerClient is passed to all sub clients to provision a volume

func FromConfig

func FromConfig(logger *zap.SugaredLogger, cfg *Config) (ProvisionerClient, error)

FromConfig creates an OCI client from the given configuration.

type VCN

type VCN interface {
	GetPrivateIp(ctx context.Context, request core.GetPrivateIpRequest) (response core.GetPrivateIpResponse, err error)
}

VCN specifies the subset of the OCI core API utilised by the provisioner.

Jump to

Keyboard shortcuts

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