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
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ go 1.24.0

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/deckhouse/deckhouse/pkg/log v0.1.1
github.com/deckhouse/deckhouse/pkg/log v0.2.0
github.com/deckhouse/deckhouse/pkg/metrics-storage v0.3.0
github.com/deckhouse/module-sdk v0.9.1
github.com/deckhouse/module-sdk v0.10.0
github.com/dominikbraun/graph v0.23.0
github.com/ettle/strcase v0.2.0
github.com/flant/kube-client v1.6.0
github.com/flant/shell-operator v1.14.0
github.com/flant/shell-operator v1.14.1
github.com/go-chi/chi/v5 v5.2.3
github.com/go-openapi/loads v0.23.1
github.com/go-openapi/spec v0.22.0
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deckhouse/deckhouse/pkg/log v0.1.1 h1:qHpMyj9coob+VfP3Qv+eIBa0pXFLn1FFRJztyryILB0=
github.com/deckhouse/deckhouse/pkg/log v0.1.1/go.mod h1:pbAxTSDcPmwyl3wwKDcEB3qdxHnRxqTV+J0K+sha8bw=
github.com/deckhouse/deckhouse/pkg/log v0.2.0 h1:6tmZQLwNb1o/hP1gzJQBjcwfA/bubbgObovXzxq+Exo=
github.com/deckhouse/deckhouse/pkg/log v0.2.0/go.mod h1:pbAxTSDcPmwyl3wwKDcEB3qdxHnRxqTV+J0K+sha8bw=
github.com/deckhouse/deckhouse/pkg/metrics-storage v0.3.0 h1:xZvbKuexrSQGEw6CB4n3UC7XbOb9QNLbm8UhcGZ2R1I=
github.com/deckhouse/deckhouse/pkg/metrics-storage v0.3.0/go.mod h1:Rz++SzCLkFW03WGgftnn91TimGU2shiKb5S/YuxcBuE=
github.com/deckhouse/module-sdk v0.9.1 h1:UTzSWD4EorLWEIGtimjuFSuAJZxadULd1c+ZhZTlH4Q=
github.com/deckhouse/module-sdk v0.9.1/go.mod h1:7mgyfIJHzzEknMZCiwQbPq+JfcBguLje1ZBKQU+y9fk=
github.com/deckhouse/module-sdk v0.10.0 h1:VPhYvMVQ3pT32I2WL1ITtQyrYdpiUR0RocLw7S4TfNg=
github.com/deckhouse/module-sdk v0.10.0/go.mod h1:Z1jfmd0fICoYww0daMijWAU+OZTxeJUXfMciKKuYAYA=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
Expand Down Expand Up @@ -161,8 +161,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flant/kube-client v1.6.0 h1:g6ksfIgTlrvLgp/Iu1a9c5aC4yPClLplq3w9e/qtYbk=
github.com/flant/kube-client v1.6.0/go.mod h1:dYJyx7aMldXR/F8hlhRxlcEhSkxKcMZV2Oz8d+o/Up4=
github.com/flant/shell-operator v1.14.0 h1:1tv2OQ+/VlTCKpFDsqMZe1FO5ofmtBBvKyuo+wyc/P0=
github.com/flant/shell-operator v1.14.0/go.mod h1:eoqKpq23aNltyS1i/bHY+WnJ9cLymHCgniJ6JNnGhkY=
github.com/flant/shell-operator v1.14.1 h1:Amdlolh9k+kjX0dPlJTqSPgxOfa3KXW1u60Gr8xKlX0=
github.com/flant/shell-operator v1.14.1/go.mod h1:oTahEE1kHUd9vselz83qjZ1qLLh7Jq9dXORQ3kVJwks=
github.com/flopp/go-findfont v0.1.0 h1:lPn0BymDUtJo+ZkV01VS3661HL6F4qFlkhcJN55u6mU=
github.com/flopp/go-findfont v0.1.0/go.mod h1:wKKxRDjD024Rh7VMwoU90i6ikQRCr+JTHB5n4Ejkqvw=
github.com/fluxcd/flagger v1.36.1 h1:X2PumtNwZz9YSGaOtZLFm2zAKLgHhFkbNv8beg7ifyc=
Expand Down
16 changes: 0 additions & 16 deletions pkg/module_manager/go_hook/logger.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
package go_hook

import (
"context"

"github.com/deckhouse/deckhouse/pkg/log"
sdkpkg "github.com/deckhouse/module-sdk/pkg"
)

type Logger interface {
sdkpkg.Logger

// Deprecated: use Debug instead
Debugf(format string, args ...any)
// Deprecated: use Error instead
Errorf(format string, args ...any)
// Deprecated: use Fatal instead
Fatalf(format string, args ...any)
// Deprecated: use Info instead
Infof(format string, args ...any)
// Deprecated: use Log instead
Logf(ctx context.Context, level log.Level, format string, args ...any)
// Deprecated: use Warn instead
Warnf(format string, args ...any)
}
12 changes: 8 additions & 4 deletions pkg/module_manager/models/hooks/kind/batch_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,20 @@ func (h *BatchHook) Execute(ctx context.Context, configVersion string, bContext
outputError := &sdkhook.Error{}
trimmed := strings.TrimPrefix(err.Error(), "stderr:")

err := json.NewDecoder(bytes.NewBufferString(trimmed)).Decode(outputError)
if err != nil {
return result, err
// Try to parse stderr as a JSON error from the SDK.
// If stderr contains non-JSON content (e.g. log lines before the JSON error),
// fall back to returning the raw stderr content as the error message.
jsonErr := json.NewDecoder(bytes.NewBufferString(trimmed)).Decode(outputError)
if jsonErr != nil {
h.Logger.Warn("json decode", slog.String("original", trimmed), log.Err(err))
return result, fmt.Errorf("json decode: %w", jsonErr)
}

if outputError.Message != "" {
return result, errors.New(outputError.Message)
}

return result, err
return result, fmt.Errorf("run and log lines: %w", err)
}

result.Patches[utils.ConfigMapPatch], err = utils.ValuesPatchFromFile(configValuesPatchPath)
Expand Down
Loading