Documentation ¶
Index ¶
- Constants
- Variables
- 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 CreateClient(kubeconfig *string) (*kubernetes.Clientset, error)
- func CreateEnvironmentSurvey(out io.Writer, batchMode bool, authConfigSvc auth.AuthConfigService, ...) (gits.GitProvider, error)
- func CurrentContext(config *api.Config) *api.Context
- func CurrentNamespace(config *api.Config) string
- func CurrentServer(config *api.Config) string
- func EnsureDevEnvironmentSetup(jxClient *versioned.Clientset, ns string) (*v1.Environment, error)
- func EnsureEnvironmentNamespaceSetup(kubeClient *kubernetes.Clientset, jxClient *versioned.Clientset, ...) error
- func EnsureGitServiceExistsForHost(jxClient *versioned.Clientset, devNs string, kind string, host string, ...) error
- func EnsureNamespaceCreated(kubeClient *kubernetes.Clientset, name string, labels map[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 FindServiceURL(client *kubernetes.Clientset, namespace string, name string) (string, error)
- func GetAppName(name string, namespaces ...string) string
- func GetCommitSha(r *metav1.ObjectMeta) string
- func GetCommitURL(r *metav1.ObjectMeta) string
- func GetDeploymentNames(client *kubernetes.Clientset, ns string, filter string) ([]string, error)
- func GetDeploymentPods(client *kubernetes.Clientset, name, namespace string) ([]v1.Pod, error)
- func GetDeployments(kubeClient *kubernetes.Clientset, ns string) (map[string]v1beta1.Deployment, error)
- func GetDevNamespace(kubeClient *kubernetes.Clientset, ns string) (string, string, error)
- func GetEnvironmentNames(jxClient *versioned.Clientset, ns string) ([]string, error)
- func GetEnvironments(jxClient *versioned.Clientset, ns string) (map[string]*v1.Environment, []string, error)
- func GetGitServiceKind(jxClient *versioned.Clientset, devNs string, host string) (string, error)
- func GetName(r *metav1.ObjectMeta) string
- 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.Clientset, ns string, filter string) ([]string, error)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func GetPodVersion(pod *corev1.Pod, appName string) string
- func GetReadyPodNames(client *kubernetes.Clientset, ns string, filter string) ([]string, error)
- func GetServiceNames(client *kubernetes.Clientset, ns string, filter string) ([]string, error)
- func GetServiceURL(svc *v1.Service) string
- func GetServiceURLFromMap(services map[string]*v1.Service, name string) string
- func GetServices(client *kubernetes.Clientset, ns string) (map[string]*v1.Service, error)
- func GetVersion(r *metav1.ObjectMeta) string
- func HasExternalAddress(svc *v1.Service) bool
- func IsDeploymentRunning(client *kubernetes.Clientset, name, namespace string) (bool, error)
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
- func PickEnvironment(envNames []string, defaultEnv string) (string, error)
- func RegisterEnvironmentCRD(apiClient *apiextensionsclientset.Clientset) error
- func RegisterGitServiceCRD(apiClient *apiextensionsclientset.Clientset) error
- func RegisterPipelineActivityCRD(apiClient *apiextensionsclientset.Clientset) error
- func RegisterReleaseCRD(apiClient *apiextensionsclientset.Clientset) error
- func Server(config *api.Config, context *api.Context) string
- func SortEnvironments(environments []v1.Environment)
- 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 ToValidName(name string) string
- func ToValidNameWithDots(name string) string
- func ValidNameOption(option string, value string) error
- func ValidSubDomainOption(option string, value string) error
- func ValidateEnvironmentDoesNotExist(jxClient *versioned.Clientset, ns string, str string) error
- func ValidateName(val interface{}) error
- func ValidateSubDomain(val interface{}) error
- func WaitForAllDeploymentsToBeReady(client *kubernetes.Clientset, namespace string, timeoutPerDeploy time.Duration) error
- func WaitForDeploymentToBeReady(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
- func WaitForExternalIP(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
- func WaitForPodToBeReady(client *kubernetes.Clientset, selector labels.Selector, namespace string, ...) error
- type ByOrder
- type HeapterConfig
- type PipelineActivityKey
- type PromotePullRequestFn
- type PromoteStepActivityKey
- func (k *PromoteStepActivityKey) GetOrCreatePromote(activities typev1.PipelineActivityInterface) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, bool, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromotePullRequest(activities typev1.PipelineActivityInterface) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromoteUpdate(activities typev1.PipelineActivityInterface) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, ...)
- func (k *PromoteStepActivityKey) OnPromotePullRequest(activities typev1.PipelineActivityInterface, fn PromotePullRequestFn) error
- func (k *PromoteStepActivityKey) OnPromoteUpdate(activities typev1.PipelineActivityInterface, fn PromoteUpdateFn) error
- type PromoteUpdateFn
- type ServiceURL
Constants ¶
const ( // ChartGitea the default name of the gitea chart ChartGitea = "jenkins-x/gitea" // ChartCDX the default name of the CDX chart ChartCDX = "jenkins-x/cdx" // ServiceJenkins is the name of the Jenkins Service ServiceJenkins = "jenkins" // SeriviceCDX the service name of the Helm Chart Museum service ServiceCDX = "cdx-cdx" // ServiceChartMuseum the service name of the Helm Chart Museum service ServiceChartMuseum = "jenkins-x-chartmuseum" // ServiceKubernetesDashboard the kubernetes dashboard ServiceKubernetesDashboard = "jenkins-x-kubernetes-dashboard" // the git credentials secret SecretJenkinsGitCredentials = "jenkins-git-credentials" // LocalHelmRepoName is the default name of the local chart repository where CI / CD releases go to LocalHelmRepoName = "releases" DefaultEnvironmentGitRepoURL = "https://github.com/jenkins-x/default-environment-charts.git" )
const ( LabelValueDevEnvironment = "dev" LabelTeam = "team" LabelEnvironment = "env" )
const ( OptionName = "name" OptionNamespace = "namespace" )
const (
DefaultNamespace = "jx"
)
const (
ExposeURLAnnotation = "fabric8.io/exposeUrl"
)
Variables ¶
var ( AddonCharts = map[string]string{ "gitea": ChartGitea, "cdx": ChartCDX, "prometheus": "stable/prometheus", "grafana": "stable/grafana", } )
Functions ¶
func CompletePromote ¶ added in v1.0.87
func CompletePromote(p *v1.PromoteActivityStep) error
func CompletePromotionPullRequest ¶ added in v1.0.87
func CompletePromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func CompletePromotionUpdate ¶ added in v1.0.87
func CompletePromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func CreateClient ¶
func CreateClient(kubeconfig *string) (*kubernetes.Clientset, error)
CreateClient creates a new kubernetes client
func CreateEnvironmentSurvey ¶ added in v1.0.2
func CreateEnvironmentSurvey(out io.Writer, batchMode bool, authConfigSvc auth.AuthConfigService, devEnv *v1.Environment, data *v1.Environment, config *v1.Environment, forkEnvGitURL string, ns string, jxClient *versioned.Clientset, kubeClient *kubernetes.Clientset, envDir string, gitRepoOptions gits.GitRepositoryOptions, helmValues config.HelmValuesConfig, prefix string) (gits.GitProvider, error)
CreateEnvironmentSurvey creates a Survey on the given environment using the default options from the CLI
func CurrentContext ¶
CurrentContext returns the current context
func CurrentNamespace ¶
CurrentNamespace returns the current namespace in the context
func CurrentServer ¶
CurrentServer returns the current context's server
func EnsureDevEnvironmentSetup ¶ added in v1.0.58
EnsureDevEnvironmentSetup ensures that the Environment is created in the given namespace
func EnsureEnvironmentNamespaceSetup ¶ added in v1.0.2
func EnsureEnvironmentNamespaceSetup(kubeClient *kubernetes.Clientset, jxClient *versioned.Clientset, env *v1.Environment, ns string) error
func EnsureGitServiceExistsForHost ¶ added in v1.0.114
func EnsureGitServiceExistsForHost(jxClient *versioned.Clientset, devNs string, kind string, host string, out io.Writer) error
EnsureGitServiceExistsForHost ensures that there is a GitService CRD for the given host and kind
func EnsureNamespaceCreated ¶ added in v1.0.2
func EnsureNamespaceCreated(kubeClient *kubernetes.Clientset, name string, labels map[string]string, annotations map[string]string) error
Ensure that the namespace exists for the given name
func FailedPromote ¶ added in v1.0.87
func FailedPromote(p *v1.PromoteActivityStep) error
func FailedPromotionPullRequest ¶ added in v1.0.87
func FailedPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func FailedPromotionUpdate ¶ added in v1.0.87
func FailedPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func FindServiceURL ¶
func GetAppName ¶ added in v1.0.69
GetAppName returns the app name
func GetCommitSha ¶ added in v1.0.18
func GetCommitSha(r *metav1.ObjectMeta) string
GetCommitSha returns the git commit sha
func GetCommitURL ¶ added in v1.0.18
func GetCommitURL(r *metav1.ObjectMeta) string
GetCommitURL returns the git commit URL
func GetDeploymentNames ¶ added in v1.0.10
func GetDeploymentPods ¶ added in v1.0.66
func GetDeployments ¶ added in v1.0.17
func GetDeployments(kubeClient *kubernetes.Clientset, ns string) (map[string]v1beta1.Deployment, error)
func GetDevNamespace ¶ added in v1.0.2
GetDevNamespace returns the developer environment namespace which is the namespace that contains the Environments and the developer tools like Jenkins
func GetEnvironmentNames ¶ added in v1.0.2
GetEnvironmentNames returns the sorted list of environment names
func GetEnvironments ¶ added in v1.0.2
func GetEnvironments(jxClient *versioned.Clientset, ns string) (map[string]*v1.Environment, []string, error)
GetEnvironments returns a map of the enviroments along with a sorted list of names
func GetGitServiceKind ¶ added in v1.0.114
GetGitServiceKind returns the kind of the given host if one can be found or ""
func GetName ¶ added in v1.0.18
func GetName(r *metav1.ObjectMeta) string
GetName returns the app name
func GetPodCondition ¶ added in v1.0.2
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 ¶ added in v1.0.25
func GetPodMetrics(client *metricsclient.Clientset, ns string) (*metricsv1beta1.PodMetricsList, error)
func GetPodNames ¶ added in v1.0.10
func GetPodReadyCondition ¶ added in v1.0.2
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 GetPodVersion ¶ added in v1.0.28
GetPodVersion returns the version for the given app name
func GetReadyPodNames ¶ added in v1.0.10
func GetServiceNames ¶ added in v1.0.10
func GetServiceURL ¶ added in v1.0.83
func GetServiceURLFromMap ¶ added in v1.0.83
func GetServices ¶ added in v1.0.83
func GetVersion ¶ added in v1.0.2
func GetVersion(r *metav1.ObjectMeta) string
GetVersion returns the version from the labels on the deployment if it can be deduced
func HasExternalAddress ¶ added in v1.0.29
func IsDeploymentRunning ¶ added in v1.0.2
func IsDeploymentRunning(client *kubernetes.Clientset, name, namespace string) (bool, error)
func IsPodReady ¶ added in v1.0.2
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 ¶ added in v1.0.2
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 LoadConfig ¶
func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
LoadConfig loads the kubernetes configuration
func PickEnvironment ¶ added in v1.0.2
func RegisterEnvironmentCRD ¶ added in v1.0.2
func RegisterEnvironmentCRD(apiClient *apiextensionsclientset.Clientset) error
RegisterEnvironmentCRD ensures that the CRD is registered for Environments
func RegisterGitServiceCRD ¶ added in v1.0.114
func RegisterGitServiceCRD(apiClient *apiextensionsclientset.Clientset) error
RegisterGitServiceCRD ensures that the CRD is registered for GitServices
func RegisterPipelineActivityCRD ¶ added in v1.0.84
func RegisterPipelineActivityCRD(apiClient *apiextensionsclientset.Clientset) error
RegisterPipelineActivityCRD ensures that the CRD is registered for PipelineActivity
func RegisterReleaseCRD ¶ added in v1.0.90
func RegisterReleaseCRD(apiClient *apiextensionsclientset.Clientset) error
RegisterReleaseCRD ensures that the CRD is registered for Release
func SortEnvironments ¶ added in v1.0.2
func SortEnvironments(environments []v1.Environment)
func StartPromote ¶ added in v1.0.87
func StartPromote(p *v1.PromoteActivityStep) error
func StartPromotionPullRequest ¶ added in v1.0.87
func StartPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func StartPromotionUpdate ¶ added in v1.0.87
func StartPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func ToValidName ¶ added in v1.0.84
ToValidName converts the given string into a valid kubernetes resource name
func ToValidNameWithDots ¶ added in v1.0.93
ToValidNameWithDots converts the given string into a valid kubernetes resource name
func ValidNameOption ¶ added in v1.0.2
func ValidSubDomainOption ¶ added in v1.0.2
func ValidateEnvironmentDoesNotExist ¶ added in v1.0.2
func ValidateName ¶ added in v1.0.2
func ValidateName(val interface{}) error
func ValidateSubDomain ¶ added in v1.0.2
func ValidateSubDomain(val interface{}) error
func WaitForAllDeploymentsToBeReady ¶ added in v1.0.2
func WaitForDeploymentToBeReady ¶ added in v1.0.2
func WaitForDeploymentToBeReady(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
waits for the pods of a deployment to become ready
func WaitForExternalIP ¶ added in v1.0.29
func WaitForExternalIP(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
waits for the pods of a deployment to become ready
func WaitForPodToBeReady ¶ added in v1.0.2
func WaitForPodToBeReady(client *kubernetes.Clientset, selector labels.Selector, namespace string, timeout time.Duration) error
waits for the pod to become ready using label selector to match the pod
Types ¶
type ByOrder ¶ added in v1.0.2
type ByOrder []v1.Environment
type HeapterConfig ¶ added in v1.0.26
type PipelineActivityKey ¶ added in v1.0.84
type PipelineActivityKey struct { Name string Pipeline string Build string BuildURL string BuildLogsURL string GitInfo *gits.GitRepositoryInfo }
func (*PipelineActivityKey) GetOrCreate ¶ added in v1.0.84
func (k *PipelineActivityKey) GetOrCreate(activities typev1.PipelineActivityInterface) (*v1.PipelineActivity, error)
GetOrCreate gets or creates the pipeline activity
func (*PipelineActivityKey) IsValid ¶ added in v1.0.84
func (k *PipelineActivityKey) IsValid() bool
type PromotePullRequestFn ¶ added in v1.0.84
type PromotePullRequestFn func(*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromotePullRequestStep) error
type PromoteStepActivityKey ¶ added in v1.0.87
type PromoteStepActivityKey struct { PipelineActivityKey Environment string }
func (*PromoteStepActivityKey) GetOrCreatePromote ¶ added in v1.0.87
func (k *PromoteStepActivityKey) GetOrCreatePromote(activities typev1.PipelineActivityInterface) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, bool, error)
GetOrCreatePromote gets or creates the Promote step for the key
func (*PromoteStepActivityKey) GetOrCreatePromotePullRequest ¶ added in v1.0.87
func (k *PromoteStepActivityKey) GetOrCreatePromotePullRequest(activities typev1.PipelineActivityInterface) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromotePullRequestStep, bool, error)
GetOrCreatePromotePullRequest gets or creates the PromotePullRequest for the key
func (*PromoteStepActivityKey) GetOrCreatePromoteUpdate ¶ added in v1.0.87
func (k *PromoteStepActivityKey) GetOrCreatePromoteUpdate(activities typev1.PipelineActivityInterface) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromoteUpdateStep, bool, error)
GetOrCreatePromoteUpdate gets or creates the Promote for the key
func (*PromoteStepActivityKey) OnPromotePullRequest ¶ added in v1.0.87
func (k *PromoteStepActivityKey) OnPromotePullRequest(activities typev1.PipelineActivityInterface, fn PromotePullRequestFn) error
func (*PromoteStepActivityKey) OnPromoteUpdate ¶ added in v1.0.87
func (k *PromoteStepActivityKey) OnPromoteUpdate(activities typev1.PipelineActivityInterface, fn PromoteUpdateFn) error
type PromoteUpdateFn ¶ added in v1.0.87
type PromoteUpdateFn func(*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromoteUpdateStep) error
type ServiceURL ¶
func FindServiceURLs ¶
func FindServiceURLs(client *kubernetes.Clientset, namespace string) ([]ServiceURL, error)