{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/11448","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/11448/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/11448/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/11448/events","html_url":"https://github.com/openshift/origin/pull/11448","id":183998205,"number":11448,"title":"[WIP] fix nil printer panic in oc set sub-commands","user":{"login":"juanvallejo","id":3902875,"avatar_url":"https://avatars.githubusercontent.com/u/3902875?v=3","gravatar_id":"","url":"https://api.github.com/users/juanvallejo","html_url":"https://github.com/juanvallejo","followers_url":"https://api.github.com/users/juanvallejo/followers","following_url":"https://api.github.com/users/juanvallejo/following{/other_user}","gists_url":"https://api.github.com/users/juanvallejo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanvallejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanvallejo/subscriptions","organizations_url":"https://api.github.com/users/juanvallejo/orgs","repos_url":"https://api.github.com/users/juanvallejo/repos","events_url":"https://api.github.com/users/juanvallejo/events{/privacy}","received_events_url":"https://api.github.com/users/juanvallejo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-19T15:38:36Z","updated_at":"2016-10-19T18:12:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/11448","html_url":"https://github.com/openshift/origin/pull/11448","diff_url":"https://github.com/openshift/origin/pull/11448.diff","patch_url":"https://github.com/openshift/origin/pull/11448.patch"},"body":"Fixes https://github.com/openshift/origin/issues/11439\r\n\r\n##### Sub-commands that potentially need to be addressed\r\n- [x] `set/env.go`\r\n- [ ] `set/buildsecret.go`\r\n- [ ] `set/triggers.go`\r\n- [ ] `set/volume.go`\r\n- [ ] `set/probe.go`\r\n- [ ] `set/buildhook.go`\r\n- [ ] `set/deploymenthook.go`\r\n\r\n@openshift/cli-review @csrwng "},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/254895405","html_url":"https://github.com/openshift/origin/pull/11448#issuecomment-254895405","issue_url":"https://api.github.com/repos/openshift/origin/issues/11448","id":254895405,"user":{"login":"juanvallejo","id":3902875,"avatar_url":"https://avatars.githubusercontent.com/u/3902875?v=3","gravatar_id":"","url":"https://api.github.com/users/juanvallejo","html_url":"https://github.com/juanvallejo","followers_url":"https://api.github.com/users/juanvallejo/followers","following_url":"https://api.github.com/users/juanvallejo/following{/other_user}","gists_url":"https://api.github.com/users/juanvallejo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanvallejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanvallejo/subscriptions","organizations_url":"https://api.github.com/users/juanvallejo/orgs","repos_url":"https://api.github.com/users/juanvallejo/repos","events_url":"https://api.github.com/users/juanvallejo/events{/privacy}","received_events_url":"https://api.github.com/users/juanvallejo/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T18:12:01Z","updated_at":"2016-10-19T18:12:01Z","body":"@csrwng from what I have seen, `oc set ...` commands seem to support [these output formats](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/resource_printer.go#L71-L128), although with formats such as `custom-columns` which require a `custom-columns=COL1` syntax, the `=` is not handled between key-value pairs, preventing the format from being parsed correctly.\r\n\r\nIn the case of the `-o wide` print format, I tried to see if I could simply return a `HumanReadablePrinter` [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/resource_printer.go#L138), but after trying this out, I found out that some resources, such as `DeploymentConfigs` won't work, causing an error output such as this one to be printed instead:\r\n\r\n```\r\n$  oc new-app node -o yaml | oc set env -f - MYVAR=value -o wide\r\n\r\nerror: unknown type &v1.DeploymentConfig{TypeMeta:unversioned.TypeMeta{Kind:\"DeploymentConfig\", APIVersion:\"v1\"}, ObjectMeta:v1.ObjectMeta{Name:\"node\", GenerateName:\"\", Namespace:\"default\", SelfLink:\"\", UID:\"\", ResourceVersion:\"\", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string{\"app\":\"node\"}, Annotations:map[string]string{\"openshift.io/generated-by\":\"OpenShiftNewApp\"}, OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:\"\"}, Spec:v1.DeploymentConfigSpec{Strategy:v1.DeploymentStrategy{Type:\"Rolling\", CustomParams:(*v1.CustomDeploymentStrategyParams)(nil), RecreateParams:(*v1.RecreateDeploymentStrategyParams)(nil), RollingParams:(*v1.RollingDeploymentStrategyParams)(0xc42085ea40), Resources:v1.ResourceRequirements{Limits:v1.ResourceList(nil), Requests:v1.ResourceList(nil)}, Labels:map[string]string(nil), Annotations:map[string]string(nil)}, MinReadySeconds:0, Triggers:v1.DeploymentTriggerPolicies{v1.DeploymentTriggerPolicy{Type:\"ConfigChange\", ImageChangeParams:(*v1.DeploymentTriggerImageChangeParams)(nil)}, v1.DeploymentTriggerPolicy{Type:\"ImageChange\", ImageChangeParams:(*v1.DeploymentTriggerImageChangeParams)(0xc42087d220)}}, Replicas:1, RevisionHistoryLimit:(*int32)(nil), Test:false, Paused:false, Selector:map[string]string{\"app\":\"node\", \"deploymentconfig\":\"node\"}, Template:(*v1.PodTemplateSpec)(0xc4204d14a0)}, Status:v1.DeploymentConfigStatus{LatestVersion:0, ObservedGeneration:0, Replicas:0, UpdatedReplicas:0, AvailableReplicas:0, UnavailableReplicas:0, Details:(*v1.DeploymentDetails)(nil), Conditions:[]v1.DeploymentCondition(nil)}}\r\n```"}}
{"actor":{"display_login":"juanvallejo"}}