Skip to content

Commit

Permalink
Renamed components property, set it as array
Browse files Browse the repository at this point in the history
  • Loading branch information
satr committed Jan 19, 2024
1 parent 90e4351 commit 88ea484
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7,741 deletions.
18 changes: 8 additions & 10 deletions api/applications/models/pipeline_parameters.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package models

import (
"strings"

jobModels "github.com/equinor/radix-api/api/jobs/models"
)

Expand Down Expand Up @@ -127,20 +125,20 @@ type PipelineParametersDeploy struct {
// example: 4faca8595c5283a9d0f17a623b9255a0d9866a2e
CommitID string `json:"commitID,omitempty"`

// Components List of components to deploy
// ComponentsToDeploy List of components to deploy
// OPTIONAL If specified, only these components are deployed
//
// example: component1,component2
Components string `json:"components,omitempty"`
// required: false
ComponentsToDeploy []string `json:"componentsToDeploy"`
}

// MapPipelineParametersDeployToJobParameter maps to JobParameter
func (deployParam PipelineParametersDeploy) MapPipelineParametersDeployToJobParameter() *jobModels.JobParameters {
return &jobModels.JobParameters{
ToEnvironment: deployParam.ToEnvironment,
TriggeredBy: deployParam.TriggeredBy,
ImageTagNames: deployParam.ImageTagNames,
CommitID: deployParam.CommitID,
Components: strings.Split(deployParam.Components, ","),
ToEnvironment: deployParam.ToEnvironment,
TriggeredBy: deployParam.TriggeredBy,
ImageTagNames: deployParam.ImageTagNames,
CommitID: deployParam.CommitID,
ComponentsToDeploy: deployParam.ComponentsToDeploy,
}
}
2 changes: 1 addition & 1 deletion api/jobs/models/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func GetJobFromRadixJob(job *radixv1.RadixJob, jobDeployments []*deploymentModel
case radixv1.Deploy:
jobModel.ImageTagNames = job.Spec.Deploy.ImageTagNames
jobModel.CommitID = job.Spec.Deploy.CommitID
jobModel.ComponentsToDeploy = job.Spec.Deploy.Components
jobModel.ComponentsToDeploy = job.Spec.Deploy.ComponentsToDeploy
case radixv1.Promote:
jobModel.PromotedFromDeployment = job.Spec.Promote.DeploymentName
jobModel.PromotedFromEnvironment = job.Spec.Promote.FromEnvironment
Expand Down
6 changes: 3 additions & 3 deletions api/jobs/models/job_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ type JobParameters struct {
// example: component1=tag1,component2=tag2
ImageTagNames map[string]string

// Components List of components to deploy
// ComponentsToDeploy List of components to deploy
// OPTIONAL If specified, only these components are deployed
//
// example: component1,component2
Components []string
// required: false
ComponentsToDeploy []string `json:"componentsToDeploy"`
}

// GetPushImageTag Represents boolean as 1 or 0
Expand Down
8 changes: 4 additions & 4 deletions api/jobs/start_job_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ func (jh JobHandler) buildPipelineJob(appName, cloneURL, radixConfigFullName str
}
case v1.Deploy:
deploySpec = v1.RadixDeploySpec{
ToEnvironment: jobSpec.ToEnvironment,
ImageTagNames: jobSpec.ImageTagNames,
CommitID: jobSpec.CommitID,
Components: jobSpec.Components,
ToEnvironment: jobSpec.ToEnvironment,
ImageTagNames: jobSpec.ImageTagNames,
CommitID: jobSpec.CommitID,
ComponentsToDeploy: jobSpec.ComponentsToDeploy,
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/equinor/radix-common v1.8.0
github.com/equinor/radix-job-scheduler v1.8.5
github.com/equinor/radix-operator v1.49.1-0.20240116123121-b7148c5ca4dd
github.com/equinor/radix-operator v1.49.1-0.20240119121633-3435bfbfc02c
github.com/evanphx/json-patch/v5 v5.7.0
github.com/go-swagger/go-swagger v0.30.5
github.com/golang-jwt/jwt/v4 v4.5.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ github.com/equinor/radix-operator v1.49.0 h1:yNdb0zocBw7GdWybAGUm2lWmk6I+xeeCjvr
github.com/equinor/radix-operator v1.49.0/go.mod h1:i8A6V/g1OM+Zk2lAASZaoX+lHdJIZYYZHA586SHB2p8=
github.com/equinor/radix-operator v1.49.1-0.20240116123121-b7148c5ca4dd h1:0WsH5+0vu9k1AFV8Whux2VrtawqjA1tKWseEo1D7siQ=
github.com/equinor/radix-operator v1.49.1-0.20240116123121-b7148c5ca4dd/go.mod h1:i8A6V/g1OM+Zk2lAASZaoX+lHdJIZYYZHA586SHB2p8=
github.com/equinor/radix-operator v1.49.1-0.20240118144607-04eaef7b60d0 h1:QtaXzPoaRBaSoVA5g/KUDTcujf6x7kz/Mx5O052gxdQ=
github.com/equinor/radix-operator v1.49.1-0.20240118144607-04eaef7b60d0/go.mod h1:i8A6V/g1OM+Zk2lAASZaoX+lHdJIZYYZHA586SHB2p8=
github.com/equinor/radix-operator v1.49.1-0.20240119121633-3435bfbfc02c h1:jXUXYMZCzYyGEhZg6RfrRLHfS9uxV++Y+z//b88S6cI=
github.com/equinor/radix-operator v1.49.1-0.20240119121633-3435bfbfc02c/go.mod h1:i8A6V/g1OM+Zk2lAASZaoX+lHdJIZYYZHA586SHB2p8=
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.7.0 h1:nJqP7uwL84RJInrohHfW0Fx3awjbm8qZeFv0nW9SYGc=
Expand Down
Loading

0 comments on commit 88ea484

Please sign in to comment.