Skip to content

Bug: Check applying not working, when using only private Location #60

@fluktuid

Description

@fluktuid

When applying an api-check with only private location, the check produces an error.

steps to reproduce:

  • create private-location
  • apply api-check with (existing) location
    e.g.
    apiVersion: k8s.checklyhq.com/v1alpha1
    kind: ApiCheck
    metadata:
      name: operator-apicheck-sample
    spec:
      endpoint: "checklyhq.com"
      success: "200"
      muted: true # Default "false"
      group: non-existant-dummy-group
    ---
    apiVersion: k8s.checklyhq.com/v1alpha1
    kind: Group
    metadata:
      name: operator-apicheck-sample-grp
    spec:
      alertchannel: []
      locations:
      - test-location
      muted: true
  • check operator logs:
    2025-02-21T08:20:52Z	ERROR	Reconciler error	{"controller": "group", "controllerGroup": "k8s.checklyhq.com", "controllerKind": "Group", "Group": {"name":"operator-apicheck-sample-grp"}, "namespace": "", "name": "operator-apicheck-sample-grp", "reconcileID": "<shadowed>", "error": "unexpected response status 400: \"{\\\"statusCode\\\":400,\\\"error\\\":\\\"Bad Request\\\",\\\"message\\\":\\\"You have to set at least one `location` or `privateLocation`\\\"}\""}
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler.
      /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:329
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
      /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:266
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
      /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.3/pkg/internal/controller/controller.go:227
    

Workaround:

  • use public location

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions