Skip to content

Commit 4b2d1e3

Browse files
committed
create Vars
1 parent be6bf58 commit 4b2d1e3

File tree

3 files changed

+8417
-3757
lines changed

3 files changed

+8417
-3757
lines changed

cmd/ctrlc/root/api/upsert/deploymentversion/deployment-version.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,23 @@ func NewUpsertDeploymentVersionCmd() *cobra.Command {
8686
if err != nil {
8787
return fmt.Errorf("failed to convert deployment version status: %w", err)
8888
}
89+
if stat == nil {
90+
s := api.DeploymentVersionStatusReady
91+
stat = &s
92+
}
8993

9094
workspaceID := client.GetWorkspaceID(cmd.Context(), workspace)
9195

9296
config := cliutil.ConvertConfigArrayToNestedMap(configArray)
9397
var response *http.Response
9498
for _, id := range deploymentID {
95-
resp, err := client.UpsertDeploymentVersion(cmd.Context(), workspaceID.String(), id, api.UpsertDeploymentVersionJSONRequestBody{
99+
resp, err := client.CreateDeploymentVersion(cmd.Context(), workspaceID.String(), id, api.CreateDeploymentVersionJSONRequestBody{
96100
Tag: tag,
97-
DeploymentId: id,
98101
Metadata: &metadata,
99102
CreatedAt: parsedTime,
100103
Config: &config,
101-
Name: &name,
102-
Status: stat,
104+
Name: name,
105+
Status: *stat,
103106
})
104107
if err != nil {
105108
return fmt.Errorf("failed to create deployment version: %w", err)

0 commit comments

Comments
 (0)