Documentation ¶
Index ¶
- Constants
- Variables
- func AcquireBuildLock(kubeClient kubernetes.Interface, devNamespace, namespace string) (func() error, error)
- func AddUserToConfig(user string, token string, config *api.Config) (*api.Config, error)
- func BuildJSONPatch(obj interface{}, mutate PatchModifier) ([]byte, error)
- func CanI(kubeClient kubernetes.Interface, verb Verb, resources ...Resource) (bool, []error)
- func CertificateAuthorityData(config *api.Config, context *api.Context) []byte
- func Cluster(config *api.Config) string
- func ClusterRoleBindingYaml(user string) string
- func ClusterRoleYaml(user string) string
- func CombineVolumes(volumes []corev1.Volume, otherVolumes ...corev1.Volume) []corev1.Volume
- func CompletePromote(p *v1.PromoteActivityStep) error
- func CompletePromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func CompletePromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func ContainsVolume(volumes []corev1.Volume, volume corev1.Volume) bool
- func ContainsVolumeMount(volumes []corev1.VolumeMount, volume corev1.VolumeMount) bool
- func CreateClusterRole(kubeClient kubernetes.Interface, namesapce string, name string, ...) error
- func CreateClusterRoleBinding(kubeClient kubernetes.Interface, namespace string, name string, ...) error
- func CreateDefaultDevEnvironment(ns string) *v1.Environment
- func CreateEnvGitRepository(batchMode bool, authConfigSvc auth.ConfigService, devEnv *v1.Environment, ...) (*gits.GitRepository, gits.GitProvider, error)
- func CreateEnvironmentSurvey(batchMode bool, authConfigSvc auth.ConfigService, devEnv *v1.Environment, ...) (gits.GitProvider, error)
- func CreateKubeClient(kubeconfig *string) (kubernetes.Interface, error)
- func CreatePatchBytes(op string, path string, value interface{}) ([]byte, error)
- func CreateTeam(ns string, name string, members []string) *v1.Team
- func CurrentCluster(config *api.Config) (string, *api.Cluster)
- func CurrentContext(config *api.Config) *api.Context
- func CurrentContextName(config *api.Config) string
- func CurrentNamespace(config *api.Config) string
- func CurrentServer(config *api.Config) string
- func DefaultModifyConfigMap(kubeClient kubernetes.Interface, ns string, name string, ...) (*v1.ConfigMap, error)
- func DefaultModifySecret(kubeClient kubernetes.Interface, ns string, name string, ...) (*v1.Secret, error)
- func DeleteClusterRole(kubeClient kubernetes.Interface, name string) error
- func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, name string) error
- func DeleteIngress(client kubernetes.Interface, ns, name string) error
- func DeleteJob(client kubernetes.Interface, namespace, name string) error
- func DeleteTeam(jxClient versioned.Interface, ns string, teamName string) error
- func DeploymentPodCount(client kubernetes.Interface, name, namespace string) (int, error)
- func DoCreateEnvironmentGitRepo(batchMode bool, authConfigSvc auth.ConfigService, env *v1.Environment, ...) (*gits.GitRepository, gits.GitProvider, error)
- func EnableInsecureRegistry(iqJson string, dockerRegistry string) (string, error)
- func EnsureDevEnvironmentSetup(jxClient versioned.Interface, ns string) (*v1.Environment, error)
- func EnsureDevNamespaceCreatedWithoutEnvironment(kubeClient kubernetes.Interface, ns string) error
- func EnsureEditEnvironmentSetup(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, ...) (*v1.Environment, error)
- func EnsureEnvironmentNamespaceSetup(kubeClient kubernetes.Interface, jxClient versioned.Interface, ...) error
- func EnsureGitServiceExistsForHost(jxClient versioned.Interface, devNs string, kind string, name string, ...) error
- func EnsureNamespaceCreated(kubeClient kubernetes.Interface, name string, labels map[string]string, ...) error
- func EnvironmentMatches(env *v1.Environment, filter *v1.EnvironmentFilter) bool
- func EnvironmentMatchesAny(env *v1.Environment, filters []v1.EnvironmentFilter) bool
- func ExtensionOwnerRef(ext *jenkinsv1.Extension) metav1.OwnerReference
- func ExtractDomainValue(data map[string]string) (string, error)
- func FailedPromote(p *v1.PromoteActivityStep) error
- func FailedPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func FailedPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func FindSourceRepository(jxClient versioned.Interface, ns string, owner string, name string, ...) (*v1.SourceRepository, error)
- func FindSourceRepositoryWithoutProvider(jxClient versioned.Interface, ns string, owner string, name string) (*v1.SourceRepository, error)
- func FixSchema(schema spec.Schema, ref common.ReferenceCallback) (spec.Schema, error)
- func GenerateBuildNumber(activities typev1.PipelineActivityInterface, pipelines []*v1.PipelineActivity, ...) (string, *v1.PipelineActivity, error)
- func GetAdminNamespace(kubeClient kubernetes.Interface, teamNs string) (string, error)
- func GetAppName(name string, namespaces ...string) string
- func GetCommandAndArgs(container *corev1.Container, isInit bool) ([]string, []string)
- func GetCommitSha(r *metav1.ObjectMeta) string
- func GetCommitURL(r *metav1.ObjectMeta) string
- func GetConfigMap(client kubernetes.Interface, ns string, name string) (*v1.ConfigMap, error)
- func GetConfigMapData(client kubernetes.Interface, name, ns string) (map[string]string, error)
- func GetConfigMaps(kubeClient kubernetes.Interface, ns string) (map[string]*v1.ConfigMap, []string, error)
- func GetContainersWithStatusAndIsInit(pod *v1.Pod) ([]v1.Container, []v1.ContainerStatus, bool)
- func GetCurrentDomain(client kubernetes.Interface, ns string) (string, error)
- func GetCurrentPod(kubeClient kubernetes.Interface, ns string) (*v1.Pod, error)
- func GetDeploymentByRepo(client kubernetes.Interface, ns string, repoName string) (*appsv1.Deployment, error)
- func GetDeploymentNames(client kubernetes.Interface, ns string, filter string) ([]string, error)
- func GetDeploymentPods(client kubernetes.Interface, name, namespace string) ([]v1.Pod, error)
- func GetDeployments(kubeClient kubernetes.Interface, ns string) (map[string]appsv1.Deployment, error)
- func GetDevEnvGitOwner(jxClient versioned.Interface) (string, error)
- func GetDevEnvTeamSettings(jxClient versioned.Interface, ns string) (*v1.TeamSettings, error)
- func GetDevEnvironment(jxClient versioned.Interface, ns string) (*v1.Environment, error)
- func GetDevNamespace(kubeClient kubernetes.Interface, ns string) (string, string, error)
- func GetDevPodNames(client kubernetes.Interface, ns string, username string) ([]string, map[string]*v1.Pod, error)
- func GetEditAppName(name string) string
- func GetEditEnvironmentNamespace(jxClient versioned.Interface, ns string) (string, error)
- func GetEnrichedDevEnvironment(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string) (*v1.Environment, error)
- func GetEnvVar(container *corev1.Container, name string) *corev1.EnvVar
- func GetEnvironment(jxClient versioned.Interface, ns string, name string) (*v1.Environment, error)
- func GetEnvironmentNames(jxClient versioned.Interface, ns string) ([]string, error)
- func GetEnvironmentNamespace(jxClient versioned.Interface, ns, environment string) (string, error)
- func GetEnvironmentRoles(jxClient versioned.Interface, ns string) (map[string]*v1.EnvironmentRoleBinding, []string, error)
- func GetEnvironments(jxClient versioned.Interface, ns string) (map[string]*v1.Environment, []string, error)
- func GetEnvironmentsByPrURL(jxClient versioned.Interface, ns string, prURL string) (*v1.Environment, error)
- func GetFilteredEnvironmentNames(jxClient versioned.Interface, ns string, ...) ([]string, error)
- func GetGitServiceKind(jxClient versioned.Interface, kubeClient kubernetes.Interface, devNs string, ...) (string, error)
- func GetIngress(client kubernetes.Interface, ns, name string) (string, error)
- func GetName(r *metav1.ObjectMeta) string
- func GetOrCreateRelease(jxClient versioned.Interface, ns string, release *v1.Release) (*v1.Release, error)
- func GetOrCreateSourceRepository(jxClient versioned.Interface, ns string, ...) (*v1.SourceRepository, error)
- func GetOrCreateSourceRepositoryCallback(jxClient versioned.Interface, ns string, ...) (*v1.SourceRepository, error)
- func GetOrCreateStage(a *v1.PipelineActivity, stageName string) (*v1.PipelineActivityStep, *v1.StageActivityStep, bool)
- func GetOrderedEnvironments(jxClient versioned.Interface, ns string) (map[string]*v1.Environment, []string, error)
- func GetOrderedReleases(jxClient versioned.Interface, ns string, filter string) ([]v1.Release, error)
- func GetPendingTeams(jxClient versioned.Interface, ns string) (map[string]*v1.Team, []string, error)
- func GetPermanentEnvironments(jxClient versioned.Interface, ns string) ([]*v1.Environment, error)
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodMetrics(client *metricsclient.Clientset, ns string) (*metricsv1beta1.PodMetricsList, error)
- func GetPodNames(client kubernetes.Interface, ns string, filter string) ([]string, error)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func GetPodRestarts(pod *v1.Pod) int32
- func GetPodVersion(pod *corev1.Pod, appName string) string
- func GetPods(client kubernetes.Interface, ns string, filter string) ([]string, map[string]*v1.Pod, error)
- func GetPodsWithLabels(client kubernetes.Interface, ns string, selector string) ([]string, map[string]*v1.Pod, error)
- func GetPreviewEnvironmentReleaseName(env *v1.Environment) string
- func GetQuickstartLocations(jxClient versioned.Interface, ns string) ([]v1.QuickStartLocation, error)
- func GetRepositoryGitURL(s *v1.SourceRepository) (string, error)
- func GetSecrets(kubeClient kubernetes.Interface, ns string) (map[string]*v1.Secret, []string, error)
- func GetServiceKindFromSecrets(kubeClient kubernetes.Interface, ns string, gitServiceURL string) (string, error)
- func GetSliceEnvVar(envVars []corev1.EnvVar, name string) *corev1.EnvVar
- func GetStepValueFromStage(stage *v1.StageActivityStep, stepName string) (v1.CoreActivityStep, bool)
- func GetTeamRoles(kubeClient kubernetes.Interface, ns string) (map[string]*rbacv1.Role, []string, error)
- func GetTeams(kubeClient kubernetes.Interface) ([]*corev1.Namespace, []string, error)
- func GetUserRoles(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, ...) ([]string, error)
- func GetVersion(r *metav1.ObjectMeta) string
- func GetVolume(volumes *[]corev1.Volume, name string) *corev1.Volume
- func GetVolumeMount(volumenMounts *[]corev1.VolumeMount, name string) *corev1.VolumeMount
- func HasContainerStarted(pod *v1.Pod, idx int) bool
- func IsClusterRole(kubeClient kubernetes.Interface, name string) bool
- func IsClusterRoleBinding(kubeClient kubernetes.Interface, name string) bool
- func IsDaemonSetExists(client kubernetes.Interface, name, namespace string) (bool, error)
- func IsDefaultQuickstartLocation(location v1.QuickStartLocation) bool
- func IsDeploymentRunning(client kubernetes.Interface, name, namespace string) (bool, error)
- func IsIncludedInTheGivenEnvs(environments map[string]*v1.Environment, repository *v1.SourceRepository) bool
- func IsJobFinished(job *batchv1.Job) bool
- func IsJobSucceeded(job *batchv1.Job) bool
- func IsPermanentEnvironment(env *v1.Environment) bool
- func IsPodCompleted(pod *v1.Pod) bool
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func IsPodSucceeded(pod *v1.Pod) bool
- func IsPreviewEnvironment(env *v1.Environment) bool
- func IsProwEnabled(kubeClient kubernetes.Interface, ns string) (bool, error)
- func IsRemoteEnvironmentRepository(environments map[string]*v1.Environment, repository *v1.SourceRepository) bool
- func IsResourceVersionNewer(v1 string, v2 string) bool
- func IsStagingCertificate(client certmngclient.Interface, ns string) (bool, error)
- func IsTektonEnabled(kubeClient kubernetes.Interface, ns string) (bool, error)
- func ListSelectedPipelineActivities(activitiesClient typev1.PipelineActivityInterface, labelSelector fmt.Stringer, ...) (*v1.PipelineActivityList, error)
- func LoadPodTemplates(kubeClient kubernetes.Interface, ns string) (map[string]*corev1.Pod, error)
- func ModifyNamespace(out io.Writer, dir string, env *v1.Environment, git gits.Gitter, ...) error
- func NewPermanentEnvironment(name string) *v1.Environment
- func NewPermanentEnvironmentWithGit(name string, gitUrl string) *v1.Environment
- func NewPreviewEnvironment(name string) *v1.Environment
- func ParseXml(xml string) (*etree.Document, string, error)
- func PickEnvironment(envNames []string, defaultEnv string, handles util.IOFileHandles) (string, error)
- func PodOwnerRef(pod *corev1.Pod) metav1.OwnerReference
- func PodRequestsAndLimits(pod *v1.Pod) (reqs map[v1.ResourceName]resource.Quantity, ...)
- func PodStatus(pod *v1.Pod) string
- func ReadInstallValues(kubeClient kubernetes.Interface, namespace string) (map[string]string, error)
- func ReadRegion(kubeClient kubernetes.Interface, namespace string) (string, error)
- func RegisterAllCRDs(apiClient apiextensionsclientset.Interface) error
- func RegisterAppCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterBuildPackCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterCRD(apiClient apiextensionsclientset.Interface, name string, ...) error
- func RegisterCommitStatusCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterEnvironmentCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterEnvironmentRoleBindingCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterExtensionCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterFactCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterGitServiceCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterPipelineActivityCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterPipelineCRDs(apiClient apiextensionsclientset.Interface) error
- func RegisterPipelineScheduler(apiClient apiextensionsclientset.Interface) error
- func RegisterPipelineStructureCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterPluginCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterReleaseCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterSourceRepositoryCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterSourceRepositoryGroup(apiClient apiextensionsclientset.Interface) error
- func RegisterTeamCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterUserCRD(apiClient apiextensionsclientset.Interface) error
- func RegisterWorkflowCRD(apiClient apiextensionsclientset.Interface) error
- func RememberInstallValues(kubeClient kubernetes.Interface, namespace string, values map[string]string) error
- func RememberRegion(kubeClient kubernetes.Interface, namespace string, region string) error
- func ReplaceMakeVariable(lines []string, name string, value string) error
- func RoleBindingKubeSystemYaml(user string) string
- func RoleBindings(client kubernetes.Interface, namespace string) (string, error)
- func RoleKubeSystemYaml(user string) string
- func SaveAsConfigMap(c kubernetes.Interface, configMapName string, ns string, obj interface{}) (*v1.ConfigMap, error)
- func Server(config *api.Config, context *api.Context) string
- func ServiceOwnerRef(svc *corev1.Service) metav1.OwnerReference
- func SetAdminNamespace(kubeClient kubernetes.Interface, teamNs string, adminNs string) error
- func SetEnvVar(envVars []corev1.EnvVar, name string, value string) []corev1.EnvVar
- func SortActivities(activities []v1.PipelineActivity)
- func SortEnvironments(environments []v1.Environment)
- func SortListWatchByName(listWatch *cache.ListWatch)
- func SortReleases(releases []v1.Release)
- func SortRuntimeObjectsByName(objects []runtime.Object)
- func StartPromote(p *v1.PromoteActivityStep) error
- func StartPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func StartPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func TailLogs(ns string, pod string, containerName string, errOut io.Writer, out io.Writer) error
- func ToMetaTime(t *time.Time) *metav1.Time
- func ToProviderName(gitURL string) string
- func UpdateJenkinsGitServers(cm *corev1.ConfigMap, server *auth.AuthServer, userAuth *auth.UserAuth, ...) (bool, error)
- func UpdateUserRoles(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, ...) error
- func ValidNameOption(option string, value string) error
- func ValidSubDomainOption(option string, value string) error
- func ValidateEnvironmentDoesNotExist(jxClient versioned.Interface, ns string, str string) error
- func ValidateName(val interface{}) error
- func ValidateSecret(kubeClient kubernetes.Interface, secretName, key, ns string) error
- func ValidateSubDomain(val interface{}) error
- func WaitForAllDeploymentsToBeReady(client kubernetes.Interface, namespace string, timeoutPerDeploy time.Duration) error
- func WaitForDeploymentToBeCreatedAndReady(client kubernetes.Interface, name, namespace string, ...) error
- func WaitForDeploymentToBeReady(client kubernetes.Interface, name, namespace string, timeout time.Duration) error
- func WaitForJobToComplete(client kubernetes.Interface, namespace, jobName string, timeout time.Duration, ...) error
- func WaitForJobToFinish(client kubernetes.Interface, namespace, jobName string, timeout time.Duration, ...) error
- func WaitForJobToSucceeded(client kubernetes.Interface, namespace, jobName string, timeout time.Duration) error
- func WaitForPodNameToBeComplete(client kubernetes.Interface, namespace string, name string, ...) error
- func WaitForPodNameToBeReady(client kubernetes.Interface, namespace string, name string, ...) error
- type ByName
- type ByOrder
- type ByTimestamp
- type ClusterStatus
- func (clusterStatus *ClusterStatus) AverageCpuPercent() int
- func (clusterStatus *ClusterStatus) AverageMemPercent() int
- func (clusterStatus *ClusterStatus) CheckResource() string
- func (clusterStatus *ClusterStatus) Info() string
- func (clusterStatus *ClusterStatus) MinimumResourceLimit() int
- func (clusterStatus *ClusterStatus) NodeCount() int
- type EnvironmentNamespaceCache
- type HeapterConfig
- type IngressConfig
- type JXInstallConfig
- type KubeConfig
- type Kuber
- type LogMasker
- type NodeStatus
- type ObjectReference
- type PatchModifier
- type PatchRow
- type PipelineActivityKey
- func (k *PipelineActivityKey) GetOrCreate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, bool, error)
- func (k *PipelineActivityKey) GitOwner() string
- func (k *PipelineActivityKey) GitRepository() string
- func (k *PipelineActivityKey) GitURL() string
- func (k *PipelineActivityKey) IsValid() bool
- type PipelineDetails
- type PipelineID
- type PipelineNamespaceCache
- type PromotePullRequestFn
- type PromoteStepActivityKey
- func (k *PromoteStepActivityKey) GetOrCreatePreview(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PreviewActivityStep, bool, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromote(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, bool, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromotePullRequest(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromoteUpdate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, ...)
- func (k *PromoteStepActivityKey) OnPromotePullRequest(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, ...) error
- func (k *PromoteStepActivityKey) OnPromoteUpdate(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, ...) error
- type PromoteUpdateFn
- type ReleaseOrder
- type ResolveChartMuseumURLFn
- type Resource
- type Verb
Constants ¶
const ( // DefaultNamespace the standard namespace for Jenkins X DefaultNamespace = "jx" // PodNamespaceFile the file path and name for pod namespace PodNamespaceFile = "/var/run/secrets/kubernetes.io/serviceaccount/namespace" )
const ( // DefaultChartMuseumURL default URL for Jenkins X Charts DefaultChartMuseumURL = "https://storage.googleapis.com/chartmuseum.jenkins-x.io" // DefaultChartMuseumJxRepoName default repo name for Jenkins X Charts DefaultChartMuseumJxRepoName = "jenkins-x" // ChartAmbassador the default chart for ambassador ChartAmbassador = "datawire/ambassador" // ChartAnchore the default chart for the Anchore plugin ChartAnchore = "stable/anchore-engine" // ChartExposecontrollerService the default name of the Exposecontroller Service chart for Edit environments ChartExposecontrollerService = "jenkins-x/exposecontroller-service" // ChartAnchore the default chart for the Anchore plugin ChartPipelineEvent = "jenkins-x/pipeline-events-addon" // ChartGitea the default name of the gitea chart ChartGitea = "jenkins-x/gitea" // ChartFlagger the default chart for the Flagger chart ChartFlagger = "flagger/flagger" ChartFlaggerGrafana = "flagger/grafana" DefaultFlaggerReleaseName = "flagger" // ChartIstio the default chart for the Istio chart ChartIstio = "install/kubernetes/helm/istio" // ChartKubeless the default chart for kubeless ChartKubeless = "incubator/kubeless" // ChartProw the default chart for Prow ChartProw = "jenkins-x/prow" // ChartKnative the default chart for knative ChartKnativeBuild = "jenkins-x/knative-build" // ChartBuildTemplates the build templates for Knative Build ChartBuildTemplates = "jenkins-x/jx-build-templates" // ChartTekton the default chart for tekton ChartTekton = "jenkins-x/tekton" // DefaultProwReleaseName the default helm release name for Prow DefaultProwReleaseName = "jx-prow" // DefaultKnativeBuildReleaseName the default helm release name for knative build DefaultKnativeBuildReleaseName = "knative-build" // DefaultTektonReleaseName the default helm release name for tekton DefaultTektonReleaseName = "tekton" // DefaultBuildTemplatesReleaseName the default helm release name for the knative build templates DefaultBuildTemplatesReleaseName = "jx-build-templates" // Charts Single Sign-On addon ChartSsoOperator = "jenkins-x/sso-operator" DefaultSsoOperatorReleaseName = "jx-sso-operator" ChartSsoDex = "jenkins-x/dex" DefaultSsoDexReleaseName = "jx-sso-dex" // ChartVaultOperator the default chart for vault opeator ChartVaultOperator = "jenkins-x/vault-operator" DefaultVaultOperatorReleaseName = "vault-operator" //ChartExternalDNS the default chart for external-dns ChartOwnerExternalDNS = "bitnami" ChartURLExternalDNS = "https://charts.bitnami.com/bitnami" ChartExternalDNS = "bitnami/external-dns" DefaultExternalDNSReleaseName = "external-dns" DefaultExternalDNSTag = "1.5.2" // SecretKaniko the name of the secret containing the kaniko service account SecretKaniko = "kaniko-secret" // SecretVelero the name of the secret containing the velero service account SecretVelero = "velero-secret" // #nosec // ServiceJenkins is the name of the Jenkins Service ServiceJenkins = "jenkins" // SecretJenkins is the name of the Jenkins secret SecretJenkins = "jenkins" // ServiceChartMuseum the service name of the Helm ChartMuseum service ServiceChartMuseum = "jenkins-x-chartmuseum" // ServiceKubernetesDashboard the Kubernetes dashboard ServiceKubernetesDashboard = "jenkins-x-kubernetes-dashboard" // SecretJenkinsChartMuseum the chart museum secret SecretJenkinsChartMuseum = "jenkins-x-chartmuseum" // SecretBucketRepo the bucket repo secret if using it as a chart repositoru SecretBucketRepo = "jenkins-x-bucketrepo" // SecretJenkinsReleaseGPG the GPG secrets for doing releases SecretJenkinsReleaseGPG = "jenkins-release-gpg" // SecretJenkinsPipelinePrefix prefix for a jenkins pipeline secret name SecretJenkinsPipelinePrefix = "jx-pipeline-" // SecretJenkinsPipelineAddonCredentials the chat credentials secret SecretJenkinsPipelineAddonCredentials = "jx-pipeline-addon-" // #nosec // SecretJenkinsPipelineChatCredentials the chat credentials secret SecretJenkinsPipelineChatCredentials = "jx-pipeline-chat-" // SecretJenkinsPipelineGitCredentials the git credentials secret SecretJenkinsPipelineGitCredentials = "jx-pipeline-git-" // #nosec // SecretJenkinsPipelineIssueCredentials the issue tracker credentials secret SecretJenkinsPipelineIssueCredentials = "jx-pipeline-issues-" // #nosec // ConfigMapExposecontroller the name of the ConfigMap with the Exposecontroller configuration ConfigMapExposecontroller = "exposecontroller" // ConfigMapIngressConfig the new name of the ConfigMap with the Exposecontroller configuration ConfigMapIngressConfig = "ingress-config" // ConfigMapJenkinsX the name of the ConfigMap with the Jenkins configuration ConfigMapJenkinsX = "jenkins" // ConfigMapJenkinsPodTemplates is the ConfigMap containing all the Pod Templates available ConfigMapJenkinsPodTemplates = "jenkins-x-pod-templates" // ConfigMapJenkinsTeamController is the ConfigMap containing the TeamController config files ConfigMapJenkinsTeamController = "jenkins-x-team-controller" // ConfigMapJenkinsDockerRegistry is the ConfigMap containing the Docker Registry configuration ConfigMapJenkinsDockerRegistry = "jenkins-x-docker-registry" // ConfigMapNameJXInstallConfig is the ConfigMap containing the jx installation's CA and server url. Used by jx login ConfigMapNameJXInstallConfig = "jx-install-config" // LocalHelmRepoName is the default name of the local chart repository where CI/CD releases go to LocalHelmRepoName = "releases" // DeploymentTektonController the name of the Deployment for the Tekton Pipeline controller DeploymentTektonController = "tekton-pipelines-controller" // DeploymentExposecontrollerService the name of the Deployment for the Exposecontroller Service DeploymentExposecontrollerService = "exposecontroller-service" // DeploymentProwBuild the name of the Deployment for the Prow webhook engine DeploymentProwBuild = "prow-build" DefaultEnvironmentGitRepoURL = "https://github.com/jenkins-x/default-environment-charts.git" DefaultOrganisationGitRepoURL = "https://github.com/jenkins-x/default-organisation.git" // AnnotationTitle the human readable name of a resource which can include mixed case, spaces and punctuation AnnotationTitle = "title" // AnnotationDescription the tooltip / texual description of an resource AnnotationDescription = "description" // LabelGitSync to indicate whether or not to sync this resource to GitOps LabelGitSync = "jenkins.io/gitSync" // LabelKind to indicate the kind of auth, such as Git or Issue LabelKind = "jenkins.io/kind" // ValueKindAddon an addon auth secret/credentials ValueKindAddon = "addon" // ValueKindChat a chat auth secret/credentials ValueKindChat = "chat" // ValueKindCVE an CVS App secret/credentials ValueKindCVE = "cve" // ValueKindEnvironmentRole to indicate a Role which maps to an EnvironmentRoleBinding ValueKindEnvironmentRole = "EnvironmentRole" // ValueKindGit a git auth secret/credentials ValueKindGit = "git" // ValueKindIssue an issue auth secret/credentials ValueKindIssue = "issue" // ValueKindChartmuseum a chartmuseum auth secret/credentials ValueKindChartmuseum = "chartmuseum" // ValueKindJenkins an Jenkins App secret/credentials ValueKindJenkins = "jenkins" // ValueKindCVE an addon auth PipelineEvent ValueKindPipelineEvent = "PipelineEvent" // ValueKindPodTemplate a PodTemplate in a ConfigMap ValueKindPodTemplate = "podTemplate" // ValueKindPodTemplateXML a PodTemplate XML in a ConfigMap ValueKindPodTemplateXML = "podTemplateXml" // ValueKindCVE an addon auth PipelineEvent ValueKindRelease = "Release" // ValueKindEditNamespace for edit namespace ValueKindEditNamespace = "editspace" // LabelServiceKind the label to indicate the auto Server's Kind LabelServiceKind = "jenkins.io/service-kind" // LabelGithubAppOwner the label to indicate the owner of a repository for github app token secrets LabelGithubAppOwner = "jenkins.io/githubapp-owner" // LabelCreatedBy indicates the service that created this resource LabelCreatedBy = "jenkins.io/created-by" // LabelPodTemplate the name of the pod template for a DevPod LabelPodTemplate = "jenkins.io/pod_template" // LabelDevPodName the name of a dev pod LabelDevPodName = "jenkins.io/devpod" // LabelDevPodUsername the user name owner of the DeVPod LabelDevPodUsername = "jenkins.io/devpod_user" // LabelDevPodGitPrefix used to label a devpod with the repository host, owner, repo LabelDevPodGitPrefix = "jenkins.io/repo" // LabelUsername the user name owner of a namespace or resource LabelUsername = "jenkins.io/user" // ValueCreatedByJX for resources created by the Jenkins X CLI ValueCreatedByJX = "jx" // LabelCredentialsType the kind of jenkins credential for a secret LabelCredentialsType = "jenkins.io/credentials-type" // ValueCredentialTypeUsernamePassword for user password credential secrets ValueCredentialTypeUsernamePassword = "usernamePassword" // ValueCredentialTypeSecretFile for secret files ValueCredentialTypeSecretFile = "secretFile" // LabelTeam indicates the team name an environment belongs to LabelTeam = "team" // LabelEnvironment indicates the name of the environment LabelEnvironment = "env" // LabelValueDevEnvironment is the value of the LabelTeam label for Development environments (system namespace) LabelValueDevEnvironment = "dev" // LabelValueThisEnvironment is the value of the LabelTeam label for the current environment in remote clusters LabelValueThisEnvironment = "this" // LabelJobKind the kind of job LabelJobKind = "jenkins.io/job-kind" // ValueJobKindPostPreview ValueJobKindPostPreview = "post-preview-step" // AnnotationURL indicates a service/server's URL AnnotationURL = "jenkins.io/url" // AnnotationExpose used to expose service using exposecontroller AnnotationExpose = "fabric8.io/expose" // AnnotationIngress tells exposecontroller to annotate generated ingress rule with values AnnotationIngress = "fabric8.io/ingress.annotations" // AnnotationExposePort indicates to the exposecontroller which service port to expose //in case a service has multiple prots AnnotationExposePort = "fabric8.io/exposePort" // AnnotationName indicates a service/server's textual name (can be mixed case, contain spaces unlike Kubernetes resources) AnnotationName = "jenkins.io/name" // AnnotationCredentialsDescription the description text for a Credential on a Secret AnnotationCredentialsDescription = "jenkins.io/credentials-description" // AnnotationWorkingDir the working directory, such as for a DevPod AnnotationWorkingDir = "jenkins.io/working-dir" // AnnotationLocalDir the local directory that is sync'd to the DevPod AnnotationLocalDir = "jenkins.io/local-dir" // AnnotationGitURLs the newline separated list of git URLs of the DevPods AnnotationGitURLs = "jenkins.io/git-urls" // AnnotationGitReportState used to annotate what state has been reported to git AnnotationGitReportState = "jenkins.io/git-report-state" // AnnotationGitReportRunningStages used to annotate what stages were last reported to git as running AnnotationGitReportRunningStages = "jenkins.io/git-report-running-stages" // AnnotationIsDefaultStorageClass used to indicate a storageclass is default AnnotationIsDefaultStorageClass = "storageclass.kubernetes.io/is-default-class" // AnnotationReleaseName is the name of the annotation that stores the release name in the preview environment AnnotationReleaseName = "jenkins.io/chart-release" // SecretDataUsername the username in a Secret/Credentials SecretDataUsername = "username" // SecretDataPassword the password in a Secret/Credentials SecretDataPassword = "password" // SecretBasicAuth the name for the Jenkins X basic auth secret SecretBasicAuth = "jx-basic-auth" // #nosec // JenkinsAdminApiToken the API token JenkinsAdminApiToken = "jenkins-admin-api-token" // JenkinsAdminUserField the admin user name JenkinsAdminUserField = "jenkins-admin-user" // JenkinsAdminPasswordField the password field JenkinsAdminPasswordField = "jenkins-admin-password" // JenkinsBearTokenField the bearer token JenkinsBearTokenField = "jenkins-bearer-token" AUTH = "auth" // Region stores the cloud region the cluster is installed on Region = "region" // Zone stores the cloud zone of the install Zone = "zone" // ProjectID stores the project ID used to install the cluster (a GKE thing mostly) ProjectID = "projectID" // ClusterName stores the name of the cluster that is created ClusterName = "clusterName" // KubeProvider stores the kubernetes provider name KubeProvider = "kubeProvider" )
const ( IngressConfigConfigmap = "ingress-config" Domain = "domain" Email = "email" TLS = "tls" Issuer = "issuer" ClusterIssuer = "clusterissuer" Exposer = "exposer" UrlTemplate = "urltemplate" )
const ( BitbucketConfigMapKey = "com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration.xml" GiteaConfigMapKey = "org.jenkinsci.plugin.gitea.servers.GiteaServers.xml" GithubConfigMapKey = "org.jenkinsci.plugins.github_branch_source.GitHubConfiguration.xml" )
const ( // ClusterRoleBindings is the clusterrolebindings.rbac.authorization.k8s.io resource ClusterRoleBindings Resource = "clusterrolebindings" // ClusterRoles is the clusterroles.rbac.authorization.k8s.io resource ClusterRoles Resource = "clusterrole" // CustomResourceDefinitions is the customresourcedefinitions.apiextensions.k8s.io resource CustomResourceDefinitions Resource = "customresourcedefinitions" // All is the representation of '*' meaning all resources All Resource = "'*'" // Create represents the create verb Create Verb = "create" // Delete represents the delete verb Delete Verb = "delete" // Get represents the get verb Get Verb = "get" // List represents the list verb List Verb = "list" // Update represents the update verb Update Verb = "use" // Watch represents the watch verb Watch Verb = "watch" )
const ( // ClassificationLogs stores build logs ClassificationLogs = "logs" // ClassificationTests stores test results/reports ClassificationTests = "tests" // ClassificationCoverage stores code coverage results/reports ClassificationCoverage = "coverage" // ClassificationReports stores test results, coverage & quality reports ClassificationReports = "reports" )
const ( OptionName = "name" OptionNamespace = "namespace" )
const DisableBuildLockEnvKey = "JX_DISABLE_BUILD_LOCK"
DisableBuildLockEnvKey environment variable used to disable build lock in jx step helm apply
Variables ¶
var ( AddonCharts = map[string]string{ "ambassador": ChartAmbassador, "anchore": ChartAnchore, DefaultFlaggerReleaseName: ChartFlagger, "gitea": ChartGitea, "istio": ChartIstio, "kubeless": ChartKubeless, "prometheus": "stable/prometheus", "grafana": "stable/grafana", "jx-build-templates": "jenkins-x/jx-build-templates", DefaultProwReleaseName: ChartProw, DefaultKnativeBuildReleaseName: ChartKnativeBuild, DefaultTektonReleaseName: ChartTekton, DefaultSsoDexReleaseName: ChartSsoDex, DefaultSsoOperatorReleaseName: ChartSsoOperator, DefaultVaultOperatorReleaseName: ChartVaultOperator, } AddonServices = map[string]string{ "anchore": "anchore-anchore-engine", "pipeline-events": "jx-pipeline-events-elasticsearch-client", "grafana": "grafana", } )
var ( // Classifications the common classification names Classifications = []string{ ClassificationCoverage, ClassificationTests, ClassificationLogs, ClassificationReports, } // ClassificationValues the classification values as a string ClassificationValues = strings.Join(Classifications, ", ") )
var ( DefaultQuickstartLocations = []v1.QuickStartLocation{ { GitURL: gits.GitHubURL, GitKind: gits.KindGitHub, Owner: "jenkins-x-quickstarts", Includes: []string{"*"}, Excludes: []string{"WIP-*"}, }, } )
Functions ¶
func AcquireBuildLock ¶
func AcquireBuildLock(kubeClient kubernetes.Interface, devNamespace, namespace string) (func() error, error)
AcquireBuildLock acquires a build lock, to avoid other builds to edit the same namespace while a deployment is already running, other deployments can negotiate which one should run after, by editing its data. Returns a function to release the lock (to be called in a defer) Returns an error if a newer build is already running, or if an error happened
func AddUserToConfig ¶
AddUserToConfig adds the given user to the config
func BuildJSONPatch ¶
func BuildJSONPatch(obj interface{}, mutate PatchModifier) ([]byte, error)
BuildJSONPatch builds JSON patch data for an entity mutation, that can then be applied to K8S as a Patch update. The mutation is applied via the supplied callback, which modifies the entity it is given. If the supplied mutate method returns an error then the process is aborted and the error returned.
func CanI ¶
CanI will take a verb and a list of resources and it will check whether the current user / service account can perform that verb against the resources in the Kubernetes cluster
func CertificateAuthorityData ¶
CertificateAuthorityData returns the certificate authority data for the given context
func ClusterRoleBindingYaml ¶
func ClusterRoleYaml ¶
func CombineVolumes ¶
CombineVolumes combines all the given volumes together ignoring duplicates
func CompletePromote ¶
func CompletePromote(p *v1.PromoteActivityStep) error
func CompletePromotionPullRequest ¶
func CompletePromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func CompletePromotionUpdate ¶
func CompletePromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func ContainsVolume ¶
ContainsVolume returns true if the given volume slice contains the given volume
func ContainsVolumeMount ¶
func ContainsVolumeMount(volumes []corev1.VolumeMount, volume corev1.VolumeMount) bool
ContainsVolumeMount returns true if the given volume mount slice contains the given volume
func CreateClusterRole ¶
func CreateClusterRole(kubeClient kubernetes.Interface, namesapce string, name string, apiGroups []string, resources []string, verbs []string) error
CreateClusterRole creates a new cluster role
func CreateClusterRoleBinding ¶
func CreateClusterRoleBinding(kubeClient kubernetes.Interface, namespace string, name string, serviceAccountName string, clusterRoleName string) error
CreateClusterRoleBinding creates acluster role binding in a given namespace for a service account
func CreateDefaultDevEnvironment ¶
func CreateDefaultDevEnvironment(ns string) *v1.Environment
CreateDefaultDevEnvironment creates a default development environment
func CreateEnvGitRepository ¶
func CreateEnvGitRepository(batchMode bool, authConfigSvc auth.ConfigService, devEnv *v1.Environment, data *v1.Environment, config *v1.Environment, forkEnvGitURL string, envDir string, gitRepoOptions *gits.GitRepositoryOptions, helmValues config.HelmValuesConfig, prefix string, git gits.Gitter, chartMusemFn ResolveChartMuseumURLFn, handles util.IOFileHandles) (*gits.GitRepository, gits.GitProvider, error)
CreateEnvGitRepository creates the git repository for the given Environment
func CreateEnvironmentSurvey ¶
func CreateEnvironmentSurvey(batchMode bool, authConfigSvc auth.ConfigService, devEnv *v1.Environment, data *v1.Environment, config *v1.Environment, update bool, forkEnvGitURL string, ns string, jxClient versioned.Interface, kubeClient kubernetes.Interface, envDir string, gitRepoOptions *gits.GitRepositoryOptions, helmValues config.HelmValuesConfig, prefix string, git gits.Gitter, chartMusemFn ResolveChartMuseumURLFn, handles util.IOFileHandles) (gits.GitProvider, error)
CreateEnvironmentSurvey creates a Survey on the given environment using the default options from the CLI
func CreateKubeClient ¶
func CreateKubeClient(kubeconfig *string) (kubernetes.Interface, error)
CreateKubeClient creates a new Kubernetes client
func CreatePatchBytes ¶
CreatePatchBytes creates a kubernetes PATCH block
func CreateTeam ¶
CreateTeam creates a new default Team
func CurrentCluster ¶
CurrentCluster returns the current cluster
func CurrentContext ¶
CurrentContext returns the current context
func CurrentContextName ¶
CurrentContextName returns the current context name
func CurrentNamespace ¶
CurrentNamespace returns the current namespace in the context
func CurrentServer ¶
CurrentServer returns the current context's server
func DefaultModifyConfigMap ¶
func DefaultModifyConfigMap(kubeClient kubernetes.Interface, ns string, name string, fn func(env *v1.ConfigMap) error, defaultConfigMap *v1.ConfigMap) (*v1.ConfigMap, error)
DefaultModifyConfigMap default implementation of a function to modify
func DefaultModifySecret ¶
func DefaultModifySecret(kubeClient kubernetes.Interface, ns string, name string, fn func(env *v1.Secret) error, defaultSecret *v1.Secret) (*v1.Secret, error)
DefaultModifySecret default implementation of a function to modify
func DeleteClusterRole ¶
func DeleteClusterRole(kubeClient kubernetes.Interface, name string) error
DeleteClusterRole deletes a cluster role if exists
func DeleteClusterRoleBinding ¶
func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, name string) error
DeleteClusterRoleBinding deltes a cluster role binding
func DeleteIngress ¶
func DeleteIngress(client kubernetes.Interface, ns, name string) error
DeleteIngress removes an ingress by name
func DeleteTeam ¶
DeleteTeam deletes the team resource but does not uninstall the underlying namespaces
func DeploymentPodCount ¶
func DeploymentPodCount(client kubernetes.Interface, name, namespace string) (int, error)
DeploymentPodCount returns pod counts of deployment
func DoCreateEnvironmentGitRepo ¶
func DoCreateEnvironmentGitRepo(batchMode bool, authConfigSvc auth.ConfigService, env *v1.Environment, forkEnvGitURL string, environmentsDir string, gitRepoOptions *gits.GitRepositoryOptions, helmValues config.HelmValuesConfig, prefix string, git gits.Gitter, chartMuseumFn ResolveChartMuseumURLFn, handles util.IOFileHandles) (*gits.GitRepository, gits.GitProvider, error)
DoCreateEnvironmentGitRepo actually creates the git repository for the environment
func EnableInsecureRegistry ¶
EnableInsecureRegistry appends the Docker Registry
func EnsureDevEnvironmentSetup ¶
EnsureDevEnvironmentSetup ensures that the Environment is created in the given namespace
func EnsureDevNamespaceCreatedWithoutEnvironment ¶
func EnsureDevNamespaceCreatedWithoutEnvironment(kubeClient kubernetes.Interface, ns string) error
EnsureDevNamespaceCreatedWithoutEnvironment ensures that there is a development namespace created
func EnsureEditEnvironmentSetup ¶
func EnsureEditEnvironmentSetup(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, username string) (*v1.Environment, error)
EnsureEditEnvironmentSetup ensures that the Environment is created in the given namespace
func EnsureEnvironmentNamespaceSetup ¶
func EnsureEnvironmentNamespaceSetup(kubeClient kubernetes.Interface, jxClient versioned.Interface, env *v1.Environment, ns string) error
func EnsureGitServiceExistsForHost ¶
func EnsureGitServiceExistsForHost(jxClient versioned.Interface, devNs string, kind string, name string, gitUrl string, out io.Writer) error
EnsureGitServiceExistsForHost ensures that there is a GitService CRD for the given host and kind
func EnsureNamespaceCreated ¶
func EnsureNamespaceCreated(kubeClient kubernetes.Interface, name string, labels map[string]string, annotations map[string]string) error
Ensure that the namespace exists for the given name
func EnvironmentMatches ¶
func EnvironmentMatches(env *v1.Environment, filter *v1.EnvironmentFilter) bool
EnvironmentMatches returns true if the environment matches the given filter
func EnvironmentMatchesAny ¶
func EnvironmentMatchesAny(env *v1.Environment, filters []v1.EnvironmentFilter) bool
EnvironmentMatchesAny returns true if the list of filters is empty or one of the filters matches the given environment
func ExtensionOwnerRef ¶
func ExtensionOwnerRef(ext *jenkinsv1.Extension) metav1.OwnerReference
func ExtractDomainValue ¶
ExtractDomainValue returns the domain value
func FailedPromote ¶
func FailedPromote(p *v1.PromoteActivityStep) error
func FailedPromotionPullRequest ¶
func FailedPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func FailedPromotionUpdate ¶
func FailedPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func FindSourceRepository ¶
func FindSourceRepository(jxClient versioned.Interface, ns string, owner string, name string, providerName string) (*v1.SourceRepository, error)
FindSourceRepository returns a SourceRepository for the given namespace, owner, repo name, and (optional) provider name. If no SourceRepository is found, return nil.
func FindSourceRepositoryWithoutProvider ¶
func FindSourceRepositoryWithoutProvider(jxClient versioned.Interface, ns string, owner string, name string) (*v1.SourceRepository, error)
FindSourceRepositoryWithoutProvider returns a SourceRepository for the given namespace, owner and repo name. If no SourceRepository is found, return nil.
func FixSchema ¶
FixSchema walks the schema and automatically fixes it up to be better supported by Kubernetes. Current automatic fixes are: * resolving $ref * remove unresolved $ref * clear additionalProperties (this is unsupported in older kubernetes, when we drop them, we can investigate adding support, for now use patternProperties)
as these are all unsupported
func GenerateBuildNumber ¶
func GenerateBuildNumber(activities typev1.PipelineActivityInterface, pipelines []*v1.PipelineActivity, pn PipelineID) (string, *v1.PipelineActivity, error)
GenerateBuildNumber generates a new build number for the given pipeline
func GetAdminNamespace ¶
func GetAdminNamespace(kubeClient kubernetes.Interface, teamNs string) (string, error)
GetAdminNamespace tries to find the admin namespace that corresponds to this team. in other words this is the namespace where the team CRD was initially created when this team was created, or the current team namespace for the case where this team was just created with a standalone `jx install`
func GetAppName ¶
GetAppName returns the app name
func GetCommandAndArgs ¶
GetCommandAndArgs extracts the command and arguments for the container, taking into account the entrypoint invocation if it's not an init container
func GetCommitSha ¶
func GetCommitSha(r *metav1.ObjectMeta) string
GetCommitSha returns the git commit sha
func GetCommitURL ¶
func GetCommitURL(r *metav1.ObjectMeta) string
GetCommitURL returns the git commit URL
func GetConfigMap ¶
GetConfigMap gets a named ConfigMap
func GetConfigMapData ¶
GetConfigMapData gets config map data
func GetConfigMaps ¶
func GetConfigMaps(kubeClient kubernetes.Interface, ns string) (map[string]*v1.ConfigMap, []string, error)
GetConfigMaps returns a map of the ConfigMaps along with a sorted list of names
func GetContainersWithStatusAndIsInit ¶
GetContainersWithStatusAndIsInit gets the containers in the pod, either init containers or non-init depending on whether non-init containers are present, and a flag as to whether this list of containers are init containers or not.
func GetCurrentDomain ¶
func GetCurrentDomain(client kubernetes.Interface, ns string) (string, error)
GetCurrentDomain gets the current domain
func GetCurrentPod ¶
GetCurrentPod returns the current pod the code is running in or nil if it cannot be deduced
func GetDeploymentByRepo ¶
func GetDeploymentByRepo(client kubernetes.Interface, ns string, repoName string) (*appsv1.Deployment, error)
GetDeploymentByRepo get deployment in the given namespace with repo name
func GetDeploymentNames ¶
GetDeploymentNames get deployment names in the given namespace with filter
func GetDeploymentPods ¶
GetDeploymentPods returns pods of deployment
func GetDeployments ¶
func GetDeployments(kubeClient kubernetes.Interface, ns string) (map[string]appsv1.Deployment, error)
GetDeployments get deployments in the given namespace
func GetDevEnvGitOwner ¶
GetDevEnvGitOwner gets the default GitHub owner/organisation to use for Environment repos. This takes the setting from the 'jx' Dev Env to get the one that was selected at installation time.
func GetDevEnvTeamSettings ¶
GetDevEnvTeamSettings gets the team settings from the specified namespace.
func GetDevEnvironment ¶
GetDevEnvironment returns the current development environment using the jxClient for the given ns. If the Dev Environment cannot be found, returns nil Environment (rather than an error). A non-nil error is only returned if there is an error fetching the Dev Environment.
func GetDevNamespace ¶
GetDevNamespace returns the developer environment namespace which is the namespace that contains the Environments and the developer tools like Jenkins
func GetDevPodNames ¶
func GetDevPodNames(client kubernetes.Interface, ns string, username string) ([]string, map[string]*v1.Pod, error)
GetDevPodNames returns the users dev pod names. If username is blank, all devpod names will be returned
func GetEditAppName ¶
func GetEditEnvironmentNamespace ¶
GetEditEnvironmentNamespace returns the namespace of the current users edit environment
func GetEnrichedDevEnvironment ¶
func GetEnrichedDevEnvironment(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string) (*v1.Environment, error)
GetEnrichedDevEnvironment lazily creates the dev namespace if it does not already exist and auto-detects the webhook engine if its not specified
func GetEnvironment ¶
GetEnvironment find an environment by name
func GetEnvironmentNames ¶
GetEnvironmentNames returns the sorted list of environment names
func GetEnvironmentNamespace ¶
GetEnvironments returns the namespace name for a given environment
func GetEnvironmentRoles ¶
func GetEnvironmentRoles(jxClient versioned.Interface, ns string) (map[string]*v1.EnvironmentRoleBinding, []string, error)
GetEnvironmentRoles returns all the environment role binding names and details
func GetEnvironments ¶
func GetEnvironments(jxClient versioned.Interface, ns string) (map[string]*v1.Environment, []string, error)
GetEnvironments returns a map of the environments along with a sorted list of names
func GetEnvironmentsByPrURL ¶
func GetEnvironmentsByPrURL(jxClient versioned.Interface, ns string, prURL string) (*v1.Environment, error)
GetEnvironmentsByPrURL find an environment by a pull request URL
func GetFilteredEnvironmentNames ¶
func GetFilteredEnvironmentNames(jxClient versioned.Interface, ns string, fn func(environment *v1.Environment) bool) ([]string, error)
GetFilteredEnvironmentNames returns the sorted list of environment names
func GetGitServiceKind ¶
func GetGitServiceKind(jxClient versioned.Interface, kubeClient kubernetes.Interface, devNs string, clusterAuthConfig *auth.AuthConfig, gitServiceURL string) (string, error)
GetGitServiceKind returns the kind of the given host if one can be found or ""
func GetIngress ¶
func GetIngress(client kubernetes.Interface, ns, name string) (string, error)
func GetOrCreateRelease ¶
func GetOrCreateRelease(jxClient versioned.Interface, ns string, release *v1.Release) (*v1.Release, error)
GetOrCreateRelease creates or updates the given release resource
func GetOrCreateSourceRepository ¶
func GetOrCreateSourceRepository(jxClient versioned.Interface, ns string, name, organisation, providerURL string) (*v1.SourceRepository, error)
GetOrCreateSourceRepository gets or creates the SourceRepository for the given repository name and organisation
func GetOrCreateSourceRepositoryCallback ¶
func GetOrCreateSourceRepositoryCallback(jxClient versioned.Interface, ns string, name, organisation, providerURL string, callback func(*v1.SourceRepository)) (*v1.SourceRepository, error)
GetOrCreateSourceRepositoryCallback gets or creates the SourceRepository for the given repository name and organisation invoking the given callback to modify the resource before create/udpate
func GetOrCreateStage ¶
func GetOrCreateStage(a *v1.PipelineActivity, stageName string) (*v1.PipelineActivityStep, *v1.StageActivityStep, bool)
GetOrCreateStage gets or creates the stage for the given name
func GetOrderedEnvironments ¶
func GetOrderedEnvironments(jxClient versioned.Interface, ns string) (map[string]*v1.Environment, []string, error)
GetOrderedEnvironments returns a map of the environments along with the correctly ordered names
func GetOrderedReleases ¶
func GetOrderedReleases(jxClient versioned.Interface, ns string, filter string) ([]v1.Release, error)
GetOrderedReleases returns the releases sorted in newest release first
func GetPendingTeams ¶
func GetPendingTeams(jxClient versioned.Interface, ns string) (map[string]*v1.Team, []string, error)
GetPendingTeams returns the pending teams with the sorted order of names
func GetPermanentEnvironments ¶
GetPermanentEnvironments returns a list with the current permanent environments
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.
func GetPodMetrics ¶
func GetPodMetrics(client *metricsclient.Clientset, ns string) (*metricsv1beta1.PodMetricsList, error)
func GetPodNames ¶
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go Extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.
func GetPodRestarts ¶
GetPodRestars returns the number of restarts of a POD
func GetPodVersion ¶
GetPodVersion returns the version for the given app name
func GetPodsWithLabels ¶
func GetPreviewEnvironmentReleaseName ¶
func GetPreviewEnvironmentReleaseName(env *v1.Environment) string
GetPreviewEnvironmentReleaseName returns the (helm) release name for the given (preview) environment or the empty string is the environment is not a preview environment, or has no release name associated with it
func GetQuickstartLocations ¶
func GetQuickstartLocations(jxClient versioned.Interface, ns string) ([]v1.QuickStartLocation, error)
GetQuickstartLocations returns the current quickstart locations. If no locations are defined yet lets return the defaults
func GetRepositoryGitURL ¶
func GetRepositoryGitURL(s *v1.SourceRepository) (string, error)
GetRepositoryGitURL returns the git repository clone URL
func GetSecrets ¶
func GetSecrets(kubeClient kubernetes.Interface, ns string) (map[string]*v1.Secret, []string, error)
GetSecrets returns a map of the Secrets along with a sorted list of names
func GetServiceKindFromSecrets ¶
func GetServiceKindFromSecrets(kubeClient kubernetes.Interface, ns string, gitServiceURL string) (string, error)
GetServiceKindFromSecrets gets the kind of service from secrets
func GetSliceEnvVar ¶
GetSliceEnvVar returns the EnvVar for the given name or nil if none exists in the slice
func GetStepValueFromStage ¶
func GetStepValueFromStage(stage *v1.StageActivityStep, stepName string) (v1.CoreActivityStep, bool)
GetStepValueFromStage gets the value for the step for the given name in the given stage, if it already exists. If it doesn't exist, it will create a new step for that name instead.
func GetTeamRoles ¶
func GetTeamRoles(kubeClient kubernetes.Interface, ns string) (map[string]*rbacv1.Role, []string, error)
GetTeamRoles returns the roles for the given team dev namespace
func GetUserRoles ¶
func GetUserRoles(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, userKind string, userName string) ([]string, error)
UpdateUserRoles updates the EnvironmentRoleBinding values based on the given userRoles userKind is "User" or "ServiceAccount"
func GetVersion ¶
func GetVersion(r *metav1.ObjectMeta) string
GetVersion returns the version from the labels on the deployment if it can be deduced
func GetVolumeMount ¶
func GetVolumeMount(volumenMounts *[]corev1.VolumeMount, name string) *corev1.VolumeMount
func HasContainerStarted ¶
HasContainerStarted returns true if the given Container has started running
func IsClusterRole ¶
func IsClusterRole(kubeClient kubernetes.Interface, name string) bool
IsClusterRole checks if a cluster role exists
func IsClusterRoleBinding ¶
func IsClusterRoleBinding(kubeClient kubernetes.Interface, name string) bool
IsClusterRoleBinding checks if the cluster role binding exists
func IsDaemonSetExists ¶
func IsDaemonSetExists(client kubernetes.Interface, name, namespace string) (bool, error)
IsDaemonSetExists checks if a daemonset exists in the namespace
func IsDefaultQuickstartLocation ¶
func IsDefaultQuickstartLocation(location v1.QuickStartLocation) bool
IsDefaultQuickstartLocation checks whether the given quickstart location is a default one, and if so returns true
func IsDeploymentRunning ¶
func IsDeploymentRunning(client kubernetes.Interface, name, namespace string) (bool, error)
IsDeploymentRunning returns whether this deployment is running
func IsIncludedInTheGivenEnvs ¶
func IsIncludedInTheGivenEnvs(environments map[string]*v1.Environment, repository *v1.SourceRepository) bool
IsIncludedInTheGivenEnvs returns true if the given repository is an environment repository
func IsJobFinished ¶
IsJobFinished returns true if the job has completed
func IsJobSucceeded ¶
IsJobSucceeded returns true if the job completed and did not fail
func IsPermanentEnvironment ¶
func IsPermanentEnvironment(env *v1.Environment) bool
IsPermanentEnvironment indicates if an environment is permanent
func IsPodCompleted ¶
IsPodCompleted returns true if a pod is completed (succeeded or failed); false otherwise.
func IsPodReady ¶
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go IsPodReady retruns true if a pod is ready; false otherwise.
func IsPodSucceeded ¶
IsPodSucceeded returns true if a pod is succeeded
func IsPreviewEnvironment ¶
func IsPreviewEnvironment(env *v1.Environment) bool
func IsProwEnabled ¶
func IsProwEnabled(kubeClient kubernetes.Interface, ns string) (bool, error)
IsProwEnabled returns true if Prow is enabled in the given development namespace
func IsRemoteEnvironmentRepository ¶
func IsRemoteEnvironmentRepository(environments map[string]*v1.Environment, repository *v1.SourceRepository) bool
IsRemoteEnvironmentRepository returns true if the given repository is a remote environment
func IsResourceVersionNewer ¶
IsResourceVersionNewer returns true if the first resource version is newer than the second
func IsStagingCertificate ¶
func IsStagingCertificate(client certmngclient.Interface, ns string) (bool, error)
IsStagingCertificate looks at certmanager certificates to find if we are using staging or prod certs
func IsTektonEnabled ¶
func IsTektonEnabled(kubeClient kubernetes.Interface, ns string) (bool, error)
IsTektonEnabled returns true if Build Pipeline is enabled in the given development namespace
func ListSelectedPipelineActivities ¶
func ListSelectedPipelineActivities(activitiesClient typev1.PipelineActivityInterface, labelSelector fmt.Stringer, fieldSelector fields.Selector) (*v1.PipelineActivityList, error)
ListSelectedPipelineActivities retrieves the PipelineActivities instances matching the specified label and field selectors. Selectors can be empty or nil.
func LoadPodTemplates ¶
LoadPodTemplates loads the Jenkins pod templates from the given namespace
func ModifyNamespace ¶
func ModifyNamespace(out io.Writer, dir string, env *v1.Environment, git gits.Gitter, chartMusemFn ResolveChartMuseumURLFn) error
ModifyNamespace modifies the namespace
func NewPermanentEnvironment ¶
func NewPermanentEnvironment(name string) *v1.Environment
NewPermanentEnvironment creates a new permanent environment for testing
func NewPermanentEnvironmentWithGit ¶
func NewPermanentEnvironmentWithGit(name string, gitUrl string) *v1.Environment
NewPermanentEnvironment creates a new permanent environment for testing
func NewPreviewEnvironment ¶
func NewPreviewEnvironment(name string) *v1.Environment
NewPreviewEnvironment creates a new preview environment for testing
func PickEnvironment ¶
func PodOwnerRef ¶
func PodOwnerRef(pod *corev1.Pod) metav1.OwnerReference
func PodRequestsAndLimits ¶
func PodRequestsAndLimits(pod *v1.Pod) (reqs map[v1.ResourceName]resource.Quantity, limits map[v1.ResourceName]resource.Quantity)
func ReadInstallValues ¶
func ReadInstallValues(kubeClient kubernetes.Interface, namespace string) (map[string]string, error)
ReadInstallValues reads the installed configuration values from the installation namespace
Empty map is returned if: - jx-install-config config map doesn't exist - kube client returns error on Config Map read operation
Error is returned if: - jx-install-config config map doesn't exist - kube client returns error on Config Map read operation
func ReadRegion ¶
func ReadRegion(kubeClient kubernetes.Interface, namespace string) (string, error)
ReadRegion allows to read cloud region from Config Map (jx-install-config). Region value is usually written using RememberRegion function.
Empty string is returned if: - region value doesn't exist - has empty value - jx-install-config config map doesn't exist - kube client returns error on Config Map read operation
Error is returned if: - jx-install-config config map doesn't exist - kube client returns error on Config Map read operation
func RegisterAllCRDs ¶
func RegisterAllCRDs(apiClient apiextensionsclientset.Interface) error
RegisterAllCRDs ensures that all Jenkins-X CRDs are registered
func RegisterAppCRD ¶
func RegisterAppCRD(apiClient apiextensionsclientset.Interface) error
RegisterAppCRD ensures that the CRD is registered for App
func RegisterBuildPackCRD ¶
func RegisterBuildPackCRD(apiClient apiextensionsclientset.Interface) error
RegisterBuildPackCRD ensures that the CRD is registered for BuildPack
func RegisterCRD ¶
func RegisterCRD(apiClient apiextensionsclientset.Interface, name string, names *v1beta1.CustomResourceDefinitionNames, columns []v1beta1.CustomResourceColumnDefinition, groupName string, pkg string, version string) error
RegisterCRD allows new custom resources to be registered using apiClient under a particular name. Various forms of the name are provided using names. In Kubernetes 1.11 and later a custom display format for kubectl is used, which is specified using columns.
func RegisterCommitStatusCRD ¶
func RegisterCommitStatusCRD(apiClient apiextensionsclientset.Interface) error
RegisterCommitStatusCRD ensures that the CRD is registered for CommitStatus
func RegisterEnvironmentCRD ¶
func RegisterEnvironmentCRD(apiClient apiextensionsclientset.Interface) error
RegisterEnvironmentCRD ensures that the CRD is registered for Environments
func RegisterEnvironmentRoleBindingCRD ¶
func RegisterEnvironmentRoleBindingCRD(apiClient apiextensionsclientset.Interface) error
RegisterEnvironmentRoleBindingCRD ensures that the CRD is registered for Environments
func RegisterExtensionCRD ¶
func RegisterExtensionCRD(apiClient apiextensionsclientset.Interface) error
RegisterExtensionCRD ensures that the CRD is registered for Extension
func RegisterFactCRD ¶
func RegisterFactCRD(apiClient apiextensionsclientset.Interface) error
RegisterFactCRD ensures that the CRD is registered for Fact
func RegisterGitServiceCRD ¶
func RegisterGitServiceCRD(apiClient apiextensionsclientset.Interface) error
RegisterGitServiceCRD ensures that the CRD is registered for GitServices
func RegisterPipelineActivityCRD ¶
func RegisterPipelineActivityCRD(apiClient apiextensionsclientset.Interface) error
RegisterPipelineActivityCRD ensures that the CRD is registered for PipelineActivity
func RegisterPipelineCRDs ¶
func RegisterPipelineCRDs(apiClient apiextensionsclientset.Interface) error
RegisterPipelineCRDs ensures that all Jenkins X Pipeline related CRDs are registered
func RegisterPipelineScheduler ¶
func RegisterPipelineScheduler(apiClient apiextensionsclientset.Interface) error
RegisterPipelineScheduler ensures that the CRD is registered for App
func RegisterPipelineStructureCRD ¶
func RegisterPipelineStructureCRD(apiClient apiextensionsclientset.Interface) error
RegisterPipelineStructureCRD ensures that the CRD is registered for PipelineStructure
func RegisterPluginCRD ¶
func RegisterPluginCRD(apiClient apiextensionsclientset.Interface) error
RegisterPluginCRD ensures that the CRD is registered for Plugin
func RegisterReleaseCRD ¶
func RegisterReleaseCRD(apiClient apiextensionsclientset.Interface) error
RegisterReleaseCRD ensures that the CRD is registered for Release
func RegisterSourceRepositoryCRD ¶
func RegisterSourceRepositoryCRD(apiClient apiextensionsclientset.Interface) error
RegisterSourceRepositoryCRD ensures that the CRD is registered for Applications
func RegisterSourceRepositoryGroup ¶
func RegisterSourceRepositoryGroup(apiClient apiextensionsclientset.Interface) error
RegisterSourceRepositoryGroup ensures that the CRD is registered for App
func RegisterTeamCRD ¶
func RegisterTeamCRD(apiClient apiextensionsclientset.Interface) error
RegisterTeamCRD ensures that the CRD is registered for Team
func RegisterUserCRD ¶
func RegisterUserCRD(apiClient apiextensionsclientset.Interface) error
RegisterUserCRD ensures that the CRD is registered for User
func RegisterWorkflowCRD ¶
func RegisterWorkflowCRD(apiClient apiextensionsclientset.Interface) error
RegisterWorkflowCRD ensures that the CRD is registered for Environments
func RememberInstallValues ¶
func RememberInstallValues(kubeClient kubernetes.Interface, namespace string, values map[string]string) error
RememberInstallValues remembers any non-blank installation values in the Kubernetes Config Map (jx-install-config), so jx can access this information later. Usually executed when provisioning new Kubernetes cluster.
If jx-install-config config map doesn't exist, it will be created. If region value is already saved, it will be overridden by this function call.
func RememberRegion ¶
func RememberRegion(kubeClient kubernetes.Interface, namespace string, region string) error
RememberRegion remembers cloud providers region in Kubernetes Config Map (jx-install-config), so jx can access this information later. Usually executed when provisioning new Kubernetes cluster.
If jx-install-config config map doesn't exist, it will be created. If region value is already saved, it will be overridden by this function call.
func ReplaceMakeVariable ¶
ReplaceMakeVariable needs a description
func RoleBindings ¶
func RoleBindings(client kubernetes.Interface, namespace string) (string, error)
func RoleKubeSystemYaml ¶
func SaveAsConfigMap ¶
func SaveAsConfigMap(c kubernetes.Interface, configMapName string, ns string, obj interface{}) (*v1.ConfigMap, error)
SaveAsConfigMap to the specified namespace as a config map.
func ServiceOwnerRef ¶
func ServiceOwnerRef(svc *corev1.Service) metav1.OwnerReference
func SetAdminNamespace ¶
func SetAdminNamespace(kubeClient kubernetes.Interface, teamNs string, adminNs string) error
SetAdminNamespace annotates the given namespace with a backlink to the admin namespace. it does not make any changes if the current annotation points to the same admin namespace
func SetEnvVar ¶
SetEnvVar returns the env vars with the env var of the given name updated or appended
func SortActivities ¶
func SortActivities(activities []v1.PipelineActivity)
SortActivities sorts a list of PipelineActivities
func SortEnvironments ¶
func SortEnvironments(environments []v1.Environment)
func SortListWatchByName ¶
func SortReleases ¶
SortReleases sorts the releases in name order then latest version first
func StartPromote ¶
func StartPromote(p *v1.PromoteActivityStep) error
func StartPromotionPullRequest ¶
func StartPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func StartPromotionUpdate ¶
func StartPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func TailLogs ¶
TailLogs will tail the logs for the pod in ns with containerName, returning when the logs are complete. It writes to errOut and out.
func ToMetaTime ¶
ToMetaTime converts the go time pointer to a meta time
func ToProviderName ¶
ToProviderName takes the git URL and converts it to a provider name which can be used as a label selector
func UpdateJenkinsGitServers ¶
func UpdateJenkinsGitServers(cm *corev1.ConfigMap, server *auth.AuthServer, userAuth *auth.UserAuth, credentials string) (bool, error)
UpdateJenkinsGitServers update the Jenkins ConfigMap with any missing Git server configurations for the given server and token
func UpdateUserRoles ¶
func UpdateUserRoles(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, userKind string, userName string, userRoles []string, roles map[string]*rbacv1.Role) error
UpdateUserRoles updates the EnvironmentRoleBinding values based on the given userRoles. userKind is "User" or "ServiceAccount"
func ValidNameOption ¶
func ValidSubDomainOption ¶
func ValidateName ¶
func ValidateName(val interface{}) error
func ValidateSecret ¶
func ValidateSecret(kubeClient kubernetes.Interface, secretName, key, ns string) error
ValidateSecret checks a given secret and key exists in the provided namespace
func ValidateSubDomain ¶
func ValidateSubDomain(val interface{}) error
func WaitForAllDeploymentsToBeReady ¶
func WaitForAllDeploymentsToBeReady(client kubernetes.Interface, namespace string, timeoutPerDeploy time.Duration) error
WaitForAllDeploymentsToBeReady waits for the pods of all deployment to become ready in the given namespace
func WaitForDeploymentToBeCreatedAndReady ¶
func WaitForDeploymentToBeCreatedAndReady(client kubernetes.Interface, name, namespace string, timeoutPerDeploy time.Duration) error
WaitForDeploymentToBeCreatedAndReady waits for the pods of a deployment created and to become ready
func WaitForDeploymentToBeReady ¶
func WaitForDeploymentToBeReady(client kubernetes.Interface, name, namespace string, timeout time.Duration) error
WaitForDeploymentToBeReady waits for the pods of a deployment to become ready
func WaitForJobToComplete ¶
func WaitForJobToComplete(client kubernetes.Interface, namespace, jobName string, timeout time.Duration, verbose bool) error
WaitForJobToComplete waits for the job to complete
func WaitForJobToFinish ¶
func WaitForJobToFinish(client kubernetes.Interface, namespace, jobName string, timeout time.Duration, verbose bool) error
WaitForJobToFinish waits for the job to finish
func WaitForJobToSucceeded ¶
func WaitForJobToSucceeded(client kubernetes.Interface, namespace, jobName string, timeout time.Duration) error
waits for the job to complete
func WaitForPodNameToBeComplete ¶
func WaitForPodNameToBeComplete(client kubernetes.Interface, namespace string, name string, timeout time.Duration) error
WaitForPodNameToBeComplete waits for the pod to complete (succeed or fail) using the pod name
func WaitForPodNameToBeReady ¶
func WaitForPodNameToBeReady(client kubernetes.Interface, namespace string, name string, timeout time.Duration) error
waits for the pod to become ready using the pod name
Types ¶
type ByOrder ¶
type ByOrder []v1.Environment
type ByTimestamp ¶
type ByTimestamp []v1.PipelineActivity
ByTimestamp is used to fileter a list of PipelineActivities by their given timestamp
func (ByTimestamp) Len ¶
func (a ByTimestamp) Len() int
func (ByTimestamp) Less ¶
func (a ByTimestamp) Less(i, j int) bool
func (ByTimestamp) Swap ¶
func (a ByTimestamp) Swap(i, j int)
type ClusterStatus ¶
type ClusterStatus struct { Name string // contains filtered or unexported fields }
func GetClusterStatus ¶
func GetClusterStatus(client kubernetes.Interface, namespace string, verbose bool) (ClusterStatus, error)
func (*ClusterStatus) AverageCpuPercent ¶
func (clusterStatus *ClusterStatus) AverageCpuPercent() int
func (*ClusterStatus) AverageMemPercent ¶
func (clusterStatus *ClusterStatus) AverageMemPercent() int
func (*ClusterStatus) CheckResource ¶
func (clusterStatus *ClusterStatus) CheckResource() string
func (*ClusterStatus) Info ¶
func (clusterStatus *ClusterStatus) Info() string
func (*ClusterStatus) MinimumResourceLimit ¶
func (clusterStatus *ClusterStatus) MinimumResourceLimit() int
func (*ClusterStatus) NodeCount ¶
func (clusterStatus *ClusterStatus) NodeCount() int
type EnvironmentNamespaceCache ¶
type EnvironmentNamespaceCache struct {
// contains filtered or unexported fields
}
EnvironmentNamespaceCache caches the Environments for a single namespace
func CreateEnvironmentCache ¶
func CreateEnvironmentCache(jxClient versioned.Interface, ns string) *EnvironmentNamespaceCache
CreateEnvironmentCache creates a cache for the given namespace of Environments
func (*EnvironmentNamespaceCache) Item ¶
func (c *EnvironmentNamespaceCache) Item(name string) *v1.Environment
Item returns the Environment for the tiven name
func (*EnvironmentNamespaceCache) Items ¶
func (c *EnvironmentNamespaceCache) Items() []*v1.Environment
Items returns the Environments in this namespace sorted in name order
type HeapterConfig ¶
type IngressConfig ¶
type IngressConfig struct { Email string `structs:"email" yaml:"email" json:"email"` Domain string `structs:"domain" yaml:"domain" json:"domain"` Issuer string `structs:"issuer" yaml:"issuer" json:"issuer"` ClusterIssuer bool `structs:"clusterissuer" yaml:"clusterissuer" json:"clusterissuer"` Exposer string `structs:"exposer" yaml:"exposer" json:"exposer"` UrlTemplate string `structs:"urltemplate" yaml:"urltemplate" json:"urltemplate"` TLS bool `structs:"tls" yaml:"tls" json:"tls"` }
func GetIngressConfig ¶
func GetIngressConfig(c kubernetes.Interface, ns string) (IngressConfig, error)
type JXInstallConfig ¶
type JXInstallConfig struct { Server string `structs:"server" yaml:"server" json:"server"` CA []byte `structs:"ca.crt" yaml:"ca.crt" json:"ca.crt"` KubeProvider string `structs:"kubeProvider" yaml:"kubeProvider" json:"kubeProvider"` }
JXInstallConfig is the struct used to create the jx-install-config configmap
type KubeConfig ¶
type KubeConfig struct{}
KubeConfig implements kube interactions
func (*KubeConfig) LoadConfig ¶
func (k *KubeConfig) LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
LoadConfig loads the Kubernetes configuration
func (*KubeConfig) UpdateConfig ¶
func (k *KubeConfig) UpdateConfig(namespace string, server string, caData string, user string, token string) error
UpdateConfig defines new config entries for jx
type Kuber ¶
type Kuber interface { // LoadConfig loads the Kubernetes configuration LoadConfig() (*api.Config, *clientcmd.PathOptions, error) // UpdateConfig defines new config entries for jx UpdateConfig(namespace string, server string, caData string, user string, token string) error }
Kuber defines common kube actions used within Jenkins X
func NewKubeConfig ¶
func NewKubeConfig() Kuber
NewKubeConfig creates a new KubeConfig struct to be used to interact with the underlying kube system
type LogMasker ¶
LogMasker replaces words in a log from a set of secrets
func NewLogMasker ¶
func NewLogMasker(kubeClient kubernetes.Interface, ns string) (*LogMasker, error)
NewLogMasker creates a new LogMasker loading secrets from the given namespace
func NewLogMaskerFromMap ¶
NewLogMaskerFromMap creates a new LogMasker with all the string values in a tree of map
func (*LogMasker) LoadSecret ¶
LoadSecret loads the secret data into the log masker
func (*LogMasker) LoadSecrets ¶
func (m *LogMasker) LoadSecrets(kubeClient kubernetes.Interface, ns string) error
LoadSecrets loads the secrets into the log masker
func (*LogMasker) MaskLogData ¶
MaskLogData masks the log data
type NodeStatus ¶
type NodeStatus struct { Name string AllocatableMemory *resource.Quantity AllocatableCPU *resource.Quantity AllocatableStorage *resource.Quantity CpuRequests resource.Quantity CpuLimits resource.Quantity MemRequests resource.Quantity MemLimits resource.Quantity DiskRequests resource.Quantity DiskLimits resource.Quantity // contains filtered or unexported fields }
func Status ¶
func Status(client kubernetes.Interface, namespace string, node v1.Node, verbose bool) (NodeStatus, error)
type ObjectReference ¶
type ObjectReference struct { APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"` // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // Name of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#names Name string `json:"name" protobuf:"bytes,3,opt,name=name"` }
ObjectReference represents a reference to a k8s resource
func CreateObjectReference ¶
func CreateObjectReference(t metav1.TypeMeta, o metav1.ObjectMeta) ObjectReference
CreateObjectReference create an ObjectReference from the typed and object meta stuff
type PatchModifier ¶
type PatchModifier func(obj interface{}) error
PatchModifier is a function that is function that mutates an entity during JSON patch generation. The function should modify the provided value, and can return an non-nil error if something goes wrong.
type PatchRow ¶
type PatchRow struct { Op string `json:"op"` Path string `json:"path"` Value interface{} `json:"value"` }
PatchRow used to generate the patch JSON for patching
type PipelineActivityKey ¶
type PipelineActivityKey struct { Name string Pipeline string Build string Version string BuildURL string BuildLogsURL string ReleaseNotesURL string LastCommitSHA string LastCommitMessage string LastCommitURL string GitInfo *gits.GitRepository PullRefs map[string]string Context string }
func (*PipelineActivityKey) GetOrCreate ¶
func (k *PipelineActivityKey) GetOrCreate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, bool, error)
GetOrCreate gets or creates the pipeline activity
func (*PipelineActivityKey) GitOwner ¶
func (k *PipelineActivityKey) GitOwner() string
GitOwner returns the git owner (person / organisation) or blank string if it cannot be found
func (*PipelineActivityKey) GitRepository ¶
func (k *PipelineActivityKey) GitRepository() string
GitRepository returns the git repository name or blank string if it cannot be found
func (*PipelineActivityKey) GitURL ¶
func (k *PipelineActivityKey) GitURL() string
GitURL returns the git URL or blank string if it cannot be found
func (*PipelineActivityKey) IsValid ¶
func (k *PipelineActivityKey) IsValid() bool
type PipelineDetails ¶
type PipelineDetails struct { GitOwner string GitRepository string BranchName string Pipeline string Build string Context string }
func CreatePipelineDetails ¶
func CreatePipelineDetails(activity *v1.PipelineActivity) *PipelineDetails
CreatePipelineDetails creates a PipelineDetails object populated from the activity
type PipelineID ¶
PipelineID is an identifier for a Pipeline. A pipeline is typically identified by its owner, repository, and branch with the ID field taking the form `<owner>/>repository>/<branch>`
func NewPipelineID ¶
func NewPipelineID(owner string, repository string, branch string) PipelineID
NewPipelineID creates a new PipelineID for a given owner, repository, and branch.
func NewPipelineIDFromString ¶
func NewPipelineIDFromString(id string) PipelineID
NewPipelineIDFromString creates a new PipelineID, given a pre-built string identifier. The string identifier is expected to follow the format `<owner>/>repository>/<branch>`, though this isn't actually validated/mandated here.
func (*PipelineID) GetActivityName ¶
func (p *PipelineID) GetActivityName(activity string) string
GetActivityName Builds a Kubernetes-friendly (i.e. a-z,-,. only) name for a specific activity, within a pipeline.
type PipelineNamespaceCache ¶
type PipelineNamespaceCache struct {
// contains filtered or unexported fields
}
PipelineNamespaceCache caches the pipelines for a single namespace
func NewPipelineCache ¶
func NewPipelineCache(jxClient versioned.Interface, ns string) *PipelineNamespaceCache
NewPipelineCache creates a cache of pipelines for a namespace
func (*PipelineNamespaceCache) ForEach ¶
func (c *PipelineNamespaceCache) ForEach(callback func(*v1.PipelineActivity))
ForEach runs the supplied function on every element in the Map. In no particular order.
func (*PipelineNamespaceCache) Pipelines ¶
func (c *PipelineNamespaceCache) Pipelines() []*v1.PipelineActivity
Pipelines returns the pipelines in this namespace sorted in name order
func (*PipelineNamespaceCache) Ready ¶
func (c *PipelineNamespaceCache) Ready() bool
Ready returns true if this cache has done its initial load and is in sync.
func (*PipelineNamespaceCache) Stop ¶
func (c *PipelineNamespaceCache) Stop()
Stop closes the underlying chanel processing events which stops consuming watch events
type PromotePullRequestFn ¶
type PromotePullRequestFn func(*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromotePullRequestStep) error
type PromoteStepActivityKey ¶
type PromoteStepActivityKey struct { PipelineActivityKey Environment string ApplicationURL string }
func (*PromoteStepActivityKey) GetOrCreatePreview ¶
func (k *PromoteStepActivityKey) GetOrCreatePreview(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PreviewActivityStep, bool, error)
GetOrCreatePreview gets or creates the Preview step for the key
func (*PromoteStepActivityKey) GetOrCreatePromote ¶
func (k *PromoteStepActivityKey) GetOrCreatePromote(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, bool, error)
GetOrCreatePromote gets or creates the Promote step for the key
func (*PromoteStepActivityKey) GetOrCreatePromotePullRequest ¶
func (k *PromoteStepActivityKey) GetOrCreatePromotePullRequest(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromotePullRequestStep, bool, error)
GetOrCreatePromotePullRequest gets or creates the PromotePullRequest for the key
func (*PromoteStepActivityKey) GetOrCreatePromoteUpdate ¶
func (k *PromoteStepActivityKey) GetOrCreatePromoteUpdate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromoteUpdateStep, bool, error)
GetOrCreatePromoteUpdate gets or creates the Promote for the key
func (*PromoteStepActivityKey) OnPromotePullRequest ¶
func (k *PromoteStepActivityKey) OnPromotePullRequest(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, fn PromotePullRequestFn) error
OnPromotePullRequest updates activities on a Promote PR
func (*PromoteStepActivityKey) OnPromoteUpdate ¶
func (k *PromoteStepActivityKey) OnPromoteUpdate(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, fn PromoteUpdateFn) error
OnPromoteUpdate updates activities on a Promote Update
type PromoteUpdateFn ¶
type PromoteUpdateFn func(*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromoteUpdateStep) error
type ReleaseOrder ¶
func (ReleaseOrder) Len ¶
func (a ReleaseOrder) Len() int
func (ReleaseOrder) Less ¶
func (a ReleaseOrder) Less(i, j int) bool
func (ReleaseOrder) Swap ¶
func (a ReleaseOrder) Swap(i, j int)
type ResolveChartMuseumURLFn ¶
ResolveChartMuseumURLFn used to resolve the chart repository URL if using remote environments
Source Files ¶
- activity.go
- activity_functions.go
- build_lock.go
- certmanager.go
- clients.go
- cluster_status.go
- config.go
- configmap.go
- constants.go
- containers.go
- crds.go
- daemonsets.go
- deployments.go
- env.go
- env_cache.go
- envrolebindings.go
- envvar.go
- field_map.go
- git_services.go
- ingress.go
- install_rbac.go
- interface.go
- jenkins.go
- job.go
- jx_install_config.go
- kops.go
- log_masker.go
- logs.go
- metadata.go
- metrics.go
- namespaces.go
- owners.go
- patch.go
- permissions.go
- pipeline_cache.go
- pod.go
- pod_templates.go
- quickstarts.go
- releases.go
- roles.go
- runtime_objects.go
- secrets.go
- sourcerepositories.go
- storage.go
- teams.go
- times.go
- validate.go
- version.go
- volumes.go