opssight

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: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptySpec             string = "empty"
	UpstreamSpec          string = "upstream"
	DefaultSpec           string = "default"
	DisabledBlackDuckSpec string = "disabledBlackDuck"
)

Constants for predefined specs

View Source
const (
	// Running is used when OpsSight is running
	Running State = "Running"
	// Stopped is used when OpsSight to be stopped
	Stopped State = "Stopped"
	// Error is used when OpsSight deployment errored out
	Error State = "Error"

	// Start is used when OpsSight deployment to be created or updated
	Start DesiredState = ""
	// Stop is used when OpsSight deployment to be stopped
	Stop DesiredState = "Stop"
)

Variables

This section is empty.

Functions

func FlagWasSet

func FlagWasSet(flagset *pflag.FlagSet, flagName string) bool

FlagWasSet returns true if a flag was changed and it exists, otherwise it returns false

Types

type ArtifactoryPerceiverConfig

type ArtifactoryPerceiverConfig struct {
	Dumper bool
}

ArtifactoryPerceiverConfig stores the Artifactory Perceiver configuration

type BlackDuckConfig

type BlackDuckConfig struct {
	ConnectionsEnvironmentVariableName string
	TLSVerification                    bool
}

BlackDuckConfig stores the Black Duck configuration

type CRDInstaller

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

CRDInstaller defines the specification

func NewCRDInstaller

func NewCRDInstaller(config *protoform.Config, kubeConfig *rest.Config, kubeClient *kubernetes.Clientset, defaults interface{}, stopCh <-chan struct{}) *CRDInstaller

NewCRDInstaller will create a controller configuration

func (*CRDInstaller) AddInformerEventHandler

func (c *CRDInstaller) AddInformerEventHandler()

AddInformerEventHandler will add the event handlers for the informers

func (*CRDInstaller) CreateClientSet

func (c *CRDInstaller) CreateClientSet() error

CreateClientSet will create the CRD client

func (*CRDInstaller) CreateController

func (c *CRDInstaller) CreateController()

CreateController will create a CRD controller

func (*CRDInstaller) CreateHandler

func (c *CRDInstaller) CreateHandler()

CreateHandler will create a CRD handler

func (*CRDInstaller) CreateInformer

func (c *CRDInstaller) CreateInformer()

CreateInformer will create a informer for the CRD

func (*CRDInstaller) CreateQueue

func (c *CRDInstaller) CreateQueue()

CreateQueue will create a queue to process the CRD

func (*CRDInstaller) Deploy

func (c *CRDInstaller) Deploy() error

Deploy will deploy the CRD

func (*CRDInstaller) PostDeploy

func (c *CRDInstaller) PostDeploy()

PostDeploy will initialize before deploying the CRD

func (*CRDInstaller) PostRun

func (c *CRDInstaller) PostRun()

PostRun will run post CRD controller execution

func (*CRDInstaller) Run

func (c *CRDInstaller) Run()

Run will run the CRD controller

type CRSpecBuilderFromCobraFlags

