Add DevfileOptions to GetPodTemplateSpec#167
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #167 +/- ##
==========================================
+ Coverage 60.41% 60.47% +0.05%
==========================================
Files 36 37 +1
Lines 4229 4369 +140
==========================================
+ Hits 2555 2642 +87
- Misses 1525 1567 +42
- Partials 149 160 +11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Philippe Martin <[email protected]>
561a872 to
4c562a1
Compare
kim-tsao
left a comment
There was a problem hiding this comment.
Can we update the copyright year in the generators file to 2022-2023
pkg/devfile/generator/generators.go
Outdated
| // PodTemplateParams is a struct that contains the required data to create a podtemplatespec object | ||
| type PodTemplateParams struct { | ||
| ObjectMeta metav1.ObjectMeta | ||
| options common.DevfileOptions |
There was a problem hiding this comment.
Is options only intended to be used within the generator package and that's why it's private?
There was a problem hiding this comment.
No, it should be public. Thanks for the catch
pkg/devfile/generator/generators.go
Outdated
| // The containers included in the podTemplateSpec can be filtered using podTemplateParams.options | ||
| func GetPodTemplateSpec(devfileObj parser.DevfileObj, podTemplateParams PodTemplateParams) (*corev1.PodTemplateSpec, error) { | ||
| containers, err := GetContainers(devfileObj, common.DevfileOptions{}) | ||
| containers, err := GetContainers(devfileObj, podTemplateParams.options) |
There was a problem hiding this comment.
Can we get additional test coverage for this?
Signed-off-by: Philippe Martin <[email protected]>
ac38a51 to
0af08e8
Compare
|
Thanks @kim-tsao for your review |
Signed-off-by: Philippe Martin <[email protected]>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feloy, kim-tsao The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?:
The PR adds the ability to filter the containers included in the
generator.PodTemplateSpec()when calling GetPodTemplateSpec. This is equivalent to filtering when callingGetContainers()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
QE Integration test
Documentation
Client Impact
Gosec scans
How to test changes / Special notes to the reviewer: