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

pkg/pod: extracting function from the package… #4261

Closed
wants to merge 1 commit into from

Conversation

vdemeester
Copy link
Member

@vdemeester vdemeester commented Sep 27, 2021

Changes

… to smaller packages.

Signed-off-by: Vincent Demeester vdemeest@redhat.com

/kind cleanup

Opening this for early feedback if those make sense. I am trying to refactor the script and breakpoint part now (both signatures and the way they are tied together and shouldn't probably).

Submitter Checklist

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

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in or deleted (only if no user facing changes)

Release Notes

Refactoring pkg/pod package by splitting it into several smaller more comprehensible packages

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Sep 27, 2021
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign vdemeester
You can assign the PR to them by writing /assign @vdemeester in a comment when ready.

The full list of commands accepted by this bot can be found 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 size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 27, 2021
@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/entrypoint.go 87.0% 90.7% 3.7
pkg/pod/script/script.go Do not exist 100.0%
pkg/pod/status/status.go Do not exist 90.8%

@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/entrypoint.go 87.0% 90.7% 3.7
pkg/pod/script/script.go Do not exist 100.0%
pkg/pod/status/status.go Do not exist 90.8%

@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/entrypoint.go 87.0% 90.7% 3.7
pkg/pod/script/script.go Do not exist 100.0%
pkg/pod/status/status.go Do not exist 90.8%

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 7, 2021
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 13, 2021
@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/script/script.go Do not exist 100.0%
pkg/pod/status/status.go Do not exist 90.8%

@vdemeester vdemeester changed the title wip: pkg/pod: extracting function from the package… pkg/pod: extracting function from the package… Oct 13, 2021
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 13, 2021
@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/entrypoint.go 86.8% 90.6% 3.7
pkg/pod/script/script.go Do not exist 100.0%
pkg/pod/status/status.go Do not exist 90.8%

@vdemeester
Copy link
Member Author

/cc @abayer @afrittoli

@vdemeester
Copy link
Member Author

/test check-pr-has-kind-label

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2021
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2021
@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/entrypoint.go 86.8% 90.6% 3.7
pkg/pod/script/script.go Do not exist 100.0%
pkg/pod/status/status.go Do not exist 90.8%

Copy link
Contributor

@abayer abayer left a comment

Choose a reason for hiding this comment

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

Looks reasonable - I had a few questions on FIXMEs. =)

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes"
)

const (
binVolumeName = "tekton-internal-bin"
binDir = "/tekton/bin"
binVolumeName = "tekton-internal-bin" // FIXME(vdemeester) remove duplication with script package
Copy link
Contributor

Choose a reason for hiding this comment

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

There comes a time in every project when a pkg/util/const.go ends up being handy. =)

@@ -159,7 +163,7 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1beta1.TaskRun, taskSpec
return nil, err
}

// Rewrite steps with entrypoint binary. Append the entrypoint init
// Rewrite steps with entrypoint binàary. Append the entrypoint init
Copy link
Contributor

Choose a reason for hiding this comment

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

Surprise accent! =)

@@ -134,18 +135,21 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1beta1.TaskRun, taskSpec

// Convert any steps with Script to command+args.
// If any are found, append an init container to initialize scripts.
// TODO(vdemeester) get one list of steps, return 1 list of containers
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean passing in one list of both steps and sidecars, and getting back one list of both step containers and sidecar containers?

@@ -134,18 +135,21 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1beta1.TaskRun, taskSpec

// Convert any steps with Script to command+args.
// If any are found, append an init container to initialize scripts.
// TODO(vdemeester) get one list of steps, return 1 list of containers
// TODO(vdemeester) extract breakpoint from scripts
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason to do this? (just trying to understand, since, honestly, last time I was in this code, breakpoints weren't a thing yet!)

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 21, 2021
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 22, 2021
@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/entrypoint.go 86.8% 90.6% 3.7
pkg/pod/status/status.go Do not exist 90.8%

… to smaller packages.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@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/sidecars/sidecars.go Do not exist 41.2%
pkg/pod/entrypoint.go 86.8% 90.6% 3.7
pkg/pod/script/script.go Do not exist 100.0%
pkg/pod/status/status.go Do not exist 90.8%

@tekton-robot
Copy link
Collaborator

@vdemeester: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-tekton-pipeline-alpha-integration-tests 1d29739 link /test pull-tekton-pipeline-alpha-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

1 similar comment
@tekton-robot
Copy link
Collaborator

@vdemeester: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-tekton-pipeline-alpha-integration-tests 1d29739 link /test pull-tekton-pipeline-alpha-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2021
@tekton-robot
Copy link
Collaborator

@vdemeester: PR needs rebase.

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.

@vdemeester
Copy link
Member Author

Rebases are getting out of hand, I'll close this one for now.
/close

@tekton-robot
Copy link
Collaborator

@vdemeester: Closed this PR.

In response to this:

Rebases are getting out of hand, I'll close this one for now.
/close

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
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants