Documentation
¶
Index ¶
- Constants
- func CheckKubeConfigExist() bool
- func CheckPathExists(path string) bool
- func GetHostWithPort(inputURL string) (string, error)
- type Client
- type OpenShift
- func (oc *OpenShift) AttachVolume(ctx *lepton.Context, instanceName, volumeName string, attachID int) error
- func (oc *OpenShift) BuildImage(ctx *lepton.Context) (string, error)
- func (oc *OpenShift) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)
- func (oc *OpenShift) CreateImage(ctx *lepton.Context, imagePath string) error
- func (oc *OpenShift) CreateInstance(ctx *lepton.Context) error
- func (oc *OpenShift) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
- func (oc *OpenShift) CustomizeImage(ctx *lepton.Context) (string, error)
- func (oc *OpenShift) DeleteImage(ctx *lepton.Context, imagename string) error
- func (oc *OpenShift) DeleteInstance(ctx *lepton.Context, instancename string) error
- func (oc *OpenShift) DeleteVolume(ctx *lepton.Context, volumeName string) error
- func (oc *OpenShift) DetachVolume(ctx *lepton.Context, instanceName, volumeName string) error
- func (oc *OpenShift) GetAllVolumes(ctx *lepton.Context) (*[]lepton.NanosVolume, error)
- func (oc *OpenShift) GetImages(ctx *lepton.Context, filter string) ([]lepton.CloudImage, error)
- func (oc *OpenShift) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)
- func (oc *OpenShift) GetInstanceLogs(ctx *lepton.Context, instancename string) (string, error)
- func (oc *OpenShift) GetInstances(ctx *lepton.Context) ([]lepton.CloudInstance, error)
- func (oc *OpenShift) Initialize(config *types.ProviderConfig) error
- func (oc *OpenShift) InstanceStats(ctx *lepton.Context, instancename string, watch bool) error
- func (oc *OpenShift) ListImages(ctx *lepton.Context, filter string) error
- func (oc *OpenShift) ListInstances(ctx *lepton.Context) error
- func (oc *OpenShift) PrintInstanceLogs(ctx *lepton.Context, instancename string, watch bool) error
- func (oc *OpenShift) RebootInstance(ctx *lepton.Context, instanceName string) error
- func (oc *OpenShift) ResizeImage(ctx *lepton.Context, imagename string, hbytes string) error
- func (oc *OpenShift) StartInstance(ctx *lepton.Context, instancename string) error
- func (oc *OpenShift) StopInstance(ctx *lepton.Context, instancename string) error
- func (oc *OpenShift) SyncImage(config *types.Config, target lepton.Provider, imagename string) error
Constants ¶
const ProviderName = "openshift"
ProviderName of the cloud platform provider
Variables ¶
This section is empty.
Functions ¶
func CheckKubeConfigExist ¶
func CheckKubeConfigExist() bool
CheckKubeConfigExist checks for existence of kubeconfig
func CheckPathExists ¶
CheckPathExists checks if a path exists or not
func GetHostWithPort ¶
GetHostWithPort parses provided url and returns string formated as host:port even if port was not specifically specified in the origin url. If port is not specified, standart port corresponding to url schema is provided. example: for url https://example.com function will return "example.com:443" for url https://example.com:8443 function will return "example:8443"
Types ¶
type Client ¶
type Client struct { KubeClient kubernetes.Interface KubeConfig clientcmd.ClientConfig KubeClientConfig *rest.Config Namespace string OperatorClient *operatorsclientset.OperatorsV1alpha1Client }
Client is a collection of fields used for client configuration and interaction
func NewForConfig ¶
func NewForConfig(config clientcmd.ClientConfig) (client *Client, err error)
NewForConfig creates a new client with the provided configuration or initializes the configuration if none is provided
type OpenShift ¶
type OpenShift struct {
// contains filtered or unexported fields
}
OpenShift provides access to the OpenShift/Kubernetes API and implements the provider interface.
func (*OpenShift) AttachVolume ¶
func (oc *OpenShift) AttachVolume(ctx *lepton.Context, instanceName, volumeName string, attachID int) error
AttachVolume attaches a volume to a nano instance
func (*OpenShift) BuildImage ¶
BuildImage builds the image
func (*OpenShift) BuildImageWithPackage ¶
BuildImageWithPackage builds the image with package
func (*OpenShift) CreateImage ¶
CreateImage creates the image
func (*OpenShift) CreateInstance ¶
CreateInstance creates nano instance
func (*OpenShift) CreateVolume ¶
func (oc *OpenShift) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
CreateVolume creates a volume on the openshift cluster
func (*OpenShift) CustomizeImage ¶
CustomizeImage customizes the images
func (*OpenShift) DeleteImage ¶
DeleteImage deletes the image using the image name
func (*OpenShift) DeleteInstance ¶
DeleteInstance deletes a nano instance using the name
func (*OpenShift) DeleteVolume ¶
DeleteVolume deletes a volume
func (*OpenShift) DetachVolume ¶
DetachVolume detaches a volume from a nano instance
func (*OpenShift) GetAllVolumes ¶
GetAllVolumes gets all volumes
func (*OpenShift) GetInstanceByName ¶
func (oc *OpenShift) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)
GetInstanceByName gets a nano instance by name
func (*OpenShift) GetInstanceLogs ¶
GetInstanceLogs gets the logs from a nanos instance
func (*OpenShift) GetInstances ¶
GetInstances gets all nano instances
func (*OpenShift) Initialize ¶
func (oc *OpenShift) Initialize(config *types.ProviderConfig) error
Initialize prepares the openshift client and checks if the openshift server is up
func (*OpenShift) InstanceStats ¶
InstanceStats show metrics for instances on openshift.
func (*OpenShift) ListImages ¶
ListImages lists all the images
func (*OpenShift) ListInstances ¶
ListInstances lists all nano instances locally or on the provider
func (*OpenShift) PrintInstanceLogs ¶
PrintInstanceLogs prints the logs from a nanos instance
func (*OpenShift) RebootInstance ¶
RebootInstance reboots a nanos instance.
func (*OpenShift) ResizeImage ¶
ResizeImage resizes the image
func (*OpenShift) StartInstance ¶
StartInstance starts a nanos instance
func (*OpenShift) StopInstance ¶
StopInstance stops a nanos instance