Skip to content

Commit cab7b81

Browse files
committed
fix: minor upgrades disabled as not ready in production yet
1 parent cb427c0 commit cab7b81

File tree

5 files changed

+56
-53
lines changed

5 files changed

+56
-53
lines changed

.github/workflows/terraform_provider_pr.yml

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,28 @@ jobs:
5656
name: go build
5757
run: go build -o terraform-plugin-dir/registry.terraform.io/RedisLabs/rediscloud/99.99.99/$(go env GOOS)_$(go env GOARCH)/terraform-provider-rediscloud .
5858

59+
go_unit_test:
60+
name: go unit test
61+
needs: [go_build]
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
66+
with:
67+
go-version-file: go.mod
68+
- run: go test ./... -run="^TestUnit" # Runs tests starting with TestUnit
69+
70+
tfproviderlint:
71+
name: tfproviderlint
72+
needs: [go_build]
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
76+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
77+
with:
78+
go-version-file: go.mod
79+
- run: make tfproviderlint
80+
5981
terraform_providers_schema:
6082
name: terraform providers schema
6183
needs: [go_build]
@@ -102,20 +124,21 @@ jobs:
102124
mkdir terraform-providers-schema
103125
terraform providers schema -json > terraform-providers-schema/schema.json
104126
105-
go_test_smoke_aa_db:
106-
name: go test smoke aa db
107-
needs: [go_build]
127+
# All acceptance tests run in parallel after quick tests
128+
go_test_smoke_aa_tgw_attachment:
129+
name: go test smoke aa tgw attachment
130+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
108131
runs-on: ubuntu-latest
109132
steps:
110133
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
111134
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
112135
with:
113136
go-version-file: go.mod
114-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveDatabase_CRUDI"'
137+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveTransitGatewayAttachment_CRUDI"'
115138

116139
go_test_smoke_aa_enable_default_user:
117140
name: go test smoke aa enable default user
118-
needs: [go_build]
141+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
119142
runs-on: ubuntu-latest
120143
steps:
121144
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -124,20 +147,20 @@ jobs:
124147
go-version-file: go.mod
125148
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveDatabase_enableDefaultUser"'
126149

127-
go_test_smoke_aa_tgw_attachment:
128-
name: go test smoke aa tgw attachment
129-
needs: [go_build]
150+
go_test_smoke_aa_db:
151+
name: go test smoke aa db
152+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
130153
runs-on: ubuntu-latest
131154
steps:
132155
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
133156
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
134157
with:
135158
go-version-file: go.mod
136-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveTransitGatewayAttachment_CRUDI"'
159+
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveDatabase_CRUDI"'
137160

138161
go_test_smoke_essentials_sub:
139162
name: go test smoke essentials sub
140-
needs: [go_build]
163+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
141164
runs-on: ubuntu-latest
142165
steps:
143166
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -161,7 +184,7 @@ jobs:
161184

162185
go_test_smoke_pro_db:
163186
name: go test smoke pro db
164-
needs: [go_build]
187+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
165188
runs-on: ubuntu-latest
166189
steps:
167190
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -173,7 +196,7 @@ jobs:
173196

174197
go_test_smoke_misc:
175198
name: go test smoke misc
176-
needs: [ go_build ]
199+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
177200
runs-on: ubuntu-latest
178201
steps:
179202
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -184,7 +207,7 @@ jobs:
184207

185208
go_test_pro_db_upgrade:
186209
name: go test smoke pro db upgrade
187-
needs: [ go_build ]
210+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
188211
runs-on: ubuntu-latest
189212
steps:
190213
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -195,7 +218,7 @@ jobs:
195218

196219
go_test_privatelink:
197220
name: go test smoke privatelink
198-
needs: [ go_build ]
221+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
199222
runs-on: ubuntu-latest
200223
steps:
201224
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -207,7 +230,7 @@ jobs:
207230

208231
go_test_block_public_endpoints:
209232
name: go test smoke public endpoints
210-
needs: [ go_build ]
233+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
211234
runs-on: ubuntu-latest
212235
steps:
213236
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -218,33 +241,11 @@ jobs:
218241

219242
go_test_smoke_qpf:
220243
name: go test smoke query performance factor
221-
needs: [ go_build ]
244+
needs: [go_unit_test, tfproviderlint, terraform_providers_schema]
222245
runs-on: ubuntu-latest
223246
steps:
224247
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
225248
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
226249
with:
227250
go-version-file: go.mod
228251
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudProDatabase_qpf"'
229-
230-
go_unit_test:
231-
name: go unit test
232-
needs: [go_build]
233-
runs-on: ubuntu-latest
234-
steps:
235-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
236-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
237-
with:
238-
go-version-file: go.mod
239-
- run: go test ./... -run="^TestUnit" # Runs tests starting with TestUnit
240-
241-
tfproviderlint:
242-
name: tfproviderlint
243-
needs: [go_build]
244-
runs-on: ubuntu-latest
245-
steps:
246-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
247-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
248-
with:
249-
go-version-file: go.mod
250-
- run: make tfproviderlint

