Documentation
¶
Index ¶
- Constants
- func CreateSelfSignedCert() (string, string)
- func FlagWasSet(flagset *pflag.FlagSet, flagName string) bool
- type APISetHubsRequest
- type CRDInstaller
- func (c *CRDInstaller) AddInformerEventHandler()
- func (c *CRDInstaller) CreateClientSet() error
- func (c *CRDInstaller) CreateController()
- func (c *CRDInstaller) CreateHandler()
- func (c *CRDInstaller) CreateInformer()
- func (c *CRDInstaller) CreateQueue()
- func (c *CRDInstaller) Deploy() error
- func (c *CRDInstaller) PostDeploy()
- func (c *CRDInstaller) PostRun()
- func (c *CRDInstaller) Run()
- type CRSpecBuilderFromCobraFlags
- func (ctl *CRSpecBuilderFromCobraFlags) AddCRSpecFlagsToCommand(cmd *cobra.Command, master bool)
- func (ctl *CRSpecBuilderFromCobraFlags) CheckValuesFromFlags(flagset *pflag.FlagSet) error
- func (ctl *CRSpecBuilderFromCobraFlags) GenerateCRSpecFromFlags(flagset *pflag.FlagSet) (interface{}, error)
- func (ctl *CRSpecBuilderFromCobraFlags) GetCRSpec() interface{}
- func (ctl *CRSpecBuilderFromCobraFlags) SetCRSpec(spec interface{}) error
- func (ctl *CRSpecBuilderFromCobraFlags) SetCRSpecFieldByFlag(f *pflag.Flag)
- func (ctl *CRSpecBuilderFromCobraFlags) SetPredefinedCRSpec(specType string) error
- type Controller
- type DesiredState
- type Handler
- type HandlerInterface
- type State
Constants ¶
const ( // Running is used when the instance is running Running State = "Running" // Starting is used when the instance is starting Starting State = "Starting" // Stopped is used when the instance is about to stop Stopped State = "Stopped" // Error is used when the instance deployment errored out Error State = "Error" // DbMigration is used when the instance is about to be in the migrated state DbMigration DesiredState = "DbMigration" // Start is used when the instance to be created or updated Start DesiredState = "" // Stop is used when the instance to be stopped Stop DesiredState = "Stop" // DbMigrate is used when the instance is migrated DbMigrate DesiredState = "DbMigrate" )
const ( EmptySpec string = "empty" PersistentStorageLatestSpec string = "persistentStorageLatest" PersistentStorageV1Spec string = "persistentStorageV1" ExternalPersistentStorageLatestSpec string = "externalPersistentStorageLatest" ExternalPersistentStorageV1Spec string = "externalPersistentStorageV1" BDBASpec string = "bdba" EphemeralSpec string = "ephemeral" EphemeralCustomAuthCASpec string = "ephemeralCustomAuthCA" ExternalDBSpec string = "externalDB" IPV6DisabledSpec string = "IPV6Disabled" )
Constants for predefined specs
Variables ¶
This section is empty.
Functions ¶
func CreateSelfSignedCert ¶
CreateSelfSignedCert will create a random self signed certificate
Types ¶
type APISetHubsRequest ¶
type APISetHubsRequest struct {
HubURLs []string
}
APISetHubsRequest to set the Black Duck urls for Perceptor
type CRDInstaller ¶
type CRDInstaller struct {
// contains filtered or unexported fields
}
CRDInstaller defines the specification for the CRD
func NewCRDInstaller ¶
func NewCRDInstaller(config *protoform.Config, kubeConfig *rest.Config, kubeClient *kubernetes.Clientset, defaults interface{}, stopCh <-chan struct{}) *CRDInstaller
NewCRDInstaller will create a CRD installer 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 and other relevant components
func (*CRDInstaller) PostDeploy ¶
func (c *CRDInstaller) PostDeploy()
PostDeploy will call after deploying the CRD
func (*CRDInstaller) PostRun ¶
func (c *CRDInstaller) PostRun()
PostRun will run post CRD controller execution
type CRSpecBuilderFromCobraFlags ¶
type CRSpecBuilderFromCobraFlags struct {
Size string
Version string
ExposeService string
DbPrototype string
ExternalPostgresHost string
ExternalPostgresPort int
ExternalPostgresAdmin string
ExternalPostgresUser string
ExternalPostgresSsl string
ExternalPostgresAdminPassword string
ExternalPostgresUserPassword string
PvcStorageClass string
LivenessProbes string
PersistentStorage string
PVCFilePath string
PostgresClaimSize string
CertificateName string
CertificateFilePath string
CertificateKeyFilePath string
ProxyCertificateFilePath string
AuthCustomCAFilePath string
Type string
DesiredState string
MigrationMode bool
Environs []string
ImageRegistries []string
LicenseKey string
AdminPassword string
PostgresPassword string
UserPassword string
EnableBinaryAnalysis bool
EnableSourceCodeUpload bool
NodeAffinityFilePath string
SecurityContextFilePath string
Registry string
RegistryNamespace string
PullSecrets []string
SealKey string
// contains filtered or unexported fields
}
CRSpecBuilderFromCobraFlags uses Cobra commands, Cobra flags and other values to create a Black Duck 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 a Black Duck 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 BlackDuck'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 blackDuckSpec
func (*CRSpecBuilderFromCobraFlags) GenerateCRSpecFromFlags ¶
func (ctl *CRSpecBuilderFromCobraFlags) GenerateCRSpecFromFlags(flagset *pflag.FlagSet) (interface{}, error)
GenerateCRSpecFromFlags checks if a flag was changed and updates the blackDuckSpec 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 BlackDuckSpec as an interface{}
func (*CRSpecBuilderFromCobraFlags) SetCRSpec ¶
func (ctl *CRSpecBuilderFromCobraFlags) SetCRSpec(spec interface{}) error
SetCRSpec sets the blackDuckSpec in the struct
func (*CRSpecBuilderFromCobraFlags) SetCRSpecFieldByFlag ¶
func (ctl *CRSpecBuilderFromCobraFlags) SetCRSpecFieldByFlag(f *pflag.Flag)
SetCRSpecFieldByFlag updates a field in the blackDuckSpec 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 blackDuckSpec to a predefined spec
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller will store the controller configuration
func NewController ¶
func NewController(logger *log.Entry, queue workqueue.RateLimitingInterface, informer cache.SharedIndexInformer, handler HandlerInterface) *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 DesiredState ¶
type DesiredState string
DesiredState contains the desired state of the Black Duck
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler will store the configuration that is required to initiantiate the informers callback
func NewHandler ¶
func NewHandler(config *protoform.Config, kubeConfig *rest.Config, kubeClient *kubernetes.Clientset, hubClient *blackduckclientset.Clientset, defaults *blackduckv1.BlackduckSpec, cmMutex chan bool, osSecurityClient *securityclient.SecurityV1Client, routeClient *routeclient.RouteV1Client) *Handler
NewHandler will create the handler
func (*Handler) ObjectCreated ¶
func (h *Handler) ObjectCreated(obj interface{})
ObjectCreated will be called for create hub events
func (*Handler) ObjectDeleted ¶
ObjectDeleted will be called for delete hub events
func (*Handler) ObjectUpdated ¶
func (h *Handler) ObjectUpdated(objOld, objNew interface{})
ObjectUpdated will be called for update black duck events
type HandlerInterface ¶
type HandlerInterface interface {
ObjectCreated(obj interface{})
ObjectDeleted(obj string)
ObjectUpdated(objOld, objNew interface{})
}
HandlerInterface interface contains the methods that are required
Source Files
¶
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/blackduck/v1
This package has the automatically generated typed clients.
|
This package has the automatically generated typed clients. |
|
clientset/versioned/typed/blackduck/v1/fake
Package fake has the automatically generated clients.
|
Package fake has the automatically generated clients. |