type CRSpecBuilderFromCobraFlags struct {
	IsUpstream                                      string
	PerceptorExpose                                 string
	PerceptorCheckForStalledScansPauseHours         int
	PerceptorStalledScanClientTimeoutHours          int
	PerceptorModelMetricsPauseSeconds               int
	PerceptorUnknownImagePauseMilliseconds          int
	PerceptorClientTimeoutMilliseconds              int
	ScannerPodScannerClientTimeoutSeconds           int
	ScannerPodImageFacadeInternalRegistriesFilePath string
	ScannerPodImageFacadeImagePullerType            string
	ScannerPodReplicaCount                          int
	ScannerPodImageDirectory                        string
	PerceiverEnableImagePerceiver                   string
	PerceiverEnableArtifactoryPerceiver             string
	PerceiverEnableArtifactoryPerceiverDumper       string
	PerceiverEnableQuayPerceiver                    string
	PerceiverEnablePodPerceiver                     string
	PerceiverArtifactoryExpose                      string
	PerceiverQuayExpose                             string
	PerceiverTLSCertificatePath                     string
	PerceiverTLSKeyPath                             string
	PerceiverPodPerceiverNamespaceFilter            string
	PerceiverAnnotationIntervalSeconds              int
	PerceiverDumpIntervalMinutes                    int
	DefaultCPU                                      string
	DefaultMem                                      string
	ScannerCPU                                      string
	ScannerMem                                      string
	LogLevel                                        string
	EnableMetrics                                   string
	PrometheusExpose                                string
	EnableSkyfire                                   string
	SkyfireHubClientTimeoutSeconds                  int
	SkyfireHubDumpPauseSeconds                      int
	SkyfireKubeDumpIntervalSeconds                  int
	SkyfirePerceptorDumpIntervalSeconds             int
	BlackduckExternalHostsFilePath                  string
	BlackduckConnectionsEnvironmentVaraiableName    string
	BlackduckTLSVerification                        string
	BlackduckPassword                               string
	BlackduckInitialCount                           int
	BlackduckMaxCount                               int
	BlackduckType                                   string
	Registry                                        string
	RegistryNamespace                               string
	PullSecrets                                     []string
	ImageRegistries                                 []string
	// contains filtered or unexported fields
}

CRSpecBuilderFromCobraFlags uses Cobra commands, Cobra flags and other values to create an OpsSight CR's Spec.

The fields in the CRSpecBuilderFromCobraFlags represent places where the values of the Cobra flags are stored.

Usage: Use CRSpecBuilderFromCobraFlags to add flags to your Cobra Command for making an OpsSight Spec. When flags are used the correspoding value in this struct will by set. You can then generate the spec by telling CRSpecBuilderFromCobraFlags what flags were changed.

func NewCRSpecBuilderFromCobraFlags

func NewCRSpecBuilderFromCobraFlags() *CRSpecBuilderFromCobraFlags

NewCRSpecBuilderFromCobraFlags creates a new CRSpecBuilderFromCobraFlags type

func (*CRSpecBuilderFromCobraFlags) AddCRSpecFlagsToCommand

func (ctl *CRSpecBuilderFromCobraFlags) AddCRSpecFlagsToCommand(cmd *cobra.Command, master bool)

AddCRSpecFlagsToCommand adds flags to a Cobra Command that are need for OpsSight's Spec. The flags map to fields in the CRSpecBuilderFromCobraFlags struct. master - if false, doesn't add flags that all Users shouldn't use

func (*CRSpecBuilderFromCobraFlags) CheckValuesFromFlags

func (ctl *CRSpecBuilderFromCobraFlags) CheckValuesFromFlags(flagset *pflag.FlagSet) error

CheckValuesFromFlags returns an error if a value stored in the struct will not be able to be used in the opsSightSpec

func (*CRSpecBuilderFromCobraFlags) GenerateCRSpecFromFlags

func (ctl *CRSpecBuilderFromCobraFlags) GenerateCRSpecFromFlags(flagset *pflag.FlagSet) (interface{}, error)

GenerateCRSpecFromFlags checks if a flag was changed and updates the opsSightSpec with the value that's stored in the corresponding struct field

func (*CRSpecBuilderFromCobraFlags) GetCRSpec

func (ctl *CRSpecBuilderFromCobraFlags) GetCRSpec() interface{}

GetCRSpec returns a pointer to the OpsSightSpec as an interface{}

func (*CRSpecBuilderFromCobraFlags) SetCRSpec

func (ctl *CRSpecBuilderFromCobraFlags) SetCRSpec(spec interface{}) error

SetCRSpec sets the opsSightSpec in the struct

func (*CRSpecBuilderFromCobraFlags) SetCRSpecFieldByFlag

func (ctl *CRSpecBuilderFromCobraFlags) SetCRSpecFieldByFlag(f *pflag.Flag)

SetCRSpecFieldByFlag updates a field in the opsSightSpec if the flag was set by the user. It gets the value from the corresponding struct field Note: It should only handle values with a 1 to 1 mapping - struct-field to spec

