Skip to content

Commit

Permalink
More copy-paste errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jradtilbrook committed Dec 12, 2023
1 parent 38f645b commit 331013f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions buildkite/resource_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (o *organizationResource) Read(ctx context.Context, req resource.ReadReques
}

org, err := o.client.GetOrganizationID()
if err == nil {
if err != nil {
resp.Diagnostics.AddError(
"Unable to find organization",
fmt.Sprintf("Unable to find Organization: %s", err.Error()),
Expand Down Expand Up @@ -198,7 +198,7 @@ func (o *organizationResource) Update(ctx context.Context, req resource.UpdateRe
cidrs := createCidrSliceFromList(plan.AllowedApiIpAddresses)

org, err := o.client.GetOrganizationID()
if err == nil {
if err != nil {
resp.Diagnostics.AddError(
"Unable to find organization",
fmt.Sprintf("Unable to find Organization: %s", err.Error()),
Expand All @@ -223,7 +223,7 @@ func (o *organizationResource) Update(ctx context.Context, req resource.UpdateRe

if !plan.Enforce2FA.IsNull() && !plan.Enforce2FA.IsUnknown() {
org, err := o.client.GetOrganizationID()
if err == nil {
if err != nil {
resp.Diagnostics.AddError(
"Unable to find organization",
fmt.Sprintf("Unable to find Organization: %s", err.Error()),
Expand Down Expand Up @@ -253,7 +253,7 @@ func (o *organizationResource) Update(ctx context.Context, req resource.UpdateRe

func (o *organizationResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
org, err := o.client.GetOrganizationID()
if err == nil {
if err != nil {
resp.Diagnostics.AddError(
"Unable to find organization",
fmt.Sprintf("Unable to find Organization: %s", err.Error()),
Expand Down
2 changes: 1 addition & 1 deletion buildkite/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestGetOrganizationIDMissing(t *testing.T) {
// NewClient calls GetOrganizationId so we can test the output
client := NewClient(config)
org, err := client.GetOrganizationID()
if err == nil {
if err != nil {
t.Fatalf("err: %s", err)
}
if org != nil {
Expand Down

0 comments on commit 331013f

Please sign in to comment.