Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add gke event filtering for notification in kube module (#1840) #1900

Closed
wants to merge 9 commits into from

Conversation

aminelaabi
Copy link

@aminelaabi aminelaabi commented Mar 12, 2024

Trying to resolve this issue #1840

@aminelaabi aminelaabi requested review from ericyz, gtsorbo and a team as code owners March 12, 2024 14:00
Copy link

google-cla bot commented Mar 12, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@aminelaabi
Copy link
Author

Just adding the filter, in order to filter directly on the GKE cluster and not in the pubsub or the code that will use the event

@apeabody
Copy link
Contributor

/gcbrun

@aminelaabi
Copy link
Author

Can i get the logs for the failed cloud build, please?

@apeabody
Copy link
Contributor

Can i get the logs for the failed cloud build, please?

I'm going to re-trigger the test:

Step #28 - "converge simple-regional-with-gateway-api-local": module.example.module.gke.google_container_cluster.primary: Creating...
Step #28 - "converge simple-regional-with-gateway-api-local": STDERR: Error: Plugin did not respond
Step #28 - "converge simple-regional-with-gateway-api-local": 
Step #28 - "converge simple-regional-with-gateway-api-local":   with module.example.module.gke.google_container_cluster.primary,
Step #28 - "converge simple-regional-with-gateway-api-local":   on ../../../cluster.tf line 22, in resource "google_container_cluster" "primary":
Step #28 - "converge simple-regional-with-gateway-api-local":   22: resource "google_container_cluster" "primary" {
Step #28 - "converge simple-regional-with-gateway-api-local": 
Step #28 - "converge simple-regional-with-gateway-api-local": The plugin encountered an error, and failed to respond to the
Step #28 - "converge simple-regional-with-gateway-api-local": plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain
Step #28 - "converge simple-regional-with-gateway-api-local": more details.
Step #28 - "converge simple-regional-with-gateway-api-local": 
Step #28 - "converge simple-regional-with-gateway-api-local": Stack trace from the terraform-provider-google_v5.29.1_x5 plugin:
Step #28 - "converge simple-regional-with-gateway-api-local": 
Step #28 - "converge simple-regional-with-gateway-api-local": panic: interface conversion: interface {} is nil, not map[string]interface {}
Step #28 - "converge simple-regional-with-gateway-api-local": 
Step #28 - "converge simple-regional-with-gateway-api-local": goroutine 170 [running]:
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-provider-google/google/services/container.expandNotificationConfig({0x3588c80?, 0xc001a52e88?})
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-provider-google/google/services/container/resource_container_cluster.go:4497 +0x3d4
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-provider-google/google/services/container.resourceContainerClusterCreate(0x0?, {0x3e3cb20?, 0xc000521500})
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-provider-google/google/services/container/resource_container_cluster.go:2068 +0x1250
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x45cc3b8?, {0x45cc3b8?, 0xc0018b02d0?}, 0xd?, {0x3e3cb20?, 0xc000521500?})
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:766 +0x163
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000ef7500, {0x45cc3b8, 0xc0018b02d0}, 0xc0018c7930, 0xc0018a1180, {0x3e3cb20, 0xc000521500})
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:909 +0xa89
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00100c0c0, {0x45cc3b8?, 0xc0018b01e0?}, 0xc00123df40)
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/grpc_provider.go:1078 +0xdbc
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x45cc3f0?, {0x45cc3b8?, 0xc001887ec0?}, 0xc00123df40)
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-plugin-mux@v0.15.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00057c820, {0x45cc3b8?, 0xc0018876b0?}, 0xc0016aa620)
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/tf5server/server.go:846 +0x3d0
Step #28 - "converge simple-regional-with-gateway-api-local": github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x3de44e0?, 0xc00057c820}, {0x45cc3b8, 0xc0018876b0}, 0xc0018a0100, 0x0)
Step #28 - "converge simple-regional-with-gateway-api-local": 	github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x169
Step #28 - "converge simple-regional-with-gateway-api-local": google.golang.org/grpc.(*Server).processUnaryRPC(0xc00100e200, {0x45cc3b8, 0xc001887620}, {0x45d7210, 0xc000515800}, 0xc00187f320, 0xc000fac840, 0x61d6af8, 0x0)
Step #28 - "converge simple-regional-with-gateway-api-local": 	google.golang.org/grpc@v1.63.2/server.go:1369 +0xe23
Step #28 - "converge simple-regional-with-gateway-api-local": google.golang.org/grpc.(*Server).handleStream(0xc00100e200, {0x45d7210, 0xc000515800}, 0xc00187f320)
Step #28 - "converge simple-regional-with-gateway-api-local": 	google.golang.org/grpc@v1.63.2/server.go:1780 +0x1016
Step #28 - "converge simple-regional-with-gateway-api-local": google.golang.org/grpc.(*Server).serveStreams.func2.1()
Step #28 - "converge simple-regional-with-gateway-api-local": 	google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
Step #28 - "converge simple-regional-with-gateway-api-local": created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 15
Step #28 - "converge simple-regional-with-gateway-api-local": 	google.golang.org/grpc@v1.63.2/server.go:1030 +0x135
Step #28 - "converge simple-regional-with-gateway-api-local": 
Step #28 - "converge simple-regional-with-gateway-api-local": Error: The terraform-provider-google_v5.29.1_x5 plugin crashed!
Step #28 - "converge simple-regional-with-gateway-api-local": 
Step #28 - "converge simple-regional-with-gateway-api-local": This is always indicative of a bug within the plugin. It would be immensely
Step #28 - "converge simple-regional-with-gateway-api-local": helpful if you could report the crash with the plugin's maintainers so that it
Step #28 - "converge simple-regional-with-gateway-api-local": can be fixed. The output above should help diagnose the issue.
Step #28 - "converge simple-regional-with-gateway-api-local": ---- End output of terraform apply -auto-approve -lock=true -lock-timeout=0s -input=false -no-color -parallelism=10 -refresh=true   ----
@aminelaabi
Copy link
Author

