Skip to content

Commit

Permalink
Remove debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
anvial committed Apr 16, 2024
1 parent 5e61b41 commit 48b94fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
14 changes: 2 additions & 12 deletions internal/provider/resource_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func (s *secretResource) Create(ctx context.Context, req resource.CreateRequest,
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to add secret, got error: %s", err))
return
}
s.trace(fmt.Sprintf("add secret resource %q", plan.SecretId))

plan.SecretId = types.StringValue(createSecretOutput.SecretId)

Expand Down Expand Up @@ -170,10 +169,6 @@ func (s *secretResource) Read(ctx context.Context, req resource.ReadRequest, res
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read secret, got error: %s", err))
return
}
s.trace(fmt.Sprintf("read secret resource %q", state.SecretId))

// Print the secret details
fmt.Printf("r = %#v\n", readSecretOutput)

// Save the secret details into the Terraform state
if !state.Name.IsNull() {
Expand All @@ -192,6 +187,8 @@ func (s *secretResource) Read(ctx context.Context, req resource.ReadRequest, res

// Save state into Terraform state
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)

s.trace(fmt.Sprintf("read secret resource %q", state.SecretId))
}

func (s *secretResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
Expand All @@ -210,10 +207,6 @@ func (s *secretResource) Update(ctx context.Context, req resource.UpdateRequest,
return
}

// print the plan and state
fmt.Printf("plan = %+v\n", plan)
fmt.Printf("state = %+v\n", state)

var err error
noChange := true

Expand Down Expand Up @@ -253,9 +246,6 @@ func (s *secretResource) Update(ctx context.Context, req resource.UpdateRequest,
return
}

// print the updated secret input
fmt.Printf("updatedSecretInput = %+v\n", updatedSecretInput)

err = s.client.Secrets.UpdateSecret(&updatedSecretInput)
if err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to update secret, got error: %s", err))
Expand Down
12 changes: 0 additions & 12 deletions internal/provider/resource_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ func TestAcc_ResourceSecret_Update(t *testing.T) {
})
}

func testAccResourceOnlyModel(modelName string) string {
return internaltesting.GetStringFromTemplateWithData(
"testAccResourceOnlyModel",
`
resource "juju_model" "{{.ModelName}}" {
name = "{{.ModelName}}"
}
`, internaltesting.TemplateData{
"ModelName": modelName,
})
}

func testAccResourceSecret(modelName, secretName string, secretValue map[string]string, secretInfo string) string {
return internaltesting.GetStringFromTemplateWithData(
"testAccResourceSecret",
Expand Down

0 comments on commit 48b94fb

Please sign in to comment.