Skip to content

Instantly share code, notes, and snippets.

@juanvallejo
juanvallejo / diff.patch
Last active July 2, 2018 15:47
Commands that bound the --template flag in kubectl 1.10 and contained the word `go-template` in --output description
diff --git a/pkg/kubectl/cmd/cmd.go b/pkg/kubectl/cmd/cmd.go
index 3bdd843b97..21ff8addc5 100644
--- a/pkg/kubectl/cmd/cmd.go
+++ b/pkg/kubectl/cmd/cmd.go
@@ -20,6 +20,7 @@ import (
"fmt"
"io"
"os"
+ "strings"
Analyzing a total of 352 packages
"Yours": 39 dependencies exclusive to ["k8s.io/kubernetes"]
- github.com/square/go-jose
- github.com/kardianos/osext
- github.com/quobyte/api
- k8s.io/sample-controller
- github.com/robfig/cron
- github.com/exponent-io/jsonpath
- k8s.io/sample-apiserver
This file has been truncated, but you can view the full file.
<!doctype html>
<meta charset="utf-8">
<title>tools/depcheck</title>
<script>
// https://d3js.org Version 4.13.0. Copyright 2018 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {})));
}(this, (function (exports) { 'use strict';
Analyzing a total of 259 packages
"Yours": 41 dependencies exclusive to ["k8s.io/kubernetes"]
- github.com/vmware/photon-controller-go-sdk
- github.com/russross/blackfriday
- github.com/vmware/govmomi
- github.com/rubiojr/go-vhd
- github.com/robfig/cron
- github.com/renstrom/dedent
- k8s.io/code-generator
$ oc get pods -o custom-columns=FOO:.metadata.name
FOO
docker-registry-1-kjqrm
persistent-volume-setup-szpw9
router-1-dlgkt
I0223 16:08:30.622375 2391 request.go:874] Response Body: {"kind":"Table","apiVersion":"meta.k8s.io/v1beta1","metadata":{"selfLink":"/apis/extensions/v1beta1/namespaces/default/deployments","resourceVersion":"227"},"columnDefinitions":[{"name":"Name","type":"string","format":"name","description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names","priority":0},{"name":"Created At","type":"date","format":"","description":"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only.
oc get pod,svc --sort-by='{.metadata.name}'
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
docker-registry ClusterIP 172.30.1.1 <none> 5000/TCP 1h
NAME READY STATUS RESTARTS AGE
docker-registry-1-kjqrm 1/1 Running 0 1h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 172.30.0.1 <none> 443/TCP,53/UDP,53/TCP 1h
oc get pod,svc --sort-by='{.spec.restartPolicy}'
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
router ClusterIP 172.30.230.132 <none> 80/TCP,443/TCP,1936/TCP 1h
kubernetes ClusterIP 172.30.0.1 <none> 443/TCP,53/UDP,53/TCP 1h
docker-registry ClusterIP 172.30.1.1 <none> 5000/TCP 1h
NAME READY STATUS RESTARTS AGE
docker-registry-1-kjqrm 1/1 Running 0 1h
router-1-dlgkt 1/1 Running 0 1h
persistent-volume-setup-szpw9 0/1 Completed 0 1h
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.0-alpha.1.2590+4879c8779666cc-dirty", GitCommit:"4879c8779666cc71148f3c4be6473b79103a5545", GitTreeState:"dirty", BuildDate:"2018-02-21T23:28:23Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"archive", BuildDate:"2018-02-21T23:49:01Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}

$ kubectl get pods -v8
I0221 18:53:02.806008   14065 round_trippers.go:383] GET http://127.0.0.1:8080/api/v1/namespaces/default/pods?limit=500
I0221 18:53:02.806022   14065 round_trippers.go:390] Request Headers:
I0221 18:53:02.806029   14065 round_trippers.go:393]     Accept: application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json
I0221 18:53:02.806036   14065 round_trippers.go:393]     User-Agent: kubectl/v1.10.0 (linux/amd64) kubernetes/4879c87