-
Notifications
You must be signed in to change notification settings - Fork 36
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
Version checks for boolean properties #126
Conversation
This patch fixes the issue raised in #697. Thanks @kim-tsao |
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.
thanks for the change Kim. besides the comment I put below, can you also add unit tests for setDefaults()
and the new function,verifyEphemeralUnset()
, introduced by this PR?
we want to have new functions also covered by unit tests
pkg/devfile/parser/parse.go
Outdated
@@ -478,6 +478,7 @@ func convertDevWorskapceTemplateToDevObj(dwTemplate v1.DevWorkspaceTemplate) (d | |||
|
|||
//setDefaults sets the default values for nil boolean properties after the merging of devWorkspaceTemplateSpec is complete | |||
func setDefaults(d DevfileObj) (err error) { | |||
schemaVersion := d.Data.GetSchemaVersion() |
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.
DevfileObj.Ctx.GetApiVersion()
should take higher priority than Data.GetSchemaVersion()
.
if devfileVersion = DevfileObj.Ctx.GetApiVersion(); devfileVersion == "" {
devfileVersion = DevfileObj.Data.GetSchemaVersion()
}
|
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.
Changes lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kim-tsao, yangcao77 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 |
What does this PR do?:
Adds a version check when setting defaults for the ephemeral property
Which issue(s) this PR fixes:
devfile/api#697
PR acceptance criteria:
Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.
Unit/Functional tests
The functional tests only cover what's fixed in the defect. Additional coverage will be handled in this issue devfile/api#655
QE Integration test
Documentation
Client Impact
How to test changes / Special notes to the reviewer:
build a new odo binary and run the scenario detailed in devfile/api#697