Documentation ¶
Index ¶
- Constants
- func ArePodsReady(clientset *kubernetes.Clientset, namespace string, labelSelector string) (bool, error)
- func Base64Decode(data string) (string, error)
- func Base64Encode(data []byte) string
- func BoolToPtr(b bool) *bool
- func CheckAndUpdateNamespace(kubeClient *kubernetes.Clientset, resourceName string, namespace string, ...) (bool, error)
- func CheckResourceNamespace(kubeClient *kubernetes.Clientset, namespace string, label string, ...) (bool, error)
- func ConvertYamlFileToRuntimeObjects(stringContent string) (map[string]runtime.Object, error)
- func CreateAlert(alertClientset *alertclientset.Clientset, namespace string, ...) (*alertapi.Alert, error)
- func CreateBlackduck(blackduckClientset *hubclientset.Clientset, namespace string, ...) (*blackduckapi.Blackduck, error)
- func CreateClusterRoleBinding(namespace string, name string, serviceAccountName string, ...) *components.ClusterRoleBinding
- func CreateConfigMapVolume(volumeName string, mapName string, defaultMode int) (*components.Volume, error)
- func CreateContainer(config *horizonapi.ContainerConfig, envs []*horizonapi.EnvConfig, ...) (*components.Container, error)
- func CreateDeployment(deploymentConfig *horizonapi.DeploymentConfig, pod *components.Pod, ...) *components.Deployment
- func CreateDeploymentFromContainer(deploymentConfig *horizonapi.DeploymentConfig, podConfig *PodConfig, ...) (*components.Deployment, error)
- func CreateEmptyDirVolume(volumeName string, sizeLimit string) (*components.Volume, error)
- func CreateEmptyDirVolumeWithoutSizeLimit(volumeName string) (*components.Volume, error)
- func CreateExecContainerRequest(clientset *kubernetes.Clientset, pod *corev1.Pod, command string) *rest.Request
- func CreateGCEPersistentDiskVolume(volumeName string, diskName string, fsType string) *components.Volume
- func CreateHelmActionConfiguration(kubeConfig, kubeContext, namespace string) (*action.Configuration, error)
- func CreateNamespace(clientset *kubernetes.Clientset, namespace string) (*corev1.Namespace, error)
- func CreateOpsSight(opssightClientset *opssightclientset.Clientset, namespace string, ...) (*opssightapi.OpsSight, error)
- func CreatePersistentVolume(clientset *kubernetes.Clientset, name string, storageClass string, ...) (*corev1.PersistentVolume, error)
- func CreatePersistentVolumeClaim(name string, namespace string, pvcClaimSize string, storageClass string, ...) (*components.PersistentVolumeClaim, error)
- func CreatePersistentVolumeClaimVolume(volumeName string, pvcName string) (*components.Volume, error)
- func CreatePod(podConfig *PodConfig) (*components.Pod, error)
- func CreateReplicationController(replicationControllerConfig *horizonapi.ReplicationControllerConfig, ...) *components.ReplicationController
- func CreateReplicationControllerFromContainer(replicationControllerConfig *horizonapi.ReplicationControllerConfig, ...) (*components.ReplicationController, error)
- func CreateRoute(routeClient *routeclient.RouteV1Client, namespace string, route *routev1.Route) (*routev1.Route, error)
- func CreateSecret(clientset *kubernetes.Clientset, namespace string, name string, ...) (*corev1.Secret, error)
- func CreateSecretFromFile(clientset *kubernetes.Clientset, jsonFile string, namespace string, ...) (*corev1.Secret, error)
- func CreateSecretVolume(volumeName string, secretName string, defaultMode int) (*components.Volume, error)
- func CreateService(name string, selectLabel map[string]string, namespace string, port int32, ...) *components.Service
- func CreateServiceAccount(namespace string, name string) *components.ServiceAccount
- func CreateServiceWithMultiplePort(name string, selectLabel map[string]string, namespace string, ports []int32, ...) *components.Service
- func CreateWithHelm3(releaseName, namespace, chartURL string, vals map[string]interface{}, ...) error
- func DeleteAlert(clientSet *alertclientset.Clientset, name string, namespace string, ...) error
- func DeleteBlackduck(blackduckClientset *hubclientset.Clientset, name string, namespace string, ...) error
- func DeleteClusterRole(clientset *kubernetes.Clientset, name string) error
- func DeleteClusterRoleBinding(clientset *kubernetes.Clientset, name string) error
- func DeleteConfigMap(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteCustomResourceDefinition(apiExtensionClient *apiextensionsclient.Clientset, name string) error
- func DeleteDeployment(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteNamespace(clientset *kubernetes.Clientset, namespace string) error
- func DeleteOpsSight(clientSet *opssightclientset.Clientset, name string, namespace string, ...) error
- func DeletePVC(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeletePersistentVolume(clientset *kubernetes.Clientset, name string) error
- func DeletePod(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteReplicationController(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteResourceNamespace(kubeClient *kubernetes.Clientset, resourceName string, namespace string, ...) error
- func DeleteRole(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteRoleBinding(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteRoute(routeClient *routeclient.RouteV1Client, namespace string, name string) error
- func DeleteSecret(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteService(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteServiceAccount(clientset *kubernetes.Clientset, namespace string, name string) error
- func DeleteWithHelm3(releaseName, namespace, kubeConfig string) error
- func EncodeStringToBase64(str string) string
- func EnsureFilterPodsByNamePrefixInNamespaceToZero(clientset *kubernetes.Clientset, namespace string, prefix string) error
- func ExecContainer(kubeConfig *rest.Config, request *rest.Request, command []string) (string, error)
- func FilterPodByNamePrefix(pods *corev1.PodList, prefix string) *corev1.Pod
- func FilterPodByNamePrefixInNamespace(clientset *kubernetes.Clientset, namespace string, prefix string) (*corev1.Pod, error)
- func GeneratePemSelfSignedCertificateAndKey(name pkix.Name) (string, string, error)
- func GetActionConfigurations(host, namespace, token string, transport *http.RoundTripper) *action.Configuration
- func GetAlert(clientSet *alertclientset.Clientset, namespace string, name string, ...) (*alertapi.Alert, error)
- func GetAlertDefault() *alertv1.AlertSpec
- func GetAlertTemplate() *alertv1.AlertSpec
- func GetAlerts(clientSet *alertclientset.Clientset) (*alertapi.AlertList, error)
- func GetBaseYaml(baseurl string, appName string, version string, fileName string) (string, error)
- func GetBlackDuckDefaultBDBA() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultEphemeral() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultEphemeralCustomAuthCA() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultExternalDB() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultExternalPersistentStorageLatest() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultExternalPersistentStorageV1() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultIPV6Disabled() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultPersistentStorageLatest() *blackduckv1.BlackduckSpec
- func GetBlackDuckDefaultPersistentStorageV1() *blackduckv1.BlackduckSpec
- func GetBlackDuckTemplate() *blackduckv1.BlackduckSpec
- func GetBlackduck(blackduckClientset *hubclientset.Clientset, namespace string, name string, ...) (*blackduckapi.Blackduck, error)
- func GetCRDNamesFromConfigMap(kubeClient *kubernetes.Clientset, namespace string) (string, error)
- func GetClusterRole(clientset *kubernetes.Clientset, name string) (*rbacv1.ClusterRole, error)
- func GetClusterRoleBinding(clientset *kubernetes.Clientset, name string) (*rbacv1.ClusterRoleBinding, error)
- func GetClusterScope(apiExtensionClient *apiextensionsclient.Clientset) bool
- func GetClusterScopeByName(apiExtensionClient *apiextensionsclient.Clientset, name string) bool
- func GetConfigMap(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.ConfigMap, error)
- func GetCustomResourceDefinition(apiExtensionClient *apiextensionsclient.Clientset, name string) (*apiextensions.CustomResourceDefinition, error)
- func GetDeployment(clientset *kubernetes.Clientset, namespace string, name string) (*appsv1.Deployment, error)
- func GetImageName(image string) (string, error)
- func GetImageTag(image string) (string, error)
- func GetKubernetesVersion(clientset *kubernetes.Clientset) (string, error)
- func GetNamespace(clientset *kubernetes.Clientset, namespace string) (*corev1.Namespace, error)
- func GetOpenShiftSecurityConstraint(osSecurityClient *securityclient.SecurityV1Client, name string) (*securityv1.SecurityContextConstraints, error)
- func GetOperatorNamespace(clientset *kubernetes.Clientset, namespace string) ([]string, error)
- func GetOperatorNamespaceByCRDScope(kubeClient *kubernetes.Clientset, crdName string, ...) (string, error)
- func GetOperatorRoleBindings(clientset *kubernetes.Clientset, namespace string) ([]string, []string, error)
- func GetOperatorRoles(clientset *kubernetes.Clientset, namespace string) ([]string, []string, error)
- func GetOpsSight(opssightClientset *opssightclientset.Clientset, namespace string, name string, ...) (*opssightapi.OpsSight, error)
- func GetOpsSightDefault() *opssightv1.OpsSightSpec
- func GetOpsSightDefaultWithIPV6DisabledBlackDuck() *opssightv1.OpsSightSpec
- func GetOpsSightUpstream() *opssightv1.OpsSightSpec
- func GetOpsSights(clientSet *opssightclientset.Clientset) (*opssightapi.OpsSightList, error)
- func GetPVC(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.PersistentVolumeClaim, error)
- func GetPod(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.Pod, error)
- func GetRandomString(n int) (string, error)
- func GetReplicationController(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.ReplicationController, error)
- func GetResourceName(name string, appName string, defaultName string) string
- func GetRole(clientset *kubernetes.Clientset, namespace string, name string) (*rbacv1.Role, error)
- func GetRoleBinding(clientset *kubernetes.Clientset, namespace string, name string) (*rbacv1.RoleBinding, error)
- func GetRoute(routeClient *routeclient.RouteV1Client, namespace string, name string) (*routev1.Route, error)
- func GetRouteClient(restConfig *rest.Config, clientset *kubernetes.Clientset, namespace string) *routeclient.RouteV1Client
- func GetRouteComponent(routeClient *routeclient.RouteV1Client, route *api.Route, ...) *routev1.Route
- func GetSecret(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.Secret, error)
- func GetService(clientset *kubernetes.Clientset, namespace string, serviceName string) (*corev1.Service, error)
- func GetServiceAccount(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.ServiceAccount, error)
- func GetServiceEndPoint(clientset *kubernetes.Clientset, namespace string, serviceName string) (*corev1.Endpoints, error)
- func GetWithHelm3(releaseName, namespace, kubeConfig string) (*release.Release, error)
- func HTTPGet(url string) (content []byte, err error)
- func InitAnnotations(annotations map[string]string) map[string]string
- func InitLabels(labels map[string]string) map[string]string
- func Int32ToInt(i *int32) int
- func IntToInt32(i int) *int32
- func IntToInt64(i int) *int64
- func IntToPtr(i int) *int
- func IntToUInt32(i int) uint32
- func IsBlackDuckVersionSupportMultipleInstance(version string) (bool, error)
- func IsClusterRoleBindingSubjectNamespaceExist(subjects []rbacv1.Subject, namespace string) bool
- func IsClusterRoleRefExistForOtherNamespace(roleRef rbacv1.RoleRef, roleName string, namespace string, ...) bool
- func IsClusterRoleRuleExist(oldRules []rbacv1.PolicyRule, newRule rbacv1.PolicyRule) bool
- func IsExistInStringSlice(slice []string, str string) bool
- func IsExposeServiceValid(serviceType string) bool
- func IsNotDefaultVersionGreaterThanOrEqualTo(version string, majorRelease int, minorRelease int, dotRelease int) (bool, error)
- func IsOpenshift(clientset *kubernetes.Clientset) bool
- func IsOperatorExist(clientset *kubernetes.Clientset, namespace string) bool
- func IsOwnerLabelExistInNamespace(kubeClient *kubernetes.Clientset, namespace string) bool
- func IsSubjectExist(subjects []rbacv1.Subject, namespace string, name string) bool
- func IsSubjectExistForOtherNamespace(subject rbacv1.Subject, namespace string) bool
- func IsVersionEqualTo(version string, year int, month time.Month, dotRelease int) (bool, error)
- func IsVersionGreaterThanOrEqualTo(version string, year int, month time.Month, dotRelease int) (bool, error)
- func ListAlerts(clientSet *alertclientset.Clientset, namespace string, opts metav1.ListOptions) (*alertapi.AlertList, error)
- func ListBlackduck(blackduckClientset *hubclientset.Clientset, namespace string, ...) (*blackduckapi.BlackduckList, error)
- func ListClusterRoleBindings(clientset *kubernetes.Clientset, labelSelector string) (*rbacv1.ClusterRoleBindingList, error)
- func ListClusterRoles(clientset *kubernetes.Clientset, labelSelector string) (*rbacv1.ClusterRoleList, error)
- func ListConfigMaps(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ConfigMapList, error)
- func ListCustomResourceDefinitions(apiExtensionClient *apiextensionsclient.Clientset, labelSelector string) (*apiextensions.CustomResourceDefinitionList, error)
- func ListDeployments(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*appsv1.DeploymentList, error)
- func ListHubPV(hubClientset *hubclientset.Clientset, namespace string) (map[string]string, error)
- func ListNamespaces(clientset *kubernetes.Clientset, labelSelector string) (*corev1.NamespaceList, error)
- func ListOpsSights(opssightClientset *opssightclientset.Clientset, namespace string, ...) (*opssightapi.OpsSightList, error)
- func ListPVCs(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.PersistentVolumeClaimList, error)
- func ListPods(clientset *kubernetes.Clientset, namespace string) (*corev1.PodList, error)
- func ListPodsWithLabels(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.PodList, error)
- func ListReplicationControllers(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ReplicationControllerList, error)
- func ListRoleBindings(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*rbacv1.RoleBindingList, error)
- func ListRoles(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*rbacv1.RoleList, error)
- func ListRoutes(routeClient *routeclient.RouteV1Client, namespace string, labelSelector string) (*routev1.RouteList, error)
- func ListSecrets(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.SecretList, error)
- func ListServiceAccounts(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ServiceAccountList, error)
- func ListServices(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ServiceList, error)
- func ListStorageClasses(clientset *kubernetes.Clientset) (*v1beta1.StorageClassList, error)
- func LoadChart(chartURL string, actionConfig *action.Configuration) (*chart.Chart, error)
- func MapKeyToStringArray(maps map[string]string) []string
- func MapToStringArrayJoinBySeparator(maps map[string]string, separator string) []string
- func MergeEnvMaps(source, destination map[string]string) map[string]string
- func MergeEnvSlices(source, destination []string) []string
- func NewStringReader(ss []string) io.Reader
- func PatchDeployment(clientset *kubernetes.Clientset, old appsv1.Deployment, new appsv1.Deployment) error
- func PatchDeploymentForReplicas(clientset *kubernetes.Clientset, old *appsv1.Deployment, replicas *int32) (*appsv1.Deployment, error)
- func PatchReplicationController(clientset *kubernetes.Clientset, old corev1.ReplicationController, ...) error
- func PatchReplicationControllerForReplicas(clientset *kubernetes.Clientset, old *corev1.ReplicationController, ...) (*corev1.ReplicationController, error)
- func PrettyPrint(v interface{}) (string, error)
- func RandomString(n int) (string, error)
- func ReadFileData(filepath string) (string, error)
- func ReadFromFile(filePath string) ([]byte, error)
- func ReleaseExists(releaseName, namespace, kubeConfig string) bool
- func RemoveFromStringSlice(slice []string, str string) []string
- func RenderManifests(releaseName, namespace string, chart *chart.Chart, vals map[string]interface{}, ...) (string, error)
- func SetHelmValueInMap(valueMapPointer map[string]interface{}, keyList []string, ...)
- func SetSecurityContextInPodConfig(podConfig *PodConfig, securityContext *SecurityContext, isOpenshift bool)
- func StringArrayToMapSplitBySeparator(strs []string, separator string) map[string]string
- func StringToStringSlice(s string, sep string) []string
- func TemplateWithHelm3(releaseName, namespace, chartURL string, vals map[string]interface{}) error
- func UniqueStringSlice(input []string) []string
- func UniqueValues(input []string) []string
- func UpdateAlert(clientSet *alertclientset.Clientset, namespace string, alert *alertapi.Alert) (*alertapi.Alert, error)
- func UpdateAlerts(clientSet *alertclientset.Clientset, alertCRDs []alertapi.Alert) error
- func UpdateBlackduck(blackduckClientset *hubclientset.Clientset, blackduck *blackduckapi.Blackduck) (*blackduckapi.Blackduck, error)
- func UpdateBlackducks(clientSet *hubclientset.Clientset, blackduckCRDs []blackduckapi.Blackduck) error
- func UpdateClusterRole(clientset *kubernetes.Clientset, clusterRole *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error)
- func UpdateClusterRoleBinding(clientset *kubernetes.Clientset, clusterRoleBinding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error)
- func UpdateConfigMap(clientset *kubernetes.Clientset, namespace string, configMap *corev1.ConfigMap) (*corev1.ConfigMap, error)
- func UpdateCustomResourceDefinition(apiExtensionClient *apiextensionsclient.Clientset, ...) (*apiextensions.CustomResourceDefinition, error)
- func UpdateDeployment(clientset *kubernetes.Clientset, namespace string, ...) (*appsv1.Deployment, error)
- func UpdateNamespace(clientset *kubernetes.Clientset, namespace *corev1.Namespace) (*corev1.Namespace, error)
- func UpdateOpenShiftSecurityConstraint(osSecurityClient *securityclient.SecurityV1Client, serviceAccounts []string, ...) error
- func UpdateOpsSight(opssightClientset *opssightclientset.Clientset, namespace string, ...) (*opssightapi.OpsSight, error)
- func UpdateOpsSights(clientSet *opssightclientset.Clientset, opsSightCRDs []opssightapi.OpsSight) error
- func UpdatePVC(clientset *kubernetes.Clientset, namespace string, ...) (*corev1.PersistentVolumeClaim, error)
- func UpdateRegistry(obj map[string]runtime.Object, registry string) (map[string]runtime.Object, error)
- func UpdateReplicationController(clientset *kubernetes.Clientset, namespace string, ...) (*corev1.ReplicationController, error)
- func UpdateRole(clientset *kubernetes.Clientset, namespace string, role *rbacv1.Role) (*rbacv1.Role, error)
- func UpdateRoleBinding(clientset *kubernetes.Clientset, namespace string, role *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)
- func UpdateRoute(routeClient *routeclient.RouteV1Client, namespace string, route *routev1.Route) (*routev1.Route, error)
- func UpdateSecret(clientset *kubernetes.Clientset, namespace string, secret *corev1.Secret) (*corev1.Secret, error)
- func UpdateService(clientset *kubernetes.Clientset, namespace string, service *corev1.Service) (*corev1.Service, error)
- func UpdateServiceAccount(clientset *kubernetes.Clientset, namespace string, ...) (*corev1.ServiceAccount, error)
- func UpdateWithHelm3(releaseName, namespace, chartURL string, vals map[string]interface{}, ...) error
- func ValidateImageString(image string) ([]string, error)
- func ValidateImageVersion(version string) ([]string, error)
- func ValidateServiceEndpoint(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.Endpoints, error)
- func WaitForServiceEndpointReady(clientset *kubernetes.Clientset, namespace string, name string) error
- func WaitUntilPodsAreReady(clientset *kubernetes.Clientset, namespace string, labelSelector string, ...) error
- type Container
- type DeployerHelper
- type MapErrors
- type PodConfig
- type PodListController
- type SecurityContext
Constants ¶
const ( // OPENSHIFT denotes to create an OpenShift routes OPENSHIFT = "OPENSHIFT" // NONE denotes no exposed service NONE = "NONE" // NODEPORT denotes to create a NodePort service NODEPORT = "NODEPORT" // LOADBALANCER denotes to create a LoadBalancer service LOADBALANCER = "LOADBALANCER" )
const ( // AlertCRDName is the name of an Alert CRD AlertCRDName = "alerts.synopsys.com" // BlackDuckCRDName is the name of the Black Duck CRD BlackDuckCRDName = "blackducks.synopsys.com" // OpsSightCRDName is the name of an OpsSight CRD OpsSightCRDName = "opssights.synopsys.com" // PrmCRDName is the name of the Polaris Reporting Module CRD PrmCRDName = "prms.synopsys.com" // OperatorName is the name of an Operator OperatorName = "synopsys-operator" // AlertName is the name of an Alert app AlertName = "alert" // BlackDuckName is the name of the Black Duck app BlackDuckName = "blackduck" // OpsSightName is the name of an OpsSight app OpsSightName = "opssight" // PrmName is the name of the Prm app PrmName = "prm" )
Variables ¶
This section is empty.
Functions ¶
func ArePodsReady ¶
func ArePodsReady(clientset *kubernetes.Clientset, namespace string, labelSelector string) (bool, error)
ArePodsReady returns whether the pods are ready or not. Returns an error if pods will never become ready.
func Base64Decode ¶
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.
func Base64Encode ¶
Base64Encode will return an encoded string using a URL-compatible base64 format
func CheckAndUpdateNamespace ¶
func CheckAndUpdateNamespace(kubeClient *kubernetes.Clientset, resourceName string, namespace string, name string, version string, isDelete bool) (bool, error)
CheckAndUpdateNamespace will check whether the namespace is exist and if exist, update the version label in namespace of the updated/deleted resource
func CheckResourceNamespace ¶
func CheckResourceNamespace(kubeClient *kubernetes.Clientset, namespace string, label string, isOperator bool) (bool, error)
CheckResourceNamespace checks whether namespace is having any resource types
func ConvertYamlFileToRuntimeObjects ¶
ConvertYamlFileToRuntimeObjects converts the yaml file string to map of runtime object
func CreateAlert ¶
func CreateAlert(alertClientset *alertclientset.Clientset, namespace string, createAlert *alertapi.Alert) (*alertapi.Alert, error)
CreateAlert will create alert in the cluster
func CreateBlackduck ¶
func CreateBlackduck(blackduckClientset *hubclientset.Clientset, namespace string, createHub *blackduckapi.Blackduck) (*blackduckapi.Blackduck, error)
CreateBlackduck will create hub in the cluster
func CreateClusterRoleBinding ¶
func CreateClusterRoleBinding(namespace string, name string, serviceAccountName string, clusterRoleAPIGroup string, clusterRoleKind string, clusterRoleName string) *components.ClusterRoleBinding
CreateClusterRoleBinding creates a cluster role binding
func CreateConfigMapVolume ¶
func CreateConfigMapVolume(volumeName string, mapName string, defaultMode int) (*components.Volume, error)
CreateConfigMapVolume will mount the config map for a pod
func CreateContainer ¶
func CreateContainer(config *horizonapi.ContainerConfig, envs []*horizonapi.EnvConfig, volumeMounts []*horizonapi.VolumeMountConfig, ports []*horizonapi.PortConfig, actionConfig *horizonapi.ActionConfig, preStopConfig *horizonapi.ActionConfig, livenessProbeConfigs []*horizonapi.ProbeConfig, readinessProbeConfigs []*horizonapi.ProbeConfig) (*components.Container, error)
CreateContainer will create the container
func CreateDeployment ¶
func CreateDeployment(deploymentConfig *horizonapi.DeploymentConfig, pod *components.Pod, labels map[string]string, labelSelector map[string]string) *components.Deployment
CreateDeployment will create a deployment
func CreateDeploymentFromContainer ¶
func CreateDeploymentFromContainer(deploymentConfig *horizonapi.DeploymentConfig, podConfig *PodConfig, labelSelector map[string]string) (*components.Deployment, error)
CreateDeploymentFromContainer will create a deployment with multiple containers inside a pod
func CreateEmptyDirVolume ¶
func CreateEmptyDirVolume(volumeName string, sizeLimit string) (*components.Volume, error)
CreateEmptyDirVolume will create a empty directory for a pod
func CreateEmptyDirVolumeWithoutSizeLimit ¶
func CreateEmptyDirVolumeWithoutSizeLimit(volumeName string) (*components.Volume, error)
CreateEmptyDirVolumeWithoutSizeLimit will create a empty directory for a pod
func CreateExecContainerRequest ¶
func CreateExecContainerRequest(clientset *kubernetes.Clientset, pod *corev1.Pod, command string) *rest.Request
CreateExecContainerRequest will create the request to exec into Kubernetes pod
func CreateGCEPersistentDiskVolume ¶
func CreateGCEPersistentDiskVolume(volumeName string, diskName string, fsType string) *components.Volume
CreateGCEPersistentDiskVolume will create a GCE Persistent disk volume for a pod
func CreateHelmActionConfiguration ¶
func CreateHelmActionConfiguration(kubeConfig, kubeContext, namespace string) (*action.Configuration, error)
CreateHelmActionConfiguration creates an action.Configuration that points to the specified cluster and namespace
func CreateNamespace ¶
CreateNamespace will create the namespace
func CreateOpsSight ¶
func CreateOpsSight(opssightClientset *opssightclientset.Clientset, namespace string, opssight *opssightapi.OpsSight) (*opssightapi.OpsSight, error)
CreateOpsSight will create opsSight in the cluster
func CreatePersistentVolume ¶
func CreatePersistentVolume(clientset *kubernetes.Clientset, name string, storageClass string, claimSize string, nfsPath string, nfsServer string) (*corev1.PersistentVolume, error)
CreatePersistentVolume will create the persistent volume
func CreatePersistentVolumeClaim ¶
func CreatePersistentVolumeClaim(name string, namespace string, pvcClaimSize string, storageClass string, accessMode horizonapi.PVCAccessModeType) (*components.PersistentVolumeClaim, error)
CreatePersistentVolumeClaim will create the persistent volume claim
func CreatePersistentVolumeClaimVolume ¶
func CreatePersistentVolumeClaimVolume(volumeName string, pvcName string) (*components.Volume, error)
CreatePersistentVolumeClaimVolume will create a PVC claim for a pod
func CreatePod ¶
func CreatePod(podConfig *PodConfig) (*components.Pod, error)
CreatePod will create the pod
func CreateReplicationController ¶
func CreateReplicationController(replicationControllerConfig *horizonapi.ReplicationControllerConfig, pod *components.Pod, labels map[string]string, labelSelector map[string]string) *components.ReplicationController
CreateReplicationController will create a replication controller
func CreateReplicationControllerFromContainer ¶
func CreateReplicationControllerFromContainer(replicationControllerConfig *horizonapi.ReplicationControllerConfig, podConfig *PodConfig, labelSelector map[string]string) (*components.ReplicationController, error)
CreateReplicationControllerFromContainer will create a replication controller with multiple containers inside a pod
func CreateRoute ¶
func CreateRoute(routeClient *routeclient.RouteV1Client, namespace string, route *routev1.Route) (*routev1.Route, error)
CreateRoute creates an OpenShift routes
func CreateSecret ¶
func CreateSecret(clientset *kubernetes.Clientset, namespace string, name string, stringData map[string]string) (*corev1.Secret, error)
CreateSecret will create the secret
func CreateSecretFromFile ¶
func CreateSecretFromFile(clientset *kubernetes.Clientset, jsonFile string, namespace string, name string, dataKey string) (*corev1.Secret, error)
CreateSecretFromFile will create the secret from file
func CreateSecretVolume ¶
func CreateSecretVolume(volumeName string, secretName string, defaultMode int) (*components.Volume, error)
CreateSecretVolume will mount the secret for a pod
func CreateService ¶
func CreateService(name string, selectLabel map[string]string, namespace string, port int32, target int32, serviceType horizonapi.ServiceType, label map[string]string) *components.Service
CreateService will create the service
func CreateServiceAccount ¶
func CreateServiceAccount(namespace string, name string) *components.ServiceAccount
CreateServiceAccount creates a service account
func CreateServiceWithMultiplePort ¶
func CreateServiceWithMultiplePort(name string, selectLabel map[string]string, namespace string, ports []int32, serviceType horizonapi.ServiceType, label map[string]string) *components.Service
CreateServiceWithMultiplePort will create the service with multiple port
func CreateWithHelm3 ¶
func CreateWithHelm3(releaseName, namespace, chartURL string, vals map[string]interface{}, kubeConfig string, dryRun bool) error
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
func DeleteAlert ¶
func DeleteAlert(clientSet *alertclientset.Clientset, name string, namespace string, options *metav1.DeleteOptions) error
DeleteAlert will delete Alert in the cluster
func DeleteBlackduck ¶
func DeleteBlackduck(blackduckClientset *hubclientset.Clientset, name string, namespace string, options *metav1.DeleteOptions) error
DeleteBlackduck will delete Blackduck in the cluster
func DeleteClusterRole ¶
func DeleteClusterRole(clientset *kubernetes.Clientset, name string) error
DeleteClusterRole delete a cluster role
func DeleteClusterRoleBinding ¶
func DeleteClusterRoleBinding(clientset *kubernetes.Clientset, name string) error
DeleteClusterRoleBinding delete a cluster role binding
func DeleteConfigMap ¶
func DeleteConfigMap(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteConfigMap will delete the config map
func DeleteCustomResourceDefinition ¶
func DeleteCustomResourceDefinition(apiExtensionClient *apiextensionsclient.Clientset, name string) error
DeleteCustomResourceDefinition deletes the custom resource defintion
func DeleteDeployment ¶
func DeleteDeployment(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteDeployment will delete the deployment corresponding to a namespace and name
func DeleteNamespace ¶
func DeleteNamespace(clientset *kubernetes.Clientset, namespace string) error
DeleteNamespace will delete the namespace
func DeleteOpsSight ¶
func DeleteOpsSight(clientSet *opssightclientset.Clientset, name string, namespace string, options *metav1.DeleteOptions) error
DeleteOpsSight will delete OpsSight in the cluster
func DeletePVC ¶
func DeletePVC(clientset *kubernetes.Clientset, namespace string, name string) error
DeletePVC will delete the PVC information for the input pvc name inside the input namespace
func DeletePersistentVolume ¶
func DeletePersistentVolume(clientset *kubernetes.Clientset, name string) error
DeletePersistentVolume will delete the persistent volume
func DeletePod ¶
func DeletePod(clientset *kubernetes.Clientset, namespace string, name string) error
DeletePod will delete the input pods corresponding to a namespace
func DeleteReplicationController ¶
func DeleteReplicationController(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteReplicationController will delete the replication controller corresponding to a namespace and name
func DeleteResourceNamespace ¶
func DeleteResourceNamespace(kubeClient *kubernetes.Clientset, resourceName string, namespace string, name string, isOperator bool) error
DeleteResourceNamespace deletes the namespace if none of the other resource types are running
func DeleteRole ¶
func DeleteRole(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteRole delete a role
func DeleteRoleBinding ¶
func DeleteRoleBinding(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteRoleBinding delete a role binding
func DeleteRoute ¶
func DeleteRoute(routeClient *routeclient.RouteV1Client, namespace string, name string) error
DeleteRoute deletes an OpenShift routes
func DeleteSecret ¶
func DeleteSecret(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteSecret will delete the secret
func DeleteService ¶
func DeleteService(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteService will delete the service information for the input service name inside the input namespace
func DeleteServiceAccount ¶
func DeleteServiceAccount(clientset *kubernetes.Clientset, namespace string, name string) error
DeleteServiceAccount delete a service account
func DeleteWithHelm3 ¶
DeleteWithHelm3 uses the helm NewUninstall action to delete a resource from the cluster
func EncodeStringToBase64 ¶
EncodeStringToBase64 will return encoded string to base64
func EnsureFilterPodsByNamePrefixInNamespaceToZero ¶
func EnsureFilterPodsByNamePrefixInNamespaceToZero(clientset *kubernetes.Clientset, namespace string, prefix string) error
EnsureFilterPodsByNamePrefixInNamespaceToZero filters the pods based on the prefix and make sure that it is zero
func ExecContainer ¶
func ExecContainer(kubeConfig *rest.Config, request *rest.Request, command []string) (string, error)
ExecContainer will exec into the container and run the commands provided in the input
func FilterPodByNamePrefix ¶
FilterPodByNamePrefix will filter the pod based on pod name prefix from a list a pods
func FilterPodByNamePrefixInNamespace ¶
func FilterPodByNamePrefixInNamespace(clientset *kubernetes.Clientset, namespace string, prefix string) (*corev1.Pod, error)
FilterPodByNamePrefixInNamespace will filter the pod based on pod name prefix from a list a pods in a given namespace
func GeneratePemSelfSignedCertificateAndKey ¶
GeneratePemSelfSignedCertificateAndKey returns a self-signed certificate and its key
func GetActionConfigurations ¶
func GetActionConfigurations(host, namespace, token string, transport *http.RoundTripper) *action.Configuration
GetActionConfigurations creates an action.Configuration that points to the specified cluster and namespace TODO - this function specifies more values than CreateHelmActionConfiguration(), consider using this
func GetAlert ¶
func GetAlert(clientSet *alertclientset.Clientset, namespace string, name string, options metav1.GetOptions) (*alertapi.Alert, error)
GetAlert will get Alert in the cluster
func GetAlertDefault ¶
GetAlertDefault creates an Alert crd configuration object with defaults
func GetAlertTemplate ¶
GetAlertTemplate returns the required fields for Alert
func GetAlerts ¶
func GetAlerts(clientSet *alertclientset.Clientset) (*alertapi.AlertList, error)
GetAlerts gets all alerts
func GetBaseYaml ¶
GetBaseYaml returns the base yaml as string for the given app and version
func GetBlackDuckDefaultBDBA ¶
func GetBlackDuckDefaultBDBA() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultBDBA returns a BlackDuck with BDBA
func GetBlackDuckDefaultEphemeral ¶
func GetBlackDuckDefaultEphemeral() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultEphemeral returns a BlackDuck with ephemeral storage
func GetBlackDuckDefaultEphemeralCustomAuthCA ¶
func GetBlackDuckDefaultEphemeralCustomAuthCA() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultEphemeralCustomAuthCA returns a BlackDuck with ephemeral storage using custom auth CA
func GetBlackDuckDefaultExternalDB ¶
func GetBlackDuckDefaultExternalDB() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultExternalDB returns a BlackDuck with an external Data Base
func GetBlackDuckDefaultExternalPersistentStorageLatest ¶
func GetBlackDuckDefaultExternalPersistentStorageLatest() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultExternalPersistentStorageLatest creates a BlackDuck crd configuration object with defaults and external persistent storage for latest BlackDuck
func GetBlackDuckDefaultExternalPersistentStorageV1 ¶
func GetBlackDuckDefaultExternalPersistentStorageV1() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultExternalPersistentStorageV1 creates a BlackDuck crd configuration object with defaults and external persistent storage for V1 BlackDuck
func GetBlackDuckDefaultIPV6Disabled ¶
func GetBlackDuckDefaultIPV6Disabled() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultIPV6Disabled returns a BlackDuck with IPV6 Disabled
func GetBlackDuckDefaultPersistentStorageLatest ¶
func GetBlackDuckDefaultPersistentStorageLatest() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultPersistentStorageLatest creates a Black Duck crd configuration object with defaults and persistent storage
func GetBlackDuckDefaultPersistentStorageV1 ¶
func GetBlackDuckDefaultPersistentStorageV1() *blackduckv1.BlackduckSpec
GetBlackDuckDefaultPersistentStorageV1 creates a BlackDuck crd configuration object with defaults and persistent storage for V1 BlackDuck
func GetBlackDuckTemplate ¶
func GetBlackDuckTemplate() *blackduckv1.BlackduckSpec
GetBlackDuckTemplate returns the required fields for Black Duck
func GetBlackduck ¶
func GetBlackduck(blackduckClientset *hubclientset.Clientset, namespace string, name string, options metav1.GetOptions) (*blackduckapi.Blackduck, error)
GetBlackduck will get hubs in the cluster
func GetCRDNamesFromConfigMap ¶
func GetCRDNamesFromConfigMap(kubeClient *kubernetes.Clientset, namespace string) (string, error)
GetCRDNamesFromConfigMap get CRD names from the Synopsys Operator config map
func GetClusterRole ¶
func GetClusterRole(clientset *kubernetes.Clientset, name string) (*rbacv1.ClusterRole, error)
GetClusterRole get a cluster role
func GetClusterRoleBinding ¶
func GetClusterRoleBinding(clientset *kubernetes.Clientset, name string) (*rbacv1.ClusterRoleBinding, error)
GetClusterRoleBinding get a cluster role
func GetClusterScope ¶
func GetClusterScope(apiExtensionClient *apiextensionsclient.Clientset) bool
GetClusterScope returns whether any of the CRD is cluster scope
func GetClusterScopeByName ¶
func GetClusterScopeByName(apiExtensionClient *apiextensionsclient.Clientset, name string) bool
GetClusterScopeByName returns whether the CRD is cluster scope
func GetConfigMap ¶
func GetConfigMap(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.ConfigMap, error)
GetConfigMap will get the config map
func GetCustomResourceDefinition ¶
func GetCustomResourceDefinition(apiExtensionClient *apiextensionsclient.Clientset, name string) (*apiextensions.CustomResourceDefinition, error)
GetCustomResourceDefinition get the custom resource defintion
func GetDeployment ¶
func GetDeployment(clientset *kubernetes.Clientset, namespace string, name string) (*appsv1.Deployment, error)
GetDeployment will get the deployment corresponding to a namespace and name
func GetImageName ¶
GetImageName takes a docker image string and returns the name
func GetImageTag ¶
GetImageTag takes a docker image string and returns the tag
func GetKubernetesVersion ¶
func GetKubernetesVersion(clientset *kubernetes.Clientset) (string, error)
GetKubernetesVersion will return the kubernetes version
func GetNamespace ¶
GetNamespace will get the namespace
func GetOpenShiftSecurityConstraint ¶
func GetOpenShiftSecurityConstraint(osSecurityClient *securityclient.SecurityV1Client, name string) (*securityv1.SecurityContextConstraints, error)
GetOpenShiftSecurityConstraint gets an OpenShift security constraints
func GetOperatorNamespace ¶
func GetOperatorNamespace(clientset *kubernetes.Clientset, namespace string) ([]string, error)
GetOperatorNamespace uses labels to return the namespace of the synopsys operator based on the provided namespace. In cluster scoped mode it will return the namespaces of all operators if provided namespace=NamespaceAll. In namespace scoped mode it will return nil if there is no operator in the namespace
func GetOperatorNamespaceByCRDScope ¶
func GetOperatorNamespaceByCRDScope(kubeClient *kubernetes.Clientset, crdName string, scope apiextensions.ResourceScope, namespace string) (string, error)
GetOperatorNamespaceByCRDScope get the operator namespace by CRD scope
func GetOperatorRoleBindings ¶
func GetOperatorRoleBindings(clientset *kubernetes.Clientset, namespace string) ([]string, []string, error)
GetOperatorRoleBindings returns the cluster role bindings of the synopsys operator based on the labels
func GetOperatorRoles ¶
func GetOperatorRoles(clientset *kubernetes.Clientset, namespace string) ([]string, []string, error)
GetOperatorRoles returns the roles or the cluster role of the synopsys operator based on the labels
func GetOpsSight ¶
func GetOpsSight(opssightClientset *opssightclientset.Clientset, namespace string, name string, options metav1.GetOptions) (*opssightapi.OpsSight, error)
GetOpsSight will get OpsSight in the cluster
func GetOpsSightDefault ¶
func GetOpsSightDefault() *opssightv1.OpsSightSpec
GetOpsSightDefault returns the required fields for OpsSight
func GetOpsSightDefaultWithIPV6DisabledBlackDuck ¶
func GetOpsSightDefaultWithIPV6DisabledBlackDuck() *opssightv1.OpsSightSpec
GetOpsSightDefaultWithIPV6DisabledBlackDuck retuns an OpsSight with a BlackDuck and IPV6 disabled
func GetOpsSightUpstream ¶
func GetOpsSightUpstream() *opssightv1.OpsSightSpec
GetOpsSightUpstream returns the required fields for an upstream OpsSight
func GetOpsSights ¶
func GetOpsSights(clientSet *opssightclientset.Clientset) (*opssightapi.OpsSightList, error)
GetOpsSights gets all opssights
func GetPVC ¶
func GetPVC(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.PersistentVolumeClaim, error)
GetPVC will get the PVC for the given name
func GetRandomString ¶
GetRandomString returns a random hexadecimal string of length n.
func GetReplicationController ¶
func GetReplicationController(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.ReplicationController, error)
GetReplicationController will get the replication controller corresponding to a namespace and name
func GetResourceName ¶
GetResourceName returns the name of the resource
func GetRoleBinding ¶
func GetRoleBinding(clientset *kubernetes.Clientset, namespace string, name string) (*rbacv1.RoleBinding, error)
GetRoleBinding get a role binding
func GetRoute ¶
func GetRoute(routeClient *routeclient.RouteV1Client, namespace string, name string) (*routev1.Route, error)
GetRoute gets an OpenShift routes
func GetRouteClient ¶
func GetRouteClient(restConfig *rest.Config, clientset *kubernetes.Clientset, namespace string) *routeclient.RouteV1Client
GetRouteClient attempts to get a Route Client. It returns nil if it fails due to an error or due to being on kubernetes (doesn't support routes)
func GetRouteComponent ¶
func GetRouteComponent(routeClient *routeclient.RouteV1Client, route *api.Route, labels map[string]string) *routev1.Route
GetRouteComponent returns the route component
func GetSecret ¶
func GetSecret(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.Secret, error)
GetSecret will create the secret
func GetService ¶
func GetService(clientset *kubernetes.Clientset, namespace string, serviceName string) (*corev1.Service, error)
GetService will get the service information for the input service name inside the input namespace
func GetServiceAccount ¶
func GetServiceAccount(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.ServiceAccount, error)
GetServiceAccount get a service account
func GetServiceEndPoint ¶
func GetServiceEndPoint(clientset *kubernetes.Clientset, namespace string, serviceName string) (*corev1.Endpoints, error)
GetServiceEndPoint will get the service endpoint information for the input service name inside the input namespace
func GetWithHelm3 ¶
GetWithHelm3 uses the helm NewGet action to return a Release with information about a resource from the cluster
func InitAnnotations ¶
InitAnnotations initialize the annotation
func InitLabels ¶
InitLabels initialize the label
func IsBlackDuckVersionSupportMultipleInstance ¶
IsBlackDuckVersionSupportMultipleInstance returns whether it supports multiple instance in a single namespace
func IsClusterRoleBindingSubjectNamespaceExist ¶
IsClusterRoleBindingSubjectNamespaceExist checks whether the namespace is already exist in the subject of cluster role binding
func IsClusterRoleRefExistForOtherNamespace ¶
func IsClusterRoleRefExistForOtherNamespace(roleRef rbacv1.RoleRef, roleName string, namespace string, subjects []rbacv1.Subject) bool
IsClusterRoleRefExistForOtherNamespace checks whether the cluster role exist for any cluster role bindings present in other namespace
func IsClusterRoleRuleExist ¶
func IsClusterRoleRuleExist(oldRules []rbacv1.PolicyRule, newRule rbacv1.PolicyRule) bool
IsClusterRoleRuleExist checks whether the namespace is already exist in the rule of cluster role
func IsExistInStringSlice ¶
IsExistInStringSlice will check for the input string in the given slice
func IsExposeServiceValid ¶
IsExposeServiceValid validates the expose service type
func IsNotDefaultVersionGreaterThanOrEqualTo ¶
func IsNotDefaultVersionGreaterThanOrEqualTo(version string, majorRelease int, minorRelease int, dotRelease int) (bool, error)
IsNotDefaultVersionGreaterThanOrEqualTo returns whether the given version is greater than or equal to the given inputs
func IsOpenshift ¶
func IsOpenshift(clientset *kubernetes.Clientset) bool
IsOpenshift will whether it is an openshift cluster
func IsOperatorExist ¶
func IsOperatorExist(clientset *kubernetes.Clientset, namespace string) bool
IsOperatorExist returns whether the operator exist or not
func IsOwnerLabelExistInNamespace ¶
func IsOwnerLabelExistInNamespace(kubeClient *kubernetes.Clientset, namespace string) bool
IsOwnerLabelExistInNamespace check for owner label exist in the namespace
func IsSubjectExist ¶
IsSubjectExist checks whether the namespace is already exist in the subject of cluster role binding
func IsSubjectExistForOtherNamespace ¶
IsSubjectExistForOtherNamespace checks whether anyother namespace is exist in the subject of cluster role binding
func IsVersionEqualTo ¶
IsVersionEqualTo returns whether the given version is equal to the given year, month and dot release
func IsVersionGreaterThanOrEqualTo ¶
func IsVersionGreaterThanOrEqualTo(version string, year int, month time.Month, dotRelease int) (bool, error)
IsVersionGreaterThanOrEqualTo returns whether the given version is greater than or equal to the given year, month and dot release
func ListAlerts ¶
func ListAlerts(clientSet *alertclientset.Clientset, namespace string, opts metav1.ListOptions) (*alertapi.AlertList, error)
ListAlerts will list all alerts in the cluster
func ListBlackduck ¶
func ListBlackduck(blackduckClientset *hubclientset.Clientset, namespace string, opts metav1.ListOptions) (*blackduckapi.BlackduckList, error)
ListBlackduck gets all blackducks
func ListClusterRoleBindings ¶
func ListClusterRoleBindings(clientset *kubernetes.Clientset, labelSelector string) (*rbacv1.ClusterRoleBindingList, error)
ListClusterRoleBindings list a cluster role binding
func ListClusterRoles ¶
func ListClusterRoles(clientset *kubernetes.Clientset, labelSelector string) (*rbacv1.ClusterRoleList, error)
ListClusterRoles list a cluster role
func ListConfigMaps ¶
func ListConfigMaps(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ConfigMapList, error)
ListConfigMaps will list the config map
func ListCustomResourceDefinitions ¶
func ListCustomResourceDefinitions(apiExtensionClient *apiextensionsclient.Clientset, labelSelector string) (*apiextensions.CustomResourceDefinitionList, error)
ListCustomResourceDefinitions list the custom resource defintions
func ListDeployments ¶
func ListDeployments(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*appsv1.DeploymentList, error)
ListDeployments will get all the deployments corresponding to a namespace
func ListNamespaces ¶
func ListNamespaces(clientset *kubernetes.Clientset, labelSelector string) (*corev1.NamespaceList, error)
ListNamespaces will list the namespace
func ListOpsSights ¶
func ListOpsSights(opssightClientset *opssightclientset.Clientset, namespace string, opts metav1.ListOptions) (*opssightapi.OpsSightList, error)
ListOpsSights will list all opssights in the cluster
func ListPVCs ¶
func ListPVCs(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.PersistentVolumeClaimList, error)
ListPVCs will list the PVC for the given label selector
func ListPodsWithLabels ¶
func ListPodsWithLabels(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.PodList, error)
ListPodsWithLabels will get all the pods corresponding to a namespace and labels
func ListReplicationControllers ¶
func ListReplicationControllers(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ReplicationControllerList, error)
ListReplicationControllers will get the replication controllers corresponding to a namespace
func ListRoleBindings ¶
func ListRoleBindings(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*rbacv1.RoleBindingList, error)
ListRoleBindings list a role binding
func ListRoles ¶
func ListRoles(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*rbacv1.RoleList, error)
ListRoles list a role
func ListRoutes ¶
func ListRoutes(routeClient *routeclient.RouteV1Client, namespace string, labelSelector string) (*routev1.RouteList, error)
ListRoutes list an OpenShift routes
func ListSecrets ¶
func ListSecrets(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.SecretList, error)
ListSecrets will list the secret
func ListServiceAccounts ¶
func ListServiceAccounts(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ServiceAccountList, error)
ListServiceAccounts list a service account
func ListServices ¶
func ListServices(clientset *kubernetes.Clientset, namespace string, labelSelector string) (*corev1.ServiceList, error)
ListServices will list the service information for the input service name inside the input namespace
func ListStorageClasses ¶
func ListStorageClasses(clientset *kubernetes.Clientset) (*v1beta1.StorageClassList, error)
ListStorageClasses will list all the storageClass in the cluster
func LoadChart ¶
LoadChart returns a chart from the specified chartURL Modified from https://github.com/openshift/console/blob/master/pkg/helm/actions/template_test.go
func MapKeyToStringArray ¶
MapKeyToStringArray will return map keys
func MapToStringArrayJoinBySeparator ¶
MapToStringArrayJoinBySeparator converts the map to string array and each key and value of the map will be joined by separator
func MergeEnvMaps ¶
MergeEnvMaps will merge the source and destination environs. If the same value exist in both, source environ will given more preference
func MergeEnvSlices ¶
MergeEnvSlices will merge the source and destination environs. If the same value exist in both, source environ will given more preference
func NewStringReader ¶
NewStringReader will convert string array to string reader object
func PatchDeployment ¶
func PatchDeployment(clientset *kubernetes.Clientset, old appsv1.Deployment, new appsv1.Deployment) error
PatchDeployment patch a deployment
func PatchDeploymentForReplicas ¶
func PatchDeploymentForReplicas(clientset *kubernetes.Clientset, old *appsv1.Deployment, replicas *int32) (*appsv1.Deployment, error)
PatchDeploymentForReplicas patch a deployment for replica update
func PatchReplicationController ¶
func PatchReplicationController(clientset *kubernetes.Clientset, old corev1.ReplicationController, new corev1.ReplicationController, isUpdateReplica bool) error
PatchReplicationController patch a replication controller
func PatchReplicationControllerForReplicas ¶
func PatchReplicationControllerForReplicas(clientset *kubernetes.Clientset, old *corev1.ReplicationController, replicas *int32) (*corev1.ReplicationController, error)
PatchReplicationControllerForReplicas patch a replication controller for replica update
func PrettyPrint ¶
PrettyPrint will print the interface in string format
func RandomString ¶
RandomString will generate the random string
func ReadFileData ¶
ReadFileData returns the information within a file as a string
func ReadFromFile ¶
ReadFromFile will read the file
func ReleaseExists ¶
ReleaseExists verifies that a resources is deployed in the cluster
func RemoveFromStringSlice ¶
RemoveFromStringSlice will remove the string from the slice and it will maintain the order
func RenderManifests ¶
func RenderManifests(releaseName, namespace string, chart *chart.Chart, vals map[string]interface{}, actionConfig *action.Configuration) (string, error)
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
func SetHelmValueInMap ¶
func SetHelmValueInMap(valueMapPointer map[string]interface{}, keyList []string, finalValue interface{})
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
func SetSecurityContextInPodConfig ¶
func SetSecurityContextInPodConfig(podConfig *PodConfig, securityContext *SecurityContext, isOpenshift bool)
SetSecurityContextInPodConfig sets the Security Context fields in the PodConfig
func StringArrayToMapSplitBySeparator ¶
StringArrayToMapSplitBySeparator converts the string array to map based on separator for each string in the array
func StringToStringSlice ¶
StringToStringSlice slices s into all substrings separated by sep
func TemplateWithHelm3 ¶
TemplateWithHelm3 prints the kube manifest files for a resource
func UniqueStringSlice ¶
UniqueStringSlice returns a unique subset of the string slice provided.
func UniqueValues ¶
UniqueValues returns a unique subset of the string slice provided.
func UpdateAlert ¶
func UpdateAlert(clientSet *alertclientset.Clientset, namespace string, alert *alertapi.Alert) (*alertapi.Alert, error)
UpdateAlert will update an Alert in the cluster
func UpdateAlerts ¶
func UpdateAlerts(clientSet *alertclientset.Clientset, alertCRDs []alertapi.Alert) error
UpdateAlerts will update a set of Alerts in the cluster
func UpdateBlackduck ¶
func UpdateBlackduck(blackduckClientset *hubclientset.Clientset, blackduck *blackduckapi.Blackduck) (*blackduckapi.Blackduck, error)
UpdateBlackduck will update Blackduck in the cluster
func UpdateBlackducks ¶
func UpdateBlackducks(clientSet *hubclientset.Clientset, blackduckCRDs []blackduckapi.Blackduck) error
UpdateBlackducks will update a set of Blackducks in the cluster
func UpdateClusterRole ¶
func UpdateClusterRole(clientset *kubernetes.Clientset, clusterRole *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error)
UpdateClusterRole updates the cluster role
func UpdateClusterRoleBinding ¶
func UpdateClusterRoleBinding(clientset *kubernetes.Clientset, clusterRoleBinding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error)
UpdateClusterRoleBinding updates the cluster role binding
func UpdateConfigMap ¶
func UpdateConfigMap(clientset *kubernetes.Clientset, namespace string, configMap *corev1.ConfigMap) (*corev1.ConfigMap, error)
UpdateConfigMap updates a config map
func UpdateCustomResourceDefinition ¶
func UpdateCustomResourceDefinition(apiExtensionClient *apiextensionsclient.Clientset, crd *apiextensions.CustomResourceDefinition) (*apiextensions.CustomResourceDefinition, error)
UpdateCustomResourceDefinition updates the custom resource defintion
func UpdateDeployment ¶
func UpdateDeployment(clientset *kubernetes.Clientset, namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
UpdateDeployment updates the deployment
func UpdateNamespace ¶
func UpdateNamespace(clientset *kubernetes.Clientset, namespace *corev1.Namespace) (*corev1.Namespace, error)
UpdateNamespace updates a namespace
func UpdateOpenShiftSecurityConstraint ¶
func UpdateOpenShiftSecurityConstraint(osSecurityClient *securityclient.SecurityV1Client, serviceAccounts []string, name string) error
UpdateOpenShiftSecurityConstraint updates an OpenShift security constraints
func UpdateOpsSight ¶
func UpdateOpsSight(opssightClientset *opssightclientset.Clientset, namespace string, opssight *opssightapi.OpsSight) (*opssightapi.OpsSight, error)
UpdateOpsSight will update OpsSight in the cluster
func UpdateOpsSights ¶
func UpdateOpsSights(clientSet *opssightclientset.Clientset, opsSightCRDs []opssightapi.OpsSight) error
UpdateOpsSights will update a set of OpsSights in the cluster
func UpdatePVC ¶
func UpdatePVC(clientset *kubernetes.Clientset, namespace string, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
UpdatePVC will update the pvc information for the input pvc name inside the input namespace
func UpdateRegistry ¶
func UpdateRegistry(obj map[string]runtime.Object, registry string) (map[string]runtime.Object, error)
UpdateRegistry updates the registry for all runtime objects containers
func UpdateReplicationController ¶
func UpdateReplicationController(clientset *kubernetes.Clientset, namespace string, rc *corev1.ReplicationController) (*corev1.ReplicationController, error)
UpdateReplicationController updates the replication controller
func UpdateRole ¶
func UpdateRole(clientset *kubernetes.Clientset, namespace string, role *rbacv1.Role) (*rbacv1.Role, error)
UpdateRole updates the role
func UpdateRoleBinding ¶
func UpdateRoleBinding(clientset *kubernetes.Clientset, namespace string, role *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)
UpdateRoleBinding updates the role binding
func UpdateRoute ¶
func UpdateRoute(routeClient *routeclient.RouteV1Client, namespace string, route *routev1.Route) (*routev1.Route, error)
UpdateRoute updates an OpenShift routes
func UpdateSecret ¶
func UpdateSecret(clientset *kubernetes.Clientset, namespace string, secret *corev1.Secret) (*corev1.Secret, error)
UpdateSecret updates a secret
func UpdateService ¶
func UpdateService(clientset *kubernetes.Clientset, namespace string, service *corev1.Service) (*corev1.Service, error)
UpdateService will update the service information for the input service name inside the input namespace
func UpdateServiceAccount ¶
func UpdateServiceAccount(clientset *kubernetes.Clientset, namespace string, serviceAccount *corev1.ServiceAccount) (*corev1.ServiceAccount, error)
UpdateServiceAccount updates a service account
func UpdateWithHelm3 ¶
func UpdateWithHelm3(releaseName, namespace, chartURL string, vals map[string]interface{}, kubeConfig string) error
UpdateWithHelm3 uses the helm NewUpgrade action to update a resource in the cluster
func ValidateImageString ¶
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]
func ValidateImageVersion ¶
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]
func ValidateServiceEndpoint ¶
func ValidateServiceEndpoint(clientset *kubernetes.Clientset, namespace string, name string) (*corev1.Endpoints, error)
ValidateServiceEndpoint will validate whether the service endpoint is ready to serve
func WaitForServiceEndpointReady ¶
func WaitForServiceEndpointReady(clientset *kubernetes.Clientset, namespace string, name string) error
WaitForServiceEndpointReady will wait for the service endpoint to start the service
func WaitUntilPodsAreReady ¶
func WaitUntilPodsAreReady(clientset *kubernetes.Clientset, namespace string, labelSelector string, timeoutInSeconds int64) error
WaitUntilPodsAreReady will wait for the pods to be ready
Types ¶
type Container ¶
type Container struct { ContainerConfig *horizonapi.ContainerConfig EnvConfigs []*horizonapi.EnvConfig VolumeMounts []*horizonapi.VolumeMountConfig PortConfig []*horizonapi.PortConfig ActionConfig *horizonapi.ActionConfig ReadinessProbeConfigs []*horizonapi.ProbeConfig LivenessProbeConfigs []*horizonapi.ProbeConfig PreStopConfig *horizonapi.ActionConfig }
Container defines the configuration for a container
type DeployerHelper ¶
DeployerHelper will contain the deployer specification, it has wrapper methods for adding stuff to a horizon deployer object. TODO this shoudl go into jayunit100/horizon probably (or horizon core if we're allowed to).
func NewDeployer ¶
func NewDeployer(config *rest.Config) (*DeployerHelper, error)
NewDeployer will create the horizon deployer
func (*DeployerHelper) AddController ¶
func (i *DeployerHelper) AddController(name string, c horizonapi.DeployerControllerInterface)
AddController will add the controller to the deployer
func (*DeployerHelper) PreDeploy ¶
func (i *DeployerHelper) PreDeploy(components *api.ComponentList, namespace string)
PreDeploy will provide the deploy objects
func (*DeployerHelper) StartControllers ¶
func (i *DeployerHelper) StartControllers()
StartControllers will start the controllers
type MapErrors ¶
MapErrors defines an object that contains errors across one or more components
func NewMapErrors ¶
NewMapErrors converts a map of string:error to a MapErrors interface
type PodConfig ¶
type PodConfig struct { Name string Labels map[string]string ServiceAccount string Containers []*Container Volumes []*components.Volume InitContainers []*Container PodAffinityConfigs map[horizonapi.AffinityType][]*horizonapi.PodAffinityConfig PodAntiAffinityConfigs map[horizonapi.AffinityType][]*horizonapi.PodAffinityConfig NodeAffinityConfigs map[horizonapi.AffinityType][]*horizonapi.NodeAffinityConfig ImagePullSecrets []string FSGID *int64 RunAsUser *int64 RunAsGroup *int64 }
PodConfig used for configuring the pod
type PodListController ¶
type PodListController struct {
// contains filtered or unexported fields
}
PodListController defines a controller that will list pods
func NewPodListController ¶
func NewPodListController(ns string) *PodListController
NewPodListController will create a new ListPodController
func (*PodListController) Run ¶
func (l *PodListController) Run(resources horizonapi.DeployerResources, stopCh chan struct{}) error
Run will print to debug output the status of the pods that were started
type SecurityContext ¶
type SecurityContext struct { FsGroup *int64 `json:"fsGroup"` RunAsUser *int64 `json:"runAsUser"` RunAsGroup *int64 `json:"runAsGroup"` }
SecurityContext will contain the specifications of a security context