func (*CRSpecBuilderFromCobraFlags) SetPredefinedCRSpec

func (ctl *CRSpecBuilderFromCobraFlags) SetPredefinedCRSpec(specType string) error

SetPredefinedCRSpec sets the opsSightSpec to a predefined spec

type Controller

type Controller struct {
	Logger            *log.Entry
	Clientset         kubernetes.Interface
	Queue             workqueue.RateLimitingInterface
	Informer          cache.SharedIndexInformer
	Handler           HandlerInterface
	OpsSightClientset *opssightclientset.Clientset
	Namespace         string
}

Controller will store the controller configuration

func NewController

func NewController(config interface{}) *Controller

NewController will contain the controller specification

func (*Controller) HasSynced

func (c *Controller) HasSynced() bool

HasSynced will check for informer sync

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{})

Run will be executed to create the informers or controllers

type Creater

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

Creater will store the configuration to create OpsSight

func NewCreater

func NewCreater(config *protoform.Config, kubeConfig *rest.Config, kubeClient *kubernetes.Clientset, opssightClient *opssightclientset.Clientset, osSecurityClient *securityclient.SecurityV1Client, routeClient *routeclient.RouteV1Client, hubClient *hubclientset.Clientset, isBlackDuckClusterScope bool) *Creater

NewCreater will instantiate the Creater

func (*Creater) CreateOpsSight

func (ac *Creater) CreateOpsSight(opssight *opssightapi.OpsSight) error

CreateOpsSight will create the Black Duck OpsSight

func (*Creater) DeleteOpsSight

func (ac *Creater) DeleteOpsSight(name string) error

DeleteOpsSight will delete the OpsSight

func (*Creater) StopOpsSight

func (ac *Creater) StopOpsSight(opssight *opssightapi.OpsSightSpec) error

StopOpsSight will stop the Black Duck OpsSight

func (*Creater) UpdateOpsSight

func (ac *Creater) UpdateOpsSight(opssight *opssightapi.OpsSight) error

UpdateOpsSight will update the Black Duck OpsSight

type DesiredState

type DesiredState string

DesiredState contains the desired state of the OpsSight

type ExternalHostStructs

type ExternalHostStructs struct {
	Data []opssightapi.Host
}

ExternalHostStructs - file format for reading data

type Handler

type Handler struct {
	Config                  *protoform.Config
	KubeConfig              *rest.Config
	KubeClient              *kubernetes.Clientset
	OpsSightClient          *opssightclientset.Clientset
	IsBlackDuckClusterScope bool
	Defaults                *opssightapi.OpsSightSpec
	Namespace               string
	OSSecurityClient        *securityclient.SecurityV1Client
	RouteClient             *routeclient.RouteV1Client
	HubClient               *hubclientset.Clientset
}

Handler will store the configuration that is required to initiantiate the informers callback

func (*Handler) ObjectCreated

func (h *Handler) ObjectCreated(obj interface{})

ObjectCreated will be called for create opssight events

func (*Handler) ObjectDeleted

func (h *Handler) ObjectDeleted(name string)

ObjectDeleted will be called for delete opssight events

func (*Handler) ObjectUpdated

func (h *Handler) ObjectUpdated(objOld, objNew interface{})

ObjectUpdated will be called for update opssight events

type HandlerInterface

type HandlerInterface interface {
	ObjectCreated(obj interface{})
	ObjectDeleted(obj string)
	ObjectUpdated(objOld, objNew interface{})
}

HandlerInterface contains the methods that are required ... not really sure why we have this type

type ImageFacadeConfig

type ImageFacadeConfig struct {
	Host             string
	Port             int
	ImagePullerType  string
	CreateImagesOnly bool
}

ImageFacadeConfig stores the Perceptor Image Facade configuration

type ImagePerceiverConfig

type ImagePerceiverConfig struct{}

ImagePerceiverConfig stores the Image Perceiver configuration

type InternalRegistryStructs

type InternalRegistryStructs struct {
	Data []opssightapi.RegistryAuth
}

