File tree Expand file tree Collapse file tree 2 files changed +56
-1
lines changed
pkg/devspace/deploy/deployer/helm Expand file tree Collapse file tree 2 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package helm
33import (
44 "fmt"
55 devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
6+ "github.com/loft-sh/devspace/pkg/devspace/helm/types"
67
78 "github.com/loft-sh/devspace/pkg/devspace/deploy/deployer"
89 "github.com/loft-sh/devspace/pkg/devspace/helm"
@@ -44,7 +45,7 @@ func (d *DeployConfig) Status(ctx devspacecontext.Context) (*deployer.StatusResu
4445 }
4546
4647 for _ , release := range releases {
47- if release . Name == d . DeploymentConfig . Name {
48+ if d . matchesRelease ( release ) {
4849 if release .Status != "DEPLOYED" {
4950 return & deployer.StatusResult {
5051 Name : d .DeploymentConfig .Name ,
@@ -83,3 +84,12 @@ func (d *DeployConfig) getDeployTarget() string {
8384
8485 return retString
8586}
87+ func (d * DeployConfig ) matchesRelease (release * types.Release ) bool {
88+ if d .DeploymentConfig .Name == release .Name {
89+ return true
90+ }
91+ if d .DeploymentConfig .Helm != nil && d .DeploymentConfig .Helm .ReleaseName == release .Name {
92+ return true
93+ }
94+ return false
95+ }
Original file line number Diff line number Diff line change @@ -30,6 +30,51 @@ type statusTestCase struct {
3030
3131func TestStatus (t * testing.T ) {
3232 testCases := []statusTestCase {
33+ {
34+ name : "Deployment successful" ,
35+ deployment : "deployed" ,
36+ releases : []* helmtypes.Release {
37+ {
38+ Name : "deployed" ,
39+ Status : "DEPLOYED" ,
40+ },
41+ },
42+ helmConfig : & latest.HelmConfig {
43+ Chart : & latest.ChartConfig {
44+ Name : "chartName" ,
45+ Version : "chartVersion" ,
46+ },
47+ },
48+ expectedStatus : deployer.StatusResult {
49+ Name : "deployed" ,
50+ Type : "Helm" ,
51+ Target : "chartName (chartVersion)" ,
52+ Status : "Deployed" ,
53+ },
54+ },
55+ {
56+ name : "helmReleaseName" ,
57+ deployment : "deployment" ,
58+ releases : []* helmtypes.Release {
59+ {
60+ Name : "releaseName" ,
61+ Status : "DEPLOYED" ,
62+ },
63+ },
64+ helmConfig : & latest.HelmConfig {
65+ ReleaseName : "releaseName" ,
66+ Chart : & latest.ChartConfig {
67+ Name : "chartName" ,
68+ Version : "chartVersion" ,
69+ },
70+ },
71+ expectedStatus : deployer.StatusResult {
72+ Name : "deployment" ,
73+ Type : "Helm" ,
74+ Target : "chartName (chartVersion)" ,
75+ Status : "Deployed" ,
76+ },
77+ },
3378 {
3479 name : "No releases" ,
3580 deployment : "depl" ,
You can’t perform that action at this time.
0 commit comments