Skip to content

Commit

Permalink
fix: some missing changes
Browse files Browse the repository at this point in the history
Signed-off-by: Evsyukov Denis <[email protected]>
  • Loading branch information
juev committed Dec 17, 2024
1 parent 2a745f2 commit 23c8ae6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
8 changes: 6 additions & 2 deletions pkg/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ func NewExecutor(dir string, entrypoint string, args []string, envs []string) *E
}

func (e *Executor) Output() ([]byte, error) {
e.logger.Debug("Executing command", strings.Join(e.cmd.Args, " "), e.cmd.Dir)
e.logger.Debug("Executing command",
slog.String("command", strings.Join(e.cmd.Args, " ")),
slog.String("dir", e.cmd.Dir))
return e.cmd.Output()
}

Expand All @@ -98,7 +100,9 @@ func (e *Executor) RunAndLogLines(logLabels map[string]string) (*CmdUsage, error
stdoutLogEntry := logEntry.With("output", "stdout")
stderrLogEntry := logEntry.With("output", "stderr")

log.Debug("Executing command", slog.String("command", strings.Join(e.cmd.Args, " ")), slog.String("dir", e.cmd.Dir))
log.Debug("Executing command",
slog.String("command", strings.Join(e.cmd.Args, " ")),
slog.String("dir", e.cmd.Dir))

plo := &proxyLogger{e.logProxyHookJSON, e.proxyJsonKey, stdoutLogEntry, make([]byte, 0)}
ple := &proxyLogger{e.logProxyHookJSON, e.proxyJsonKey, stderrLogEntry, make([]byte, 0)}
Expand Down
5 changes: 3 additions & 2 deletions pkg/hook/controller/conversion_bindings_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package controller
import (
"log/slog"

"github.com/deckhouse/deckhouse/pkg/log"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

"github.com/deckhouse/deckhouse/pkg/log"

bctx "github.com/flant/shell-operator/pkg/hook/binding_context"
htypes "github.com/flant/shell-operator/pkg/hook/types"
"github.com/flant/shell-operator/pkg/webhook/conversion"
Expand Down Expand Up @@ -84,7 +85,7 @@ func (c *ConversionBindingsController) CanHandleEvent(crdName string, _ *v1.Conv
func (c *ConversionBindingsController) HandleEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule) BindingExecutionInfo {
_, hasKey := c.Links[crdName]
if !hasKey {
log.Error("Possible bug!!! No binding for conversion event for crd", slog.String("name", crdName))
log.Error("Possible bug!!! No binding for conversion event for crd", slog.String("crd", crdName))
return BindingExecutionInfo{
BindingContext: []bctx.BindingContext{},
AllowFailure: false,
Expand Down
9 changes: 5 additions & 4 deletions pkg/kube_events_manager/namespace_informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
"fmt"
"log/slog"

"github.com/deckhouse/deckhouse/pkg/log"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
corev1 "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/tools/cache"

"github.com/deckhouse/deckhouse/pkg/log"

klient "github.com/flant/kube-client/client"
)

Expand Down Expand Up @@ -124,7 +125,7 @@ func (ni *namespaceInformer) start() {
log.Debug("Run namespace informer", slog.String("name", ni.Monitor.Metadata.DebugName))
if ni.SharedInformer == nil {
log.Error("Possible BUG!!! Start called before createSharedInformer, ShredInformer is nil",
slog.String("name", ni.Monitor.Metadata.DebugName))
slog.String("debugName", ni.Monitor.Metadata.DebugName))
return
}
cctx, cancel := context.WithCancel(ni.ctx)
Expand All @@ -140,10 +141,10 @@ func (ni *namespaceInformer) start() {
return ni.SharedInformer.HasSynced(), nil
}); err != nil {
ni.Monitor.Logger.Error("Cache is not synced for informer",
slog.String("name", ni.Monitor.Metadata.DebugName))
slog.String("debugName", ni.Monitor.Metadata.DebugName))
}

log.Debug("Informer is ready", slog.String("name", ni.Monitor.Metadata.DebugName))
log.Debug("Informer is ready", slog.String("debugName", ni.Monitor.Metadata.DebugName))
}

func (ni *namespaceInformer) pauseHandleEvents() {
Expand Down
9 changes: 5 additions & 4 deletions pkg/kube_events_manager/resource_informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
"sync"
"time"

"github.com/deckhouse/deckhouse/pkg/log"
"github.com/gofrs/uuid/v5"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/tools/cache"

"github.com/deckhouse/deckhouse/pkg/log"

klient "github.com/flant/kube-client/client"
"github.com/flant/shell-operator/pkg/app"
"github.com/flant/shell-operator/pkg/filter/jq"
Expand Down Expand Up @@ -121,10 +122,10 @@ func (ei *resourceInformer) createSharedInformer() (err error) {
log.Err(err))
return err
}
log.Debug("%GVR for kind",
log.Debug("GVR for kind",
slog.String("debugName", ei.Monitor.Metadata.DebugName),
slog.String("kind", ei.Monitor.Kind),
slog.String("GVR", ei.GroupVersionResource.String()))
slog.String("gvr", ei.GroupVersionResource.String()))

// define tweakListOptions for informer
fmtLabelSelector, err := FormatLabelSelector(ei.Monitor.LabelSelector)
Expand Down Expand Up @@ -201,7 +202,7 @@ func (ei *resourceInformer) loadExistedObjects() error {
Namespace(ei.Namespace).
List(context.TODO(), ei.ListOptions)
if err != nil {
log.Error("%s: initial list resources of kind '%s': %v",
log.Error("initial list resources of kind",
slog.String("debugName", ei.Monitor.Metadata.DebugName),
slog.String("kind", ei.Monitor.Kind),
log.Err(err))
Expand Down
2 changes: 1 addition & 1 deletion pkg/task/queue/task_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (q *TaskQueue) debugf(format string, args ...interface{}) {
if !q.debug {
return
}
log.Debug("", fmt.Sprintf(format, args...))
log.Debug("DEBUG", fmt.Sprintf(format, args...))
}

func (q *TaskQueue) Stop() {
Expand Down

0 comments on commit 23c8ae6

Please sign in to comment.