The CI failed again can i see the logs for the failed cloud build please?

@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

Step #43 - "converge stub-domains-local": module.example.module.gke.google_container_cluster.primary: Creating...
Step #43 - "converge stub-domains-local": STDERR: Error: Plugin did not respond
Step #43 - "converge stub-domains-local": 
Step #43 - "converge stub-domains-local":   with module.example.module.gke.google_container_cluster.primary,
Step #43 - "converge stub-domains-local":   on ../../../cluster.tf line 22, in resource "google_container_cluster" "primary":
Step #43 - "converge stub-domains-local":   22: resource "google_container_cluster" "primary" {
Step #43 - "converge stub-domains-local": 
Step #43 - "converge stub-domains-local": The plugin encountered an error, and failed to respond to the
Step #43 - "converge stub-domains-local": plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain
Step #43 - "converge stub-domains-local": more details.
Step #43 - "converge stub-domains-local": 
Step #43 - "converge stub-domains-local": Stack trace from the terraform-provider-google_v5.29.1_x5 plugin:
Step #43 - "converge stub-domains-local": 
Step #43 - "converge stub-domains-local": panic: interface conversion: interface {} is nil, not map[string]interface {}
Step #43 - "converge stub-domains-local": 
Step #43 - "converge stub-domains-local": goroutine 158 [running]:
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-provider-google/google/services/container.expandNotificationConfig({0x3588c80?, 0xc001776ed0?})
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-provider-google/google/services/container/resource_container_cluster.go:4497 +0x3d4
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-provider-google/google/services/container.resourceContainerClusterCreate(0x0?, {0x3e3cb20?, 0xc0001e8000})
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-provider-google/google/services/container/resource_container_cluster.go:2068 +0x1250
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x45cc3b8?, {0x45cc3b8?, 0xc001c08cc0?}, 0xd?, {0x3e3cb20?, 0xc0001e8000?})
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:766 +0x163
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00106a0e0, {0x45cc3b8, 0xc001c08cc0}, 0xc000992c30, 0xc000a6b000, {0x3e3cb20, 0xc0001e8000})
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:909 +0xa89
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0007023f0, {0x45cc3b8?, 0xc001c08bd0?}, 0xc001c3a050)
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/grpc_provider.go:1078 +0xdbc
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x45cc3f0?, {0x45cc3b8?, 0xc001c088d0?}, 0xc001c3a050)
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-plugin-mux@v0.15.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0004fd540, {0x45cc3b8?, 0xc001c08090?}, 0xc001c1e000)
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/tf5server/server.go:846 +0x3d0
Step #43 - "converge stub-domains-local": github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x3de44e0?, 0xc0004fd540}, {0x45cc3b8, 0xc001c08090}, 0xc001014000, 0x0)
Step #43 - "converge stub-domains-local": 	github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x169
Step #43 - "converge stub-domains-local": google.golang.org/grpc.(*Server).processUnaryRPC(0xc000d42000, {0x45cc3b8, 0xc001c08000}, {0x45d7210, 0xc0003a0600}, 0xc0018407e0, 0xc0009eb4d0, 0x61d6af8, 0x0)
Step #43 - "converge stub-domains-local": 	google.golang.org/grpc@v1.63.2/server.go:1369 +0xe23
Step #43 - "converge stub-domains-local": google.golang.org/grpc.(*Server).handleStream(0xc000d42000, {0x45d7210, 0xc0003a0600}, 0xc0018407e0)
Step #43 - "converge stub-domains-local": 	google.golang.org/grpc@v1.63.2/server.go:1780 +0x1016
Step #43 - "converge stub-domains-local": google.golang.org/grpc.(*Server).serveStreams.func2.1()
Step #43 - "converge stub-domains-local": 	google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
Step #43 - "converge stub-domains-local": created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 26
Step #43 - "converge stub-domains-local": 	google.golang.org/grpc@v1.63.2/server.go:1030 +0x135
Step #43 - "converge stub-domains-local": 
Step #43 - "converge stub-domains-local": Error: The terraform-provider-google_v5.29.1_x5 plugin crashed!
Step #43 - "converge stub-domains-local": 
Step #43 - "converge stub-domains-local": This is always indicative of a bug within the plugin. It would be immensely
Step #43 - "converge stub-domains-local": helpful if you could report the crash with the plugin's maintainers so that it
Step #43 - "converge stub-domains-local": can be fixed. The output above should help diagnose the issue.
@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

