Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Expose ClusterMaintenenceConfig options to terraform#886

Merged
lxea merged 7 commits into
masterfrom
lxea/terraform-cluster_maintenance_config
Sep 14, 2023
Merged

Expose ClusterMaintenenceConfig options to terraform#886
lxea merged 7 commits into
masterfrom
lxea/terraform-cluster_maintenance_config

Conversation

@lxea
Copy link
Copy Markdown
Contributor

@lxea lxea commented Aug 9, 2023

@lxea lxea force-pushed the lxea/terraform-cluster_maintenance_config branch from c38bd24 to 4c079b4 Compare August 9, 2023 13:41
Copy link
Copy Markdown
Contributor

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

Generally looks good to me but would be good to get @marcoandredinis's review as well.

Comment thread terraform/reference.mdx
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.

Shouldn't the reference documentation have been updated to include the new resource as well? @marcoandredinis

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.

New resources must be added to terraform/gen/main.go

// Create Docs Markdown
var (
	mapResourceSchema = map[string]func(context.Context) (tfsdk.Schema, diag.Diagnostics){
		"cluster_maintenance_config": tfschema.GenSchemaClusterMaintenanceConfigV1,
		// ...

@r0mant r0mant requested a review from marcoandredinis August 10, 2023 00:37
Copy link
Copy Markdown
Contributor

@tcsc tcsc left a comment

Choose a reason for hiding this comment

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

This doesn't build cleanly for me:

❯ make build
rm -rf example/terraform.tfstate
rm -rf example/terraform.tfstate.backup
rm -rf example/.terraform
rm -rf example/.terraform.lock.hcl
rm -rf ~/.terraform.d/plugins/terraform.releases.teleport.dev/gravitational/teleport/13.3.1/darwin_arm64/*
rm -rf build/*
rm -rf terraform-provider-teleport-v13.3.1-darwin-arm64-bin.tar.gz
go clean
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o build/terraform-provider-teleport  -ldflags '-w -s'
# github.com/gravitational/teleport-plugins/terraform/tfschema
tfschema/types_terraform.go:16444:24: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:16455:27: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:18089:24: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:18100:27: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21881:106: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21886:106: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21889:26: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21891:31: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21892:106: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21894:42: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21894:42: too many errors
make: *** [build] Error 1

@lxea
Copy link
Copy Markdown
Contributor Author

lxea commented Aug 10, 2023

This doesn't build cleanly for me:

❯ make build
rm -rf example/terraform.tfstate
rm -rf example/terraform.tfstate.backup
rm -rf example/.terraform
rm -rf example/.terraform.lock.hcl
rm -rf ~/.terraform.d/plugins/terraform.releases.teleport.dev/gravitational/teleport/13.3.1/darwin_arm64/*
rm -rf build/*
rm -rf terraform-provider-teleport-v13.3.1-darwin-arm64-bin.tar.gz
go clean
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o build/terraform-provider-teleport  -ldflags '-w -s'
# github.com/gravitational/teleport-plugins/terraform/tfschema
tfschema/types_terraform.go:16444:24: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:16455:27: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:18089:24: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:18100:27: obj.Verbs undefined (type *"github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21881:106: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21886:106: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21889:26: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21891:31: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21892:106: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21894:42: obj.Verbs undefined (type "github.com/gravitational/teleport/api/types".KubernetesResource has no field or method Verbs)
tfschema/types_terraform.go:21894:42: too many errors
make: *** [build] Error 1

I encountered this issue at some point also, I can't remember how I resolved it, but I think it might be to do with the teleport commit in the go.mod and makefile where it go mod downloads teleport, it also wont built until #30214 is merged

@marcoandredinis
Copy link
Copy Markdown
Contributor

This looks mostly good 👍

it also wont built until gravitational/teleport#30214 is merged

Not only merged, but also backported to v13 (teleport-plugins follows only the latest major teleport version)

Copy link
Copy Markdown
Contributor

@tcsc tcsc left a comment

Choose a reason for hiding this comment

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

Looks good to me once gravitational/teleport#30214 and the subsequent v13 backport are merged.

@lxea lxea force-pushed the lxea/terraform-cluster_maintenance_config branch 2 times, most recently from c2b67fd to 3de4015 Compare August 29, 2023 11:46
@lxea lxea force-pushed the lxea/terraform-cluster_maintenance_config branch from 3de4015 to 7b8e08e Compare September 5, 2023 11:56
@marcoandredinis
Copy link
Copy Markdown
Contributor

Let me know if I should do another pass.
It looks like the CI is failing.

@lxea lxea force-pushed the lxea/terraform-cluster_maintenance_config branch from 7b8e08e to ffdbefb Compare September 14, 2023 12:29
@lxea lxea force-pushed the lxea/terraform-cluster_maintenance_config branch from 2ec9398 to 1569b96 Compare September 14, 2023 12:42
@lxea lxea force-pushed the lxea/terraform-cluster_maintenance_config branch from 1569b96 to 6f7c23f Compare September 14, 2023 12:50
@lxea lxea merged commit 948585e into master Sep 14, 2023
@lxea lxea deleted the lxea/terraform-cluster_maintenance_config branch September 14, 2023 14:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants