trident
trident copied to clipboard
tridentctl erroneously captures kubectl stderr output
Describe the bug It looks like tridentctl is erroneously intercepting kubectl stderr. Example:
% ./trident-installer-24.02.0/extras/macos/bin/tridentctl -d version
DEBU[2024-03-12T14:10:11-05:00] >>>> command.ExecuteWithoutLog args="[get serviceaccount default -o=json]" command=kubectl
DEBU[2024-03-12T14:10:12-05:00] <<<< command.ExecuteWithoutLog command=kubectl error="<nil>"
Error: invalid character 'W' looking for beginning of value
kubectl in my environment (rancher-deployed cluster) is currently emitting a warning:
% kubectl get nodes
Warning: Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
NAME STATUS ROLES AGE VERSION
...
Environment
- Rancher-deployed cluster, v1.27.11+rke2r1.
- Trident version: 24.02.0
To Reproduce Run tridentctl with underlying kubectl configuration using legacy tokens
Expected behavior tridentctl version output emitted.
Additional context One way to work around this, which we've done for now, is to disable the LegacyServiceAccountTokenTracking k8s feature gate. That makes the kubectl warning go away, which makes things work.