-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor path for configuration file, option(s) and Docker image #168
Merged
thakurajayL
merged 2 commits into
omec-project:main
from
gab-arrobo:refactor-configuration
Nov 2, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2024 Intel Corporation | ||
# SPDX-FileCopyrightText: 2021 Open Networking Foundation <[email protected]> | ||
# Copyright 2019 free5GC.org | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# This file contains all available configuration options | ||
# with their default values. | ||
|
@@ -28,19 +27,6 @@ run: | |
# default is true. Enables skipping of directories: | ||
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ | ||
skip-dirs-use-default: true | ||
# which files to skip: they will be analyzed, but issues from them | ||
# won't be reported. Default value is empty list, but there is | ||
# no need to include all autogenerated files, we confidently recognize | ||
# autogenerated files. If it's not please let us know. | ||
# "/" will be replaced by current OS file path separator to properly work | ||
# on Windows. | ||
skip-files: | ||
- "api_.*\\.go$" | ||
- "model_.*\\.go$" | ||
- "routers.go" | ||
- "client.go" | ||
- "configuration.go" | ||
- "nas.go" | ||
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": | ||
# If invoked with -mod=readonly, the go command is disallowed from the implicit | ||
# automatic updating of go.mod described above. Instead, it fails when any changes | ||
|
@@ -56,7 +42,7 @@ run: | |
# output configuration options | ||
output: | ||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" | ||
format: colored-line-number | ||
formats: colored-line-number | ||
# print lines of code with issue, default is true | ||
print-issued-lines: true | ||
# print linter name in the end of issue text, default is true | ||
|
@@ -139,10 +125,14 @@ linters-settings: | |
# minimal confidence for issues, default is 0.8 | ||
min-confidence: 0.8 | ||
gomnd: | ||
settings: | ||
mnd: | ||
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. | ||
checks: argument,case,condition,operation,return,assign | ||
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. | ||
checks: | ||
- argument | ||
- case | ||
- condition | ||
- operation | ||
- return | ||
- assign | ||
gomodguard: | ||
allowed: | ||
modules: # List of allowed modules | ||
|
@@ -160,8 +150,6 @@ linters-settings: | |
# version: "< 1.1.0" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons | ||
# reason: "testing if blocked version constraint works." # Reason why the version constraint exists. (Optional) | ||
govet: | ||
# report about shadowed variables | ||
check-shadowing: true | ||
# settings per analyzer | ||
settings: | ||
printf: # analyzer name, run `go tool vet help` to see all analyzers | ||
|
@@ -204,8 +192,6 @@ linters-settings: | |
whitespace: | ||
multi-if: false # Enforces newlines (or comments) after every multi-line if statement | ||
multi-func: false # Enforces newlines (or comments) after every multi-line function signature | ||
gci: | ||
local-prefixes: "bitbucket.org" | ||
misspell: | ||
locale: US | ||
ignore-words: | ||
|
@@ -231,7 +217,7 @@ linters: | |
# - gocognit | ||
# - nestif | ||
# - gomodguard | ||
# - nakedret | ||
- nakedret | ||
- gci | ||
- misspell | ||
- gofumpt | ||
|
@@ -240,11 +226,11 @@ linters: | |
- predeclared | ||
- noctx | ||
- dogsled | ||
# - bodyclose | ||
- bodyclose | ||
- asciicheck | ||
#- stylecheck | ||
# - unparam | ||
# - wsl | ||
# - stylecheck | ||
# - unparam | ||
# - wsl | ||
|
||
#disable-all: false | ||
fast: true | ||
|
@@ -255,6 +241,8 @@ issues: | |
# excluded by default patterns execute `golangci-lint run --help` | ||
exclude: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-files: | ||
- "routers.go" | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
# Independently from option `exclude` we use default exclude patterns, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ | |
|
||
FROM golang:1.23.2-bookworm AS builder | ||
|
||
LABEL maintainer="Aether SD-Core <[email protected]>" | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install --no-install-recommends \ | ||
apt-transport-https \ | ||
|
@@ -28,7 +26,8 @@ RUN make all | |
|
||
FROM alpine:3.20 AS pcf | ||
|
||
LABEL description="ONF open source 5G Core Network" \ | ||
LABEL maintainer="Aether SD-Core <[email protected]>" \ | ||
description="ONF open source 5G Core Network" \ | ||
version="Stage 3" | ||
|
||
ARG DEBUG_TOOLS | ||
|
@@ -38,8 +37,5 @@ RUN if [ "$DEBUG_TOOLS" = "true" ]; then \ | |
apk update && apk add --no-cache -U vim strace net-tools curl netcat-openbsd bind-tools; \ | ||
fi | ||
|
||
# Set working dir | ||
WORKDIR /free5gc/pcf | ||
|
||
# Copy executable and default certs | ||
COPY --from=builder /go/src/pcf/bin/* . | ||
COPY --from=builder /go/src/pcf/bin/* /usr/local/bin/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What benefit we get with this coding style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to address a linter issue (
bodyclose
). If you have a better approach, I am more than happy to integrate it into the code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just close it .. does it give performance benefit of creating new goroutine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean something like this?
If so, golangci-linter complains with the following error when just using
defer httpResp.Body.Close()