-
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 : Preference #5296
Separate layers : Preference #5296
Conversation
✔️ Deploy Preview for odo-docusaurus-preview canceled. 🔨 Explore the source changes: 2bfa3da 🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/61dc0a4f1b8bd30007f4768a |
156fecb
to
41d8cc6
Compare
pkg/preference/implem.go
Outdated
// preferenceInfo wraps the preference and provides helpers to | ||
// serialize it. | ||
type preferenceInfo struct { | ||
Filename string `yaml:"FileName,omitempty"` | ||
Preference `yaml:",omitempty"` | ||
} |
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 think it makes more sense to define this on line 174, after defining Preference
type.
d0a7040
to
1540816
Compare
1540816
to
ca79149
Compare
a454093
to
277a8c3
Compare
01187ab
to
78ca051
Compare
/test v4.9-integration-e2e
|
/test unit
|
3a39532
to
d998350
Compare
pkg/kclient/pods_test.go
Outdated
@@ -80,7 +80,7 @@ func TestWaitAndGetPodWithEvents(t *testing.T) { | |||
|
|||
podSelector := fmt.Sprintf("deploymentconfig=%s", tt.podName) | |||
|
|||
pod, err := fakeClient.WaitAndGetPodWithEvents(podSelector, corev1.PodRunning, "Waiting for component to start") | |||
pod, err := fakeClient.WaitAndGetPodWithEvents(podSelector, corev1.PodRunning, "Waiting for component to start", time.Second) |
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.
Shouldn't this test with DefaultPushTimeout?
pkg/odo/cli/component/create.go
Outdated
return &CreateOptions{ | ||
PushOptions: NewPushOptions(prjClient), | ||
PushOptions: NewPushOptions(prjClient, prefClient), | ||
prefClient: prefClient, |
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 don't think you will need a separate prefClient here. CreateOptions 'inherits' PushOptions, thereby getting access to prefClient.
pkg/odo/cli/preference/view_test.go
Outdated
prefClient.EXPECT().UpdateNotification() | ||
prefClient.EXPECT().NamePrefix() | ||
prefClient.EXPECT().Timeout() | ||
prefClient.EXPECT().BuildTimeout() | ||
prefClient.EXPECT().PushTimeout() | ||
prefClient.EXPECT().EphemeralSourceVolume() | ||
prefClient.EXPECT().ConsentTelemetry() |
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.
Don't you need to return something here?
Co-authored-by: Parthvi Vala <pvala@redhat.com>
40925c8
to
2bfa3da
Compare
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 have one more suggestion, but seems like things are working without it as well.
} | ||
|
||
if tt.exists || tt.forceFlag { | ||
prefClient.EXPECT().DeleteConfiguration("arg1") |
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.
Should this return any error, or if nothing is mentioned, it returns a default value?
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 cannot find any documentation on this, but I assume it will return the zero values for all the returned values if we don't specify any other value.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: valaparthvi 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 |
/test v4.9-integration-e2e
|
@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. |
* Refactor preference package * Unit tests * Apply suggestions from code review Co-authored-by: Parthvi Vala <pvala@redhat.com> * Review * Review from Dharmit * Replace panic with LogErrorAndExit * Remove preference from kclient/oc_server * Remove preference.New from devfile * Remove preference.New from kclient/WaitAndGetPodWithEvents * Get prefClient from CreateOptions * Parthvi review Co-authored-by: Parthvi Vala <pvala@redhat.com>
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: