Skip to content

Commit

Permalink
Merge pull request #489 from akgalwas/fix-audit-lo-matcher
Browse files Browse the repository at this point in the history
Fixed issue with audit log extension comparison
  • Loading branch information
kyma-bot authored Nov 18, 2024
2 parents de36327 + fb76261 commit 56d665b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hack/runtime-migrator/cmd/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"github.com/pkg/errors"
"log/slog"

"github.com/gardener/gardener/pkg/apis/core/v1beta1"
Expand Down Expand Up @@ -85,7 +86,7 @@ func (m Migration) Do(ctx context.Context, runtimeIDs []string) error {
run := func(runtimeID string) {
shoot := findShoot(runtimeID, shootList)
if shoot == nil {
reportError(runtimeID, "", "Failed to find shoot", nil)
reportError(runtimeID, "", "Failed to find shoot", errors.New("no shoot with given runtimeID found"))
return
}

Expand Down
5 changes: 4 additions & 1 deletion hack/shoot-comparator/pkg/runtime/raw_extension_matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package runtime

import (
"sort"
"strings"

"github.com/kyma-project/infrastructure-manager/hack/shoot-comparator/pkg/utilz"
"github.com/onsi/gomega"
Expand Down Expand Up @@ -43,7 +44,9 @@ func (m *RawExtensionMatcher) Match(actual interface{}) (bool, error) {
sort.Sort(sortBytes(rawActual))
sort.Sort(sortBytes(rawToMatch))

return gomega.BeComparableTo(rawActual).Match(rawToMatch)
return gomega.
BeComparableTo(strings.TrimSpace(string(rawActual))).
Match(strings.TrimSpace(string(rawToMatch)))
}

func (m *RawExtensionMatcher) NegatedFailureMessage(_ interface{}) string {
Expand Down

0 comments on commit 56d665b

Please sign in to comment.