Documentation ¶
Index ¶
- Constants
- 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 CompareVersions(version1 string, version2 string) int
- func CompareVersionsHelper(v1, v2 []int) int
- func ConvertFilesFromChartToMap(namespace, kubeConfig, chartURL, fileName string) (map[string]interface{}, 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 CreateKubeService(clientset *kubernetes.Clientset, namespace string, service *corev1.Service) (*corev1.Service, 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 DeepCopyHelmValuesMap(src map[string]interface{}, dest 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 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 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 GetAlerts(clientSet *alertclientset.Clientset) (*alertapi.AlertList, error)
- func GetBlackduck(blackduckClientset *hubclientset.Clientset, namespace string, name string, ...) (*blackduckapi.Blackduck, error)
- func GetCRDNamesFromConfigMap(kubeClient *kubernetes.Clientset, namespace string) (string, error)
- func GetChartURLs(repoURL, appName 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 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 GetDeploymentResources(deploymentResourceFilePath string, valueMapPointer map[string]interface{}, ...)
- func GetHelmValueFromMap(valueMapPointer map[string]interface{}, keyList []string) interface{}
- func GetIndexFile(repoURL string, actionConfig *action.Configuration) (*repo.IndexFile, error)
- func GetKubeService(namespace string, name string, labels map[string]string, ...) *corev1.Service
- func GetKubernetesVersion(clientset *kubernetes.Clientset) (string, error)
- func GetLatestChartURLForApp(chartURLs []string, appName string) (string, error)
- func GetLatestChartURLForAppVersion(chartURLs []string, appName, version string) (string, error)
- func GetLatestChartVersionForAppVersion(chartURLs []string, appName, version string) (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 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 GetReleaseValues(release *release.Release) map[string]interface{}
- 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(route *api.Route, labels map[string]string) *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 GetValueFromRelease(release *release.Release, keyList []string) interface{}
- func GetWithHelm3(releaseName, namespace, kubeConfig string) (*release.Release, 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 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 MergeMaps(a, b map[string]interface{}) map[string]interface{}
- func NewStringReader(ss []string) io.Reader
- func ParseChartVersion(chartURL string) string
- func ParseImageName(image string) string
- func ParseImageRepo(image string) string
- func ParseImageTag(image string) string
- func ParsePackageName(chartURL string) []string
- 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 PodContainersAreRunning(pod corev1.Pod) bool
- func PodIsRunningOrComplete(pod corev1.Pod) bool
- func PodIsTerminating(pod corev1.Pod) bool
- 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 StringSliceToIntSlice(vs []string) []int
- func StringToPtr(i 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 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 ValidateFullImageString(image string) bool
- func ValidateImageVersion(version string) bool
- func WaitForMoreThanNPods(kubeClient *kubernetes.Clientset, namespace string, labelSelector string, ...) error
- func WaitForPodsToAppear(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
- func WaitForPodsToBeDeletedOrComplete(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
- func WaitForPodsToBeRunningOrComplete(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
- func WaitForPodsToStartChanging(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
- func WaitForPodsToStopTerminating(kubeClient *kubernetes.Clientset, namespace string) error
- type Container
- type DeployerHelper
- 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 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 CompareVersions ¶ added in v1.1.0
CompareVersions returns an int representing version comparison if version1 < version2 -> -1 if version1 == version2 -> 0 if version1 > version2 -> 1
func CompareVersionsHelper ¶ added in v1.1.0
CompareVersionsHelper ...
func ConvertFilesFromChartToMap ¶ added in v1.0.2
func ConvertFilesFromChartToMap(namespace, kubeConfig, chartURL, fileName string) (map[string]interface{}, error)
ConvertFilesFromChartToMap checks whether an file exist in the chart. If exist, it will convert the file to map and return the map
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 CreateKubeService ¶
func CreateKubeService(clientset *kubernetes.Clientset, namespace string, service *corev1.Service) (*corev1.Service, error)
CreateKubeService will create the kubernetes service
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, extraFiles ...string) 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 DeepCopyHelmValuesMap ¶ added in v1.0.2
DeepCopyHelmValuesMap copies the src map to the dest map. Values in new map have different pointers/references
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 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 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 GetAlerts ¶
func GetAlerts(clientSet *alertclientset.Clientset) (*alertapi.AlertList, error)
GetAlerts gets all alerts
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 GetChartURLs ¶ added in v1.1.0
GetChartURLs ... if appName == "" then it returns all chart URLs (as seen in Chart.yaml) (NOTE: if the package name does not match name in Chart.yaml exactly then it will not be returned)
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 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 GetDeploymentResources ¶
func GetDeploymentResources(deploymentResourceFilePath string, valueMapPointer map[string]interface{}, heapMaxMemoryName string)
GetDeploymentResources reads the deployment resource file path and sets the Helm resource maps
func GetHelmValueFromMap ¶
GetHelmValueFromMap returns an interface{} if the value exists in the map
func GetIndexFile ¶ added in v1.1.0
GetIndexFile ...
func GetKubeService ¶
func GetKubeService(namespace string, name string, labels map[string]string, selector map[string]string, port int32, target string, serviceType corev1.ServiceType) *corev1.Service
GetKubeService will get the kubernetes service
func GetKubernetesVersion ¶
func GetKubernetesVersion(clientset *kubernetes.Clientset) (string, error)
GetKubernetesVersion will return the kubernetes version
func GetLatestChartURLForApp ¶ added in v1.1.0
GetLatestChartURLForApp ...
func GetLatestChartURLForAppVersion ¶ added in v1.1.0
GetLatestChartURLForAppVersion ...
func GetLatestChartVersionForAppVersion ¶ added in v1.1.0
func GetLatestChartVersionForAppVersion(chartURLs []string, appName, version string) (string, error)
GetLatestChartVersionForAppVersion ...
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 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 GetReleaseValues ¶ added in v1.0.1
GetReleaseValues merges the default Chart Values with the user's set values and retuns that set of values
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 ¶
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 GetValueFromRelease ¶
GetValueFromRelease merges the default Chart Values with the user's set values to find the value that is current set in the Release
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 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 MergeMaps ¶
MergeMaps Copied from https://github.com/helm/helm/blob/9b42702a4bced339ff424a78ad68dd6be6e1a80a/pkg/cli/values/options.go#L88
func NewStringReader ¶
NewStringReader will convert string array to string reader object
func ParseChartVersion ¶ added in v1.1.0
ParseChartVersion ...
func ParseImageName ¶ added in v1.0.3
ParseImageName takes a docker image string and returns the name image := "docker.io/blackducksoftware/synopsys-operator:latest" subMatch = [blackducksoftware/synopsys-operator:latest docker.io/blackducksoftware/ synopsys-operator :latest]
func ParseImageRepo ¶ added in v1.0.3
ParseImageRepo takes a docker image string and returns the repo image := "docker.io/blackducksoftware/synopsys-operator:latest" subMatch = [blackducksoftware/synopsys-operator:latest docker.io/blackducksoftware/ synopsys-operator :latest]
func ParseImageTag ¶ added in v1.0.3
ParseImageTag takes a docker image string and returns the tag image := "docker.io/blackducksoftware/synopsys-operator:latest" subMatch = [blackducksoftware/synopsys-operator:latest latest]
func ParsePackageName ¶ added in v1.1.0
ParsePackageName returns {app-name, app-version, chart-num} synopsys-alert-5.3.1-12 -> [synopsys-alert-5.3.1-12 synopsys-alert 5.3.1 -12 12] blackduck-2020.4.2 -> [blackduck-2020.4.2 blackduck 2020.4.2 ]
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 PodContainersAreRunning ¶ added in v1.1.0
PodContainersAreRunning ...
func PodIsRunningOrComplete ¶ added in v1.1.0
PodIsRunningOrComplete ...
func PodIsTerminating ¶ added in v1.1.0
PodIsTerminating ...
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 StringSliceToIntSlice ¶ added in v1.1.0
StringSliceToIntSlice ...
func StringToStringSlice ¶
StringToStringSlice slices s into all substrings separated by sep
func TemplateWithHelm3 ¶
func TemplateWithHelm3(releaseName, namespace, chartURL string, vals map[string]interface{}, extraFiles ...string) error
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 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, extraFiles ...string) error
UpdateWithHelm3 uses the helm NewUpgrade action to update a resource in the cluster
func ValidateFullImageString ¶ added in v1.0.3
ValidateFullImageString takes a docker image string and verifies a repo, name, and tag were all provided image := "docker.io/blackducksoftware/synopsys-operator:latest" subMatch = [blackducksoftware/synopsys-operator:latest blackducksoftware synopsys-operator latest]
func ValidateImageVersion ¶
ValidateImageVersion takes a docker image version string and verifies that it follows the format x.x.x version := "2019.4.2" subMatch = [2019.4.2 2019 4 2]
func WaitForMoreThanNPods ¶ added in v1.1.0
func WaitForMoreThanNPods(kubeClient *kubernetes.Clientset, namespace string, labelSelector string, n int) error
WaitForMoreThanNPods ...
func WaitForPodsToAppear ¶ added in v1.1.0
func WaitForPodsToAppear(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
WaitForPodsToAppear ...
func WaitForPodsToBeDeletedOrComplete ¶ added in v1.1.0
func WaitForPodsToBeDeletedOrComplete(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
WaitForPodsToBeDeletedOrComplete ...
func WaitForPodsToBeRunningOrComplete ¶ added in v1.1.0
func WaitForPodsToBeRunningOrComplete(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
WaitForPodsToBeRunningOrComplete ...
func WaitForPodsToStartChanging ¶ added in v1.1.0
func WaitForPodsToStartChanging(kubeClient *kubernetes.Clientset, namespace string, labelSelector string) error
WaitForPodsToStartChanging ... TODO - need to test if this function works
func WaitForPodsToStopTerminating ¶ added in v1.1.0
func WaitForPodsToStopTerminating(kubeClient *kubernetes.Clientset, namespace string) error
WaitForPodsToStopTerminating ...
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 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