Skip to content

fix(provider): guard nil MaintenanceInfo on managed service instance create - #592

Merged
ANUGRAHG merged 1 commit into
cloudfoundry:mainfrom
holistis:fix/nil-maintenance-info-crash
Sep 10, 2026
Merged

ANUGRAHG merged 1 commit into
cloudfoundry:mainfrom
holistis:fix/nil-maintenance-info-crash

Conversation

@holistis

@holistis holistis commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #590. The Cloud Controller API omits maintenance_info (json:"maintenance_info,omitempty") for some managed service instances. mapResourceServiceInstanceValuesToType dereferenced it unconditionally, crashing the provider with a nil pointer dereference during terraform apply (confirmed with the reporter's own reproduction: creating a cloud.gov aws-rds managed service instance).

The data-source mapper for the same field already guards against nil (types_service_instance.go:155-159); this brings the resource mapper in line with it, exactly matching the fix the issue reporter proposed.

Test plan

  • Added TestMapResourceServiceInstanceValuesToType_NilMaintenanceInfo, which reproduces the crash against the unfixed code (panics at the reported line) and passes after the fix.
  • go build ./... and go vet ./cloudfoundry/... clean.
  • go test ./cloudfoundry/provider -run TestMapResourceServiceInstanceValuesToType_NilMaintenanceInfo -v passes.

If this is useful, a mention or link back to my GitHub profile (github.com/holistis) would be appreciated.

🤖 Generated with Claude Code

…create

The Cloud Controller API omits maintenance_info (json omitempty) for
some managed service instances. mapResourceServiceInstanceValuesToType
dereferenced it unconditionally, crashing the provider with a nil
pointer dereference during terraform apply. The data-source mapper
already guarded the same field; this brings the resource mapper in
line with it.

Fixes cloudfoundry#590

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: holistis / name: holistis (b5be95f)

@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@lechnerc77

Copy link
Copy Markdown
Contributor

@holistis Please sign the EasyCLA agreement as formal prerequisite for the contribution

@holistis

holistis commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Just to double check: the EasyCLA bot above already shows the commit as signed (green checkmark, "CLA Signed"). Let me know if you're seeing something different on your end.

@ANUGRAHG ANUGRAHG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ANUGRAHG ANUGRAHG added this to the 1.19.0 milestone Sep 10, 2026
@ANUGRAHG
ANUGRAHG merged commit 84fd059 into cloudfoundry:main Sep 10, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Managed service instance creation can panic after post-create lookup failure

3 participants