-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Fixes get --show-all #18165
Fixes get --show-all #18165
Conversation
Labelling this PR as size/M |
51c0d89
to
ec1811b
Compare
GCE e2e build/test failed for commit 51c0d89f4a91ce9885150846cc7cffbfa2a25df0. |
GCE e2e build/test failed for commit ec1811b4adf4d0a87a0ee002c09ccd910bd51016. |
@@ -600,15 +641,6 @@ func printPodBase(pod *api.Pod, w io.Writer, withNamespace bool, wide bool, show | |||
return err | |||
} | |||
|
|||
func printPodList(podList *api.PodList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these two functions moved without code changes? It might be better to keep them where they were, to make it easier to keep track of code changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were moved without changes, the PrintObj
method of HumanReadablePrinter
is a little misplaced. Reverted.
ec1811b
to
d4939fb
Compare
Labelling this PR as size/XS |
GCE e2e test build/test passed for commit d4939fba8daf076a5a8cd08489743346d206323e. |
No, don't change the logic. Using showIfTerminating is to solve the problem that couldn't get the terminated pod by name. kubectl get pod should retrieve the pod regardless of its state. kubectl get pods would hide all terminated pods. If showIfTerminating is a little confusing, make the variable "showWhateverPodPhase" or other meaningful variable. |
By default (--show-all=false), kubectl get pods would hide all terminated pods. When --show-all=true, kubectl get pods would show all pods. |
@feihujiang
In result, the check in line 545 will never be fulfilled, making |
@fabianofranz The problem is, change in this commit make |
We changed We should find a new way to hide terminated pods by default if not getting the pod by its name, and show all pods when |
Yes, should find a new way to hide terminated pods. |
What about removing |
@fabianofranz sounds good! And as @feihujiang mentioned, we should hide terminated pods when |
d4939fb
to
eabb9f2
Compare
Labelling this PR as size/M |
Ok, changed this to remove |
LGTM-- my comment is optional. |
// HasNames returns true if the provided args contain resource names | ||
func HasNames(args []string) bool { | ||
args = normalizeMultipleResourcesArgs(args) | ||
hasCombinedTypes, _ := hasCombinedTypeArgs(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this function need to return the error, so that we can handle the error as early as possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check the returned error here.
Adding a test for this function in test-cmd.sh is better. :) |
@feihujiang Yeah, I'll add a |
We couldn't test this in |
Add unit test is ok. :) |
eabb9f2
to
37a83a0
Compare
Labelling this PR as size/L |
The printer already has some tests, so I added some for the flag enforcing and |
GCE e2e test build/test passed for commit 37a83a0785ef0f07c3f36818ef0676f3018e5c69. |
LGTM |
@janetkuo LGTMed, up to you to tag this. tks everyone! |
args: []string{"rc/foo", "rc/bar", "rc/zee"}, | ||
expectedHasName: true, | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add ""
and invalid test cases such as "rc/foo", "bar"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
Mostly LG other than nits. Thanks! |
37a83a0
to
717896e
Compare
GCE e2e test build/test passed for commit 717896e. |
@janetkuo comments addressed. |
Thanks! LGTM. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 717896e. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
Automatic merge from submit-queue (batch tested with PRs 18129, 18152, 17403, 18020, 18165). UPSTREAM: 57422: Rework method of updating atomic-updated data volumes **What this PR does / why we need it**: This is a backport of kubernetes#57422 This change affects the way that secret, configmap, downwardAPI and projected volumes (which all use the same underlying code) implement their data update functionality. * Instead of creating a subdirectory hierarchy that will contain symlinks to each actual data file, create only symlinks to items in the root of the volume, whether they be files or directories. * Rather than comparing the user-visible data directory to see if an update is needed, compare with the current version of the data directory. * Fix data dir timestamp format year * Create `..data` symlink even when a data volume has no data so consumers can have simplified update watch logic. **Which issue(s) this PR fixes** This addresses https://bugzilla.redhat.com/show_bug.cgi?id=1516569 and https://bugzilla.redhat.com/show_bug.cgi?id=1430322 **Special notes for your reviewer**: **Release note**: ```release-note Allow volumes to be mounted beneath secret volumes [1430322] [1516569] ``` Origin-commit: 91d864d470581d67e38bbe3fe3b967aeea3feded
Automatic merge from submit-queue (batch tested with PRs 18129, 18152, 17403, 18020, 18165). UPSTREAM: 57422: Rework method of updating atomic-updated data volumes **What this PR does / why we need it**: This is a backport of kubernetes#57422 This change affects the way that secret, configmap, downwardAPI and projected volumes (which all use the same underlying code) implement their data update functionality. * Instead of creating a subdirectory hierarchy that will contain symlinks to each actual data file, create only symlinks to items in the root of the volume, whether they be files or directories. * Rather than comparing the user-visible data directory to see if an update is needed, compare with the current version of the data directory. * Fix data dir timestamp format year * Create `..data` symlink even when a data volume has no data so consumers can have simplified update watch logic. **Which issue(s) this PR fixes** This addresses https://bugzilla.redhat.com/show_bug.cgi?id=1516569 and https://bugzilla.redhat.com/show_bug.cgi?id=1430322 **Special notes for your reviewer**: **Release note**: ```release-note Allow volumes to be mounted beneath secret volumes [1430322] [1516569] ``` Origin-commit: 91d864d470581d67e38bbe3fe3b967aeea3feded
Fixes
showIfTerminating
in resource printer to make sure it only skips terminating pods and detaches it from theshowAll
check.Worth to mention that both
kubectl get pods
andkubectl get pod <name>
print objects individually, soprintPodList
is never called by thekubectl get
command making--show-all=true|false
do nothing in the previous logic.