@@ -159,6 +159,14 @@ func ClouddeployDeliveryPipelineSerialPipelineStagesSchema() *schema.Resource {
159
159
Elem : & schema.Schema {Type : schema .TypeString },
160
160
},
161
161
162
+ "strategy" : {
163
+ Type : schema .TypeList ,
164
+ Optional : true ,
165
+ Description : "Optional. The strategy to use for a `Rollout` to this stage." ,
166
+ MaxItems : 1 ,
167
+ Elem : ClouddeployDeliveryPipelineSerialPipelineStagesStrategySchema (),
168
+ },
169
+
162
170
"target_id" : {
163
171
Type : schema .TypeString ,
164
172
Optional : true ,
@@ -168,6 +176,32 @@ func ClouddeployDeliveryPipelineSerialPipelineStagesSchema() *schema.Resource {
168
176
}
169
177
}
170
178
179
+ func ClouddeployDeliveryPipelineSerialPipelineStagesStrategySchema () * schema.Resource {
180
+ return & schema.Resource {
181
+ Schema : map [string ]* schema.Schema {
182
+ "standard" : {
183
+ Type : schema .TypeList ,
184
+ Optional : true ,
185
+ Description : "Standard deployment strategy executes a single deploy and allows verifying the deployment." ,
186
+ MaxItems : 1 ,
187
+ Elem : ClouddeployDeliveryPipelineSerialPipelineStagesStrategyStandardSchema (),
188
+ },
189
+ },
190
+ }
191
+ }
192
+
193
+ func ClouddeployDeliveryPipelineSerialPipelineStagesStrategyStandardSchema () * schema.Resource {
194
+ return & schema.Resource {
195
+ Schema : map [string ]* schema.Schema {
196
+ "verify" : {
197
+ Type : schema .TypeBool ,
198
+ Optional : true ,
199
+ Description : "Whether to verify a deployment." ,
200
+ },
201
+ },
202
+ }
203
+ }
204
+
171
205
func ClouddeployDeliveryPipelineConditionSchema () * schema.Resource {
172
206
return & schema.Resource {
173
207
Schema : map [string ]* schema.Schema {
@@ -184,6 +218,13 @@ func ClouddeployDeliveryPipelineConditionSchema() *schema.Resource {
184
218
Description : "Details around targets enumerated in the pipeline." ,
185
219
Elem : ClouddeployDeliveryPipelineConditionTargetsPresentConditionSchema (),
186
220
},
221
+
222
+ "targets_type_condition" : {
223
+ Type : schema .TypeList ,
224
+ Computed : true ,
225
+ Description : "Details on the whether the targets enumerated in the pipeline are of the same type." ,
226
+ Elem : ClouddeployDeliveryPipelineConditionTargetsTypeConditionSchema (),
227
+ },
187
228
},
188
229
}
189
230
}
@@ -231,6 +272,24 @@ func ClouddeployDeliveryPipelineConditionTargetsPresentConditionSchema() *schema
231
272
}
232
273
}
233
274
275
+ func ClouddeployDeliveryPipelineConditionTargetsTypeConditionSchema () * schema.Resource {
276
+ return & schema.Resource {
277
+ Schema : map [string ]* schema.Schema {
278
+ "error_details" : {
279
+ Type : schema .TypeString ,
280
+ Computed : true ,
281
+ Description : "Human readable error message." ,
282
+ },
283
+
284
+ "status" : {
285
+ Type : schema .TypeBool ,
286
+ Computed : true ,
287
+ Description : "True if the targets are all a comparable type. For example this is true if all targets are GKE clusters. This is false if some targets are Cloud Run targets and others are GKE clusters." ,
288
+ },
289
+ },
290
+ }
291
+ }
292
+
234
293
func resourceClouddeployDeliveryPipelineCreate (d * schema.ResourceData , meta interface {}) error {
235
294
config := meta .(* Config )
236
295
project , err := getProject (d , config )
@@ -534,6 +593,7 @@ func expandClouddeployDeliveryPipelineSerialPipelineStages(o interface{}) *cloud
534
593
obj := o .(map [string ]interface {})
535
594
return & clouddeploy.DeliveryPipelineSerialPipelineStages {
536
595
Profiles : expandStringArray (obj ["profiles" ]),
596
+ Strategy : expandClouddeployDeliveryPipelineSerialPipelineStagesStrategy (obj ["strategy" ]),
537
597
TargetId : dcl .String (obj ["target_id" ].(string )),
538
598
}
539
599
}
@@ -558,20 +618,74 @@ func flattenClouddeployDeliveryPipelineSerialPipelineStages(obj *clouddeploy.Del
558
618
}
559
619
transformed := map [string ]interface {}{
560
620
"profiles" : obj .Profiles ,
621
+ "strategy" : flattenClouddeployDeliveryPipelineSerialPipelineStagesStrategy (obj .Strategy ),
561
622
"target_id" : obj .TargetId ,
562
623
}
563
624
564
625
return transformed
565
626
566
627
}
567
628
629
+ func expandClouddeployDeliveryPipelineSerialPipelineStagesStrategy (o interface {}) * clouddeploy.DeliveryPipelineSerialPipelineStagesStrategy {
630
+ if o == nil {
631
+ return clouddeploy .EmptyDeliveryPipelineSerialPipelineStagesStrategy
632
+ }
633
+ objArr := o .([]interface {})
634
+ if len (objArr ) == 0 || objArr [0 ] == nil {
635
+ return clouddeploy .EmptyDeliveryPipelineSerialPipelineStagesStrategy
636
+ }
637
+ obj := objArr [0 ].(map [string ]interface {})
638
+ return & clouddeploy.DeliveryPipelineSerialPipelineStagesStrategy {
639
+ Standard : expandClouddeployDeliveryPipelineSerialPipelineStagesStrategyStandard (obj ["standard" ]),
640
+ }
641
+ }
642
+
643
+ func flattenClouddeployDeliveryPipelineSerialPipelineStagesStrategy (obj * clouddeploy.DeliveryPipelineSerialPipelineStagesStrategy ) interface {} {
644
+ if obj == nil || obj .Empty () {
645
+ return nil
646
+ }
647
+ transformed := map [string ]interface {}{
648
+ "standard" : flattenClouddeployDeliveryPipelineSerialPipelineStagesStrategyStandard (obj .Standard ),
649
+ }
650
+
651
+ return []interface {}{transformed }
652
+
653
+ }
654
+
655
+ func expandClouddeployDeliveryPipelineSerialPipelineStagesStrategyStandard (o interface {}) * clouddeploy.DeliveryPipelineSerialPipelineStagesStrategyStandard {
656
+ if o == nil {
657
+ return clouddeploy .EmptyDeliveryPipelineSerialPipelineStagesStrategyStandard
658
+ }
659
+ objArr := o .([]interface {})
660
+ if len (objArr ) == 0 || objArr [0 ] == nil {
661
+ return clouddeploy .EmptyDeliveryPipelineSerialPipelineStagesStrategyStandard
662
+ }
663
+ obj := objArr [0 ].(map [string ]interface {})
664
+ return & clouddeploy.DeliveryPipelineSerialPipelineStagesStrategyStandard {
665
+ Verify : dcl .Bool (obj ["verify" ].(bool )),
666
+ }
667
+ }
668
+
669
+ func flattenClouddeployDeliveryPipelineSerialPipelineStagesStrategyStandard (obj * clouddeploy.DeliveryPipelineSerialPipelineStagesStrategyStandard ) interface {} {
670
+ if obj == nil || obj .Empty () {
671
+ return nil
672
+ }
673
+ transformed := map [string ]interface {}{
674
+ "verify" : obj .Verify ,
675
+ }
676
+
677
+ return []interface {}{transformed }
678
+
679
+ }
680
+
568
681
func flattenClouddeployDeliveryPipelineCondition (obj * clouddeploy.DeliveryPipelineCondition ) interface {} {
569
682
if obj == nil || obj .Empty () {
570
683
return nil
571
684
}
572
685
transformed := map [string ]interface {}{
573
686
"pipeline_ready_condition" : flattenClouddeployDeliveryPipelineConditionPipelineReadyCondition (obj .PipelineReadyCondition ),
574
687
"targets_present_condition" : flattenClouddeployDeliveryPipelineConditionTargetsPresentCondition (obj .TargetsPresentCondition ),
688
+ "targets_type_condition" : flattenClouddeployDeliveryPipelineConditionTargetsTypeCondition (obj .TargetsTypeCondition ),
575
689
}
576
690
577
691
return []interface {}{transformed }
@@ -604,3 +718,16 @@ func flattenClouddeployDeliveryPipelineConditionTargetsPresentCondition(obj *clo
604
718
return []interface {}{transformed }
605
719
606
720
}
721
+
722
+ func flattenClouddeployDeliveryPipelineConditionTargetsTypeCondition (obj * clouddeploy.DeliveryPipelineConditionTargetsTypeCondition ) interface {} {
723
+ if obj == nil || obj .Empty () {
724
+ return nil
725
+ }
726
+ transformed := map [string ]interface {}{
727
+ "error_details" : obj .ErrorDetails ,
728
+ "status" : obj .Status ,
729
+ }
730
+
731
+ return []interface {}{transformed }
732
+
733
+ }
0 commit comments