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

Get kind from openapi #23

Merged
merged 2 commits into from
Mar 20, 2024
Merged

Get kind from openapi #23

merged 2 commits into from
Mar 20, 2024

Conversation

strokyl
Copy link
Collaborator

@strokyl strokyl commented Mar 20, 2024

The idea is to have a flexible client (not need to be update) but still provide doc and autocompletion for kind.
How it work:

  • the client get the openapi doc parse it, iterate over all get endpoint having a tag starting by '-selfe-serve-', it take those tag and parse them to get the tag out of it!
  • with those list of tags we can build proper subcomment of get.
    This is done at client startup, if it fail we just display an error on stderr and keep going with the old get commanded taking two arguments.
    With this idea of leveraging the openapi, we will be able to do great stuff latter (constructing subkind path generically)!
╭─lduzan@duzan ~/code/ctl ‹get_kind_from_openapi› 
╰─$ conduktor get                                                                                                                                                                            127 ↵
get resource of a given kind

Usage:
  conduktor get [command]

Available Commands:
  Application                   get resource of kind Application
  ApplicationInstance           get resource of kind ApplicationInstance
  ApplicationInstancePermission get resource of kind ApplicationInstancePermission

Flags:
  -h, --help   help for get

Global Flags:
      --cert string   Set pem cert for certificate authentication (useful for teleport)
      --key string    Set pem key for certificate authentication (useful for teleport)
  -v, --verbose       Show more information for debugging

Use "conduktor get [command] --help" for more information about a command.

@strokyl strokyl merged commit 2cc0327 into main Mar 20, 2024
3 checks passed
@qboileau qboileau deleted the get_kind_from_openapi branch March 25, 2024 14:04
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.

2 participants