Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/cluster/kube_client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cluster

import (
"bytes"
"context"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -238,6 +239,13 @@ func (cc *KubeClusterClient) DiffStructured(
)
}

// Strip everything before the initial "{"; kubectl can insert arbitrary warnings, etc.
// that can cause the result to not be valid JSON.
jsonStart := bytes.Index(rawResults, []byte("{"))
if jsonStart > 0 {
rawResults = rawResults[jsonStart:]
}

results := diff.Results{}
if err := json.Unmarshal(rawResults, &results); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package version

// Version stores the current kubeapply version.
const Version = "0.0.26"
const Version = "0.0.27"