@@ -90,10 +90,10 @@ func TestAccCodefreshPipeline_PremitRestartFromFailedSteps(t *testing.T) {
90
90
CheckDestroy : testAccCheckCodefreshPipelineDestroy ,
91
91
Steps : []resource.TestStep {
92
92
{
93
- Config : testAccCodefreshPipelineBasicConfigPermitRestartFromFailedSteps (name , "codefresh-contrib/react-sample-app" , "./codefresh.yml" , "master" , "git" , ptrBool ( true ) ),
93
+ Config : testAccCodefreshPipelineBasicConfigPermitRestartFromFailedSteps (name , "codefresh-contrib/react-sample-app" , "./codefresh.yml" , "master" , "git" , PermitRestartPermit ),
94
94
Check : resource .ComposeTestCheckFunc (
95
95
testAccCheckCodefreshPipelineExists (resourceName , & pipeline ),
96
- resource .TestCheckResourceAttr (resourceName , "spec.0.permit_restart_from_failed_steps" , "true" ),
96
+ resource .TestCheckResourceAttr (resourceName , "spec.0.permit_restart_from_failed_steps" , PermitRestartPermit ),
97
97
),
98
98
},
99
99
{
@@ -102,10 +102,22 @@ func TestAccCodefreshPipeline_PremitRestartFromFailedSteps(t *testing.T) {
102
102
ImportStateVerify : true ,
103
103
},
104
104
{
105
- Config : testAccCodefreshPipelineBasicConfigPermitRestartFromFailedSteps (name , "codefresh-contrib/react-sample-app" , "./codefresh.yml" , "master" , "git" , ptrBool ( false ) ),
105
+ Config : testAccCodefreshPipelineBasicConfigPermitRestartFromFailedSteps (name , "codefresh-contrib/react-sample-app" , "./codefresh.yml" , "master" , "git" , PermitRestartForbid ),
106
106
Check : resource .ComposeTestCheckFunc (
107
107
testAccCheckCodefreshPipelineExists (resourceName , & pipeline ),
108
- resource .TestCheckResourceAttr (resourceName , "spec.0.permit_restart_from_failed_steps" , "false" ),
108
+ resource .TestCheckResourceAttr (resourceName , "spec.0.permit_restart_from_failed_steps" , PermitRestartForbid ),
109
+ ),
110
+ },
111
+ {
112
+ ResourceName : resourceName ,
113
+ ImportState : true ,
114
+ ImportStateVerify : true ,
115
+ },
116
+ {
117
+ Config : testAccCodefreshPipelineBasicConfigPermitRestartFromFailedSteps (name , "codefresh-contrib/react-sample-app" , "./codefresh.yml" , "master" , "git" , PermitRestartUseAccountSettings ),
118
+ Check : resource .ComposeTestCheckFunc (
119
+ testAccCheckCodefreshPipelineExists (resourceName , & pipeline ),
120
+ resource .TestCheckResourceAttr (resourceName , "spec.0.permit_restart_from_failed_steps" , PermitRestartUseAccountSettings ),
109
121
),
110
122
},
111
123
},
@@ -1070,7 +1082,7 @@ resource "codefresh_pipeline" "test" {
1070
1082
` , rName , repo , path , revision , context , concurrency , concurrencyBranch , concurrencyTrigger )
1071
1083
}
1072
1084
1073
- func testAccCodefreshPipelineBasicConfigPermitRestartFromFailedSteps (rName string , repo string , path string , revision string , context string , permitRestartFromFailedSteps * bool ) string {
1085
+ func testAccCodefreshPipelineBasicConfigPermitRestartFromFailedSteps (rName string , repo string , path string , revision string , context string , permitRestartFromFailedSteps string ) string {
1074
1086
return fmt .Sprintf (`
1075
1087
resource "codefresh_pipeline" "test" {
1076
1088
@@ -1090,11 +1102,11 @@ resource "codefresh_pipeline" "test" {
1090
1102
context = %q
1091
1103
}
1092
1104
1093
- permit_restart_from_failed_steps = %t
1105
+ permit_restart_from_failed_steps = %s
1094
1106
1095
1107
}
1096
1108
}
1097
- ` , rName , repo , path , revision , context , * permitRestartFromFailedSteps )
1109
+ ` , rName , repo , path , revision , context , permitRestartFromFailedSteps )
1098
1110
}
1099
1111
1100
1112
func testAccCodefreshPipelineBasicConfigTriggers (
0 commit comments