InternalRegistryStructs - file format for reading data

type MainOpssightConfigMap

type MainOpssightConfigMap struct {
	Perceiver   *PerceiverConfig
	BlackDuck   *BlackDuckConfig
	Perceptor   *PerceptorConfig
	Scanner     *ScannerConfig
	ImageFacade *ImageFacadeConfig
	Skyfire     *SkyfireConfig
	LogLevel    string
}

MainOpssightConfigMap stores the opssight configmap

type PerceiverConfig

type PerceiverConfig struct {
	Certificate               string
	CertificateKey            string
	AnnotationIntervalSeconds int
	DumpIntervalMinutes       int
	Port                      int
	Pod                       *PodPerceiverConfig
	Image                     *ImagePerceiverConfig
	Artifactory               *ArtifactoryPerceiverConfig
}

PerceiverConfig stores the Perceiver configuration

type PerceptorConfig

type PerceptorConfig struct {
	Timings     *PerceptorTimingsConfig
	UseMockMode bool
	Host        string
	Port        int
}

PerceptorConfig stores the Perceptor configuration

type PerceptorTimingsConfig

type PerceptorTimingsConfig struct {
	CheckForStalledScansPauseHours int
	StalledScanClientTimeoutHours  int
	ModelMetricsPauseSeconds       int
	UnknownImagePauseMilliseconds  int
	ClientTimeoutMilliseconds      int
}

PerceptorTimingsConfig stores the Perceptor configuration

type PodPerceiverConfig

type PodPerceiverConfig struct {
	NamespaceFilter string
}

PodPerceiverConfig stores the Pod Perceiver configuration

type ScannerConfig

type ScannerConfig struct {
	Port                          int
	ImageDirectory                string
	BlackDuckClientTimeoutSeconds int
}

ScannerConfig stores the Perceptor Scanner configuration

type SkyfireConfig

type SkyfireConfig struct {
	UseInClusterConfig            bool
	Port                          int
	PrometheusPort                int
	BlackDuckClientTimeoutSeconds int
	KubeDumpIntervalSeconds       int
	PerceptorDumpIntervalSeconds  int
	BlackDuckDumpPauseSeconds     int
}

SkyfireConfig stores the Skyfire configuration

type SpecConfig

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

SpecConfig will contain the specification of OpsSight

func NewSpecConfig

func NewSpecConfig(config *protoform.Config, kubeClient *kubernetes.Clientset, opssightClient *opssightclientset.Clientset, hubClient *hubclientset.Clientset, opssight *opssightapi.OpsSight, isBlackDuckClusterScope bool, dryRun bool) *SpecConfig

NewSpecConfig will create the OpsSight object

func (*SpecConfig) ArtifactoryPerceiverReplicationController

func (p *SpecConfig) ArtifactoryPerceiverReplicationController() (*components.ReplicationController, error)

ArtifactoryPerceiverReplicationController creates a replication controller for the artifactory perceiver

func (*SpecConfig) ArtifactoryPerceiverService

func (p *SpecConfig) ArtifactoryPerceiverService() *components.Service

ArtifactoryPerceiverService creates a service for the Artifactory perceiver

func (*SpecConfig) GetComponents

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

GetComponents will return the list of components

func (*SpecConfig) GetPerceiverOpenShiftRoute

func (p *SpecConfig) GetPerceiverOpenShiftRoute(perceiverName string, secure bool) *api.Route

GetPerceiverOpenShiftRoute creates the OpenShift route component for the perceiver model

func (*SpecConfig) GetPerceptorOpenShiftRoute

func (p *SpecConfig) GetPerceptorOpenShiftRoute() *api.Route

GetPerceptorOpenShiftRoute creates the OpenShift route component for the perceptor model

func (*SpecConfig) GetPrometheusOpenShiftRoute

func (p *SpecConfig) GetPrometheusOpenShiftRoute() *api.Route

GetPrometheusOpenShiftRoute creates the OpenShift route component for the prometheus metrics

func (*SpecConfig) ImageFacadeService

