chore: bump golangci-lint to v1.50.0
I had to do several things: - contextcheck now supports Go 1.18 generics, but I had to disable it because of this https://github.com/kkHAIKE/contextcheck/issues/9 - dupword produces to many false positives, so it's also disabled - revive found all packages which didn't have a documentation comment before. And tehre is A LOT of them. I updated some of them, but gave up at some point and just added them to exclude rules for now. - change lint-vulncheck to use `base` stage as base Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
This commit is contained in:
parent
aa3d9b4ca6
commit
93e55b85f2
234
.golangci.yml
234
.golangci.yml
@ -167,6 +167,8 @@ linters:
|
||||
- typecheck
|
||||
- varnamelen # too annoying
|
||||
- wrapcheck
|
||||
- contextcheck # enable once golangci-lint 1.50.1 or 1.51 lands
|
||||
- dupword # too annoying
|
||||
|
||||
# abandoned linters for which golangci shows the warning that the repo is archived by the owner
|
||||
- golint
|
||||
@ -196,6 +198,238 @@ issues:
|
||||
- path: internal/app/machined/pkg/system/services
|
||||
linters:
|
||||
- dupl
|
||||
- path: cmd/installer/pkg/qemuimg
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: cmd/talosctl/cmd/mgmt
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: cmd/talosctl/cmd/mgmt/inject
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: cmd/talosctl/cmd/talos
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: cmd/talosctl/pkg/talos/action
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: cmd/talosctl/pkg/talos/global
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: cmd/talosctl/pkg/talos/helpers
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/controllers/cri
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/controllers/kubeaccess/serviceaccount
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/controllers/perf
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/system/events
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/system/health
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/system/runner/containerd
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/system/runner/goroutine
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/system/runner/process
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/system/runner/restart
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/machined/pkg/system
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/maintenance
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/maintenance/server
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/poweroff
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/trustd/internal/reg
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/app/trustd
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/pkg/containers/image
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/pkg/etcd
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/pkg/install
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/pkg/mount
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/pkg/mount/switchroot
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: internal/pkg/tui/components
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/argsbuilder
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/chunker
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/chunker/file
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/chunker/stream
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/download
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/grpc/dialer
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/grpc/factory
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/grpc/gen
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/grpc/middleware/auth/basic
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/grpc/middleware/authz
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/kubernetes
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/kubernetes/inject
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/provision/providers
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: pkg/provision/providers/qemu
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: config/encoder
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: resources/kubespan
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: client/config
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: config/merge
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: config/types/v1alpha1/bundle
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: resources/cri
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: resources/runtime
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: kernel
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: constants
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: resources/perf
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: resources/cluster
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: role
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: resources/hardware
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: config/decoder
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: config/internal/cis
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
- path: config/types/v1alpha1/machine
|
||||
text: "should have a package comment"
|
||||
linters:
|
||||
- revive
|
||||
|
||||
# pkg/machinery module
|
||||
- path: config/types/v1alpha1
|
||||
|
@ -300,7 +300,7 @@ WORKDIR /src
|
||||
|
||||
# The vulncheck target runs the vulnerability check tool.
|
||||
|
||||
FROM build-go AS lint-vulncheck
|
||||
FROM base AS lint-vulncheck
|
||||
RUN --mount=type=cache,target=/.cache govulncheck ./...
|
||||
|
||||
# The init target builds the init binary.
|
||||
|
4
Makefile
4
Makefile
@ -18,8 +18,8 @@ PKGS ?= v1.3.0-alpha.0-29-g91e73b3
|
||||
EXTRAS ?= v1.3.0-alpha.0-1-g8f00d77
|
||||
GO_VERSION ?= 1.19
|
||||
GOIMPORTS_VERSION ?= v0.1.11
|
||||
GOFUMPT_VERSION ?= v0.3.0
|
||||
GOLANGCILINT_VERSION ?= v1.48.0
|
||||
GOFUMPT_VERSION ?= v0.4.0
|
||||
GOLANGCILINT_VERSION ?= v1.50.0
|
||||
STRINGER_VERSION ?= v0.1.12
|
||||
ENUMER_VERSION ?= v1.1.2
|
||||
DEEPCOPY_GEN_VERSION ?= v0.21.3
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package cmd implements the installer command.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package installer provides the installer implementation.
|
||||
package main
|
||||
|
||||
import "github.com/talos-systems/talos/cmd/installer/cmd"
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package pkg contains the installer cmd logic.
|
||||
package pkg
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package install provides the installation routine.
|
||||
package install
|
||||
|
||||
import (
|
||||
|
@ -212,6 +212,7 @@ func (m *Manifest) checkMounts(device Device) error {
|
||||
}
|
||||
|
||||
if !device.SkipOverlayMountsCheck && fields[len(fields)-2] == "overlay" {
|
||||
//nolint:dupword
|
||||
// parsing options (last column) in the overlay mount line which looks like:
|
||||
// 163 70 0:52 /apid / ro,relatime - overlay overlay rw,lowerdir=/opt,upperdir=/var/system/overlays/opt-diff,workdir=/var/system/overlays/opt-workdir
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package ova implements OVA creation.
|
||||
package ova
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package cmd provides the talosctl command implementation.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
@ -98,7 +99,7 @@ var docsCmd = &cobra.Command{
|
||||
},
|
||||
}
|
||||
|
||||
// GenMarkdownReference is the the same as GenMarkdownTree, but
|
||||
// GenMarkdownReference is the same as GenMarkdownTree, but
|
||||
// with custom filePrepender and linkHandler.
|
||||
func GenMarkdownReference(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error {
|
||||
for _, c := range cmd.Commands() {
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package gen implements the genration of various artifacts.
|
||||
package gen
|
||||
|
||||
import (
|
||||
|
@ -159,6 +159,8 @@ func dumpPackets(r io.Reader) error {
|
||||
// { 0x30, 0, 0, 0x00000000 },
|
||||
// { 0x54, 0, 0, 0x000000f0 },
|
||||
// { 0x15, 0, 8, 0x00000060 },
|
||||
//
|
||||
//nolint:dupword
|
||||
func parseBPFInstructions(in string) ([]*machine.BPFInstruction, error) {
|
||||
in = strings.TrimSpace(in)
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package talosctl provides the talosctl utility implementation.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package helpers provides helpers for talosctl.
|
||||
package helpers
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package global provides global flags for talosctl.
|
||||
package global
|
||||
|
||||
import (
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
// Should be never passed to the API.
|
||||
const InteractiveMode machine.ApplyConfigurationRequest_Mode = -1
|
||||
|
||||
// Mode apply, patch, edit config config update mode.
|
||||
// Mode apply, patch, edit config update mode.
|
||||
type Mode struct {
|
||||
options map[string]machine.ApplyConfigurationRequest_Mode
|
||||
Mode machine.ApplyConfigurationRequest_Mode
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package apid implements apid functionality.
|
||||
package apid
|
||||
|
||||
import (
|
||||
|
@ -28,7 +28,7 @@ type localAddressProvider struct {
|
||||
}
|
||||
|
||||
// NewLocalAddressProvider initializes and returns a new LocalAddressProvider.
|
||||
func NewLocalAddressProvider(st state.State) (*localAddressProvider, error) {
|
||||
func NewLocalAddressProvider(st state.State) (LocalAddressProvider, error) {
|
||||
p := &localAddressProvider{}
|
||||
|
||||
evCh := make(chan state.Event)
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package init implements booting process.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package runtime provides the runtime implementation.
|
||||
package runtime
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package machined provides machined implementation.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -2,4 +2,5 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package hardware provides the hardware controller implementation.
|
||||
package hardware
|
||||
|
@ -12,5 +12,5 @@ import (
|
||||
func init() {
|
||||
// ugly hack, but it doesn't look like there's better API
|
||||
// cut out error handler which logs error to standard logger
|
||||
utilruntime.ErrorHandlers = utilruntime.ErrorHandlers[len(utilruntime.ErrorHandlers)-1:]
|
||||
utilruntime.ErrorHandlers = utilruntime.ErrorHandlers[len(utilruntime.ErrorHandlers)-1:] //nolint:reassign
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ func ParseCmdlineNetwork(cmdline *procfs.Cmdline) (CmdlineNetworking, error) {
|
||||
// v1alpha1.Bond was chosen to re-use the `SetBondMaster` and `SetBondSlave` functions
|
||||
// ref: modinfo bonding
|
||||
//
|
||||
//nolint:gocyclo,cyclop
|
||||
//nolint:gocyclo,cyclop,dupword
|
||||
func parseBondOptions(options string) (v1alpha1.Bond, error) {
|
||||
var bond v1alpha1.Bond
|
||||
|
||||
|
6
internal/app/machined/pkg/controllers/runtime/runtime.go
Normal file
6
internal/app/machined/pkg/controllers/runtime/runtime.go
Normal file
@ -0,0 +1,6 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package runtime provides the runtime implementation.
|
||||
package runtime
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// Runtime defines the runtime parameters.
|
||||
type Runtime interface {
|
||||
type Runtime interface { //nolint:interfacebloat
|
||||
Config() config.Provider
|
||||
LoadAndValidateConfig([]byte) (config.Provider, error)
|
||||
RollbackToConfigAfter([]byte, time.Duration) error
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package bananapim64 provides the Banana Pi M64 board implementation.
|
||||
package bananapim64
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package board provides the function to discover the current board.
|
||||
package board
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package jetsonnano provides the Jetson Nano board implementation.
|
||||
package jetsonnano
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package libretechallh3cch5 provides the LibretechAllH3CCH5 board implementation.
|
||||
package libretechallh3cch5
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package nanopir4s provides the Nano Pi R4S board implementation.
|
||||
package nanopir4s
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package pine64 provides the Pine64 board implementation.
|
||||
package pine64
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package rock64 provides the Pine64 Rock64 board implementation.
|
||||
package rock64
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package rockpi4 provides the Radxa rock pi implementation.
|
||||
package rockpi4
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package rockpi4c provides the Radxa rock pi implementation.
|
||||
package rockpi4c
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package rpi4 provides the Raspberry Pi 4 Model B implementation.
|
||||
package rpi4
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package rpigeneric provides the Raspberry Pi Compute Module 4 implementation.
|
||||
package rpigeneric
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package bootloader provides bootloader implementation.
|
||||
package bootloader
|
||||
|
||||
// Bootloader describes a bootloader.
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package aws contains the AWS implementation of the [platform.Platform].
|
||||
package aws
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package azure contains the Azure implementation of the [platform.Platform].
|
||||
package azure
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package container contains the Container implementation of the [platform.Platform].
|
||||
package container
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package digitalocean contains the Digital Ocean implementation of the [platform.Platform].
|
||||
package digitalocean
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package equinixmetal contains the Equinix Metal implementation of the [platform.Platform].
|
||||
package equinixmetal
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package errors contains errors used by the platform package.
|
||||
package errors
|
||||
|
||||
import "errors"
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package gcp contains the GCP implementation of the [platform.Platform].
|
||||
package gcp
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package hcloud contains the Hcloud implementation of the [platform.Platform].
|
||||
package hcloud
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package metal contains the metal implementation of the [platform.Platform].
|
||||
package metal
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package nocloud provides the NoCloud platform implementation.
|
||||
package nocloud
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package openstack provides the Openstack platform implementation.
|
||||
package openstack
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package oracle provides the Oracle platform implementation.
|
||||
package oracle
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package platform provides functions to get the [runtime.Platform].
|
||||
package platform
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package scaleway provides the Scaleway platform implementation.
|
||||
package scaleway
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package upcloud provides the UpCloud platform implementation.
|
||||
package upcloud
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package utils provides utility functions for the platform package.
|
||||
package utils
|
||||
|
||||
import (
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
//go:build amd64
|
||||
|
||||
// Package vmware provides the VMware platform implementation.
|
||||
package vmware
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package vultr provides the Vultr platform implementation.
|
||||
package vultr
|
||||
|
||||
import (
|
||||
|
@ -113,6 +113,7 @@ func (lock *PriorityLock[T]) Lock(ctx context.Context, takeOverTimeout time.Dura
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock releases the lock.
|
||||
func (lock *PriorityLock[T]) Unlock() {
|
||||
var zeroSeq T
|
||||
|
||||
|
@ -1772,7 +1772,7 @@ func MountStatePartition(seq runtime.Sequence, data interface{}) (runtime.TaskEx
|
||||
|
||||
var encryption config.Encryption
|
||||
// first try reading encryption from the config
|
||||
// config always has the priority here
|
||||
// which always has the priority here
|
||||
if r.Config() != nil && r.Config().Machine() != nil {
|
||||
encryption = r.Config().Machine().SystemDiskEncryption().Get(constants.StatePartitionLabel)
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package runner provides a runner for running services.
|
||||
package runner
|
||||
|
||||
import (
|
||||
|
@ -92,7 +92,7 @@ type machinedService struct {
|
||||
c runtime.Controller
|
||||
}
|
||||
|
||||
// Main is an entrypoint the the API service.
|
||||
// Main is an entrypoint to the API service.
|
||||
func (s *machinedService) Main(ctx context.Context, r runtime.Runtime, logWriter io.Writer) error {
|
||||
injector := &authz.Injector{
|
||||
Mode: authz.MetadataOnly,
|
||||
@ -106,7 +106,7 @@ func (s *machinedService) Main(ctx context.Context, r runtime.Runtime, logWriter
|
||||
}
|
||||
|
||||
// Start the API server.
|
||||
server := factory.NewServer(
|
||||
server := factory.NewServer( //nolint:contextcheck
|
||||
&v1alpha1server.Server{
|
||||
Controller: s.c,
|
||||
// breaking the import loop cycle between services/ package and v1alpha1_server.go
|
||||
@ -117,10 +117,10 @@ func (s *machinedService) Main(ctx context.Context, r runtime.Runtime, logWriter
|
||||
factory.WithLog("machined ", logWriter),
|
||||
|
||||
factory.WithUnaryInterceptor(injector.UnaryInterceptor()),
|
||||
factory.WithStreamInterceptor(injector.StreamInterceptor()),
|
||||
factory.WithStreamInterceptor(injector.StreamInterceptor()), //nolint:contextcheck
|
||||
|
||||
factory.WithUnaryInterceptor(authorizer.UnaryInterceptor()),
|
||||
factory.WithStreamInterceptor(authorizer.StreamInterceptor()),
|
||||
factory.WithStreamInterceptor(authorizer.StreamInterceptor()), //nolint:contextcheck
|
||||
)
|
||||
|
||||
// ensure socket dir exists
|
||||
@ -133,7 +133,7 @@ func (s *machinedService) Main(ctx context.Context, r runtime.Runtime, logWriter
|
||||
return err
|
||||
}
|
||||
|
||||
listener, err := factory.NewListener(factory.Network("unix"), factory.SocketPath(constants.MachineSocketPath))
|
||||
listener, err := factory.NewListener(factory.Network("unix"), factory.SocketPath(constants.MachineSocketPath)) //nolint:contextcheck
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -153,7 +153,7 @@ func (s *machinedService) Main(ctx context.Context, r runtime.Runtime, logWriter
|
||||
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer shutdownCancel()
|
||||
|
||||
factory.ServerGracefulStop(server, shutdownCtx)
|
||||
factory.ServerGracefulStop(server, shutdownCtx) //nolint:contextcheck
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -37,7 +37,8 @@ func (c *Udevd) ID(r runtime.Runtime) string {
|
||||
|
||||
// PreFunc implements the Service interface.
|
||||
func (c *Udevd) PreFunc(ctx context.Context, r runtime.Runtime) error {
|
||||
_, err := cmd.Run(
|
||||
_, err := cmd.RunContext(
|
||||
ctx,
|
||||
"/sbin/udevadm",
|
||||
"hwdb",
|
||||
"--update",
|
||||
|
@ -126,9 +126,9 @@ func (s *singleton) Unload(ctx context.Context, serviceIDs ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Start will invoke the service's Pre, Condition, and Type funcs. If the any
|
||||
// Start will invoke the service's Pre, Condition, and Type funcs. If any
|
||||
// error occurs in the Pre or Condition invocations, it is up to the caller to
|
||||
// to restart the service.
|
||||
// restart the service.
|
||||
func (s *singleton) Start(serviceIDs ...string) error {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package internal contains server implementation.
|
||||
package internal
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package configuration implements configuration generation.
|
||||
package configuration
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package containers provides the container implementatiom.
|
||||
package containers
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package smbios provides access to SMBIOS information.
|
||||
package smbios
|
||||
|
||||
import (
|
||||
|
@ -2,7 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package sonobuoy provides functions to to run Kubernetes e2e tests.
|
||||
// Package sonobuoy provides functions to run Kubernetes e2e tests.
|
||||
package sonobuoy
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package conditions provides a set of conditions which can be used to wait for some condition to be met.
|
||||
package conditions
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package copy provides a file copy utility implementation.
|
||||
package copy //nolint:predeclared
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package dialer ...
|
||||
package dialer
|
||||
|
||||
import (
|
||||
|
@ -157,7 +157,7 @@ func NewDefaultOptions(setters ...Option) *Options {
|
||||
logger = log.New(opts.logDestination, opts.logPrefix, log.Flags())
|
||||
}
|
||||
|
||||
// Recovery is installed as the the first middleware in the chain to handle panics (via defer and recover()) in all subsequent middlewares.
|
||||
// Recovery is installed as the first middleware in the chain to handle panics (via defer and recover()) in all subsequent middlewares.
|
||||
recoveryOpt := grpc_recovery.WithRecoveryHandler(recoveryHandler(logger))
|
||||
opts.UnaryInterceptors = append(
|
||||
[]grpc.UnaryServerInterceptor{grpc_recovery.UnaryServerInterceptor(recoveryOpt)},
|
||||
|
@ -21,7 +21,7 @@ func SetMetadata(md metadata.MD, roles role.Set) {
|
||||
md.Set(mdKey, roles.Strings()...)
|
||||
}
|
||||
|
||||
// getFromMetadata returns roles extracted from from gRPC metadata.
|
||||
// getFromMetadata returns roles extracted from gRPC metadata.
|
||||
func getFromMetadata(ctx context.Context, logf func(format string, v ...interface{})) (role.Set, bool) {
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if !ok {
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package kernel provides the utilities to interact with the kernel.
|
||||
package kernel
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package kspp implements KSPP kernel parameters enforcement.
|
||||
package kspp
|
||||
|
||||
import (
|
||||
|
@ -43,6 +43,8 @@ type Provider interface {
|
||||
|
||||
// MachineConfig defines the requirements for a config that pertains to machine
|
||||
// related options.
|
||||
//
|
||||
//nolint:interfacebloat
|
||||
type MachineConfig interface {
|
||||
Install() Install
|
||||
Security() Security
|
||||
@ -159,6 +161,8 @@ type ExtraHost interface {
|
||||
}
|
||||
|
||||
// Device represents a network interface.
|
||||
//
|
||||
//nolint:interfacebloat
|
||||
type Device interface {
|
||||
Interface() string
|
||||
Addresses() []string
|
||||
@ -219,6 +223,8 @@ type WireguardPeer interface {
|
||||
|
||||
// Bond contains the various options for configuring a
|
||||
// bonded interface.
|
||||
//
|
||||
//nolint:interfacebloat
|
||||
type Bond interface {
|
||||
Interfaces() []string
|
||||
ARPIPTarget() []string
|
||||
@ -360,6 +366,8 @@ type RegistryTLSConfig interface {
|
||||
|
||||
// ClusterConfig defines the requirements for a config that pertains to cluster
|
||||
// related options.
|
||||
//
|
||||
//nolint:interfacebloat
|
||||
type ClusterConfig interface {
|
||||
ID() string
|
||||
Name() string
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
"github.com/talos-systems/talos/pkg/machinery/constants"
|
||||
)
|
||||
|
||||
//nolint:wsl
|
||||
//nolint:wsl,testableexamples
|
||||
func Example() {
|
||||
// This is an example of generating a set of machine configuration files for multiple
|
||||
// nodes of the cluster from a single cluster-specific cluster.
|
||||
|
@ -166,7 +166,7 @@ const (
|
||||
// KubernetesDefaultCertificateValidityDuration specifies default certificate duration for Kubernetes generated certificates.
|
||||
KubernetesDefaultCertificateValidityDuration = time.Hour * 24 * 365
|
||||
|
||||
// DefaultCertificatesDir is the path the the Kubernetes PKI directory.
|
||||
// DefaultCertificatesDir is the path the Kubernetes PKI directory.
|
||||
DefaultCertificatesDir = "/etc/kubernetes/pki"
|
||||
|
||||
// KubernetesCACert is the path to the root CA certificate.
|
||||
|
@ -180,6 +180,7 @@ func ExampleVIPOperatorSpec_outputProtoMarshal() {
|
||||
// 0a060a04c0a8010110011a090a01611201621a01632207080310041a0164
|
||||
}
|
||||
|
||||
//nolint:dupword
|
||||
func ExampleVIPOperatorSpec_outputProtoencMarshal() {
|
||||
spec := &network.VIPOperatorSpec{
|
||||
IP: netip.MustParseAddr("192.168.1.1"),
|
||||
@ -240,6 +241,7 @@ func TestVIPOperatorSpec(t *testing.T) {
|
||||
runTestPipe[networkpb.VIPOperatorSpec](t, spec)
|
||||
}
|
||||
|
||||
//nolint:dupword
|
||||
func TestVLANSpecOldEncoding(t *testing.T) {
|
||||
t.Parallel()
|
||||
// Input:
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// Role represents Talos user role.
|
||||
// Its string value is used everywhere: as the the Organization value of Talos client certificate,
|
||||
// Its string value is used everywhere: as the Organization value of Talos client certificate,
|
||||
// as the value of talosctl flag, etc.
|
||||
type Role string
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package reporter implements the console reporter.
|
||||
package reporter
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package safepath provides a set of functions to make paths safe for use with.
|
||||
package safepath
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package tail implements tailing of [io.ReadSeeker].
|
||||
package tail
|
||||
|
||||
import (
|
||||
|
@ -2,6 +2,7 @@
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Package version defines version information.
|
||||
package version
|
||||
|
||||
import (
|
||||
|
Loading…
x
Reference in New Issue
Block a user