Skip to content

fix(iaas): read write only field correctly from the config model - #1694

Open
SerseusWasTaken wants to merge 2 commits into
mainfrom
fix/fix-iaas-write-only-fields
Open

fix(iaas): read write only field correctly from the config model#1694
SerseusWasTaken wants to merge 2 commits into
mainfrom
fix/fix-iaas-write-only-fields

Conversation

@SerseusWasTaken

@SerseusWasTaken SerseusWasTaken commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the write-only field KeyPayloadBase64WriteOnly by reading it from the config model instead of plan model.
Also adds a regression test based on mocking that verifies that the write only field is sent to the API.

Relates to STACKITTPR-782

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@SerseusWasTaken
SerseusWasTaken requested a review from a team as a code owner August 17, 2026 07:34
@SerseusWasTaken
SerseusWasTaken force-pushed the fix/fix-iaas-write-only-fields branch from 5ffcb52 to e4cdcee Compare August 17, 2026 07:36
@SerseusWasTaken
SerseusWasTaken force-pushed the fix/fix-iaas-write-only-fields branch from e4cdcee to 2c2559d Compare August 17, 2026 07:41
// buildCreateRequest builds a resource.CreateRequest from a plan and a config model.
// Terraform populates write-only attribute values only in the config model - never in the plan or state model.
// That's why we need both, the plan model AND config model to build the request.
func buildCreateRequest(ctx context.Context, t *testing.T, schemaResp *resource.SchemaResponse, planModel, configModel *Model) resource.CreateRequest {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would actually prefer to have this tested via resource.UnitTest like e.g. here:

This is hard to mock then (I know), that's why I worked on #1663 . Will make your life easier in that regard 😅

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.

2 participants