jxenv

package
v3.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 15 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultDevEnvironment

func CreateDefaultDevEnvironment(ns string) *v1.Environment

CreateDefaultDevEnvironment creates a default development environment

func EnsureDevEnvironmentSetup

func EnsureDevEnvironmentSetup(jxClient versioned.Interface, ns string) (*v1.Environment, error)

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 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 GetDevEnvGitOwner

func GetDevEnvGitOwner(jxClient versioned.Interface) (string, error)

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

func GetDevEnvTeamSettings(jxClient versioned.Interface, ns string) (*v1.TeamSettings, error)

GetDevEnvTeamSettings gets the team settings from the specified namespace.

func GetDevEnvironment

func GetDevEnvironment(jxClient versioned.Interface, ns string) (*v1.Environment, error)

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

func GetDevNamespace(kubeClient kubernetes.Interface, ns string) (string, string, error)

GetDevNamespace returns the developer environment namespace which is the namespace that contains the Environments and the developer tools like Jenkins

func GetEditEnvironmentNamespace

func GetEditEnvironmentNamespace(jxClient versioned.Interface, ns string) (string, error)

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

func GetEnvironment(jxClient versioned.Interface, ns string, name string) (*v1.Environment, error)

GetEnvironment find an environment by name

func GetEnvironmentNames

func GetEnvironmentNames(jxClient versioned.Interface, ns string) ([]string, error)

GetEnvironmentNames returns the sorted list of environment names

func GetEnvironmentNamespace

func GetEnvironmentNamespace(jxClient versioned.Interface, ns, environment string) (string, error)

GetEnvironments returns the namespace name for a given environment

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 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 GetPermanentEnvironments

func GetPermanentEnvironments(jxClient versioned.Interface, ns string) ([]*v1.Environment, error)

GetPermanentEnvironments returns a list with the current permanent environments

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 GetRepositoryGitURL added in v3.0.4

func GetRepositoryGitURL(s *v1.SourceRepository) (string, error)

GetRepositoryGitURL returns the git repository clone URL

func GetTeams

func GetTeams(kubeClient kubernetes.Interface) ([]*corev1.Namespace, []string, error)

GetTeams returns the Teams the user is a member of

func IsIncludedInTheGivenEnvs added in v3.0.4

func IsIncludedInTheGivenEnvs(environments map[string]*v1.Environment, repository *v1.SourceRepository) bool

IsIncludedInTheGivenEnvs returns true if the given repository is an environment repository

func IsPermanentEnvironment

func IsPermanentEnvironment(env *v1.Environment) bool

IsPermanentEnvironment indicates if an environment is permanent

func IsPreviewEnvironment

func IsPreviewEnvironment(env *v1.Environment) bool

func ModifyDevEnvironment

func ModifyDevEnvironment(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, callback func(env *v1.Environment) error) error

ModifyDevEnvironment modifies the dev environment

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 SortActivities

func SortActivities(activities []v1.PipelineActivity)

SortActivities sorts a list of PipelineActivities

func SortEnvironments

func SortEnvironments(environments []v1.Environment)

Types

type ByOrder

type ByOrder []v1.Environment

func (ByOrder) Len

func (a ByOrder) Len() int

func (ByOrder) Less

func (a ByOrder) Less(i, j int) bool

func (ByOrder) Swap

func (a ByOrder) Swap(i, j int)

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 ResolveChartMuseumURLFn

type ResolveChartMuseumURLFn func() (string, error)

ResolveChartMuseumURLFn used to resolve the chart repository URL if using remote environments

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL