# Functions
ArePodsReady returns whether the pods are ready or not.
Base64Decode will return a decoded string using a URL-compatible base64 format; decoding may return an error, which you can check if you don’t already know the input to be well-formed.
Base64Encode will return an encoded string using a URL-compatible base64 format.
BoolToPtr will convert bool to pointer.
CheckAndUpdateNamespace will check whether the namespace is exist and if exist, update the version label in namespace of the updated/deleted resource.
CheckResourceNamespace checks whether namespace is having any resource types.
ConvertYamlFileToRuntimeObjects converts the yaml file string to map of runtime object.
CreateAlert will create alert in the cluster.
CreateBlackduck will create hub in the cluster.
CreateClusterRoleBinding creates a cluster role binding.
CreateConfigMapVolume will mount the config map for a pod.
CreateContainer will create the container.
CreateDeployment will create a deployment.
CreateDeploymentFromContainer will create a deployment with multiple containers inside a pod.
CreateEmptyDirVolume will create a empty directory for a pod.
CreateEmptyDirVolumeWithoutSizeLimit will create a empty directory for a pod.
CreateExecContainerRequest will create the request to exec into Kubernetes pod.
CreateGCEPersistentDiskVolume will create a GCE Persistent disk volume for a pod.
CreateHelmActionConfiguration creates an action.Configuration that points to the specified cluster and namespace.
CreateNamespace will create the namespace.
CreateOpsSight will create opsSight in the cluster.
CreatePersistentVolume will create the persistent volume.
CreatePersistentVolumeClaim will create the persistent volume claim.
CreatePersistentVolumeClaimVolume will create a PVC claim for a pod.
CreatePod will create the pod.
CreateReplicationController will create a replication controller.
CreateReplicationControllerFromContainer will create a replication controller with multiple containers inside a pod.
CreateRoute creates an OpenShift routes.
CreateSecret will create the secret.
CreateSecretFromFile will create the secret from file.
CreateSecretVolume will mount the secret for a pod.
CreateService will create the service.
CreateServiceAccount creates a service account.
CreateServiceWithMultiplePort will create the service with multiple port.
CreateWithHelm3 uses the helm NewInstall action to create a resource in the cluster Modified from https://github.com/openshift/console/blob/cdf6b189b71e488033ecaba7d90258d9f9453478/pkg/helm/actions/install_chart.go Helm Actions: https://github.com/helm/helm/tree/9bc7934f350233fa72a11d2d29065aa78ab62792/pkg/action.
DeleteAlert will delete Alert in the cluster.
DeleteBlackduck will delete Blackduck in the cluster.
DeleteClusterRole delete a cluster role.
DeleteClusterRoleBinding delete a cluster role binding.
DeleteConfigMap will delete the config map.
DeleteCustomResourceDefinition deletes the custom resource defintion.
DeleteDeployment will delete the deployment corresponding to a namespace and name.
DeleteNamespace will delete the namespace.
DeleteOpsSight will delete OpsSight in the cluster.
DeletePersistentVolume will delete the persistent volume.
DeletePod will delete the input pods corresponding to a namespace.
DeletePVC will delete the PVC information for the input pvc name inside the input namespace.
DeleteReplicationController will delete the replication controller corresponding to a namespace and name.
DeleteResourceNamespace deletes the namespace if none of the other resource types are running.
DeleteRole delete a role.
DeleteRoleBinding delete a role binding.
DeleteRoute deletes an OpenShift routes.
DeleteSecret will delete the secret.
DeleteService will delete the service information for the input service name inside the input namespace.
DeleteServiceAccount delete a service account.
DeleteWithHelm3 uses the helm NewUninstall action to delete a resource from the cluster.
EncodeStringToBase64 will return encoded string to base64.
EnsureFilterPodsByNamePrefixInNamespaceToZero filters the pods based on the prefix and make sure that it is zero.
ExecContainer will exec into the container and run the commands provided in the input.
FilterPodByNamePrefix will filter the pod based on pod name prefix from a list a pods.
FilterPodByNamePrefixInNamespace will filter the pod based on pod name prefix from a list a pods in a given namespace.
GeneratePemSelfSignedCertificateAndKey returns a self-signed certificate and its key.
GetActionConfigurations creates an action.Configuration that points to the specified cluster and namespace TODO - this function specifies more values than CreateHelmActionConfiguration(), consider using this.
GetAlert will get Alert in the cluster.
GetAlertDefault creates an Alert crd configuration object with defaults.
GetAlerts gets all alerts.
GetAlertTemplate returns the required fields for Alert.
GetBaseYaml returns the base yaml as string for the given app and version.
GetBlackduck will get hubs in the cluster.
GetBlackDuckDefaultBDBA returns a BlackDuck with BDBA.
GetBlackDuckDefaultEphemeral returns a BlackDuck with ephemeral storage.
GetBlackDuckDefaultEphemeralCustomAuthCA returns a BlackDuck with ephemeral storage using custom auth CA.
GetBlackDuckDefaultExternalDB returns a BlackDuck with an external Data Base.
GetBlackDuckDefaultExternalPersistentStorageLatest creates a BlackDuck crd configuration object with defaults and external persistent storage for latest BlackDuck.
GetBlackDuckDefaultExternalPersistentStorageV1 creates a BlackDuck crd configuration object with defaults and external persistent storage for V1 BlackDuck.
GetBlackDuckDefaultIPV6Disabled returns a BlackDuck with IPV6 Disabled.
GetBlackDuckDefaultPersistentStorageLatest creates a Black Duck crd configuration object with defaults and persistent storage.
GetBlackDuckDefaultPersistentStorageV1 creates a BlackDuck crd configuration object with defaults and persistent storage for V1 BlackDuck.
GetBlackDuckTemplate returns the required fields for Black Duck.
GetClusterRole get a cluster role.
GetClusterRoleBinding get a cluster role.
GetClusterScope returns whether any of the CRD is cluster scope.
GetClusterScopeByName returns whether the CRD is cluster scope.
GetConfigMap will get the config map.
GetCRDNamesFromConfigMap get CRD names from the Synopsys Operator config map.
GetCustomResourceDefinition get the custom resource defintion.
GetDeployment will get the deployment corresponding to a namespace and name.
GetImageName takes a docker image string and returns the name.
GetImageTag takes a docker image string and returns the tag.
GetKubernetesVersion will return the kubernetes version.
GetNamespace will get the namespace.
GetOpenShiftSecurityConstraint gets an OpenShift security constraints.
GetOperatorNamespace uses labels to return the namespace of the synopsys operator based on the provided namespace.
GetOperatorNamespaceByCRDScope get the operator namespace by CRD scope.
GetOperatorRoleBindings returns the cluster role bindings of the synopsys operator based on the labels.
GetOperatorRoles returns the roles or the cluster role of the synopsys operator based on the labels.
GetOpsSight will get OpsSight in the cluster.
GetOpsSightDefault returns the required fields for OpsSight.
GetOpsSightDefaultWithIPV6DisabledBlackDuck retuns an OpsSight with a BlackDuck and IPV6 disabled.
GetOpsSights gets all opssights.
GetOpsSightUpstream returns the required fields for an upstream OpsSight.
GetPod will get the input pods corresponding to a namespace.
GetPVC will get the PVC for the given name.
GetRandomString returns a random hexadecimal string of length n.
GetReplicationController will get the replication controller corresponding to a namespace and name.
GetResourceName returns the name of the resource.
GetRole get a role.
GetRoleBinding get a role binding.
GetRoute gets an OpenShift routes.
GetRouteClient attempts to get a Route Client.
GetRouteComponent returns the route component.
GetSecret will create the secret.
GetService will get the service information for the input service name inside the input namespace.
GetServiceAccount get a service account.
GetServiceEndPoint will get the service endpoint information for the input service name inside the input namespace.
GetWithHelm3 uses the helm NewGet action to return a Release with information about a resource from the cluster.
HTTPGet returns the http response for the api.
InitAnnotations initialize the annotation.
InitLabels initialize the label.
Int32ToInt will convert from int32 to int.
IntToInt32 will convert from int to int32.
IntToInt64 will convert from int to int64.
IntToPtr will convert int to pointer.
IntToUInt32 will convert from int to uint32.
IsBlackDuckVersionSupportMultipleInstance returns whether it supports multiple instance in a single namespace.
IsClusterRoleBindingSubjectNamespaceExist checks whether the namespace is already exist in the subject of cluster role binding.
IsClusterRoleRefExistForOtherNamespace checks whether the cluster role exist for any cluster role bindings present in other namespace.
IsClusterRoleRuleExist checks whether the namespace is already exist in the rule of cluster role.
IsExistInStringSlice will check for the input string in the given slice.
IsExposeServiceValid validates the expose service type.
IsNotDefaultVersionGreaterThanOrEqualTo returns whether the given version is greater than or equal to the given inputs.
IsOpenshift will whether it is an openshift cluster.
IsOperatorExist returns whether the operator exist or not.
IsOwnerLabelExistInNamespace check for owner label exist in the namespace.
IsSubjectExist checks whether the namespace is already exist in the subject of cluster role binding.
IsSubjectExistForOtherNamespace checks whether anyother namespace is exist in the subject of cluster role binding.
IsVersionEqualTo returns whether the given version is equal to the given year, month and dot release.
IsVersionGreaterThanOrEqualTo returns whether the given version is greater than or equal to the given year, month and dot release.
ListAlerts will list all alerts in the cluster.
ListBlackduck gets all blackducks.
ListClusterRoleBindings list a cluster role binding.
ListClusterRoles list a cluster role.
ListConfigMaps will list the config map.
ListCustomResourceDefinitions list the custom resource defintions.
ListDeployments will get all the deployments corresponding to a namespace.
ListHubPV will list all the persistent volumes attached to each hub in the cluster.
ListNamespaces will list the namespace.
ListOpsSights will list all opssights in the cluster.
ListPods will get all the pods corresponding to a namespace.
ListPodsWithLabels will get all the pods corresponding to a namespace and labels.
ListPVCs will list the PVC for the given label selector.
ListReplicationControllers will get the replication controllers corresponding to a namespace.
ListRoleBindings list a role binding.
ListRoles list a role.
ListRoutes list an OpenShift routes.
ListSecrets will list the secret.
ListServiceAccounts list a service account.
ListServices will list the service information for the input service name inside the input namespace.
ListStorageClasses will list all the storageClass in the cluster.
LoadChart returns a chart from the specified chartURL Modified from https://github.com/openshift/console/blob/master/pkg/helm/actions/template_test.go.
MapKeyToStringArray will return map keys.
MapToStringArrayJoinBySeparator converts the map to string array and each key and value of the map will be joined by separator.
MergeEnvMaps will merge the source and destination environs.
MergeEnvSlices will merge the source and destination environs.
NewDeployer will create the horizon deployer.
NewMapErrors converts a map of string:error to a MapErrors interface.
NewPodListController will create a new ListPodController.
NewStringReader will convert string array to string reader object.
PatchDeployment patch a deployment.
PatchDeploymentForReplicas patch a deployment for replica update.
PatchReplicationController patch a replication controller.
PatchReplicationControllerForReplicas patch a replication controller for replica update.
PrettyPrint will print the interface in string format.
RandomString will generate the random string.
ReadFileData returns the information within a file as a string.
ReadFromFile will read the file.
ReleaseExists verifies that a resources is deployed in the cluster.
RemoveFromStringSlice will remove the string from the slice and it will maintain the order.
RenderManifests converts a helm chart to a string of the kube manifest files Modified from https://github.com/openshift/console/blob/cdf6b189b71e488033ecaba7d90258d9f9453478/pkg/helm/actions/template_test.go.
SetHelmValueInMap adds the finalValue into the valueMapPointer at the location specified by the keyList valueMapPointer - a map for helm values (maps are pointers in Golang) - it is used to track the current map being updated keyList - an ordered list of keys that lead to the location in the valueMapPointer to place the finalValue finalValue - the value to set in the map.
SetSecurityContextInPodConfig sets the Security Context fields in the PodConfig.
StringArrayToMapSplitBySeparator converts the string array to map based on separator for each string in the array.
StringToStringSlice slices s into all substrings separated by sep.
TemplateWithHelm3 prints the kube manifest files for a resource.
UniqueStringSlice returns a unique subset of the string slice provided.
UniqueValues returns a unique subset of the string slice provided.
UpdateAlert will update an Alert in the cluster.
UpdateAlerts will update a set of Alerts in the cluster.
UpdateBlackduck will update Blackduck in the cluster.
UpdateBlackducks will update a set of Blackducks in the cluster.
UpdateClusterRole updates the cluster role.
UpdateClusterRoleBinding updates the cluster role binding.
UpdateConfigMap updates a config map.
UpdateCustomResourceDefinition updates the custom resource defintion.
UpdateDeployment updates the deployment.
UpdateNamespace updates a namespace.
UpdateOpenShiftSecurityConstraint updates an OpenShift security constraints.
UpdateOpsSight will update OpsSight in the cluster.
UpdateOpsSights will update a set of OpsSights in the cluster.
UpdatePVC will update the pvc information for the input pvc name inside the input namespace.
UpdateRegistry updates the registry for all runtime objects containers.
UpdateReplicationController updates the replication controller.
UpdateRole updates the role.
UpdateRoleBinding updates the role binding.
UpdateRoute updates an OpenShift routes.
UpdateSecret updates a secret.
UpdateService will update the service information for the input service name inside the input namespace.
UpdateServiceAccount updates a service account.
UpdateWithHelm3 uses the helm NewUpgrade action to update a resource in the cluster.
ValidateImageString takes a docker image string and returns substring submatch if it's valid, and an error if it is not; Example: image := "docker.io/blackducksoftware/synopsys-operator:latest" tagMatch = [blackducksoftware/synopsys-operator:latest blackducksoftware synopsys-operator latest].
ValidateImageVersion takes a docker image version string and returns substring submatch version if it's valid, and an error if it is not; Example: version := "2019.4.2" versionMatch = [2019.4.2 2019 4 2].
ValidateServiceEndpoint will validate whether the service endpoint is ready to serve.
WaitForServiceEndpointReady will wait for the service endpoint to start the service.
WaitUntilPodsAreReady will wait for the pods to be ready.
# Constants
AlertCRDName is the name of an Alert CRD.
AlertName is the name of an Alert app.
BlackDuckCRDName is the name of the Black Duck CRD.
BlackDuckName is the name of the Black Duck app.
LOADBALANCER denotes to create a LoadBalancer service.
NODEPORT denotes to create a NodePort service.
NONE denotes no exposed service.
OPENSHIFT denotes to create an OpenShift routes.
OperatorName is the name of an Operator.
OpsSightCRDName is the name of an OpsSight CRD.
OpsSightName is the name of an OpsSight app.
PrmCRDName is the name of the Polaris Reporting Module CRD.
PrmName is the name of the Prm app.
# Structs
Container defines the configuration for a container.
DeployerHelper will contain the deployer specification, it has wrapper methods for adding stuff to a horizon deployer object.
PodConfig used for configuring the pod.
PodListController defines a controller that will list pods.
SecurityContext will contain the specifications of a security context.
# Interfaces
MapErrors defines an object that contains errors across one or more components.