Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeprecatedInferName ¶
DeprecatedInferName infers the dev environment name from the folder received as parameter. It is deprecated as it doesn't take into account deployed dev environments to get the non-sanitized name. This is only being effectively used in push command, which will be deleted in the next major version
Types ¶
type NameInferer ¶
type NameInferer struct {
// contains filtered or unexported fields
}
NameInferer Allows to infer the name for a dev environment
func NewNameInferer ¶
func NewNameInferer(k8s kubernetes.Interface) NameInferer
NewNameInferer allows to create a new instance of a name inferer
func (NameInferer) InferName ¶
func (n NameInferer) InferName(ctx context.Context, cwd, namespace, manifestPath string) string
InferName infers the dev environment name from the folder received as parameter. It has the following preference:
- If cwd (current working directory) contains a repo, we look for a dev environment deployed with the same repository and the same manifest path, and we took the name from the config map
- If not dev environment is found, we use the repository name to infer the dev environment name
- If the current working directory doesn't have a repository, we get the name from the folder name
`manifestPath` is needed because we compare it with the one in dev environments to see if it is the dev environment we look for
func (NameInferer) InferNameFromDevEnvsAndRepository ¶
func (n NameInferer) InferNameFromDevEnvsAndRepository(ctx context.Context, repoURL, namespace, manifestPath, discoveredFile string) string
InferNameFromDevEnvsAndRepository it infers the name from the development environments deployed in the specified namespace or from the git repository URL if no dev environment is found. `manifestPath` is needed because we compare it with the one in dev environments to see if it is the dev environment we look for