func (p *SpecConfig) ImageFacadeService() *components.Service

ImageFacadeService creates a service for perceptor image-facade

func (*SpecConfig) ImagePerceiverClusterRole

func (p *SpecConfig) ImagePerceiverClusterRole() *components.ClusterRole

ImagePerceiverClusterRole creates a cluster role for the image perceiver

func (*SpecConfig) ImagePerceiverClusterRoleBinding

func (p *SpecConfig) ImagePerceiverClusterRoleBinding(clusterRole *components.ClusterRole) *components.ClusterRoleBinding

ImagePerceiverClusterRoleBinding creates a cluster role binding for the image perceiver

func (*SpecConfig) ImagePerceiverReplicationController

func (p *SpecConfig) ImagePerceiverReplicationController() (*components.ReplicationController, error)

ImagePerceiverReplicationController creates a replication controller for the image perceiver

func (*SpecConfig) ImagePerceiverService

func (p *SpecConfig) ImagePerceiverService() *components.Service

ImagePerceiverService creates a service for the image perceiver

func (*SpecConfig) ImagePerceiverServiceAccount

func (p *SpecConfig) ImagePerceiverServiceAccount() *components.ServiceAccount

ImagePerceiverServiceAccount creates a service account for the image perceiver

func (*SpecConfig) PerceiverLoadBalancerService

func (p *SpecConfig) PerceiverLoadBalancerService(perceiverName string) (*components.Service, error)

PerceiverLoadBalancerService creates a loadbalancer service for perceiver

func (*SpecConfig) PerceiverNodePortService

func (p *SpecConfig) PerceiverNodePortService(perceiverName string) (*components.Service, error)

PerceiverNodePortService creates a nodeport service for perceiver

func (*SpecConfig) PerceptorLoadBalancerService

func (p *SpecConfig) PerceptorLoadBalancerService() (*components.Service, error)

PerceptorLoadBalancerService creates a loadbalancer service for perceptor

func (*SpecConfig) PerceptorMetricsConfigMap

func (p *SpecConfig) PerceptorMetricsConfigMap() (*components.ConfigMap, error)

PerceptorMetricsConfigMap creates a config map for perceptor metrics

func (*SpecConfig) PerceptorMetricsDeployment

func (p *SpecConfig) PerceptorMetricsDeployment() (*components.Deployment, error)

PerceptorMetricsDeployment creates a deployment for perceptor metrics

func (*SpecConfig) PerceptorMetricsLoadBalancerService

func (p *SpecConfig) PerceptorMetricsLoadBalancerService() (*components.Service, error)

PerceptorMetricsLoadBalancerService creates a loadbalancer service for perceptor metrics

func (*SpecConfig) PerceptorMetricsNodePortService

func (p *SpecConfig) PerceptorMetricsNodePortService() (*components.Service, error)

PerceptorMetricsNodePortService creates a nodeport service for perceptor metrics

func (*SpecConfig) PerceptorMetricsService

func (p *SpecConfig) PerceptorMetricsService() (*components.Service, error)

PerceptorMetricsService creates a service for perceptor metrics

func (*SpecConfig) PerceptorNodePortService

func (p *SpecConfig) PerceptorNodePortService() (*components.Service, error)

PerceptorNodePortService creates a nodeport service for perceptor

func (*SpecConfig) PerceptorReplicationController

func (p *SpecConfig) PerceptorReplicationController() (*components.ReplicationController, error)

PerceptorReplicationController creates a replication controller for perceptor

func (*SpecConfig) PerceptorSecret

func (p *SpecConfig) PerceptorSecret() (*components.Secret, error)

PerceptorSecret create a secret for perceptor

func (*SpecConfig) PerceptorService

func (p *SpecConfig) PerceptorService() (*components.Service, error)

PerceptorService creates a service for perceptor

func (*SpecConfig) PerceptorSkyfireClusterRole

func (p *SpecConfig) PerceptorSkyfireClusterRole() *components.ClusterRole

