Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with audit log extension comparison #489

Merged
merged 2 commits into from
Nov 18, 2024
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
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
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
Loading