Skip to content

Commit be83200

Browse files
committed
adding doc comments
1 parent 1744018 commit be83200

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Teleport 18 removes support for:
1919
- `tls-ecdhe-ecdsa-with-aes-128-cbc-sha256`
2020
- `tls-ecdhe-rsa-with-aes-128-cbc-sha256`
2121

22-
### Terraform provider role defaults
22+
#### Terraform provider role defaults
2323

2424
The Terraform provider previously defaulted unset booleans to `false`, starting
2525
with v18 it will leave the fields empty and let Teleport pick the same default

e

Submodule e updated from e850710 to d81ae22

integrations/terraform/protoc-gen-terraform-teleport.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ computed_fields:
192192
- "AppV3.Kind"
193193

194194
# Auth preference
195+
- "AuthPreferenceV2.Spec"
195196
- "AuthPreferenceV2.Spec.AllowPasswordless"
196197
- "AuthPreferenceV2.Spec.AllowHeadless"
197198
- "AuthPreferenceV2.Spec.DisconnectExpiredCert"

integrations/terraform/tfschema/role_plan_modifier.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ import (
2020
"context"
2121
"fmt"
2222

23-
apitypes "github.com/gravitational/teleport/api/types"
2423
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
2524
tftypes "github.com/hashicorp/terraform-plugin-framework/types"
25+
26+
apitypes "github.com/gravitational/teleport/api/types"
2627
)
2728

2829
const (
@@ -34,21 +35,27 @@ One way to deal with version change is to force-recreate, but this is too destru
3435
The workaround we found was to use this plan modifier.`
3536
)
3637

38+
// DefaultRoleOptions returns the default implementation of the DefaultRoleOptionsModifier
3739
func DefaultRoleOptions() tfsdk.AttributePlanModifier {
3840
return DefaultRoleOptionsModifier{}
3941
}
4042

43+
// DefaultRoleOptionsModifier implements the tfsdk.AttributePlanModifier interface. It accounts
44+
// for default values applied by CheckAndSetDefaults that would otherwise create inconsistent states
4145
type DefaultRoleOptionsModifier struct {
4246
}
4347

48+
// Description of the RoleOptions plan modifier
4449
func (d DefaultRoleOptionsModifier) Description(ctx context.Context) string {
4550
return DefaultRoleOptionsModifierDescription
4651
}
4752

53+
// MarkdownDescription of the RoleOptions plan modifier
4854
func (d DefaultRoleOptionsModifier) MarkdownDescription(ctx context.Context) string {
4955
return DefaultRoleOptionsModifierDescription
5056
}
5157

58+
// Modify the terraform plan to account for defaults applied to RoleOptions by CheckAndSetDefaults
5259
func (d DefaultRoleOptionsModifier) Modify(ctx context.Context, req tfsdk.ModifyAttributePlanRequest, resp *tfsdk.ModifyAttributePlanResponse) {
5360
var config tftypes.Object
5461
diags := req.Config.Get(ctx, &config)

0 commit comments

Comments
 (0)