container
container copied to clipboard
[Bug]: `container cluster` errors on empty/missing kubeconfig.
I have done the following
- [x] I have searched the existing issues
- [x] If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
export KUBECONFIG=$(mktemp)
container cluster create
Problem description
% export KUBECONFIG=$(mktemp)
% container cluster create
Waiting for node to boot: ["node": cluster-dev]
Preparing node: ["id": cluster-dev, "sharedImageStore": false]
Running kubeadm init: ["node": cluster-dev]
Removing control-plane taint for single-node scheduling: ["node": cluster-dev]
Applying CNI manifest: ["node": cluster-dev]
Waiting for API server to become available
Waiting for control-plane node to become ready
Waiting for kube-system pods to become ready
Fetching kubeconfig: ["cluster": cluster-dev]
Writing kubeconfig: ["cluster": cluster-dev, "path": /var/folders/6k/tnyh0vfd07z0f9mr5cg7zs5r0000gn/T/tmp.uzcgXL1mHf]
failed to write kubeconfig: ["name": cluster-dev, "error": internalError: "kubeconfig at /var/folders/6k/tnyh0vfd07z0f9mr5cg7zs5r0000gn/T/tmp.uzcgXL1mHf could not be parsed: DecodingError.typeMismatch: Expected value of type Mapping. Debug description: Expected to decode Mapping but found Node instead."]
cluster is running; use 'container cluster write-config --name cluster-dev' to write the kubeconfig
cluster-dev
% container cluster rm
Warning! Running debug build. Performance may be degraded.
Removing kubeconfig: ["cluster": cluster-dev, "path": /var/folders/6k/tnyh0vfd07z0f9mr5cg7zs5r0000gn/T/tmp.uzcgXL1mHf]
kubeconfig exists but could not be parsed, skipping removal: ["error": DecodingError.typeMismatch: Expected value of type Mapping. Debug description: Expected to decode Mapping but found Node instead., "path": /var/folders/6k/tnyh0vfd07z0f9mr5cg7zs5r0000gn/T/tmp.uzcgXL1mHf]
cluster-dev
%
Environment
- OS: 27
- Xcode: 27
- Container: main
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
I'd like to work on this — please assign it to me.
Withdrawing my claim — #2480 already has the fix for this. Please disregard my comment above.