Skip to content

Commit

Permalink
Karavictl returns YAML instead of JSON (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
donatwork authored Jun 15, 2023
1 parent 5f670b0 commit b5d480e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tests/e2e/steps/steps_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ package steps

import (
"context"
"encoding/json"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -1041,15 +1040,8 @@ func (step *Step) configureAuthorizationProxyServer(res Resource, driver string)

// Apply token to CSI driver host
fmt.Println("=== Applying token ===\n ")
var token struct {
Token string `json:"Token"`
}
err = json.Unmarshal(b, &token)
if err != nil {
return fmt.Errorf("failed to unmarshal token %s: %v", string(b), err)
}

err = os.WriteFile("/tmp/token.yaml", []byte(token.Token), 0644)
err = os.WriteFile("/tmp/token.yaml", b, 0644)
if err != nil {
return fmt.Errorf("failed to write tenant token: %v\nErrMessage:\n%s", err, string(b))
}
Expand Down

0 comments on commit b5d480e

Please sign in to comment.