Skip to content

Commit

Permalink
Fix & Clean comments
Browse files Browse the repository at this point in the history
  • Loading branch information
piroux-sg committed Mar 14, 2024
1 parent d063d27 commit adfdf67
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
10 changes: 2 additions & 8 deletions internal/provider/api_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,8 @@ func (obj *api_object) read_object_from_listall() error {
return err
}

/*
TODO:
- Unmarshal
- Find data msg key
- Iterate over array of Secrets
- Create internal limited secret struct if it finds the ResourceName -- needed if no update ?
- No update of the state
*/
// NOTE: If another resource beyond Secret need to use the listall path for read purposes,
// a type switch deriving the resource type from the get_path shall be added here.

type secretListAllResponse struct {
Msg []struct {
Expand Down
4 changes: 1 addition & 3 deletions internal/provider/secret_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

func resourceStackGuardianSecretAPI() *schema.Resource {
// Consider data sensitive if env variables is set to true.
is_data_sensitive := true

return &schema.Resource{
Expand Down Expand Up @@ -84,7 +83,7 @@ func resourceStackGuardianSecretAPIImport(d *schema.ResourceData, meta interface
log.Printf("resource_api_object.go: Import routine called. Object built:\n%s\n", obj.toString())

// WARNING: It will fail unless FIXME is implemented
err = obj.read_object_from_listall() // FIXME: store ResourseName in obj
err = obj.read_object_from_listall() // FIXME: store ResourceName in obj
if err == nil {
set_resource_state(obj, d)
/* Data that we set in the state above must be passed along
Expand Down Expand Up @@ -199,7 +198,6 @@ func make_api_object_secret(d *schema.ResourceData, meta interface{}) (*api_obje
}

func buildApiObjectSecretOpts(d *schema.ResourceData) (*apiObjectOpts, error) {
// resultPath := "/wfgrps/" + d.Get("wfgrp").(string) + "/stacks/"
resultPath := "/secrets/"

opts := &apiObjectOpts{
Expand Down
3 changes: 0 additions & 3 deletions internal/provider/secret_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ resource "stackguardian_secret" "TPS-Test-Secret-Name" {
`

func TestAcc_ResourceSgSecret(t *testing.T) {
//t.Skipf("TODO: Fix DELETE: deletion of Secret resource is not possible with API Key")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Expand All @@ -30,8 +29,6 @@ func TestAcc_ResourceSgSecret(t *testing.T) {
"TPS-Test-Secret-Name",
),
),
//Destroy: true,
//PreventPostDestroyRefresh: true,
},
},
})
Expand Down

0 comments on commit adfdf67

Please sign in to comment.