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 container-overrides attribute #157

Merged
merged 5 commits into from
Dec 7, 2022

Conversation

valaparthvi
Copy link
Contributor

@valaparthvi valaparthvi commented Nov 28, 2022

What does this PR do?:

Adds support for container-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
  • Unit/Functional tests

  • QE Integration test

  • Documentation

    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 container by using components[*].container.attributes field.
Use the examples in devfile/api#920 (comment).

@codecov
Copy link

codecov bot commented Nov 28, 2022

Codecov Report

Base: 58.68% // Head: 59.04% // Increases project coverage by +0.35% 🎉

Coverage data is based on head (947b122) compared to base (8e009f5).
Patch coverage: 82.08% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #157      +/-   ##
==========================================
+ Coverage   58.68%   59.04%   +0.35%     
==========================================
  Files          36       36              
  Lines        4066     4131      +65     
==========================================
+ Hits         2386     2439      +53     
- Misses       1541     1549       +8     
- Partials      139      143       +4     
Impacted Files Coverage Δ
pkg/devfile/generator/utils.go 90.89% <82.08%> (-1.32%) ⬇️

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.

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.

small nit

pkg/devfile/generator/utils.go Show resolved Hide resolved
@valaparthvi valaparthvi requested review from maysunfaisal and removed request for elsony and kim-tsao December 5, 2022 10:50
@valaparthvi
Copy link
Contributor Author

valaparthvi commented Dec 5, 2022

@maysunfaisal What do I do about coverage? Would you suggest I add unit tests covering them?
Thank you for the review though 🙌

@maysunfaisal
Copy link
Member

@valaparthvi yes that would be ideal and nice

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Comment on lines +628 to +632
patched, err := containerOverridesHandler(comp, container)
if err != nil {
return nil, err
}
containers = append(containers, *patched)
Copy link
Member

Choose a reason for hiding this comment

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

can we add a test case with attributes to cover this? I think we can add one to TestGetContainers

Copy link
Contributor Author

@valaparthvi valaparthvi Dec 7, 2022

Choose a reason for hiding this comment

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

…sHandler to check for error strings

Signed-off-by: Parthvi Vala <pvala@redhat.com>
@openshift-ci openshift-ci bot added the lgtm label Dec 7, 2022
@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2022

[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