Skip to content

WIP: feat(ske) access ressource#1437

Open
cgoetz-inovex wants to merge 7 commits into
mainfrom
feat/STACKITTPR-610_ske-cluster-access-idp
Open

WIP: feat(ske) access ressource#1437
cgoetz-inovex wants to merge 7 commits into
mainfrom
feat/STACKITTPR-610_ske-cluster-access-idp

Conversation

@cgoetz-inovex

Copy link
Copy Markdown
Contributor

Description

relates to #1234

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)

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions Bot added the Stale PR is marked as stale due to inactivity. label May 8, 2026
@github-actions

Copy link
Copy Markdown

This PR was closed automatically because it has been stalled for 7 days with no activity. Feel free to re-open it at any time.

@github-actions github-actions Bot closed this May 15, 2026
@AleksuKey

Copy link
Copy Markdown

@Manuelvaas I think this PR could solve #1360

@cgoetz-inovex cgoetz-inovex reopened this Jun 23, 2026
@cgoetz-inovex cgoetz-inovex marked this pull request as ready for review June 23, 2026 12:46
@cgoetz-inovex cgoetz-inovex requested a review from a team as a code owner June 23, 2026 12:46
Comment thread stackit/internal/services/ske/ske_acc_test.go Outdated
Comment thread stackit/internal/services/ske/ske_acc_test.go Outdated
Comment thread stackit/internal/services/ske/ske_acc_test.go Outdated
Comment on lines +2142 to +2145
if cl.Access == nil {
m.Access = defaultAccess
return nil
}

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.

Is this still the workaround? I would guess that if nothing is returned by the API, we should save nothing into the state.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've double checked the API spec, it's still marked as optional. Also there are some tests in ske_test.go that use mocked cluster responses. So I went for the fallback to the default objects here.
But technically this should be unreachable code besides tests (which could be adapted)

var diags diag.Diagnostics

var idpObject basetypes.ObjectValue
if cl.Access.Idp == nil {

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.

Same as above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same as above

Description: descriptions["access_idp_type"],
Required: true,
Validators: []validator.String{
stringvalidator.OneOf("stackit"),

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.

I'll have to check if we can validate that here or if we should just put it into the description.

Co-authored-by: Manuel Vaas <34416897+Manuelvaas@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/ske 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/ske/cluster 48.53% (+1.03%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/ske/cluster/datasource.go 0.00% (ø) 39 0 39
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/ske/cluster/resource.go 50.60% (+1.00%) 915 (+34) 463 (+26) 452 (+8) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/ske/cluster/resource_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/ske/ske_acc_test.go

@rubenhoenle rubenhoenle removed the Stale PR is marked as stale due to inactivity. label Jun 23, 2026
Description: descriptions["access"],
Optional: true,
Computed: true,
Default: objectdefault.StaticValue(defaultAccess),

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.

Suggested change
Default: objectdefault.StaticValue(defaultAccess),

I don't see why we would want a default on TF side here. The API got fixed and shouldn't require any special handling. This also applies to the logic in the mapFields function, from my understanding no special handling is needed there.

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.

4 participants