Skip to content

Commit 1d6f00c

Browse files
committed
fix: set namespace when running kubectl apply
1 parent 717d446 commit 1d6f00c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/wandb/cdk8s/release/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ func (r GitRelease) Apply(
6565
owner v1.Object,
6666
scheme *runtime.Scheme,
6767
) error {
68-
return KubectlApply(r.Directory())
68+
return KubectlApply(r.Directory(), owner.GetNamespace())
6969
}

pkg/wandb/cdk8s/release/kubectl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"path"
77
)
88

9-
func KubectlApply(dir string) error {
9+
func KubectlApply(dir string, namespace string) error {
1010
folder := path.Join(dir, "dist")
11-
cmd := exec.Command("kubectl", "apply", "-f", folder, "--prune", "-l", "app=wandb")
11+
cmd := exec.Command("kubectl", "apply", "-f", folder, "--prune", "-l", "app=wandb", "-n", namespace)
1212
cmd.Dir = dir
1313
output, err := cmd.CombinedOutput()
1414
fmt.Println(string(output))

pkg/wandb/cdk8s/release/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ func (r LocalRelease) Apply(
4343
owner v1.Object,
4444
scheme *runtime.Scheme,
4545
) error {
46-
return KubectlApply(r.Directory())
46+
return KubectlApply(r.Directory(), owner.GetNamespace())
4747
}

0 commit comments

Comments
 (0)