Skip to content
Open
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
2 changes: 0 additions & 2 deletions common/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/containers/ocicrypt v1.3.2
github.com/coreos/go-systemd/v22 v22.7.0
github.com/cyphar/filepath-securejoin v0.7.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/disiqueira/gotree/v3 v3.0.2
github.com/docker/distribution v2.8.3+incompatible
github.com/docker/go-units v0.5.0
Expand All @@ -31,7 +30,6 @@ require (
github.com/opencontainers/runtime-tools v0.9.1-0.20260316125833-8a4db579f5c8
github.com/opencontainers/selinux v1.15.1
github.com/pkg/sftp v1.13.11
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/seccomp/libseccomp-golang v0.11.1
github.com/sirupsen/logrus v1.10.0
github.com/skeema/knownhosts v1.3.2
Expand Down
2 changes: 0 additions & 2 deletions common/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ github.com/cyphar/filepath-securejoin v0.7.0 h1:s0Y3ITPy6sQn5xt54DuYvTF8hu134ooY
github.com/cyphar/filepath-securejoin v0.7.0/go.mod h1:ymLGms/u3BYaviIiuKFnUx8EkQEZeK6cInNoAPJA3o4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/disiqueira/gotree/v3 v3.0.2 h1:ik5iuLQQoufZBNPY518dXhiO5056hyNBIK9lWhkNRq8=
github.com/disiqueira/gotree/v3 v3.0.2/go.mod h1:ZuyjE4+mUQZlbpkI24AmruZKhg3VHEgPLDY8Qk+uUu8=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
Expand Down
33 changes: 5 additions & 28 deletions common/pkg/hooks/exec/runtimeconfigfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ import (
"reflect"
"time"

"github.com/davecgh/go-spew/spew"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pmezard/go-difflib/difflib"
"github.com/sirupsen/logrus"
)

var spewConfig = spew.ConfigState{
Indent: " ",
DisablePointerAddresses: true,
DisableCapacities: true,
SortKeys: true,
}

type RuntimeConfigFilterOptions struct {
// The hooks to run
Hooks []spec.Hook
Expand Down Expand Up @@ -62,34 +53,20 @@ func RuntimeConfigFilterWithOptions(ctx context.Context, options RuntimeConfigFi
return hookErr, err
}

data = stdout.Bytes()
newData := stdout.Bytes()
var newConfig spec.Spec
err = json.Unmarshal(data, &newConfig)
err = json.Unmarshal(newData, &newConfig)
if err != nil {
logrus.Debugf("invalid JSON from config-filter hook %d:\n%s", i, string(data))
logrus.Debugf("invalid JSON from config-filter hook %d:\n%s", i, string(newData))
return nil, fmt.Errorf("unmarshal output from config-filter hook %d: %w", i, err)
}

if !reflect.DeepEqual(options.Config, &newConfig) {
oldConfig := spewConfig.Sdump(options.Config)
newConfig := spewConfig.Sdump(&newConfig)
diff, err := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{
A: difflib.SplitLines(oldConfig),
B: difflib.SplitLines(newConfig),
FromFile: "Old",
FromDate: "",
ToFile: "New",
ToDate: "",
Context: 1,
})
if err == nil {
logrus.Debugf("precreate hook %d made configuration changes:\n%s", i, diff)
} else {
logrus.Warnf("Precreate hook %d made configuration changes, but we could not compute a diff: %v", i, err)
}
logrus.Debugf("precreate hook %d made configuration changes from %s to %s", i, data, newData)
}

*options.Config = newConfig
data = newData
}

return nil, nil
Expand Down
15 changes: 0 additions & 15 deletions vendor/github.com/davecgh/go-spew/LICENSE

This file was deleted.

145 changes: 0 additions & 145 deletions vendor/github.com/davecgh/go-spew/spew/bypass.go

This file was deleted.

38 changes: 0 additions & 38 deletions vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

This file was deleted.

Loading
Loading