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

Sync repo templates ⚙ #1952

Merged
merged 3 commits into from
Oct 11, 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
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Test
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
go-version: [1.22.x, 1.23.x]
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.1
version: v1.61.0
args: -E=gofmt --timeout=30m0s
regenerate:
name: Regenerate
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.23.x
- name: Install schematyper
run: |
# "go install github.com/idubinskiy/schematyper:latest" fails with
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ignition-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Test ignition-validate
strategy:
matrix:
go-version: [1.21.x]
go-version: [1.23.x]
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion internal/exec/config_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (f *ConfigFetcher) fetchReferencedConfig(cfgRef types.Resource) (types.Conf
return types.Config{}, err
}
var headers http.Header
if cfgRef.HTTPHeaders != nil && len(cfgRef.HTTPHeaders) > 0 {
if len(cfgRef.HTTPHeaders) > 0 {
headers, err = cfgRef.HTTPHeaders.Parse()
if err != nil {
return types.Config{}, err
Expand Down
2 changes: 1 addition & 1 deletion internal/exec/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (e Engine) Run(stageName string) error {
return err
}

e.Logger.PushPrefix(stageName)
e.Logger.PushPrefix(stageName) //nolint:govet
defer e.Logger.PopPrefix()

fullConfig := latest.Merge(baseConfig, latest.Merge(systemBaseConfig, cfg))
Expand Down
2 changes: 1 addition & 1 deletion internal/exec/stages/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (s *stage) relabel(paths ...string) {
// relabelFiles relabels all the files that were marked for relabeling using
// the libselinux APIs.
func (s *stage) relabelFiles() error {
if s.toRelabel == nil || len(s.toRelabel) == 0 {
if len(s.toRelabel) == 0 {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/exec/util/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func newFetchOp(l *log.Logger, node types.Node, contents types.Resource) (FetchO
}

var headers http.Header
if contents.HTTPHeaders != nil && len(contents.HTTPHeaders) > 0 {
if len(contents.HTTPHeaders) > 0 {
headers, err = contents.HTTPHeaders.Parse()
if err != nil {
return FetchOp{}, err
Expand Down
6 changes: 3 additions & 3 deletions internal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func ignitionMain() {
logger := log.New(flags.logToStdout)
defer logger.Close()

logger.Info(version.String)
logger.Info(version.String) //nolint:govet
logger.Info("Stage: %v", flags.stage)

platformConfig := platform.MustGet(flags.platform.String())
Expand Down Expand Up @@ -157,7 +157,7 @@ func ignitionApplyMain() {
logger := log.New(true)
defer logger.Close()

logger.Info(version.String)
logger.Info(version.String) //nolint:govet

var blob []byte
var err error
Expand Down Expand Up @@ -219,7 +219,7 @@ func ignitionRmCfgMain() {
logger := log.New(flags.logToStdout)
defer logger.Close()

logger.Info(version.String)
logger.Info(version.String) //nolint:govet

platformConfig := platform.MustGet(flags.platform)
fetcher, err := platformConfig.NewFetcher(&logger)
Expand Down
2 changes: 1 addition & 1 deletion internal/resource/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (f *Fetcher) getCABlob(ca types.Resource) ([]byte, error) {
}

var headers http.Header
if ca.HTTPHeaders != nil && len(ca.HTTPHeaders) > 0 {
if len(ca.HTTPHeaders) > 0 {
headers, err = ca.HTTPHeaders.Parse()
if err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ PKG_VET=$(go list ./... | \
grep --invert-match internal/log)

echo "Checking gofix..."
go tool fix -diff $SRC
go_version=$(go version | awk '{print $3}')
go tool fix -go="$go_version" -diff $SRC

echo "Checking gofmt..."
res=$(gofmt -d -e -s $SRC)
Expand Down
Loading