闭包 参见http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Author: Brian Beffa <brbsix@gmail.com> | |
| # Original source: https://brbsix.github.io/2015/11/29/accessing-tab-completion-programmatically-in-bash/ | |
| # License: LGPLv3 (http://www.gnu.org/licenses/lgpl-3.0.txt) | |
| # | |
| get_completions(){ | |
| local completion COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS COMPREPLY=() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # load bash-completion helper functions | |
| source /usr/share/bash-completion/bash_completion | |
| # array of words in command line | |
| COMP_WORDS=(git a) | |
| # index of the word containing cursor position | |
| COMP_CWORD=1 | |
| # command line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (*runtime.VersionedObjects)(0xc4212cc480)({ | |
| Objects: ([]runtime.Object) (len=1 cap=1) { | |
| (*unstructured.Unstructured)(0xc42120c010)({ | |
| Object: (map[string]interface {}) (len=4) { | |
| (string) (len=10) "apiVersion": (string) (len=2) "v1", | |
| (string) (len=4) "kind": (string) (len=3) "Pod", | |
| (string) (len=8) "metadata": (map[string]interface {}) (len=1) { | |
| (string) (len=4) "name": (string) (len=8) "explorer" | |
| }, | |
| (string) (len=4) "spec": (map[string]interface {}) (len=2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //This is the flag description for `kubectl version` | |
| //message VersionFlags { | |
| // optional bool client = 2 [ (info) = { name: "client" value: "false" shorthand: "c" usage: "Client version only (no server required)."}]; | |
| // optional bool short = 3 [ (info) = { name: "short" value: "false" shorthand: "" usage: "Print just the version number."}]; | |
| // optional string output = 4 [ (info) = { name: "output" value: "" shorthand: "o" usage: "One of 'yaml' or 'json'."}]; | |
| //} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## 顺序编程 | |
| 闭包 | |
| ## 面向对象编程 | |
| ## 结构部分 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + ## kubectl apply --ignore-changed-failure=true | |
| + # Pre-Condition: no POD exists | |
| + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' | |
| + # Command: apply a pod "test-pod" (doesn't exist) should create this pod | |
| + kubectl apply -f hack/testdata/pod.yaml "${kube_flags[@]}" | |
| + # Post-Condition: pod "test-pod" is created | |
| + kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-label' | |
| + # apply with change should return 1 | |
| + ! kubectl apply -f hack/testdata/pod-apply.yaml "${kube_flags[@]}" | |
| + # apply with change but --ignore-changed-failure=true return 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (string) (len=421) "# Please edit the 'last-applied-configuration' annotations below.\n# Lines beginning with a '#' will be ignored, and an empty file will abort the edit.\n#\nkind: Service\nmetadata:\n annotations: {}\n labels:\n app: svc1\n new-label: foo\n name: svc1\n namespace: myproject\nspec\n ports:\n name: \"80\"\n port: 81\n protocol: TCP\n targetPort: 81\n sessionAffinity: None\n type: ClusterIP\nstatus:\n loadBalancer: {\n" | |
| (string) (len=535) "# Please edit the 'last-applied-configuration' annotations below.\n# Lines beginning with a '#' will be ignored, and an empty file will abort the edit.\n#\n# The edited file had a syntax error: error converting YAML to JSON: yaml: line 12: could not find expected ':'\n#\nkind: Service\nmetadata:\n annotations: {}\n labels:\n app: svc1\n new-label: foo\n name: svc1\n namespace: myproject\nspec\n ports:\n name: \"80\"\n port: 81\n protocol: TCP\n targetPort: 81\n sessionAffinity: None\n type: ClusterIP\nstatus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| To: kubernetes-membership@googlegroups.com | |
| CC: <sponsor1>, <sponsor2> | |
| Subject: REQUEST: New <sig-name> reviewer for <your-GH-handle> | |
| Body: | |
| I have joined kubernetes-dev@googlegroups.com. | |
| Sponsors: | |
| - <GH handle> / <email> | |
| - <GH handle> / <email> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ kubernetes git:(master) make test-integration WHAT=k8s.io/kubernetes/test/integration/auth | |
| +++ [0727 10:46:16] Checking etcd is on PATH | |
| /home/shiywang/GOPATH/src/k8s.io/kubernetes/third_party/etcd/etcd | |
| +++ [0727 10:46:16] Starting etcd instance | |
| etcd --advertise-client-urls http://127.0.0.1:2379 --data-dir /tmp/tmp.bNtZrZxpn4 --listen-client-urls http://127.0.0.1:2379 --debug > "/dev/null" 2>/dev/null | |
| Waiting for etcd to come up. | |
| +++ [0727 10:46:17] On try 2, etcd: : http://127.0.0.1:2379 | |
| {"action":"set","node":{"key":"/_test","value":"","modifiedIndex":4,"createdIndex":4}} | |
| +++ [0727 10:46:17] Running integration test cases | |
| Running tests for APIVersion: v1,admissionregistration.k8s.io/v1alpha1,admission.k8s.io/v1alpha1,apps/v1beta1,authentication.k8s.io/v1,authentication.k8s.io/v1beta1,authorization.k8s.io/v1,authorization.k8s.io/v1beta1,autoscaling/v1,autoscaling/v2alpha1,batch/v1,batch/v2alpha1,certificates.k8s.io/v1beta1,extensions/v1beta1,imagepolicy.k8s.io/v1alpha1,networking.k8s.io/v1,policy/v1beta1, |