Skip to content

feat: support group/kind format in parseSingle#524

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/support-group-kind-format
Draft

feat: support group/kind format in parseSingle#524
Copilot wants to merge 2 commits into
mainfrom
copilot/support-group-kind-format

Conversation

Copilot AI commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

parseSingle treated any "group/X" token (one slash, non-v1 prefix) as GroupVersion, making it impossible to filter resources by group+kind without specifying a version.

Changes

  • pkg/utils/apiresources.go

    • Added isVersion(s string) bool helper — returns true when s matches the Kubernetes version pattern (v + digit, e.g. v1, v1beta1, v2alpha1)
    • In parseSingle case 1, routes "group/X" to groupVersions when isVersion(X) is true, otherwise to groupKinds
  • pkg/utils/apiresources_test.go

    • Added TestResourceConfigGKParse covering: multiple GK tokens, single GK token, and mixed GV+GK tokens

Example

# Before: "apps/Deployment" was silently parsed as GroupVersion{Group:"apps", Version:"Deployment"}
# After:  "apps/Deployment" is correctly parsed as GroupKind{Group:"apps", Kind:"Deployment"}
#         "apps/v1"         continues to be parsed as GroupVersion{Group:"apps", Version:"v1"}

--skipped-propagating-apis "apps/Deployment;networking.k8s.io/Ingress"
Original prompt

This section details on the original issue you should resolve

<issue_title>Support the Group Kind format in the command option</issue_title>
<issue_description>can you change the parseSingle function in pkg/utils/apiresources.go so that it supports "group/kind" at line 231 instead of "group/version"?</issue_description>

<agent_instructions>based on the issue specification, validate if the /pkg/utils/apiresources.go file's func (r *ResourceConfig) parseSingle(token string) method meets the requirement.</agent_instructions>

Comments on the Issue (you are Copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: sjwaight <4828246+sjwaight@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix parseSingle function to support group/kind format feat: support group/kind format in parseSingle Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support the Group Kind format in the command option

2 participants