-
Notifications
You must be signed in to change notification settings - Fork 243
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
Separate layers - Application + Project #5293
Separate layers - Application + Project #5293
Conversation
✔️ Deploy Preview for odo-docusaurus-preview ready! 🔨 Explore the source changes: 05acfba 🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/61d59d510a683400082b2d97 😎 Browse the preview: https://deploy-preview-5293--odo-docusaurus-preview.netlify.app |
bf7541c
to
1061fe5
Compare
1061fe5
to
07d6d2d
Compare
This is great 👍 I like the approach with /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kadel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that at times I have requested/suggested changes in the piece of code that you have only copied over. I have done that since we are sort of refactoring the bits here. If you think we should handle them separately, we can discuss.
@@ -0,0 +1,111 @@ | |||
package application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a separate kubernetes.go
? Are we going to have a openshift.go
at some point? Also, #5247 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not particularly, this is to separate the implementation from the definition of the interface, and to make something similar to url
and storage
.
} | ||
|
||
// NewCmdDescribe implements the odo command. | ||
func NewCmdDescribe(name, fullName string) *cobra.Command { | ||
o := NewDescribeOptions() | ||
kubclient, _ := kclient.New() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubclient, _ := kclient.New() | |
// The error is not handled at this point, it will be handled during Context creation | |
kubclient, _ := kclient.New() |
} | ||
|
||
// NewCmdList implements the odo command. | ||
func NewCmdList(name, fullName string) *cobra.Command { | ||
o := NewListOptions() | ||
kubclient, _ := kclient.New() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubclient, _ := kclient.New() | |
// The error is not handled at this point, it will be handled during Context creation | |
kubclient, _ := kclient.New() |
} | ||
|
||
// List all applications names in current project by looking at `app` labels in deployments | ||
func (o kubernetesClient) List() ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking out loud...
Should this function and other List
functions in business logic return a struct (AppList
in this case) which can be used as-is if the user requested JSON output; and if the user requested human-readable output, the CLI layer could parse things?
I'm thinking this way because:
- IIUC, k8s does this by default, in the sense that
kubectl
gets a big JSON which it parses to print human-readable output. - Our business layer could act as an API provided we don't break it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would an interesting subject for another refactoring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Let's discuss this alongside the v3 plans.
07d6d2d
to
05acfba
Compare
@feloy: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
What type of PR is this?
/kind cleanup
What does this PR do / why we need it:
Which issue(s) this PR fixes:
Part of #5247
PR acceptance criteria:
Unit test
Integration test
Documentation
I have read the test guidelines
How to test changes / Special notes to the reviewer: