move2kube
move2kube copied to clipboard
Duplicate entires v1 for Node, Pod, NetworkPolicy, etc. when collecting cluster metadata.
Steps to reproduce
Note: This bug only occurs when collecting use the CLI. By default it will use the CLI only if the API fails.
move2kube collect -a k8s
Expected behaviour
Cluster metadata yaml should have:
Node:
- v1
Actual behaviour
Cluster metadata yaml has:
Node:
- v1
- v1
This also happens with Pod and NetworkPolicy.
This is an old bug that was never fixed.
Proposed Fix
The code that parses the CLI output needs to be looked at closely.
kubectl returns human readable output, so the parsing code is fragile.
This might be helpful: https://kubernetes.io/docs/reference/kubectl/overview/#operations https://www.mankier.com/1/kubectl-cluster-info-dump It outputs a lot of information and the format can be chosen (json, yaml, etc.).