blackduck

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
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 CRUDServiceOrRoute

func CRUDServiceOrRoute(restConfig *rest.Config, kubeClient *kubernetes.Clientset, namespace string, name string, isExposedUI interface{}, exposedServiceType interface{}, isChanged bool) error

CRUDServiceOrRoute will create or update Black Duck exposed service or route in case of OpenShift

func CorePodSecurityContextToHelm

func CorePodSecurityContextToHelm(psc corev1.PodSecurityContext) map[string]interface{}

CorePodSecurityContextToHelm converts pod security context format for Helm Values NOTE: SecurityContext doens't have fsGroup (PodSecurityContext has fsGroup)

func CreateSelfSignedCert

func CreateSelfSignedCert() (string, string)

CreateSelfSignedCert will create a random self signed certificate

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

func GetAuthCertificateSecret

func GetAuthCertificateSecret(secretName string, namespace string, cert []byte) (*corev1.Secret, error)

GetAuthCertificateSecret get the authentication CA certificate secret from file bytes

func GetCertificateSecret

func GetCertificateSecret(secretName string, namespace string, cert []byte, key []byte) (*corev1.Secret, error)

GetCertificateSecret get the webserver or nginx certificate secret from file bytes

func GetCertificateSecretFromFile

func GetCertificateSecretFromFile(secretName, namespace, certPath, keyPath string) (*corev1.Secret, error)

GetCertificateSecretFromFile generates secret from file

func GetCertsFromFlagsAndSetHelmValue

func GetCertsFromFlagsAndSetHelmValue(name string, namespace string, flagset *pflag.FlagSet, helmVal map[string]interface{}) ([]corev1.Secret, error)

GetCertsFromFlagsAndSetHelmValue converts synopsysctl certificate files to kube secrets

func GetProxyCertificateSecret

func GetProxyCertificateSecret(secretName string, namespace string, cert []byte) (*corev1.Secret, error)

GetProxyCertificateSecret get the proxy certificate secret from file bytes

func OperatorAPISecurityContextToHelm

func OperatorAPISecurityContextToHelm(opSecurityContext api.SecurityContext) map[string]interface{}

OperatorAPISecurityContextToHelm converts security context format for Helm Values NOTE: SecurityContext doens't have fsGroup (PodSecurityContext has fsGroup)

func OperatorAffinityTok8sAffinity

func OperatorAffinityTok8sAffinity(opAffinity []v1.NodeAffinity) corev1.Affinity

OperatorAffinityTok8sAffinity converts synopsysctl affinity format to kube affinity format

Types

type FlagTree

type FlagTree struct {
	Size                          string
	DeploymentResourcesFilePath   string
	Version                       string
	ExposeService                 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
	MigrationMode                 bool
	Environs                      []string
	AdminPassword                 string
	UserPassword                  string
	EnableBinaryAnalysis          bool
	EnableSourceCodeUpload        bool
	NodeAffinityFilePath          string
	SecurityContextFilePath       string
	Registry                      string
	RegistryNamespace             string
	PullSecrets                   []string
	SealKey                       string
}

FlagTree is a set of fields needed to configure the Blackduck Helm Chart

type HelmValuesFromCobraFlags

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

HelmValuesFromCobraFlags is a type for converting synopsysctl flags to Helm Chart fields and values args: map of helm chart field to value

func NewHelmValuesFromCobraFlags

func NewHelmValuesFromCobraFlags() *HelmValuesFromCobraFlags

NewHelmValuesFromCobraFlags creates a new HelmValuesFromCobraFlags type

func (*HelmValuesFromCobraFlags) AddCRSpecFlagsToCommand

func (ctl *HelmValuesFromCobraFlags) 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 (*HelmValuesFromCobraFlags) AddHelmValueByCobraFlag

func (ctl *HelmValuesFromCobraFlags) AddHelmValueByCobraFlag(f *pflag.Flag)

AddHelmValueByCobraFlag 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 (*HelmValuesFromCobraFlags) CheckValuesFromFlags

func (ctl *HelmValuesFromCobraFlags) 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 (*HelmValuesFromCobraFlags) GenerateHelmFlagsFromCobraFlags

func (ctl *HelmValuesFromCobraFlags) GenerateHelmFlagsFromCobraFlags(flagset *pflag.FlagSet) (map[string]interface{}, error)

GenerateHelmFlagsFromCobraFlags checks each flag in synopsysctl and updates the map to contain the corresponding helm chart field and value

func (*HelmValuesFromCobraFlags) SetArgs

func (ctl *HelmValuesFromCobraFlags) SetArgs(args map[string]interface{})

SetArgs set the map to values

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.

Jump to

Keyboard shortcuts

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