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 a flag for the path in export logs #1519

Closed
wants to merge 2 commits into from

Conversation

BenTheElder
Copy link
Member

kind export logs is currently the only CLI command accepting an argument, and it only accepts this one argument. All other commands require zero arguments.

This PR creates a migration path off of that argument by adding a flag to control it instead.
We can explore supporting arguments for --name in v0.9.0, which is more intuitive / ecosystem compatible in retrospect. minikube's --profile was probably not desirable to mimic.

i.e. we can enable kind get cluster kind2 <-> kubectl get po baz in a PR after v0.8.0 is out (so v0.8.0 only warns about the argument but still supports it and provides time to migrate).

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 27, 2020
@k8s-ci-robot k8s-ci-robot requested a review from aojea April 27, 2020 04:23
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder

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 requested a review from neolit123 April 27, 2020 04:23
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 27, 2020
} else {
logger.Warn("WARNING: --loglevel is deprecated, please switch to -v and -q!")
}
cmd.FancyWarn(logger, "--loglevel is deprecated, please switch to -v and -q!")
Copy link
Member Author

Choose a reason for hiding this comment

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

not related, just DRYing this out.

@BenTheElder
Copy link
Member Author

BenTheElder commented Apr 27, 2020 via email

@BenTheElder
Copy link
Member Author

there is also kind load ... which take one argument (the image name / path).
/hold

I'm going to tweak this slightly, but also taking a stronger look at what the ecosystem is doing these days.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 28, 2020
@BenTheElder
Copy link
Member Author

I do think we should rethink this tool a bit regardless though, the tempdir thing is a bit strange in retrospect.

@BenTheElder BenTheElder force-pushed the flag-out branch 3 times, most recently from eeefe39 to cc6a57b Compare April 28, 2020 07:46
@BenTheElder
Copy link
Member Author

Updated:

Behavior:

  • if the flag is set, do a chdir and then export to the current dir, . will be the default directory once the migration period is over
  • if the argument is set but not the flag, write to the argument and warn about migrating to the flag
  • if the flag and argument are not set, continue to use a tempdir but warn about the impending change to . as the default and the flag

Should be non-breaking for now (though warnings) with an easy path to switch your arg usage to a flag.

This helps free up options in the future for arguments and brings behavior more in line with other archiving / building tools.

Users of the tempdir mode are probably quite rare, we could add a special alternative flag for them if we find someone unable of using something like kind export logs -C $(mktemp -d).

It is not optimal to dump to a tempdir generally, you will wind up having to copy all of it to somewhere useful.

Not 100% convinced of this change though. Leaving the hold for now for others to inspect. Need to think more about how we handle other commands and try to find more usage in the wild.

@BenTheElder
Copy link
Member Author

I never commented here, but kind load ... is still an issue.
considering options.

@BenTheElder
Copy link
Member Author

I think we want to add a new kind load image anyhow that intelligently processes the image arguments looking to see if they should come from docker, podman, or appear to be a tar file path. cc @aojea

the issue is, do we take this opportunity to move to a more normal kubernetes UX with $tool $verb $proper-noun ... and make it kind load image [cluster] [images...] in this new command?

we could retrofit proper-noun into most of the other commands easily as they don't use arguments.
that leaves this command I think, which this PR already creates a solution for.

what about KIND_CLUSTER_NAME?

xref: #1766

@aojea
Copy link
Contributor

aojea commented Aug 7, 2020

We can explore supporting arguments for --name in v0.9.0

do you think --name is better as an argument? I see it more like the namespace flag in kubectl

kubectl -n myname get pods

@BenTheElder
Copy link
Member Author

i'm not sure honestly, but I think I'd still prefer to move this (directory) to a flag.

@BenTheElder
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

@BenTheElder: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kind-conformance-parallel-1-14 83340ea link /test pull-kind-conformance-parallel-1-14
pull-kind-conformance-parallel-1-13 83340ea link /test pull-kind-conformance-parallel-1-13
pull-kind-conformance-parallel-1-12 83340ea link /test pull-kind-conformance-parallel-1-12
pull-kind-unit 546f0b6 link /test pull-kind-unit
pull-kind-build 546f0b6 link /test pull-kind-build
pull-kind-verify 546f0b6 link /test pull-kind-verify
pull-kind-conformance-parallel-1-15 546f0b6 link /test pull-kind-conformance-parallel-1-15
pull-kind-conformance-parallel-ipv6 546f0b6 link /test pull-kind-conformance-parallel-ipv6
pull-kind-conformance-parallel-1-17 546f0b6 link /test pull-kind-conformance-parallel-1-17
pull-kind-e2e-kubernetes-1-18 546f0b6 link /test pull-kind-e2e-kubernetes-1-18
pull-kind-e2e-kubernetes 546f0b6 link /test pull-kind-e2e-kubernetes
pull-kind-conformance-parallel-1-16 546f0b6 link /test pull-kind-conformance-parallel-1-16

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 24, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 24, 2020
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. 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.

5 participants