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

feat(cli): add get modules command in the cli #219

Merged
merged 5 commits into from
Apr 21, 2024
Merged

feat(cli): add get modules command in the cli #219

merged 5 commits into from
Apr 21, 2024

Conversation

hanshal101
Copy link
Contributor

Fixes #196

Closes #196

Description

In this PR I have added get command for modules this fetches the modules from the Kubernetes Cluster where Cyclops is deployed on. It fetches the modules from the tag:

  • "app.kubernetes.io/managed-by": "cyclops"
  • The output of the code looks something like this:
$ cyctl get modules
NAME       AGE
demo-app   15h34m38s
  • And if the resource name after get is incorrect it will display a message: Give the correct resource name

Screenshots/Images

image

@hanshal101 hanshal101 requested a review from a team as a code owner April 21, 2024 07:08
@hanshal101 hanshal101 requested review from KaradzaJuraj and removed request for a team April 21, 2024 07:08
cyctl/internal/get/modules.go Outdated Show resolved Hide resolved
cyctl/internal/get/modules.go Outdated Show resolved Hide resolved
@petar-cvit
Copy link
Collaborator

Hey @hanshal101!

I did some refactoring and you can import the Modules client from the ctrl. You can run the following command to go get the cyclops ctrl:

go get github.com/cyclops-ui/cyclops/cyclops-ctrl

Then you can use client.NewForConfig(config) to create the client and list it using the same thing as done here

@hanshal101
Copy link
Contributor Author

Hey @petar-cvit I'm getting this error while installing the package:

PS H:\cyclops\cyctl> go mod tidy
go: finding module for package github.com/cyclops-ui/cyclops/cyclops-ctrl
go: github.com/cyclops-ui/cycops-cyctl/internal/get imports
        github.com/cyclops-ui/cyclops/cyclops-ctrl: module github.com/cyclops-ui/cyclops/cyclops-ctrl@latest found (v0.0.0-20240421163218-f48a78b7c0e7), but does not contain package github.com/cyclops-ui/cyclops/cyclops-ctrl

@petar-cvit petar-cvit self-requested a review April 21, 2024 21:05
@petar-cvit
Copy link
Collaborator

Can you run go mod tidy

Copy link
Collaborator

@petar-cvit petar-cvit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hanshal101

@petar-cvit petar-cvit merged commit cdc7cb7 into cyclops-ui:main Apr 21, 2024
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.

Implement Cyclops CLI get methods
2 participants