provider/pro/resource_rediscloud_pro_database.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,8 @@ func ResourceRedisCloudProDatabase() *schema.Resource {
298298
Default: true,
299299
},
300300
"auto_minor_version_upgrade": {
301-
Description: "When 'true', enables auto minor version upgrades for this database. Default: 'true'",
302-
Type: schema.TypeBool,
303-
Optional: true,
304-
Default: true,
301+
Type: schema.TypeBool,
302+
Optional: true,
305303
},
306304
"port": {
307305
Description: "TCP port on which the database is available",
@@ -759,13 +757,12 @@ func resourceRedisCloudProDatabaseUpdate(ctx context.Context, d *schema.Resource
759757
Value: utils.GetInt(d, "throughput_measurement_value"),
760758
},
761759

762-
DataPersistence: utils.GetString(d, "data_persistence"),
763-
DataEvictionPolicy: utils.GetString(d, "data_eviction"),
764-
SourceIP: utils.SetToStringSlice(d.Get("source_ips").(*schema.Set)),
765-
Alerts: &alerts,
766-
RemoteBackup: BuildBackupPlan(d.Get("remote_backup").([]interface{}), d.Get("periodic_backup_path")),
767-
EnableDefaultUser: utils.GetBool(d, "enable_default_user"),
768-
AutoMinorVersionUpgrade: utils.GetBool(d, "auto_minor_version_upgrade"),
760+
DataPersistence: utils.GetString(d, "data_persistence"),
761+
DataEvictionPolicy: utils.GetString(d, "data_eviction"),
762+
SourceIP: utils.SetToStringSlice(d.Get("source_ips").(*schema.Set)),
763+
Alerts: &alerts,
764+
RemoteBackup: BuildBackupPlan(d.Get("remote_backup").([]interface{}), d.Get("periodic_backup_path")),
765+
EnableDefaultUser: utils.GetBool(d, "enable_default_user"),
769766
}
770767

771768
// One of the following fields must be set, validation is handled in the schema (ExactlyOneOf)
@@ -810,6 +807,11 @@ func resourceRedisCloudProDatabaseUpdate(ctx context.Context, d *schema.Resource
810807
update.Password = redis.String(d.Get("password").(string))
811808
}
812809

810+
// Only send auto_minor_version_upgrade if explicitly set
811+
if v, ok := d.GetOk("auto_minor_version_upgrade"); ok {
812+
update.AutoMinorVersionUpgrade = redis.Bool(v.(bool))
813+
}
814+
813815
update.ReplicaOf = utils.SetToStringSlice(d.Get("replica_of").(*schema.Set))
814816
if update.ReplicaOf == nil {
815817
update.ReplicaOf = make([]*string, 0)

provider/rediscloud_active_active_database_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ resource "rediscloud_active_active_subscription_database" "example" {
516516
`
517517

518518
func TestAccResourceRedisCloudActiveActiveDatabase_autoMinorVersionUpgrade(t *testing.T) {
519+
t.Skip("auto_minor_version_upgrade feature not yet available")
519520

520521
utils.AccRequiresEnvVar(t, "EXECUTE_TESTS")
521522

provider/resource_rediscloud_active_active_database.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,8 @@ func resourceRedisCloudActiveActiveDatabase() *schema.Resource {
208208
Default: true,
209209
},
210210
"auto_minor_version_upgrade": {
211-
Description: "When 'true', enables auto minor version upgrades for this database. Default: 'true'",
212-
Type: schema.TypeBool,
213-
Optional: true,
214-
Default: true,
211+
Type: schema.TypeBool,
212+
Optional: true,
215213
},
216214
"override_region": {
217215
Description: "Region-specific configuration parameters to override the global configuration",

provider/resource_rediscloud_pro_database_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ func TestAccResourceRedisCloudProDatabase_respversion(t *testing.T) {
276276
}
277277

278278
func TestAccResourceRedisCloudProDatabase_autoMinorVersionUpgrade(t *testing.T) {
279+
t.Skip("auto_minor_version_upgrade feature not yet available")
279280

280281
utils.AccRequiresEnvVar(t, "EXECUTE_TESTS")
281282

0 commit comments

Comments
 (0)