PerceptorSkyfireClusterRole creates a cluster role for perceptor skyfire

func (*SpecConfig) PerceptorSkyfireClusterRoleBinding

func (p *SpecConfig) PerceptorSkyfireClusterRoleBinding(clusterRole *components.ClusterRole) *components.ClusterRoleBinding

PerceptorSkyfireClusterRoleBinding creates a cluster role binding for perceptor skyfire

func (*SpecConfig) PerceptorSkyfireReplicationController

func (p *SpecConfig) PerceptorSkyfireReplicationController() (*components.ReplicationController, error)

PerceptorSkyfireReplicationController creates a replication controller for perceptor skyfire

func (*SpecConfig) PerceptorSkyfireService

func (p *SpecConfig) PerceptorSkyfireService() *components.Service

PerceptorSkyfireService creates a service for perceptor skyfire

func (*SpecConfig) PerceptorSkyfireServiceAccount

func (p *SpecConfig) PerceptorSkyfireServiceAccount() *components.ServiceAccount

PerceptorSkyfireServiceAccount creates a service account for perceptor skyfire

func (*SpecConfig) PodPerceiverClusterRole

func (p *SpecConfig) PodPerceiverClusterRole() *components.ClusterRole

PodPerceiverClusterRole creates a cluster role for the pod perceiver

func (*SpecConfig) PodPerceiverClusterRoleBinding

func (p *SpecConfig) PodPerceiverClusterRoleBinding(clusterRole *components.ClusterRole) *components.ClusterRoleBinding

PodPerceiverClusterRoleBinding creates a cluster role binding for the pod perceiver

func (*SpecConfig) PodPerceiverReplicationController

func (p *SpecConfig) PodPerceiverReplicationController() (*components.ReplicationController, error)

PodPerceiverReplicationController creates a replication controller for the pod perceiver

func (*SpecConfig) PodPerceiverService

func (p *SpecConfig) PodPerceiverService() *components.Service

PodPerceiverService creates a service for the pod perceiver

func (*SpecConfig) PodPerceiverServiceAccount

func (p *SpecConfig) PodPerceiverServiceAccount() *components.ServiceAccount

PodPerceiverServiceAccount creates a service account for the pod perceiver

func (*SpecConfig) QuayPerceiverReplicationController

func (p *SpecConfig) QuayPerceiverReplicationController() (*components.ReplicationController, error)

QuayPerceiverReplicationController creates a replication controller for the quay perceiver

func (*SpecConfig) QuayPerceiverService

func (p *SpecConfig) QuayPerceiverService() *components.Service

QuayPerceiverService creates a service for the Quay perceiver

func (*SpecConfig) ScannerClusterRoleBinding

func (p *SpecConfig) ScannerClusterRoleBinding() (*components.ClusterRoleBinding, error)

ScannerClusterRoleBinding creates a cluster role binding for the perceptor scanner

func (*SpecConfig) ScannerReplicationController

func (p *SpecConfig) ScannerReplicationController() (*components.ReplicationController, error)

ScannerReplicationController creates a replication controller for the perceptor scanner

func (*SpecConfig) ScannerService

func (p *SpecConfig) ScannerService() *components.Service

ScannerService creates a service for perceptor scanner

func (*SpecConfig) ScannerServiceAccount

func (p *SpecConfig) ScannerServiceAccount() *components.ServiceAccount

ScannerServiceAccount creates a service account for the perceptor scanner

type State

type State string

State contains the state of the OpsSight

type Updater

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

Updater stores the opssight updater configuration

func NewUpdater

func NewUpdater(config *protoform.Config, kubeClient *kubernetes.Clientset, hubClient *hubclient.Clientset, opssightClient *opssightclientset.Clientset) *Updater

NewUpdater returns the opssight updater configuration

func (*Updater) Run

func (p *Updater) Run(ch <-chan struct{})

Run watches for Black Duck and OpsSight events and update the internal Black Duck hosts in Perceptor secret and then patch the corresponding replication controller

Directories

Path Synopsis
client
clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/opssight/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/opssight/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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