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

golangci-lint: add systemd build tag #14584

Merged
merged 1 commit into from
Jun 15, 2022
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
5 changes: 2 additions & 3 deletions hack/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
set -e

declare -A BUILD_TAGS
# TODO: add systemd tag
BUILD_TAGS[default]="apparmor,seccomp,selinux,linter"
BUILD_TAGS[abi]="${BUILD_TAGS[default]},!remoteclient"
BUILD_TAGS[tunnel]="${BUILD_TAGS[default]},remote,remoteclient"
BUILD_TAGS[abi]="${BUILD_TAGS[default]},systemd"
BUILD_TAGS[tunnel]="${BUILD_TAGS[default]},remote"

declare -A SKIP_DIRS
SKIP_DIRS[abi]="pkg/machine/e2e"
Expand Down
7 changes: 4 additions & 3 deletions libpod/container_log_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,12 @@ func formatterPrefix(entry *sdjournal.JournalEntry) (string, error) {
if !ok {
return "", errors.Errorf("no PRIORITY field present in journal entry")
}
if priority == journaldLogOut {
switch priority {
case journaldLogOut:
output += "stdout "
} else if priority == journaldLogErr {
case journaldLogErr:
output += "stderr "
} else {
default:
return "", errors.Errorf("unexpected PRIORITY field in journal entry")
}

Expand Down
3 changes: 1 addition & 2 deletions libpod/events/journal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (e EventJournalD) Write(ee Event) error {
case Volume:
m["PODMAN_NAME"] = ee.Name
}
return journal.Send(string(ee.ToHumanReadable(false)), journal.PriInfo, m)
return journal.Send(ee.ToHumanReadable(false), journal.PriInfo, m)
}

// Read reads events from the journal and sends qualified events to the event channel
Expand Down Expand Up @@ -167,7 +167,6 @@ func (e EventJournalD) Read(ctx context.Context, options ReadOptions) error {
}
}
return nil

}

func newEventFromJournalEntry(entry *sdjournal.JournalEntry) (*Event, error) { //nolint
Expand Down