-
Notifications
You must be signed in to change notification settings - Fork 307
Closed
Labels
lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Description
Hello,
I used F# code similar to the following to retrieve a secret from the k8s API:
open k8s
open k8s.Models
open System.IO
open System.Threading
let retrieveSecret (client: IKubernetes) (nspace: string) (secret: string) : Async<string> =
async {
let! v1Secret = client.ReadNamespacedSecretAsync (secret, nspace, "false", CancellationToken.None) |> Async.AwaitTask
return Yaml.SaveToString v1Secret
}
[<EntryPoint>]
let main argv =
let kClientConfig = KubernetesClientConfiguration.BuildDefaultConfig()
use kClient = new Kubernetes(kClientConfig)
async {
let! secretText = retrieveSecret kClient "mynamespace" "mysecret"
return printfn "%s" secretText
} |> Async.RunSynchronously
0Which will print the secret mysecret from the namespace mynamespace. The issue is that the secret is printed with a data field, which is assumed to be base64-encoded, but is instead printed as plain text, making the secret printed ill-formed.
As a workaround, I have replaced "\ndata:" with "\nstringData:" in the output, but this is obviously less than ideal and the secret returned should be of the correct form.
Unfortunately, I do not currently have the time to offer to help fix this.
Versions:
k8s server: tested on 1.17.6
KubernetesClient for .NET: 5.0.4
NxSoftware
Metadata
Metadata
Assignees
Labels
lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.