feat(ske): support audit log configuration - #1578
feat(ske): support audit log configuration#1578tobias-pfaffelmoser-ske wants to merge 9 commits into
Conversation
52f7b99 to
2160dd9
Compare
rubenhoenle
left a comment
There was a problem hiding this comment.
As written in the PR template checklist, the Acceptance tests / E2E tests need to be adjusted to include your new field: ske_acc_test.go
Min test
In the min test only required fields must be set in the test configuration.
Since your field is optional you only have to add checks that the new field has the correct default value.
terraform-provider-stackit/stackit/internal/services/ske/ske_acc_test.go
Lines 120 to 265 in e45f2f5
Max test
For the Max test you have to add your field to the Terraform config:
Afterwards add a new variable for your field:
Also update the field to test not only the create operation but also the update operation:
terraform-provider-stackit/stackit/internal/services/ske/ske_acc_test.go
Lines 110 to 118 in e45f2f5
Then add the checks for your new field to the text steps:
terraform-provider-stackit/stackit/internal/services/ske/ske_acc_test.go
Lines 267 to 509 in e45f2f5
2160dd9 to
54be3c6
Compare
rubenhoenle
left a comment
There was a problem hiding this comment.
Looks good besides that ✔️
8862ef0 to
28cee91
Compare
2ba818f to
c24acbe
Compare
|
@tobias-pfaffelmoser-ske could you please resolve the conflicts so we can merge this? 😅 |
c24acbe to
d79f5ff
Compare
rubenhoenle
left a comment
There was a problem hiding this comment.
I rebased the PR and solved the conflicts. Please take care of this next time on your own @tobias-pfaffelmoser-ske .
cgoetz-inovex
left a comment
There was a problem hiding this comment.
some minor cosmetic suggestions, but fine to be merged from my side, if time is an issue.
thx for your contrib
| name string | ||
| input types.Object | ||
| want *ske.Audit | ||
| wantErr bool |
There was a problem hiding this comment.
| wantErr bool |
wantErr is never true
There was a problem hiding this comment.
Adapted as suggested
| if err != nil && !tt.wantErr { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
| if err == nil && tt.wantErr { | ||
| t.Fatalf("expected error, but got none") | ||
| } |
There was a problem hiding this comment.
| if err != nil && !tt.wantErr { | |
| t.Fatalf("unexpected error: %v", err) | |
| } | |
| if err == nil && tt.wantErr { | |
| t.Fatalf("expected error, but got none") | |
| } | |
| if err != nil { | |
| t.Fatalf("unexpected error: %v", err) | |
| } |
There was a problem hiding this comment.
Adapted as suggested
| input *ske.Audit | ||
| stateAudit types.Object | ||
| want types.Object | ||
| wantErr bool |
There was a problem hiding this comment.
| wantErr bool |
same as above
There was a problem hiding this comment.
Adapted as suggested
| if !tt.wantErr && err != nil { | ||
| t.Fatalf("unexpected error: %v", err) | ||
| } | ||
| if tt.wantErr && err == nil { | ||
| t.Fatalf("expected error, but got none") | ||
| } |
There was a problem hiding this comment.
| if !tt.wantErr && err != nil { | |
| t.Fatalf("unexpected error: %v", err) | |
| } | |
| if tt.wantErr && err == nil { | |
| t.Fatalf("expected error, but got none") | |
| } | |
| if err != nil { | |
| t.Fatalf("unexpected error: %v", err) | |
| } |
There was a problem hiding this comment.
Adapted as suggested
d79f5ff to
05b238a
Compare
c21d15b
Yes - sure. Wasn't able to handle last week due to vacation-absence. Just rebased the PR again. |
c21d15b to
7633c6f
Compare
@cgoetz-inovex Thx! I addressed your comments. Please re-check. Otherwise, fine to be merged from our side ... |
7633c6f to
afedc93
Compare
Address review feedback: wantErr was never set to true in TestToAuditPayload and TestMapAudit, so fail on any unexpected error instead.
afedc93 to
12340b5
Compare
Description
Adds support for configuring SKE cluster audit log forwarding via a new optional
auditblock on thestackit_ske_clusterresource (and as a read-only attributeon the data source):
The audit.enabled flag is passed through to the SKE API (ske.Audit) on create/update and mapped back into state on read. This feature is in private preview and can only be enabled for accounts/projects that have been enabled for audit log forwarding to a Telemetry Router.
This also bumps the stackit-sdk-go/services/ske dependency to v1.19.0, which introduces the audit field.
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)