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

bug: Status subresource returns 404 for any CR with Kind: Cluster #2811

Open
fabriziopandini opened this issue Feb 17, 2023 · 9 comments · May be fixed by #2961
Open

bug: Status subresource returns 404 for any CR with Kind: Cluster #2811

fabriziopandini opened this issue Feb 17, 2023 · 9 comments · May be fixed by #2961
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@fabriziopandini
Copy link
Contributor

fabriziopandini commented Feb 17, 2023

Describe the bug

While playing around with integration between Cluster API and KCP I hit an issue where KCP returns 404 whenever we try to patch the /Status subresource on objects with Kind: Cluster.

In order to double-check the issue I have re-created the problem using wild west example and changing the Kind in it (see below)

Steps To Reproduce

Apply the following resources:

APIResourceSchema
apiVersion: apis.kcp.io/v1alpha1
kind: APIResourceSchema
metadata:
  name: v230208-22d06c1f.clusters.wildwest.dev
spec:
  group: wildwest.dev
  names:
    kind: Cluster
    listKind: ClusterList
    plural: clusters
    singular: cluster
  scope: Namespaced
  versions:
    - name: v1alpha1
      schema:
        description: Cowboy is part of the wild west
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
            of an object. Servers should convert recognized schemas to the latest
            internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
            object represents. Servers may infer this from the endpoint the client
            submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: CowboySpec holds the desired state of the Cowboy.
            properties:
              intent:
                type: string
            type: object
          status:
            description: CowboyStatus communicates the observed state of the Cowboy.
            properties:
              result:
                type: string
            type: object
        type: object
      served: true
      storage: true
      subresources:
        status: {}
APIExport
apiVersion: apis.kcp.io/v1alpha1
kind: APIExport
metadata:
  creationTimestamp: null
  name: wildwest-dev
spec:
  latestResourceSchemas:
    - v230208-22d06c1f.clusters.wildwest.dev
status: {}
APIBinding (if running in a workspace different than root, adjust the path accordingly)
apiVersion: apis.kcp.io/v1alpha1
kind: APIBinding
metadata:
  name: wildwest-dev
spec:
  reference:
    export:
      name: wildwest-dev
      path: root
Sample Cluster
apiVersion: wildwest.dev/v1alpha1
kind: Cluster
metadata:
  name: woody
spec: {}

then run

curl -k -H "Authorization: Bearer <your token>"  https://192.168.1.77:6443/clusters/root/apis/wildwest.dev/v1alpha1/namespaces/default/clusters/woody/status

You will get "404 page not found"

Expected Behaviour

To be able to use custom resources of Kind: Cluster

Additional Context

No response

@fabriziopandini fabriziopandini added the kind/bug Categorizes issue or PR as related to a bug. label Feb 17, 2023
@ncdc
Copy link
Member

ncdc commented Feb 17, 2023

@fabriziopandini fixed the yaml formatting for you 😄

@ncdc
Copy link
Member

ncdc commented Feb 17, 2023

So it works as long as the Kind is not Cluster?

@yastij
Copy link

yastij commented Feb 17, 2023

@ncdc - Yeah, we explicitly took the cowboys type, named it Cluster, from that point on, the /status subresource returns 404

@vincepri
Copy link
Contributor

🤔 Might be worth adding a test case about it, could this because of the /clusters/ prefix handling?

@ncdc
Copy link
Member

ncdc commented Feb 17, 2023

Yes please!

@yastij
Copy link

yastij commented Feb 17, 2023

yeah, we were suspecting probably something about path resolution and handling, either regex or not expecting cluster twice

@nikhita
Copy link
Member

nikhita commented Jun 29, 2023

/unassign @s-urbaniak
/assign

@kcp-ci-bot kcp-ci-bot assigned nikhita and unassigned s-urbaniak Jun 29, 2023
@kcp-ci-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
After a furter 30 days, they will turn rotten.
Mark the issue as fresh with /remove-lifecycle stale.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kcp-ci-bot kcp-ci-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 16, 2024
@kcp-ci-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

@kcp-ci-bot kcp-ci-bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

7 participants