Skip to content

Commit

Permalink
test: covering w/ test an error-catching
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Netto <[email protected]>
  • Loading branch information
nettoclaudio committed Feb 28, 2024
1 parent 03fb7c5 commit d2f8e8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/util/exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ func TestIssueClusterCredential(t *testing.T) {
expectedError: "decoding stdout: couldn't get version/kind; json parse error: json: cannot unmarshal array into Go value of type struct { APIVersion string \"json:\\\"apiVersion,omitempty\\\"\"; Kind string \"json:\\\"kind,omitempty\\\"\" }",
},

"cannot parse de API version": {
clusterName: testClusterName,
execConfig: &clientcmdapi.ExecConfig{
APIVersion: "a/b/c/d/e",
Command: "true",
},
expectedError: "failed to parse exec config API version: unexpected GroupVersion string: a/b/c/d/e",
},

"API version mismatch": {
clusterName: testClusterName,
execConfig: &clientcmdapi.ExecConfig{
Expand Down

0 comments on commit d2f8e8f

Please sign in to comment.