Skip to content

The APIGatewayV2 controller does not accept httpMethod in the Integration custom resourceΒ #2588

@Ved-Janardhan-SRT

Description

@Ved-Janardhan-SRT

Describe the bug
When an Integration CR is created, the controller reports that the httpMethod field is not set, even though a valid value is provided and a correct AWS resource is created.

Steps to reproduce

  1. Create a Method CR
  2. Create a Integration CR
apiVersion: apigateway.services.k8s.aws/v1alpha1
kind: Method
metadata:
  finalizers:
  - finalizers.apigateway.services.k8s.aws/Method
  name: openid-configuration-get
spec:
  apiKeyRequired: false
  authorizationType: NONE
  httpMethod: GET
  requestParameters:
    method.request.path.tenant: true
  resourceRef:
    from:
      name: openid-configuration-idp-nonprod-auth
  restAPIRef:
    from:
      name: idp-nonprod-auth
apiVersion: apigateway.services.k8s.aws/v1alpha1
kind: Integration
metadata:
  finalizers:
  - finalizers.apigateway.services.k8s.aws/Integration
  name: openid-configuration-get
spec:
  httpMethod: GET
  integrationHTTPMethod: GET
  requestParameters:
    integration.request.path.tenant: method.request.path.tenant
  requestTemplates:
    application/json: |
      {"statusCode": 200}
  resourceRef:
    from:
      name: openid-configuration-idp-nonprod-auth
  restAPIRef:
    from:
      name: idp-nonprod-auth
  type: MOCK

Expected outcome
The controller should not complain about the invalid spec

reason: 'Integration.apigateway.services.k8s.aws "openid-configuration-get" is
  invalid: [spec.httpMethod: Required value, <nil>: Invalid value: "null": some
   validation rules were not checked because the object was invalid; correct the
   existing errors to complete validation]'

Controller logs

{"level":"error","ts":"2025-08-04T00:40:03.657Z","msg":"Reconciler error","controller":"integration","controllerGroup":"apigateway.services.k8s.aws","controllerKind":"Integration","Integration":{"name":"openid-configuration-get","namespace":"keycloak"},"namespace":"keycloak","name":"openid-configuration-get","reconcileID":"35d4bdbb-8f50-4aba-b902-30ad51b95329","error":"Integration.apigateway.services.k8s.aws \"openid-configuration-get\" is invalid: [spec.httpMethod: Required value, <nil>: Invalid value: \"null\": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:347\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:294\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:255"}
{"level":"info","ts":"2025-08-04T00:44:09.287Z","logger":"ackrt","msg":"desired resource state has changed","kind":"Integration","namespace":"keycloak","name":"openid-configuration-options","account":"487409146247","role":"","region":"eu-west-1","is_adopted":false,"generation":1,"diff":[{"Path":{"Parts":["Spec","HTTPMethod"]},"A":"OPTIONS","B":null},{"Path":{"Parts":["Spec","PassthroughBehavior"]},"A":null,"B":"WHEN_NO_MATCH"},{"Path":{"Parts":["Spec","TimeoutInMillis"]},"A":null,"B":29000}]}
{"level":"error","ts":"2025-08-04T00:44:09.365Z","msg":"Reconciler error","controller":"integration","controllerGroup":"apigateway.services.k8s.aws","controllerKind":"Integration","Integration":{"name":"openid-configuration-options","namespace":"keycloak"},"namespace":"keycloak","name":"openid-configuration-options","reconcileID":"e5ac9e9e-aa2e-4fba-845d-1951c48acf2f","error":"Integration.apigateway.services.k8s.aws \"openid-configuration-options\" is invalid: [spec.httpMethod: Required value, <nil>: Invalid value: \"null\": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:347\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:294\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:255"}

Environment

  • Kubernetes version: v1.32.5
  • Using EKS (yes/no), if so version?: Yes , v1.32.5-eks-5d4a308
  • AWS service targeted (S3, RDS, etc.): API Gateway v2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions