Skip to content

Handle config was not read due some issue and display what was the error instead of generic deserialization error #1644

@LeszekKalibrate

Description

@LeszekKalibrate

In file, line https://github.com/kubernetes-client/csharp/blob/master/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs#L572
There is no check that the output was successful, so when it fails we get just a dump deserialization error.

Can a simple check like string.IsNulOrEmpty be added and then if yes , throw an exception, but with the text from error output?

Sometimes I get randomly that error, and today it was due to personal access token expired, but deserialization error for an empty string does not give any hint.
Thank you.

Using:
var kubernetesClientConfig = KubernetesClientConfiguration.BuildDefaultConfig(); to read from kube/.config file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions