Re: [kubernetes/kubernetes] kubectl should return more information on failure (#6132)

574 views
Skip to first unread message

Michail Kargakis

unread,
Jun 2, 2017, 7:39:27 PM6/2/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@kubernetes/sig-cli-misc


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

fejta-bot

unread,
Dec 25, 2017, 11:06:27 PM12/25/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

Brian Grant

unread,
Jan 22, 2018, 4:32:38 PM1/22/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/remove-lifecycle stale
/lifecycle frozen

Brian Pursley

unread,
Apr 12, 2020, 10:00:19 AM4/12/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Hi @thockin, @smarterclayton, @bgrant0607
This issue has been open for a while, so I'm just checking to see if it is still an issue or not in the latest version.

It looks like there currently are some useful error messages given when there are problems with the json. Do you think these are sufficient or is something more detailed needed?

Here is what I tried, using kubectl v1.18.0:


Test 1: Invalid json (removed " before metadata)

kubectl create -f - << EOF
{
    "kind": "Pod",
    "apiVersion": "v1",
    metadata": {
        "name": "nginx"
    },
    "spec": {
        "containers": [
            {
                "name": "nginx",
                "image": "nginx"
            }
        ],
        "restartPolicy": "Never"
    }
}
EOF
error: error parsing STDIN: json: line 3: invalid character 'm' looking for beginning of object key string

Test 2: Json is valid but does not conform (changed spec to xspec)

kubectl create -f - << EOF
{
    "kind": "Pod",
    "apiVersion": "v1",
    "metadata": {
        "name": "nginx"
    },
    "xspec": {
        "containers": [
            {
                "name": "nginx",
                "image": "nginx"
            }
        ],
        "restartPolicy": "Never"
    }
}
EOF
error: error validating "STDIN": error validating data: ValidationError(Pod): unknown field "xspec" in io.k8s.api.core.v1.Pod; if you choose to ignore these errors, turn validation off with --validate=false


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Brian Grant

unread,
May 19, 2020, 1:59:28 AM5/19/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Thanks. I think we can close this.
/close

Kubernetes Prow Robot

unread,
May 19, 2020, 1:59:40 AM5/19/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Closed #6132.

Kubernetes Prow Robot

unread,
May 19, 2020, 1:59:41 AM5/19/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@bgrant0607: Closing this issue.

In response to this:

Thanks. I think we can close this.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Reply all
Reply to author
Forward
0 new messages