Still seeing a plugin crash with this change:

STDERR: Error: Request cancelled

  with module.example.module.gke.google_container_cluster.primary,
  on ../../../cluster.tf line 22, in resource "google_container_cluster" "primary":
  22: resource "google_container_cluster" "primary" {

The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.

Stack trace from the terraform-provider-google_v5.33.0_x5 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 167 [running]:
github.com/hashicorp/terraform-provider-google/google/services/container.expandNotificationConfig({0x352fca0?, 0xc0016fab58?})
	github.com/hashicorp/terraform-provider-google/google/services/container/resource_container_cluster.go:4512 +0x3d4
github.com/hashicorp/terraform-provider-google/google/services/container.resourceContainerClusterCreate(0x0?, {0x3dcdce0?, 0xc0002d4a80})
	github.com/hashicorp/terraform-provider-google/google/services/container/resource_container_cluster.go:2068 +0x1250
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x4567c18?, {0x4567c18?, 0xc001782210?}, 0xd?, {0x3dcdce0?, 0xc0002d4a80?})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:766 +0x163
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000e5a700, {0x4567c18, 0xc001782210}, 0xc000922270, 0xc001e44b00, {0x3dcdce0, 0xc0002d4a80})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/resource.go:909 +0xa89
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00010ffc8, {0x4567c18?, 0xc001782120?}, 0xc001e30af0)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0/helper/schema/grpc_provider.go:1078 +0xdbc
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x4567c50?, {0x4567c18?, 0xc0009351a0?}, 0xc001e30af0)
	github.com/hashicorp/terraform-plugin-mux@v0.15.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00013f040, {0x4567c18?, 0xc000934540?}, 0xc0019f4620)
	github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/tf5server/server.go:846 +0x3d0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x3d75740?, 0xc00013f040}, {0x4567c18, 0xc000934540}, 0xc0017a5880, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000fd8000, {0x4567c18, 0xc0009344b0}, {0x4572b70, 0xc00049d800}, 0xc000e70a20, 0xc000fcd3e0, 0x611abf8, 0x0)
	google.golang.org/grpc@v1.63.2/server.go:1369 +0xe23
google.golang.org/grpc.(*Server).handleStream(0xc000fd8000, {0x4572b70, 0xc00049d800}, 0xc000e70a20)
	google.golang.org/grpc@v1.63.2/server.go:1780 +0x1016
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 44
	google.golang.org/grpc@v1.63.2/server.go:1030 +0x135

Error: The terraform-provider-google_v5.33.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
@DrFaust92
Copy link
Contributor

#1996 created this a as fork to preserve commits as my team really needs this feature, made a small change and tested it locally. hope this helps getting it in 👋

@DrFaust92
Copy link
Contributor

@apeabody can be closed

@apeabody
Copy link
Contributor

Thanks for the contribution @aminelaabi! - Superseded by #1996

@apeabody apeabody closed this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants