File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 11package cluster
22
33import (
4+ "bytes"
45 "context"
56 "encoding/json"
67 "fmt"
@@ -238,6 +239,13 @@ func (cc *KubeClusterClient) DiffStructured(
238239 )
239240 }
240241
242+ // Strip everything before the initial "{"; kubectl can insert arbitrary warnings, etc.
243+ // that can cause the result to not be valid JSON.
244+ jsonStart := bytes .Index (rawResults , []byte ("{" ))
245+ if jsonStart > 0 {
246+ rawResults = rawResults [jsonStart :]
247+ }
248+
241249 results := diff.Results {}
242250 if err := json .Unmarshal (rawResults , & results ); err != nil {
243251 return nil , err
Original file line number Diff line number Diff line change 11package version
22
33// Version stores the current kubeapply version.
4- const Version = "0.0.26 "
4+ const Version = "0.0.27 "
You can’t perform that action at this time.
0 commit comments