jiebi/CodeConvo huggingface dataset:
<ins> // Build it with: //   $ dot -Tsvg releasing.dot >releasing.svg digraph tagged_release { size = "5,5" // Arrows go up. rankdir = BT subgraph left { // Group the left nodes together. ci012abc -> pr101 -> ci345cde -> pr102 style = invis } subgraph right { // Group the right nodes together. version_commit -> dev_commit style = invis } { // Align the version commit and the info about it. rank = same // Align them with pr101 pr101 version_commit // release_info shows the change in the commit. release_info } { // Align the dev commit and the info about it. rank = same // Align them with 345cde ci345cde dev_commit dev_info } // Join the nodes from subgraph left. pr99 -> ci012abc pr102 -> pr100 // Do the version node. pr99 -> version_commit dev_commit -> pr100 tag -> version_commit pr99 [ label = "Merge PR #99" shape = box fillcolor = "#ccccff" style = "filled" fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" ]; ci012abc [ label = "012abc" shape = circle fillcolor = "#ffffcc" style = "filled" fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" ]; pr101 [ label = "Merge PR #101" shape = box fillcolor = "#ccccff" style = "filled" fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" ]; ci345cde [ label = "345cde" shape = circle fillcolor = "#ffffcc" style = "filled" fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" ]; pr102 [ label = "Merge PR #102" shape = box fillcolor = "#ccccff" style = "filled" fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" ]; version_commit [ label = "678fed" shape = circle fillcolor = "#ccffcc" style = "filled" fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" ]; dev_commit [ label = "456dcb" shape = circle fillcolor = "#ffffcc" style = "filled" fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" ]; pr100 [ label = "Merge PR #100" shape = box fillcolor = "#ccccff" style = "filled" fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" ]; release_info [ label = "pkg/version/base.go:ngitVersion = "v0.5";" shape = none fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" ]; dev_info [ label = "pkg/version/base.go:ngitVersion = "v0.5-dev";" shape = none fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" ]; tag [ label = "$ git tag -a v0.5" fillcolor = "#ffcccc" style = "filled" fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" ]; } </ins>
{% set auth_path = "-auth_path=/var/lib/kubelet/kubernetes_auth" -%} <ins> {% set registry_qps = "-registry_qps=0.1" %} </ins> DAEMON_ARGS="{{daemon_args}} {{etcd_servers}} {{apiservers}} {{auth_path}} {{hostname_override}} {{address}} {{config}} --allow_privileged={{pillar['allow_privileged']}}"
// TODO: get the real minion object of ourself, // and use the real minion name and UID. ref := &api.ObjectReference{ <del> Kind: "Minion", Name: kl.hostname, UID:  kl.hostname, </del> <ins> Kind:      "Minion", Name:      kl.hostname, UID:       kl.hostname, Namespace: api.NamespaceDefault, </ins> } record.Eventf(ref, "", "starting", "Starting kubelet.") }
if !util.IsQualifiedName(strings.ToLower(k)) { allErrs = append(allErrs, errs.NewFieldInvalid(field, k, qualifiedNameErrorMsg)) } <del> if !util.IsValidAnnotationValue(v) { allErrs = append(allErrs, errs.NewFieldInvalid(field, k, "")) } </del> totalSize += (int64)(len(k)) + (int64)(len(v)) } if totalSize > (int64)(totalAnnotationSizeLimitB) { <del> allErrs = append(allErrs, errs.NewFieldTooLong("annotations", "")) </del> <ins> allErrs = append(allErrs, errs.NewFieldTooLong(field, "", totalAnnotationSizeLimitB)) </ins> } return allErrs }
func (v *ValidationError) Error() string { var s string switch v.Type { <del> case ValidationErrorTypeRequired: </del> <ins> case ValidationErrorTypeRequired, ValidationErrorTypeTooLong: </ins> s = spew.Sprintf("%s: %s", v.Field, v.Type) default: s = spew.Sprintf("%s: %s '%+v'", v.Field, v.Type, v.BadValue)
return &ValidationError{ValidationErrorTypeNotFound, field, value, ""} } <del> func NewFieldTooLong(field string, value interface{}) *ValidationError { return &ValidationError{ValidationErrorTypeTooLong, field, value, ""} </del> <ins> func NewFieldTooLong(field string, value interface{}, maxLength int) *ValidationError { return &ValidationError{ValidationErrorTypeTooLong, field, value, fmt.Sprintf("must have at most %d characters", maxLength)} </ins> } type ValidationErrorList []error
} pod.Spec.Containers = newContainers if !api.Semantic.DeepEqual(pod.Spec, oldPod.Spec) { <del> // TODO: a better error would include all immutable fields explicitly. allErrs = append(allErrs, errs.NewFieldInvalid("spec.containers", newPod.Spec.Containers, "some fields are immutable")) </del> <ins> allErrs = append(allErrs, errs.NewFieldInvalid("spec", newPod.Spec, "may not update fields other than container.image")) </ins> } newPod.Status = oldPod.Status
if err != nil { glog.Errorf("Unable to get pod with name %q and uid %q info, health checks may be invalid", podFullName, uid) } <del> netInfo, found := podStatus.Info[dockertools.PodInfraContainerName] if found { podStatus.PodIP = netInfo.PodIP } </del> for _, container := range pod.Spec.Containers { expectedHash := dockertools.HashContainer(&container)
return nil, false } <ins> // getPhase returns the phase of a pod given its container info. func getPhase(spec *api.PodSpec, info api.PodInfo) api.PodPhase { if info == nil { return api.PodPending } running := 0 waiting := 0 stopped := 0 failed := 0 succeeded := 0 unknown := 0 for _, container := range spec.Containers { if containerStatus, ok := info[container.Name]; ok { if containerStatus.State.Running != nil { running++ } else if containerStatus.State.Termination != nil { stopped++ if containerStatus.State.Termination.ExitCode == 0 { succeeded++ } else { failed++ } } else if containerStatus.State.Waiting != nil { waiting++ } else { unknown++ } } else { unknown++ } } switch { case waiting > 0: // One or more containers has not been started return api.PodPending case running > 0 && unknown == 0: // All containers have been started, and at least // one container is running return api.PodRunning case running == 0 && stopped > 0 && unknown == 0: // All containers are terminated if spec.RestartPolicy.Always != nil { // All containers are in the process of restarting return api.PodRunning } if stopped == succeeded { // RestartPolicy is not Always, and all // containers are terminated in success return api.PodSucceeded } if spec.RestartPolicy.Never != nil { // RestartPolicy is Never, and all containers are // terminated with at least one in failure return api.PodFailed } // RestartPolicy is OnFailure, and at least one in failure // and in the process of restarting return api.PodRunning default: return api.PodPending } } </ins> // GetPodStatus returns information from Docker about the containers in a pod func (kl *Kubelet) GetPodStatus(podFullName string, uid types.UID) (api.PodStatus, error) { <del> var manifest api.PodSpec </del> <ins> var spec api.PodSpec </ins> for _, pod := range kl.pods { if GetPodFullName(&pod) == podFullName { <del> manifest = pod.Spec </del> <ins> spec = pod.Spec </ins> break } } <del> info, err := dockertools.GetDockerPodInfo(kl.dockerClient, manifest, podFullName, uid) </del> <ins> info, err := dockertools.GetDockerPodInfo(kl.dockerClient, spec, podFullName, uid) </ins> <del> // TODO(dchen1107): Determine PodPhase here </del> var podStatus api.PodStatus <ins> podStatus.Phase = getPhase(&spec, info) netContainerInfo, found := info[dockertools.PodInfraContainerName] if found { podStatus.PodIP = netContainerInfo.PodIP } // TODO(dchen1107): Change Info to list from map </ins> podStatus.Info = info return podStatus, err
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" <del> "github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/leaky" </del> "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/pod"
newStatus.Phase = api.PodUnknown } else { newStatus.Info = result.Status.Info <del> newStatus.Phase = getPhase(&pod.Spec, newStatus.Info) if netContainerInfo, ok := newStatus.Info[leaky.PodInfraContainerName]; ok { if netContainerInfo.PodIP != "" { newStatus.PodIP = netContainerInfo.PodIP } </del> <ins> newStatus.PodIP = result.Status.PodIP if newStatus.Info == nil { // There is a small race window that kubelet couldn't // propulated the status yet. This should go away once // we removed boundPods newStatus.Phase = api.PodPending } else { newStatus.Phase = result.Status.Phase </ins> } } return newStatus, err
} wg.Wait() } <del> // getPhase returns the phase of a pod given its container info. // TODO(dchen1107): push this all the way down into kubelet. func getPhase(spec *api.PodSpec, info api.PodInfo) api.PodPhase { if info == nil { return api.PodPending } running := 0 waiting := 0 stopped := 0 failed := 0 succeeded := 0 unknown := 0 for _, container := range spec.Containers { if containerStatus, ok := info[container.Name]; ok { if containerStatus.State.Running != nil { running++ } else if containerStatus.State.Termination != nil { stopped++ if containerStatus.State.Termination.ExitCode == 0 { succeeded++ } else { failed++ } } else if containerStatus.State.Waiting != nil { waiting++ } else { unknown++ } } else { unknown++ } } switch { case waiting > 0: // One or more containers has not been started return api.PodPending case running > 0 && unknown == 0: // All containers have been started, and at least // one container is running return api.PodRunning case running == 0 && stopped > 0 && unknown == 0: // All containers are terminated if spec.RestartPolicy.Always != nil { // All containers are in the process of restarting return api.PodRunning } if stopped == succeeded { // RestartPolicy is not Always, and all // containers are terminated in success return api.PodSucceeded } if spec.RestartPolicy.Never != nil { // RestartPolicy is Never, and all containers are // terminated with at least one in failure return api.PodFailed } // RestartPolicy is OnFailure, and at least one in failure // and in the process of restarting return api.PodRunning default: return api.PodPending } } </del>
"reflect" "sync" "testing" <del> "time" </del> "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/leaky" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/registrytest" <del> "github.com/GoogleCloudPlatform/kubernetes/pkg/util" </del> ) type podInfoCall struct {
if status == nil { t.Errorf("Unexpected non-status.") } <del> expected := &api.PodStatus{ Phase:  "Pending", Host:   "machine", HostIP: "1.2.3.5", Info: api.PodInfo{ "bar": api.ContainerStatus{}, }, } if !reflect.DeepEqual(status, expected) { t.Errorf("expected:n%#vngot:n%#vn", expected, status) } </del> } type podCacheTestConfig struct {
} } <del> func TestFillPodStatus(t *testing.T) { pod := makePod(api.NamespaceDefault, "foo", "machine", "bar") expectedIP := "1.2.3.4" expectedTime, _ := time.Parse("2013-Feb-03", "2013-Feb-03") config := podCacheTestConfig{ kubeletContainerInfo: api.PodStatus{ Phase:  api.PodPending, Host:   "machine", HostIP: "ip of machine", PodIP:  expectedIP, Info: api.PodInfo{ leaky.PodInfraContainerName: { State: api.ContainerState{ Running: &api.ContainerStateRunning{ StartedAt: util.NewTime(expectedTime), }, }, RestartCount: 1, PodIP:        expectedIP, }, }, }, nodes: []api.Node{*makeHealthyNode("machine", "ip of machine")}, pods:  []api.Pod{*pod}, } cache := config.Construct() err := cache.updatePodStatus(&config.pods[0]) if err != nil { t.Fatalf("Unexpected error: %+v", err) } status, err := cache.GetPodStatus(pod.Namespace, pod.Name) if e, a := &config.kubeletContainerInfo, status; !reflect.DeepEqual(e, a) { t.Errorf("Expected: %+v, Got %+v", e, a) } } </del> func TestFillPodInfoNoData(t *testing.T) { pod := makePod(api.NamespaceDefault, "foo", "machine", "bar") expectedIP := ""
return &containerStatus, nil } <del> // GetDockerPodInfo returns docker info for all containers in the pod/manifest. </del> <ins> // GetDockerPodInfo returns docker info for all containers in the pod/manifest and // infrastructure container </ins> func GetDockerPodInfo(client DockerInterface, manifest api.PodSpec, podFullName string, uid types.UID) (api.PodInfo, error) { info := api.PodInfo{} expectedContainers := make(map[string]api.Container)
// Assume info is ready to process podStatus.Phase = getPhase(spec, info) <ins> podStatus.Info = api.PodInfo{} </ins> for _, c := range spec.Containers { containerStatus := info[c.Name] containerStatus.Ready = kl.readiness.IsReady(containerStatus) <del> info[c.Name] = containerStatus </del> <ins> podStatus.Info[c.Name] = containerStatus </ins> } <del> podStatus.Conditions = append(podStatus.Conditions, getPodReadyCondition(spec, info)...) </del> <ins> podStatus.Conditions = append(podStatus.Conditions, getPodReadyCondition(spec, podStatus.Info)...) </ins> netContainerInfo, found := info[dockertools.PodInfraContainerName] if found { podStatus.PodIP = netContainerInfo.PodIP } <del> // TODO(dchen1107): Change Info to list from map podStatus.Info = info </del> return podStatus, nil }
} // Takes a list of strings and compiles them into a list of regular expressions <del> func CompileRegexps(regexpStrings StringList) ([]*regexp.Regexp, error) { </del> <ins> func CompileRegexps(regexpStrings []string) ([]*regexp.Regexp, error) { </ins> regexps := []*regexp.Regexp{} for _, regexpStr := range regexpStrings { r, err := regexp.Compile(regexpStr)
t.Errorf("diff returned %v", diff) } } <ins> func TestCompileRegex(t *testing.T) { uncompiledRegexes := []string{"endsWithMe$", "^startingWithMe"} regexes, err := CompileRegexps(uncompiledRegexes) if err != nil { t.Errorf("Failed to compile legal regexes: '%v': %v", uncompiledRegexes, err) } if len(regexes) != len(uncompiledRegexes) { t.Errorf("Wrong number of regexes returned: '%v': %v", uncompiledRegexes, regexes) } if !regexes[0].MatchString("Something that endsWithMe") { t.Errorf("Wrong regex returned: '%v': %v", uncompiledRegexes[0], regexes[0]) } if regexes[0].MatchString("Something that doesn't endsWithMe.") { t.Errorf("Wrong regex returned: '%v': %v", uncompiledRegexes[0], regexes[0]) } if !regexes[1].MatchString("startingWithMe is very important") { t.Errorf("Wrong regex returned: '%v': %v", uncompiledRegexes[1], regexes[1]) } if regexes[1].MatchString("not startingWithMe should fail") { t.Errorf("Wrong regex returned: '%v': %v", uncompiledRegexes[1], regexes[1]) } } </ins>
pod.UID = types.UID(hex.EncodeToString(hasher.Sum(nil)[0:])) glog.V(5).Infof("Generated UID %q for pod %q from file %s", pod.UID, pod.Name, filename) } <ins> // This is required for backward compatibility, and should be removed once we // completely deprecate ContainerManifest. if len(pod.Name) == 0 { pod.Name = string(pod.UID) glog.V(5).Infof("Generated Name %q for UID %q from file %s", pod.Name, pod.UID, filename) } </ins> if len(pod.Namespace) == 0 { hasher := adler32.New() fmt.Fprint(hasher, filename)
pod.UID = types.UID(hex.EncodeToString(hasher.Sum(nil)[0:])) glog.V(5).Infof("Generated UID %q for pod %q from URL %s", pod.UID, pod.Name, url) } <ins> // This is required for backward compatibility, and should be removed once we // completely deprecate ContainerManifest. if len(pod.Name) == 0 { pod.Name = string(pod.UID) glog.V(5).Infof("Generate Name %q from UID %q from URL %s", pod.Name, pod.UID, url) } </ins> if len(pod.Namespace) == 0 { hasher := adler32.New() fmt.Fprint(hasher, url)
}), }, { <ins> desc:      "Single manifest without ID", manifests: api.ContainerManifest{Version: "v1beta1", UUID: "111"}, expected: CreatePodUpdate(kubelet.SET, kubelet.HTTPSource, api.BoundPod{ ObjectMeta: api.ObjectMeta{ UID:       "111", Name:      "111", Namespace: "foobar", }, Spec: api.PodSpec{ RestartPolicy: api.RestartPolicy{Always: &api.RestartPolicyAlways{}}, DNSPolicy:     api.DNSClusterFirst, }, }), }, { </ins> desc: "Multiple manifests", manifests: []api.ContainerManifest{ {Version: "v1beta1", ID: "foo", UUID: "111", Containers: []api.Container{{Name: "1", Image: "foo"}}},
source "${KUBE_ROOT}/cluster/kube-env.sh" source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" <ins> function wait_for_running() { echo "Waiting for pods to come up." frontends=$(${KUBECTL} get pods -l name=frontend -o template '--template={{range.items}}{{.id}} {{end}}') master=$(${KUBECTL} get pods -l name=redis-master -o template '--template={{range.items}}{{.id}} {{end}}') slaves=$(${KUBECTL} get pods -l name=redisslave -o template '--template={{range.items}}{{.id}} {{end}}') pods=$(echo $frontends $master $slaves) all_running=0 for i in $(seq 1 30); do sleep 10 all_running=1 for pod in $pods; do status=$(${KUBECTL} get pods $pod -o template '--template={{.currentState.status}}') || true if [[ "$status" == "Pending" ]]; then all_running=0 break fi done if [[ "${all_running}" == 1 ]]; then break fi done if [[ "${all_running}" == 0 ]]; then echo "Pods did not come up in time" exit 1 fi } function teardown() { ${KUBECTL} stop -f "${GUESTBOOK}" } </ins> prepare-e2e GUESTBOOK="${KUBE_ROOT}/examples/guestbook" <del> echo "WARNING: this test is a no op that only attempts to launch guestbook resources." </del> # Launch the guestbook example ${KUBECTL} create -f "${GUESTBOOK}" <del> sleep 15 POD_LIST_1=$(${KUBECTL} get pods -o template '--template={{range.items}}{{.id}} {{end}}') echo "Pods running: ${POD_LIST_1}" # TODO make this an actual test. Open up a firewall and use curl to post and # read a message via the frontend ${KUBECTL} stop -f "${GUESTBOOK}" POD_LIST_2=$(${KUBECTL} get pods -o template '--template={{range.items}}{{.id}} {{end}}') echo "Pods running after shutdown: ${POD_LIST_2}" </del> <ins> trap "teardown" EXIT # Verify that all pods are running wait_for_running get-password detect-master # Add a new entry to the guestbook and verify that it was remembered FRONTEND_ADDR=https://${KUBE_MASTER_IP}/api/v1beta1/proxy/services/frontend echo "Waiting for frontend to serve content" serving=0 for i in $(seq 1 12); do ENTRY=$(curl ${FRONTEND_ADDR}/index.php?cmd=get&key=messages --insecure --user ${KUBE_USER}:${KUBE_PASSWORD}) echo $ENTRY if [[ $ENTRY == '{"data": ""}' ]]; then serving=1 break fi sleep 10 done if [[ "${serving}" == 0 ]]; then echo "Pods did not start serving content in time" exit 1 fi curl ${FRONTEND_ADDR}/index.php?cmd=set&key=messages&value=TestEntry --insecure --user ${KUBE_USER}:${KUBE_PASSWORD} ENTRY=$(curl ${FRONTEND_ADDR}/index.php?cmd=get&key=messages --insecure --user ${KUBE_USER}:${KUBE_PASSWORD}) if [[ $ENTRY != '{"data": "TestEntry"}' ]]; then echo "Wrong entry received: ${ENTRY}" exit 1 fi </ins> exit 0
local REGION=${ZONE%-*} gcloud compute forwarding-rules delete -q --region ${REGION} "${INSTANCE_PREFIX}-default-frontend" || true gcloud compute target-pools delete -q --region ${REGION} "${INSTANCE_PREFIX}-default-frontend" || true <ins> gcloud compute firewall-rules delete guestbook-e2e-minion-8000 -q || true fi } function wait_for_running() { echo "Waiting for pods to come up." local frontends master slaves pods all_running status i pod frontends=($(${KUBECTL} get pods -l name=frontend -o template '--template={{range.items}}{{.id}} {{end}}')) master=($(${KUBECTL} get pods -l name=redis-master -o template '--template={{range.items}}{{.id}} {{end}}')) slaves=($(${KUBECTL} get pods -l name=redis-slave -o template '--template={{range.items}}{{.id}} {{end}}')) pods=("${frontends[@]}" "${master[@]}" "${slaves[@]}") all_running=0 for i in {1..30}; do all_running=1 for pod in "${pods[@]}"; do status=$(${KUBECTL} get pods "${pod}" -o template '--template={{.currentState.status}}') || true if [[ "$status" != "Running" ]]; then all_running=0 break fi done if [[ "${all_running}" == 1 ]]; then break fi sleep 10 done if [[ "${all_running}" == 0 ]]; then echo "Pods did not come up in time" return 1 </ins> fi }
trap "teardown" EXIT <del> echo "WARNING: this test is a no op that only attempts to launch guestbook resources." </del> # Launch the guestbook example ${KUBECTL} create -f "${GUESTBOOK}" <del> sleep 15 POD_LIST_1=$(${KUBECTL} get pods -o template '--template={{range.items}}{{.id}} {{end}}') echo "Pods running: ${POD_LIST_1}" # TODO make this an actual test. Open up a firewall and use curl to post and # read a message via the frontend ${KUBECTL} stop -f "${GUESTBOOK}" POD_LIST_2=$(${KUBECTL} get pods -o template '--template={{range.items}}{{.id}} {{end}}') echo "Pods running after shutdown: ${POD_LIST_2}" </del> <ins> # Verify that all pods are running wait_for_running if [[ "${KUBERNETES_PROVIDER}" == "gce" ]]; then gcloud compute firewall-rules create --allow=tcp:8000 --network="${NETWORK}" --target-tags="${MINION_TAG}" guestbook-e2e-minion-8000 fi # Add a new entry to the guestbook and verify that it was remembered frontend_addr=$(${KUBECTL} get service frontend -o template '--template={{range .publicIPs}}{{.}}{{end}}:{{.port}}') echo "Waiting for frontend to serve content" serving=0 for i in {1..12}; do entry=$(curl "http://${frontend_addr}/index.php?cmd=get&key=messages") || true echo ${entry} if [[ "${entry}" == '{"data": ""}' ]]; then serving=1 break fi sleep 10 done if [[ "${serving}" == 0 ]]; then echo "Pods did not start serving content in time" exit 1 fi curl "http://${frontend_addr}/index.php?cmd=set&key=messages&value=TestEntry" entry=$(curl "http://${frontend_addr}/index.php?cmd=get&key=messages") if [[ "${entry}" != '{"data": "TestEntry"}' ]]; then echo "Wrong entry received: ${entry}" exit 1 fi </ins> exit 0
func stringBody(body string) io.ReadCloser { return ioutil.NopCloser(bytes.NewReader([]byte(body))) } <ins> // Verify that resource.RESTClients constructed from a factory respect mapping.APIVersion func TestClientVersions(t *testing.T) { f := NewFactory(nil) versions := []string{ "v1beta1", "v1beta2", "v1beta3", } for _, version := range versions { mapping := &meta.RESTMapping{ APIVersion: version, } c, err := f.RESTClient(nil, mapping) if err != nil { t.Errorf("unexpected error: %v", err) } client := c.(*client.RESTClient) if client.APIVersion() != version { t.Errorf("unexpected Client APIVersion: %s %v", client.APIVersion, client) } } } </ins>
) func GetVersion(w io.Writer, kubeClient client.Interface) { <ins> GetClientVersion(w) </ins> serverVersion, err := kubeClient.ServerVersion() if err != nil { fmt.Printf("Couldn't read version from server: %vn", err) os.Exit(1) } <del> GetClientVersion(w) </del> fmt.Fprintf(w, "Server Version: %#vn", *serverVersion) }