Documentation
¶
Index ¶
- Constants
- func AddUserToConfig(user string, token string, config *api.Config) (*api.Config, error)
- func CertificateAuthorityData(config *api.Config, context *api.Context) []byte
- func Cluster(config *api.Config) string
- 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 IsInCluster() bool
- func IsNoKubernetes() bool
- func LazyCreateDynamicClient(client dynamic.Interface) (dynamic.Interface, error)
- func LazyCreateKubeClient(client kubernetes.Interface) (kubernetes.Interface, error)
- func LazyCreateKubeClientAndNamespace(client kubernetes.Interface, ns string) (kubernetes.Interface, string, error)
- func LazyCreateKubeClientWithMandatory(client kubernetes.Interface, mandatory bool) (kubernetes.Interface, error)
- func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
- func NewFakeKubernetesClient(ns string) *fake.Clientset
- func Server(config *api.Config, context *api.Context) string
- func SortListWatchByName(listWatch *cache.ListWatch)
- func SortRuntimeObjectsByName(objects []runtime.Object)
- func ToMetaTime(t *time.Time) *metav1.Time
- func UpdateConfig(namespace string, server string, caData string, user string, token string) error
- type ByName
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 ( // ServiceJenkins is the name of the Jenkins Service ServiceJenkins = "jenkins" // ServiceChartMuseum the service name of the Helm ChartMuseum service ServiceChartMuseum = "jenkins-x-chartmuseum" // 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" // LocalHelmRepoName is the default name of the local chart repository where CI/CD releases go to LocalHelmRepoName = "releases" // 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" // AnnotationHost used to indicate the host if using NodePort Ingress resources on premise without a LoadBalancer AnnotationHost = "jenkins.io/host" // SecretBasicAuth the name for the Jenkins X basic auth secret SecretBasicAuth = "jx-basic-auth" // #nosec )
Variables ¶
This section is empty.
Functions ¶
func AddUserToConfig ¶
AddUserToConfig adds the given user to the config
func CertificateAuthorityData ¶
CertificateAuthorityData returns the certificate authority data for the given context
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 IsNoKubernetes ¶ added in v3.0.48
func IsNoKubernetes() bool
IsNoKubernetes returns true if we are inside a GitHub Action or not using kubernetes
func LazyCreateDynamicClient ¶
LazyCreateDynamicClient lazily creates the dynamic client if its not defined
func LazyCreateKubeClient ¶
func LazyCreateKubeClient(client kubernetes.Interface) (kubernetes.Interface, error)
LazyCreateKubeClient lazy creates the kube client if its not defined
func LazyCreateKubeClientAndNamespace ¶
func LazyCreateKubeClientAndNamespace(client kubernetes.Interface, ns string) (kubernetes.Interface, string, error)
LazyCreateKubeClientAndNamespace lazy creates the kube client and/or the current namespace if not already defined
func LazyCreateKubeClientWithMandatory ¶ added in v3.0.66
func LazyCreateKubeClientWithMandatory(client kubernetes.Interface, mandatory bool) (kubernetes.Interface, error)
LazyCreateKubeClientWithMandatory if mandatory is specified then the env vars are ignored to determine if we use kubernetes or not
func LoadConfig ¶
func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
LoadConfig loads the Kubernetes configuration
func NewFakeKubernetesClient ¶ added in v3.0.56
NewFakeKubernetesClient creates a fake k8s client if we have disabled kubernetes
func SortListWatchByName ¶
func ToMetaTime ¶ added in v3.0.26
ToMetaTime converts the go time pointer to a meta time