Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions e2e/tests/hooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ var _ = DevSpaceDescribe("hooks", func() {
// check namespace hook
framework.ExpectLocalFileContentsImmediately("namespace.txt", ns)

// check space hook
framework.ExpectLocalFileContentsImmediately("space.txt", ns)

// stop second command
cancel2()

Expand Down
1 change: 1 addition & 0 deletions e2e/tests/hooks/testdata/once/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ deployments:
hooks:
- command: |
echo -n $DEVSPACE_NAMESPACE > namespace.txt
echo -n $DEVSPACE_SPACE > space.txt
events: ["after:deploy"]
- command: |
mkdir -p /app
Expand Down
3 changes: 3 additions & 0 deletions pkg/devspace/config/loader/variable/predefined_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func init() {
predefinedVars["devspace.git.commit"] = predefinedVars["DEVSPACE_GIT_COMMIT"]
predefinedVars["devspace.context"] = predefinedVars["DEVSPACE_CONTEXT"]
predefinedVars["devspace.namespace"] = predefinedVars["DEVSPACE_NAMESPACE"]

// support migrating DevSpace Cloud users
predefinedVars["DEVSPACE_SPACE"] = predefinedVars["DEVSPACE_NAMESPACE"]
}

func IsPredefinedVariable(name string) bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/devspace/config/loader/variable/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/pkg/errors"
)

var AlwaysResolvePredefinedVars = []string{"DEVSPACE_NAME", "DEVSPACE_EXECUTABLE", "DEVSPACE_KUBECTL_EXECUTABLE", "DEVSPACE_TMPDIR", "DEVSPACE_VERSION", "DEVSPACE_RANDOM", "DEVSPACE_PROFILE", "DEVSPACE_PROFILES", "DEVSPACE_USER_HOME", "DEVSPACE_TIMESTAMP", "devspace.context", "DEVSPACE_CONTEXT", "devspace.namespace", "DEVSPACE_NAMESPACE"}
var AlwaysResolvePredefinedVars = []string{"DEVSPACE_NAME", "DEVSPACE_EXECUTABLE", "DEVSPACE_KUBECTL_EXECUTABLE", "DEVSPACE_TMPDIR", "DEVSPACE_VERSION", "DEVSPACE_RANDOM", "DEVSPACE_PROFILE", "DEVSPACE_PROFILES", "DEVSPACE_USER_HOME", "DEVSPACE_TIMESTAMP", "devspace.context", "DEVSPACE_CONTEXT", "devspace.namespace", "DEVSPACE_NAMESPACE", "DEVSPACE_SPACE"}

// NewResolver creates a new resolver that caches resolved variables in memory and in the provided cache
func NewResolver(localCache localcache.Cache, predefinedVariableOptions *PredefinedVariableOptions, flags []string, log log.Logger) (Resolver, error) {
Expand Down