openshift

package
v1.20.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInstance

func SetInstance(i Ops)

SetInstance replaces the instance with the provided one. Should be used only for testing purposes.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a wrapper for the openshift resource interfaces.

func New

New builds a new client.

func NewForConfig

func NewForConfig(c *rest.Config) (*Client, error)

NewForConfig builds a new client for the given config.

func (*Client) CreateDeploymentConfig

func (c *Client) CreateDeploymentConfig(deployment *ocpappsv1api.DeploymentConfig) (*ocpappsv1api.DeploymentConfig, error)

CreateDeploymentConfig creates the given deployment

func (*Client) DeleteDeploymentConfig

func (c *Client) DeleteDeploymentConfig(name, namespace string) error

DeleteDeploymentConfig deletes the given deployment

func (*Client) DescribeDeploymentConfig

func (c *Client) DescribeDeploymentConfig(depName, depNamespace string) (*ocpappsv1api.DeploymentConfigStatus, error)

DescribeDeploymentConfig gets the deployment status

func (*Client) GetDeploymentConfig

func (c *Client) GetDeploymentConfig(name, namespace string) (*ocpappsv1api.DeploymentConfig, error)

GetDeploymentConfig returns a deployment for the give name and namespace

func (*Client) GetDeploymentConfigPods

func (c *Client) GetDeploymentConfigPods(deployment *ocpappsv1api.DeploymentConfig) ([]corev1.Pod, error)

GetDeploymentConfigPods returns pods for the given deployment

func (*Client) GetDeploymentConfigsUsingStorageClass

func (c *Client) GetDeploymentConfigsUsingStorageClass(scName string) ([]ocpappsv1api.DeploymentConfig, error)

GetDeploymentConfigsUsingStorageClass returns all deployments using the given storage class

func (*Client) GetSecurityContextConstraints

func (c *Client) GetSecurityContextConstraints(name string) (result *ocpsecurityv1api.SecurityContextConstraints, err error)

GetSecurityContextConstraints takes name of the securityContextConstraints and returns the corresponding securityContextConstraints object, and an error if there is any.

func (*Client) ListDeploymentConfigs

func (c *Client) ListDeploymentConfigs(namespace string) (*ocpappsv1api.DeploymentConfigList, error)

ListDeploymentConfigs lists all deployments for the given namespace

func (*Client) ListSecurityContextConstraints

func (c *Client) ListSecurityContextConstraints() (result *ocpsecurityv1api.SecurityContextConstraintsList, err error)

ListSecurityContextConstraints returns the list of all SecurityContextConstraints, and an error if there is any.

func (*Client) SetConfig

func (c *Client) SetConfig(cfg *rest.Config)

SetConfig sets the config and resets the client

func (*Client) UpdateDeploymentConfig

func (c *Client) UpdateDeploymentConfig(deployment *ocpappsv1api.DeploymentConfig) (*ocpappsv1api.DeploymentConfig, error)

UpdateDeploymentConfig updates the given deployment

func (*Client) UpdateSecurityContextConstraints

func (c *Client) UpdateSecurityContextConstraints(securityContextConstraints *ocpsecurityv1api.SecurityContextConstraints) (result *ocpsecurityv1api.SecurityContextConstraints, err error)

UpdateSecurityContextConstraints takes the representation of a securityContextConstraints and updates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any.

func (*Client) ValidateDeploymentConfig

func (c *Client) ValidateDeploymentConfig(deployment *ocpappsv1api.DeploymentConfig, timeout, retryInterval time.Duration) error

ValidateDeploymentConfig validates the given deployment if it's running and healthy

func (*Client) ValidateTerminatedDeploymentConfig

func (c *Client) ValidateTerminatedDeploymentConfig(deployment *ocpappsv1api.DeploymentConfig) error

ValidateTerminatedDeploymentConfig validates if given deployment is terminated

type DeploymentConfigOps

type DeploymentConfigOps interface {
	// ListDeploymentConfigs lists all deployments for the given namespace
	ListDeploymentConfigs(namespace string) (*ocpappsv1api.DeploymentConfigList, error)
	// GetDeploymentConfig returns a deployment for the give name and namespace
	GetDeploymentConfig(name, namespace string) (*ocpappsv1api.DeploymentConfig, error)
	// CreateDeploymentConfig creates the given deployment
	CreateDeploymentConfig(*ocpappsv1api.DeploymentConfig) (*ocpappsv1api.DeploymentConfig, error)
	// UpdateDeploymentConfig updates the given deployment
	UpdateDeploymentConfig(*ocpappsv1api.DeploymentConfig) (*ocpappsv1api.DeploymentConfig, error)
	// DeleteDeploymentConfig deletes the given deployment
	DeleteDeploymentConfig(name, namespace string) error
	// ValidateDeploymentConfig validates the given deployment if it's running and healthy
	ValidateDeploymentConfig(deployment *ocpappsv1api.DeploymentConfig, timeout, retryInterval time.Duration) error
	// ValidateTerminatedDeploymentConfig validates if given deployment is terminated
	ValidateTerminatedDeploymentConfig(*ocpappsv1api.DeploymentConfig) error
	// GetDeploymentConfigPods returns pods for the given deployment
	GetDeploymentConfigPods(*ocpappsv1api.DeploymentConfig) ([]corev1.Pod, error)
	// DescribeDeploymentConfig gets the deployment status
	DescribeDeploymentConfig(name, namespace string) (*ocpappsv1api.DeploymentConfigStatus, error)
	// GetDeploymentConfigsUsingStorageClass returns all deployments using the given storage class
	GetDeploymentConfigsUsingStorageClass(scName string) ([]ocpappsv1api.DeploymentConfig, error)
}

DeploymentConfigOps is an interface to perform ocp deployment config operations

type Ops

type Ops interface {
	DeploymentConfigOps
	SecurityContextConstraintsOps

	// SetConfig sets the config and resets the client
	SetConfig(config *rest.Config)
}

Ops is an interface to openshift operations.

func Instance

func Instance() Ops

Instance returns a singleton instance of the client.

func NewInstanceFromConfigFile

func NewInstanceFromConfigFile(config string) (Ops, error)

NewInstanceFromConfigFile returns new instance of client by using given config file

type SecurityContextConstraintsOps

type SecurityContextConstraintsOps interface {
	// ListSecurityContextConstraints returns the list of all SecurityContextConstraints, and an error if there is any.
	ListSecurityContextConstraints() (*ocpsecurityv1api.SecurityContextConstraintsList, error)
	// GetSecurityContextConstraints takes name of the securityContextConstraints and returns the corresponding securityContextConstraints object, and an error if there is any.
	GetSecurityContextConstraints(string) (*ocpsecurityv1api.SecurityContextConstraints, error)
	// UpdateSecurityContextConstraints takes the representation of a securityContextConstraints and updates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any.
	UpdateSecurityContextConstraints(*ocpsecurityv1api.SecurityContextConstraints) (*ocpsecurityv1api.SecurityContextConstraints, error)
}

SecurityContextConstraintsOps is an interface to list, get and update security context constraints

Jump to

Keyboard shortcuts

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