krateoplatformops / oasgen-provider

0 stars 1 forks source link

Error "urlplurals is nil" in RestDynamicController for RunnerGroup #40

Open bertellil-prom opened 3 days ago

bertellil-prom commented 3 days ago

Describe the bug
When using the RunnerGroup custom resource with the provided RestDefinition and manifest, the following error is encountered during status update processing:

2024-11-28T15:32:48Z    DEBUG   rest-dynamic-controller Observe: updating status        {"error": "urlplurals is nil"}
2024-11-28T15:32:48Z    DEBUG   rest-dynamic-controller processing event, retrying      {"retries": 0, "obj": "{cJ3731frM Observe {github.custo
mer.com/v1alpha1 RunnerGroup runner-test gh-runners}}", "error": "urlplurals is nil"}

To Reproduce
Steps to reproduce the behavior:

  1. Use the following RestDefinition to configure the RunnerGroup resource:
    kind: RestDefinition
    apiVersion: swaggergen.krateo.io/v1alpha1
    metadata:
     name: github-runnergroup
     namespace: gh-runners
    spec:
     oasPath: https://raw.githubusercontent.com/banshee86vr/github-runner-group-swagger/refs/heads/main/ghec_extracted.yaml
     resourceGroup: github.customer.com
     resource:
       kind: RunnerGroup
       identifiers:
         - org
         - runner_group_id
       verbsDescription:
         - action: findby
           method: GET
           path: /orgs/{org}/actions/runner-groups/{runner_group_id}
         - action: get
           method: GET
           path: /orgs/{org}/actions/runner-groups/{runner_group_id}
         - action: update
           method: PATCH
           path: /orgs/{org}/actions/runner-groups/{runner_group_id}
         - action: create
           method: POST
           path: /orgs/{org}/actions/runner-groups
         - action: delete
           method: DELETE
           path: /orgs/{org}/actions/runner-groups/{runner_group_id}
  2. Deploy the following RunnerGroup manifest:
    apiVersion: github.customer.com/v1alpha1
    kind: RunnerGroup
    metadata:
     name: runner-test
     namespace: gh-runners
    spec:
     runner_group_id: 123
     allows_public_repositories: false
     name: runner-test-by-crd
     org: prom-candp
     selected_repository_ids:
       - 123123123
     visibility: private
     authenticationRefs:
       bearerAuthRef: bearer-gh-ref
  3. Observe the logs of the rest-dynamic-controller.

Expected behavior
The controller should update the status of the RunnerGroup resource without encountering the urlplurals is nil error.

Additional context

matteogastaldello commented 3 days ago

The pluraliser is offered by the Krateo BFF, so installing it solves the issue.