@@ -129,7 +129,7 @@ func TestAccCodefreshContextSecretYaml(t *testing.T) {
129
129
CheckDestroy : testAccCheckCodefreshContextDestroy ,
130
130
Steps : []resource.TestStep {
131
131
{
132
- Config : testAccCodefreshContextSecretYaml (name , "rootKey" , "plainKey" , "plainValue" , "listKey" , "listValue1" , "listValue2" ),
132
+ Config : testAccCodefreshContextSecretYaml (name , "rootKey" , "plainKey" , "plainValue" , "listKey" , "listValue1" , "listValue2" , true ),
133
133
Check : resource .ComposeTestCheckFunc (
134
134
testAccCheckCodefreshContextExists (resourceName ),
135
135
resource .TestCheckResourceAttr (resourceName , "name" , name ),
@@ -159,7 +159,7 @@ func testAccCheckCodefreshContextExists(resource string) resource.TestCheckFunc
159
159
contextID := rs .Primary .ID
160
160
161
161
apiClient := testAccProvider .Meta ().(* cfclient.Client )
162
- _ , err := apiClient .GetContext (contextID , true )
162
+ _ , err := apiClient .GetContext (contextID , false )
163
163
164
164
if err != nil {
165
165
return fmt .Errorf ("error fetching context with ID %s. %s" , contextID , err )
@@ -177,7 +177,7 @@ func testAccCheckCodefreshContextDestroy(s *terraform.State) error {
177
177
continue
178
178
}
179
179
180
- _ , err := apiClient .GetContext (rs .Primary .ID , true )
180
+ _ , err := apiClient .GetContext (rs .Primary .ID , false )
181
181
182
182
if err == nil {
183
183
return fmt .Errorf ("Alert still exists" )
@@ -249,18 +249,20 @@ resource "codefresh_context" "test" {
249
249
` , rName , rootKey , plainKey , plainValue , listKey , listValue1 , listValue2 )
250
250
}
251
251
252
- func testAccCodefreshContextSecretYaml (rName , rootKey , plainKey , plainValue , listKey , listValue1 , listValue2 string ) string {
252
+ func testAccCodefreshContextSecretYaml (rName , rootKey , plainKey , plainValue , listKey , listValue1 , listValue2 string , decryptSpec bool ) string {
253
253
254
254
return fmt .Sprintf (`
255
255
resource "codefresh_context" "test" {
256
256
257
257
name = "%s"
258
258
259
+ decrypt_spec = %v
260
+
259
261
spec {
260
262
secretyaml {
261
263
data = "%s: \n %s: %s\n %s: \n - %s\n - %s"
262
264
}
263
265
}
264
266
}
265
- ` , rName , rootKey , plainKey , plainValue , listKey , listValue1 , listValue2 )
267
+ ` , rName , decryptSpec , rootKey , plainKey , plainValue , listKey , listValue1 , listValue2 )
266
268
}
0 commit comments