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: odigos describe sub commands for auto completion #1407

Merged
merged 8 commits into from
Jul 31, 2024

Conversation

blumamir
Copy link
Collaborator

No description provided.

Copy link

Copy link

cli/cmd/describe.go Outdated Show resolved Hide resolved

if len(args) != 2 {
fmt.Println("Usage: odigos describe <kind> <name>")
deployment, err := client.AppsV1().Deployments(ns).Get(ctx, name, metav1.GetOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this function happens also at sources.go, login.go, uninstall.go.
Maybe we can create a util file and put the function over there.
Your call..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since it's just one line, I prefer to use the k8s client directly and not introduce more complexity to the code

return
}
workloadObj := &K8sSourceObject{
Kind: "deployment",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure but I think deployment.Kind returns this string.
Also other places

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately, The Kind property is not populated by the client when instantiating a Deployment object. This is why I needed to add it explicitly

@blumamir blumamir merged commit d7c7e93 into odigos-io:main Jul 31, 2024
11 checks passed
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