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
Print yaml definition of CR when asked for dry-run #2810
Print yaml definition of CR when asked for dry-run #2810
Conversation
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.
@dharmit No UTs will be added because of #2739 (comment) including the the changes you made for cli packages pkg/odo/cli/service/create.go
too, right ?
/test v4.3-integration-e2e-benchmark |
Codecov Report
@@ Coverage Diff @@
## master #2810 +/- ##
==========================================
- Coverage 43.26% 43.00% -0.27%
==========================================
Files 97 97
Lines 8878 8930 +52
==========================================
- Hits 3841 3840 -1
- Misses 4673 4726 +53
Partials 364 364
Continue to review full report at Codecov.
|
Yes, that's right. The data is so dynamic that it's not possible to add much in terms of unit tests. But I'm really willing to discuss adding more integration tests if you or anyone thinks that we can add some scenario. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: girishramnani 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 |
Looks good to me, just one suggestion, we should have some difference in formatting of message and yaml
|
operators := helper.CmdShouldPass("odo", "catalog", "list", "services") | ||
etcdOperator := regexp.MustCompile(`etcdoperator\.*[a-z][0-9]\.[0-9]\.[0-9]`).FindString(operators) | ||
|
||
helper.CmdShouldPass("odo", "service", "create", etcdOperator, "--crd", "EtcdCluster", "--dry-run") |
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.
can we verify that output contains apiVersion
Kind
strings? as now this Following definition will be used to create.
is removed
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.
Makes sense to me. Done.
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
What type of PR is this?
/kind feature
What does does this PR do / why we need it:
When user does
odo service create <operator-name> --crd <crd-name> --dry-run
,it will print only the CR's yaml definition that will be used to bring up the
service.
This is needed because yaml definitions provided in the alm-examples are not
always complete. Sometimes they contain template data which needs to be
modified to be able to start the service. After this PR, we will have another
PR which will let the user specify file containing a yaml definition to bring
up the service. That's where this will yaml output in this PR will be really
helpful.
Which issue(s) this PR fixes:
Addresses first acceptance criteria of #2723.
How to test changes / Special notes to the reviewer:
export ODO_EXPERIMENTAL=true
NOTE to reviewer & QE: The output generated by above command is likely to
change when the operator is upgrade by its developers. Hence, the integration
test for this PR only checks for the presence of the line
Following definition will be used to create
.NOTE to approver: This PR is rebased on top of #2739 and hence that should
go in first.