Skip to content

Commit 6d63168

Browse files
committed
Removes the superfluous update func now that we are calcualting stored date diff in read
1 parent f95000e commit 6d63168

File tree

4 files changed

+4
-18
lines changed

4 files changed

+4
-18
lines changed

github/resource_github_actions_organization_secret.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ func resourceGithubActionsOrganizationSecret() *schema.Resource {
1616
return &schema.Resource{
1717
Create: resourceGithubActionsOrganizationSecretCreateOrUpdate,
1818
Read: resourceGithubActionsOrganizationSecretRead,
19-
Update: resourceGithubActionsOrganizationSecretCreateOrUpdate,
2019
Delete: resourceGithubActionsOrganizationSecretDelete,
2120
Importer: &schema.ResourceImporter{
2221
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {

github/resource_github_actions_organization_secret_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,9 @@ func TestAccGithubActionsOrganizationSecret(t *testing.T) {
268268
}
269269
})
270270

271-
t.Run("destroy_on_drift requires ForceNew due to Update function", func(t *testing.T) {
272-
// Test that destroy_on_drift field has ForceNew: true
273-
// This is required because we have an Update function defined
271+
t.Run("destroy_on_drift field defaults", func(t *testing.T) {
272+
// Test that destroy_on_drift defaults to true for backward compatibility
274273
schema := resourceGithubActionsOrganizationSecret().Schema["destroy_on_drift"]
275-
if !schema.ForceNew {
276-
t.Error("destroy_on_drift field must have ForceNew: true when Update function is defined, to avoid 'Provider produced inconsistent result' errors")
277-
}
278-
279-
// Test that it defaults to true
280274
if schema.Default != true {
281275
t.Error("destroy_on_drift should default to true for backward compatibility")
282276
}

github/resource_github_actions_secret.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ func resourceGithubActionsSecret() *schema.Resource {
1717
return &schema.Resource{
1818
Create: resourceGithubActionsSecretCreateOrUpdate,
1919
Read: resourceGithubActionsSecretRead,
20-
Update: resourceGithubActionsSecretCreateOrUpdate,
2120
Delete: resourceGithubActionsSecretDelete,
2221
Importer: &schema.ResourceImporter{
2322
State: resourceGithubActionsSecretImport,

github/resource_github_actions_secret_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,15 +513,9 @@ func TestGithubActionsSecretDriftDetection(t *testing.T) {
513513
}
514514
})
515515

516-
t.Run("destroy_on_drift requires ForceNew due to Update function", func(t *testing.T) {
517-
// Test that destroy_on_drift field has ForceNew: true
518-
// This is required because we have an Update function defined
516+
t.Run("destroy_on_drift field defaults", func(t *testing.T) {
517+
// Test that destroy_on_drift defaults to true for backward compatibility
519518
schema := resourceGithubActionsSecret().Schema["destroy_on_drift"]
520-
if !schema.ForceNew {
521-
t.Error("destroy_on_drift field must have ForceNew: true when Update function is defined, to avoid 'Provider produced inconsistent result' errors")
522-
}
523-
524-
// Test that it defaults to true
525519
if schema.Default != true {
526520
t.Error("destroy_on_drift should default to true for backward compatibility")
527521
}

0 commit comments

Comments
 (0)