Documentation
¶
Index ¶
- Constants
- func GetFirstPortFromPod(p *corev1.Pod, podLog log.Logger) (uint16, error)
- func NewContainerProxyFactory(controller *ContainerController, deploymentTimeout time.Duration) func(net.Conn) *ContainerProxy
- func RandID() string
- func WithCAPath(caPath string) func(*ContainerController)
- func WithCertPath(certPath string) func(*ContainerController)
- func WithDeploymentPath(deploymentPath string) func(*ContainerController)
- func WithEndpoint(endpoint string) func(*ContainerController)
- func WithKeyPath(keyPath string) func(*ContainerController)
- func WithNamespace(namespace string) func(*ContainerController)
- type ContainerController
- func (c *ContainerController) CheckServerVersion() error
- func (c *ContainerController) DeleteDeployment(dep *appsv1.Deployment) error
- func (c *ContainerController) GetPodsForDeployment(dep *appsv1.Deployment) ([]corev1.Pod, error)
- func (c *ContainerController) MakeDeployment(ctx context.Context, uniqid string) (*appsv1.Deployment, error)
- func (c *ContainerController) MakeDeploymentAndWaitForReady(ctx context.Context, uniqid string) (*appsv1.Deployment, error)
- type ContainerControllerOpt
- type ContainerProxy
- type Listener
- type LoadedObject
Constants ¶
View Source
const ( DEFAULT_NAMESPACE = "default" UNIQUEID_LABEL = "uniqid" APP_LABEL = "app" )
Variables ¶
This section is empty.
Functions ¶
func GetFirstPortFromPod ¶
func NewContainerProxyFactory ¶
func NewContainerProxyFactory(controller *ContainerController, deploymentTimeout time.Duration) func(net.Conn) *ContainerProxy
func WithCAPath ¶
func WithCAPath(caPath string) func(*ContainerController)
func WithCertPath ¶
func WithCertPath(certPath string) func(*ContainerController)
func WithDeploymentPath ¶
func WithDeploymentPath(deploymentPath string) func(*ContainerController)
func WithEndpoint ¶
func WithEndpoint(endpoint string) func(*ContainerController)
func WithKeyPath ¶
func WithKeyPath(keyPath string) func(*ContainerController)
func WithNamespace ¶
func WithNamespace(namespace string) func(*ContainerController)
Types ¶
type ContainerController ¶
type ContainerController struct {
// contains filtered or unexported fields
}
func NewContainerController ¶
func NewContainerController(opts ...ContainerControllerOpt) (*ContainerController, error)
func (*ContainerController) CheckServerVersion ¶
func (c *ContainerController) CheckServerVersion() error
func (*ContainerController) DeleteDeployment ¶
func (c *ContainerController) DeleteDeployment(dep *appsv1.Deployment) error
func (*ContainerController) GetPodsForDeployment ¶
func (c *ContainerController) GetPodsForDeployment(dep *appsv1.Deployment) ([]corev1.Pod, error)
func (*ContainerController) MakeDeployment ¶
func (c *ContainerController) MakeDeployment(ctx context.Context, uniqid string) (*appsv1.Deployment, error)
func (*ContainerController) MakeDeploymentAndWaitForReady ¶
func (c *ContainerController) MakeDeploymentAndWaitForReady(ctx context.Context, uniqid string) (*appsv1.Deployment, error)
TODO: delete deployment on failure
type ContainerControllerOpt ¶
type ContainerControllerOpt func(*ContainerController)
type ContainerProxy ¶
type ContainerProxy struct {
// contains filtered or unexported fields
}
We create one of these per connection
func NewContainerProxy ¶
func NewContainerProxy(controller *ContainerController, client net.Conn) *ContainerProxy
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
func NewListener(controller *ContainerController, port uint16, deploymentTimeout, sessionTimeout time.Duration) *Listener
func (*Listener) HandleConn ¶
func (*Listener) ListenAndServe ¶
type LoadedObject ¶
type LoadedObject struct { GroupVersionKind schema.GroupVersionKind Object runtime.Object }
func LoadObjectsFromBytes ¶
func LoadObjectsFromBytes(data []byte) ([]LoadedObject, error)
Inspired by https://dx13.co.uk/articles/2021/01/15/kubernetes-types-using-go/
func LoadObjectsFromFile ¶
func LoadObjectsFromFile(fname string) ([]LoadedObject, error)
func (*LoadedObject) GetDeployment ¶
func (lo *LoadedObject) GetDeployment() *appsv1.Deployment
Converts LoadedObject to Deployment, or nil if not a deployment
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
Log is a separate package to provide access restrictions to the singleton.
|
Log is a separate package to provide access restrictions to the singleton. |
Click to show internal directories.
Click to hide internal directories.