soperator

package
v0.0.0-...-5d42de7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SOperatorCRDVersionMap = operatorCRDVersionMap{
	// contains filtered or unexported fields
}

SOperatorCRDVersionMap is a global lookup table in the package. It maps versions of the operator to the resource versions it is compatible with

Functions

func GetAlertVersionsToRemove

func GetAlertVersionsToRemove(alertClient *alertclientset.Clientset, newVersion string) ([]alertv1.Alert, error)

GetAlertVersionsToRemove finds all Alerts with a different version, returns their specs with the new version

func GetBlackduckVersionsToRemove

func GetBlackduckVersionsToRemove(blackduckClient *blackduckclientset.Clientset, newVersion string, namespace string) ([]blackduckv1.Blackduck, error)

GetBlackduckVersionsToRemove finds all Blackducks with a different version, returns their specs with the new version

func GetOperatorImage

func GetOperatorImage(kubeClient *kubernetes.Clientset, namespace string) (string, error)

GetOperatorImage returns the image for Synopsys Operator from the cluster

func GetOpsSightVersionsToRemove

func GetOpsSightVersionsToRemove(opssightClient *opssightclientset.Clientset, newVersion string, crdNamespace string) ([]opssightv1.OpsSight, error)

GetOpsSightVersionsToRemove finds all OpsSights with a different version, returns their specs with the new version

Types

type ClusterType

type ClusterType string

ClusterType represents the cluster type

const (
	KubernetesClusterType ClusterType = "KUBERNETES"
	OpenshiftClusterType  ClusterType = "OPENSHIFT"
)

Constants for the PrintFormats

func GetClusterType

func GetClusterType(kubeClient *kubernetes.Clientset) ClusterType

GetClusterType returns the Cluster type. It defaults to Kubernetes

type Creater

type Creater struct {
	DryRun     bool
	KubeConfig *rest.Config
	KubeClient *kubernetes.Clientset
}

Creater stores the configuration and clients to create specific versions of Synopsys Operator

func NewCreater

func NewCreater(dryRun bool, kubeConfig *rest.Config, kubeClient *kubernetes.Clientset) *Creater

NewCreater returns this Alert Creater

func (*Creater) EnsureSynopsysOperator

func (sc *Creater) EnsureSynopsysOperator(namespace string, blackduckClient *blackduckclientset.Clientset, opssightClient *opssightclientset.Clientset, alertClient *alertclientset.Clientset,
	oldOperatorSpec *SpecConfig, newOperatorSpec *SpecConfig) error

EnsureSynopsysOperator updates the Synopsys Operator's Kubernetes componenets and changes all CRDs to versions that the Operator can use

func (*Creater) GetComponents

func (sc *Creater) GetComponents(specConfig SpecConfig) (*api.ComponentList, error)

GetComponents returns the resource components for an Alert

func (*Creater) UpdateSOperatorComponents

func (sc *Creater) UpdateSOperatorComponents(specConfig *SpecConfig) error

UpdateSOperatorComponents updates Kubernetes resources for the Synopsys Operator

func (*Creater) Versions

func (sc *Creater) Versions() []string

Versions is an Interface function that returns the versions supported by this Creater

type SpecConfig

type SpecConfig struct {
	Namespace                     string
	Image                         string
	Expose                        string
	ClusterType                   ClusterType
	DryRun                        bool
	LogLevel                      string
	Threadiness                   int
	PostgresRestartInMins         int64
	PodWaitTimeoutSeconds         int64
	ResyncIntervalInSeconds       int64
	TerminationGracePeriodSeconds int64
	SealKey                       string
	RestConfig                    *rest.Config
	KubeClient                    *kubernetes.Clientset
	Certificate                   string
	CertificateKey                string
	IsClusterScoped               bool
	Crds                          []string
	AdmissionWebhookListener      bool
}

SpecConfig represents the SOperator component Its methods include GetComponents() and any functions that create Kubernetes Resources for Synopsys Operator

func GetOldOperatorSpec

func GetOldOperatorSpec(restConfig *rest.Config, kubeClient *kubernetes.Clientset, namespace string) (*SpecConfig, error)

GetOldOperatorSpec returns a spec that respesents the current Synopsys Operator in the cluster

func NewSOperator

func NewSOperator(namespace, synopsysOperatorImage, expose string, dryRun bool, logLevel string, threadiness int, postgresRestartInMins int64,
	podWaitTimeoutSeconds int64, resyncIntervalInSeconds int64, terminationGracePeriodSeconds int64, sealKey string, restConfig *rest.Config,
	kubeClient *kubernetes.Clientset, certificate string, certificateKey string, isClusterScoped bool, crds []string, admissionWebhookListener bool) *SpecConfig

NewSOperator will create a SOperator type

func (*SpecConfig) GetComponents

func (specConfig *SpecConfig) GetComponents() (*api.ComponentList, error)

GetComponents will return a ComponentList representing all Kubernetes Resources for Synopsys Operator

func (*SpecConfig) GetOperatorConfigMap

func (specConfig *SpecConfig) GetOperatorConfigMap() (*horizoncomponents.ConfigMap, error)

GetOperatorConfigMap creates a ConfigMap Horizon component for Synopsys Operaotor

func (*SpecConfig) GetTLSCertificateSecret

func (specConfig *SpecConfig) GetTLSCertificateSecret() *horizoncomponents.Secret

GetTLSCertificateSecret creates a TLS certificate in horizon format

Jump to

Keyboard shortcuts

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