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

apply default-container-resource-requirements before LimitRange transformer #8197

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

jkandasa
Copy link
Member

@jkandasa jkandasa commented Aug 9, 2024

Changes

The PR changing the order of execution, default-container-resource-requirements will be applied before LimtRange transformer. To make the code easy maintainability, I have created a new transformer for default-container-resource-requirements and moved the existing code to there.

transformer added as follows,

pod, err := podbuilder.Build(ctx, tr, *ts,
	defaultresourcerequirements.NewTransformer(ctx), // default-container-resource-requirements
	computeresources.NewTransformer(ctx, tr.Namespace, c.limitrangeLister), // limitRange transformer
	affinityassistant.NewTransformer(ctx, tr.Annotations),
)

/kind bug

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • pre-commit Passed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

[Bug fix]: `default-container-resource-requirements` will be applied to the container before `LimtRange`

…former

Signed-off-by: Jeeva Kandasamy <jkandasa@redhat.com>
@tekton-robot tekton-robot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 9, 2024
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/internal/defaultresourcerequirements/transformer.go Do not exist 100.0%
pkg/pod/pod.go 93.9% 92.9% -1.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/internal/defaultresourcerequirements/transformer.go Do not exist 100.0%
pkg/pod/pod.go 93.9% 92.9% -1.1

@jkandasa
Copy link
Member Author

jkandasa commented Aug 9, 2024

/cc @vdemeester

@tekton-robot tekton-robot requested a review from vdemeester August 9, 2024 04:59
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 9, 2024
@chitrangpatel
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2024
@tekton-robot tekton-robot merged commit 086e4d6 into tektoncd:main Aug 22, 2024
14 checks passed
@jkandasa jkandasa deleted the fix_default_resource branch August 22, 2024 17:48
@jkandasa
Copy link
Member Author

/cherry-pick release-v0.62.x

@tekton-robot
Copy link
Collaborator

@jkandasa: new pull request created: #8227

In response to this:

/cherry-pick release-v0.62.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jkandasa
Copy link
Member Author

/cherry-pick release-v0.59.x

@tekton-robot
Copy link
Collaborator

@jkandasa: #8197 failed to apply on top of branch "release-v0.59.x":

Applying: apply default-container-resource-requirements before LimitRange transformer
Using index info to reconstruct a base tree...
M	pkg/pod/pod.go
M	pkg/pod/pod_test.go
M	pkg/reconciler/taskrun/taskrun.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/reconciler/taskrun/taskrun.go
Auto-merging pkg/pod/pod_test.go
CONFLICT (content): Merge conflict in pkg/pod/pod_test.go
Auto-merging pkg/pod/pod.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 apply default-container-resource-requirements before LimitRange transformer
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-v0.59.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default resource requirements should be executed before LimitRange transformer
4 participants