Skip to content

Fix kubepkg options parsing #1332

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

Merged
merged 1 commit into from
Jun 2, 2020
Merged

Fix kubepkg options parsing #1332

merged 1 commit into from
Jun 2, 2020

Conversation

saschagrunert
Copy link
Member

@saschagrunert saschagrunert commented Jun 2, 2020

What type of PR is this?

/kind regression

What this PR does / why we need it:

The custom options where not working at all before because of the
parsing in init(). This as been fixed by making the flag vars global
and the ad-hoc creation of options.Options.

Which issue(s) this PR fixes:

Fixes #1331

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

- Fixed not working `kubepkg` flag parsing

The custom options where not working at all before because of the
parsing in `init()`. This as been fixed by making the flag vars global
and the ad-hoc creation of `options.Options`.

Signed-off-by: Sascha Grunert <[email protected]>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/regression Categorizes issue or PR as related to a regression from a prior release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/release-eng Issues or PRs related to the Release Engineering subproject labels Jun 2, 2020
@k8s-ci-robot k8s-ci-robot added the sig/release Categorizes an issue or PR as relevant to SIG Release. label Jun 2, 2020
@justaugustus
Copy link
Member

Looks good locally:

$ time kubepkg debs --log-level debug --packages kubelet,kubeadm --arch amd64,arm64 --channels stable --spec-only --cni-version v0.8.7
DEBU Using log level "debug"                       file="cmd/root.go:139"
DEBU Using options: &{buildType:deb revision:0 kubeVersion: cniVersion:v0.8.7 criToolsVersion: packages:[kubelet kubeadm] channels:[stable] architectures:[amd64 arm64] releaseDownloadLinkBase:https://dl.k8s.io templateDir:templates/latest specOnly:true}  file="cmd/root.go:154"
INFO Constructing builds...                        file="kubepkg/kubepkg.go:167"
INFO Successfully constructed builds               file="kubepkg/kubepkg.go:205"
INFO Walking builds...                             file="kubepkg/kubepkg.go:210"
INFO Retrieving Kubernetes release version for release/stable  file="release/version.go:91"
INFO Retrieving Kubernetes build version from https://dl.k8s.io/release/stable.txt...  file="release/version.go:118"
INFO Retrieved Kubernetes version: v1.18.3         file="release/version.go:124"
INFO Kubernetes download link base: https://dl.k8s.io/v1.18.3  file="kubepkg/kubepkg.go:294"
INFO Setting version for kubelet package...        file="kubepkg/kubepkg.go:401"
INFO Using Kubernetes version v1.18.3 for kubelet package  file="kubepkg/kubepkg.go:406"
INFO kubelet package version: 1.18.3               file="kubepkg/kubepkg.go:305"
INFO Getting CNI version...                        file="kubepkg/kubepkg.go:438"
INFO Setting CNI version to v0.8.7                 file="kubepkg/kubepkg.go:453"
INFO Building kubelet package for amd64/amd64 architecture...  file="kubepkg/kubepkg.go:326"
INFO Package specs have successfully been built    file="kubepkg/template.go:82"
INFO Spec-only mode was selected; kubepkg will now exit without building packages  file="kubepkg/kubepkg.go:353"
INFO Retrieving Kubernetes release version for release/stable  file="release/version.go:91"
INFO Retrieving Kubernetes build version from https://dl.k8s.io/release/stable.txt...  file="release/version.go:118"
INFO Retrieved Kubernetes version: v1.18.3         file="release/version.go:124"
INFO Kubernetes download link base: https://dl.k8s.io/v1.18.3  file="kubepkg/kubepkg.go:294"
INFO Setting version for kubeadm package...        file="kubepkg/kubepkg.go:401"
INFO Using Kubernetes version v1.18.3 for kubeadm package  file="kubepkg/kubepkg.go:406"
INFO kubeadm package version: 1.18.3               file="kubepkg/kubepkg.go:305"
INFO Getting CNI version...                        file="kubepkg/kubepkg.go:438"
INFO Setting CNI version to 0.8.6                  file="kubepkg/kubepkg.go:457"
INFO Building kubeadm package for amd64/amd64 architecture...  file="kubepkg/kubepkg.go:326"
INFO Package specs have successfully been built    file="kubepkg/template.go:82"
INFO Spec-only mode was selected; kubepkg will now exit without building packages  file="kubepkg/kubepkg.go:353"
INFO Retrieving Kubernetes release version for release/stable  file="release/version.go:91"
INFO Retrieving Kubernetes build version from https://dl.k8s.io/release/stable.txt...  file="release/version.go:118"
INFO Retrieved Kubernetes version: v1.18.3         file="release/version.go:124"
INFO Kubernetes download link base: https://dl.k8s.io/v1.18.3  file="kubepkg/kubepkg.go:294"
INFO Setting version for kubelet package...        file="kubepkg/kubepkg.go:401"
INFO Using Kubernetes version v1.18.3 for kubelet package  file="kubepkg/kubepkg.go:406"
INFO kubelet package version: 1.18.3               file="kubepkg/kubepkg.go:305"
INFO Getting CNI version...                        file="kubepkg/kubepkg.go:438"
INFO Setting CNI version to v0.8.7                 file="kubepkg/kubepkg.go:453"
INFO Building kubelet package for arm64/arm64 architecture...  file="kubepkg/kubepkg.go:326"
INFO Package specs have successfully been built    file="kubepkg/template.go:82"
INFO Spec-only mode was selected; kubepkg will now exit without building packages  file="kubepkg/kubepkg.go:353"
INFO Retrieving Kubernetes release version for release/stable  file="release/version.go:91"
INFO Retrieving Kubernetes build version from https://dl.k8s.io/release/stable.txt...  file="release/version.go:118"
INFO Retrieved Kubernetes version: v1.18.3         file="release/version.go:124"
INFO Kubernetes download link base: https://dl.k8s.io/v1.18.3  file="kubepkg/kubepkg.go:294"
INFO Setting version for kubeadm package...        file="kubepkg/kubepkg.go:401"
INFO Using Kubernetes version v1.18.3 for kubeadm package  file="kubepkg/kubepkg.go:406"
INFO kubeadm package version: 1.18.3               file="kubepkg/kubepkg.go:305"
INFO Getting CNI version...                        file="kubepkg/kubepkg.go:438"
INFO Setting CNI version to 0.8.6                  file="kubepkg/kubepkg.go:457"
INFO Building kubeadm package for arm64/arm64 architecture...  file="kubepkg/kubepkg.go:326"
INFO Package specs have successfully been built    file="kubepkg/template.go:82"
INFO Spec-only mode was selected; kubepkg will now exit without building packages  file="kubepkg/kubepkg.go:353"
INFO Package specs have been saved in /tmp/kubepkg787923350  file="kubepkg/kubepkg.go:230"
INFO Successfully walked builds                    file="kubepkg/kubepkg.go:232"

Thanks for the quick fix!
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 2, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justaugustus, saschagrunert

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 2, 2020
@k8s-ci-robot k8s-ci-robot merged commit b5184f8 into kubernetes:master Jun 2, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 2, 2020
@saschagrunert saschagrunert deleted the kubepkg-options branch June 2, 2020 15:17
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. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubepkg does not respect flags
3 participants