Skip to content

Commit

Permalink
Merge pull request #2160 from tukobadnyanoba/add-release-name-in-envi…
Browse files Browse the repository at this point in the history
…ronment-variable

replaced name in helm with releaseName field
  • Loading branch information
FabianKramm authored Jul 6, 2022
2 parents e2f796d + 568b84c commit 7479e66
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pkg/devspace/config/versions/latest/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,8 @@ type RollingUpdateConfig struct {

// HelmConfig defines the specific helm options used during deployment
type HelmConfig struct {
// ReleaseName of the helm configuration
ReleaseName string `yaml:"releaseName,omitempty" json:"releaseName,omitempty"`
// Chart holds the chart configuration and where DevSpace can find the chart
Chart *ChartConfig `yaml:"chart,omitempty" json:"chart,omitempty" jsonschema:"required"`
// Values are additional values that should get passed to deploying this chart
Expand Down
19 changes: 14 additions & 5 deletions pkg/devspace/deploy/deployer/helm/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ import (

// Deploy deploys the given deployment with helm
func (d *DeployConfig) Deploy(ctx devspacecontext.Context, forceDeploy bool) (bool, error) {
var (
var releaseName string
if d.DeploymentConfig.Helm.ReleaseName != "" {
releaseName = d.DeploymentConfig.Helm.ReleaseName
} else {
releaseName = d.DeploymentConfig.Name
chartPath = d.DeploymentConfig.Helm.Chart.Name
hash = ""
}

var (
chartPath = d.DeploymentConfig.Helm.Chart.Name
hash = ""
)

releaseNamespace := ctx.KubeClient().Namespace()
Expand Down Expand Up @@ -152,9 +158,12 @@ func (d *DeployConfig) Deploy(ctx devspacecontext.Context, forceDeploy bool) (bo
}

func (d *DeployConfig) internalDeploy(ctx devspacecontext.Context, overwriteValues map[string]interface{}, out io.Writer) (*types.Release, error) {
var (
var releaseName string
if d.DeploymentConfig.Helm.ReleaseName != "" {
releaseName = d.DeploymentConfig.Helm.ReleaseName
} else {
releaseName = d.DeploymentConfig.Name
)
}
releaseNamespace := ctx.KubeClient().Namespace()
if d.DeploymentConfig.Namespace != "" {
releaseNamespace = d.DeploymentConfig.Namespace
Expand Down

0 comments on commit 7479e66

Please sign in to comment.