Skip to content
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

Add support for "pod-overrides" attribute #158

Merged
merged 4 commits into from
Jan 5, 2023

Conversation

valaparthvi
Copy link
Contributor

What does this PR do?:

Adds support for pod-overrides attribute, as described in devfile/api#920 (comment).

The logic for this PR is motivated by devfile/devworkspace-operator#967.

Which issue(s) this PR fixes:

Fixes part of devfile/api#936

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.

  • Open new test/doc issues under the devfile/api repo
  • Check each criteria if:
  • There is a separate tracking issue. Add the issue link under the criteria
    or
  • test/doc updates are made as part of this PR
  • If unchecked, explain why it's not needed

Will work on docs once the PR is approved.

  • Client Impact

  • Gosec scans

How to test changes / Special notes to the reviewer:

Override fields such as securityContext or resources of a pod by using components[*].container.attributes or metadata.attributes field.

@valaparthvi valaparthvi force-pushed the pod-overrides branch 2 times, most recently from bbd501c to b8db5e1 Compare December 8, 2022 08:45
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Base: 59.04% // Head: 59.52% // Increases project coverage by +0.48% 🎉

Coverage data is based on head (ae3d5d1) compared to base (7beda08).
Patch coverage: 81.44% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #158      +/-   ##
==========================================
+ Coverage   59.04%   59.52%   +0.48%     
==========================================
  Files          36       36              
  Lines        4131     4225      +94     
==========================================
+ Hits         2439     2515      +76     
- Misses       1549     1561      +12     
- Partials      143      149       +6     
Impacted Files Coverage Δ
pkg/devfile/generator/generators.go 63.89% <53.84%> (-0.63%) ⬇️
pkg/devfile/generator/utils.go 90.14% <85.71%> (-0.75%) ⬇️

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Parthvi Vala <pvala@redhat.com>
@valaparthvi
Copy link
Contributor Author

@maysunfaisal @kim-tsao can one of you review it?

@valaparthvi
Copy link
Contributor Author

@maysunfaisal @kim-tsao Can I get a review on this?

Copy link
Member

@maysunfaisal maysunfaisal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestions to add 2 test cases

}
podTemplateSpec, err := getPodTemplateSpec(globalAttributes, components, podTemplateSpecParams)
if err != nil {
return nil, err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you see if you can add one test to cover the err case for this func

}
for _, component := range components {
if component.Attributes.Exists(PodOverridesAttribute) {
return true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a test case where we have only component attribute and no global attribute to cover this?

Signed-off-by: Parthvi Vala <pvala@redhat.com>
@valaparthvi valaparthvi requested review from maysunfaisal and removed request for kim-tsao January 5, 2023 18:31
@openshift-ci
Copy link

openshift-ci bot commented Jan 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maysunfaisal, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants