Skip to content

Commit

Permalink
Make linter happy
Browse files Browse the repository at this point in the history
Revive linter added a new default rule for unused-parameters, update the
code to match.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
  • Loading branch information
frelon committed Feb 12, 2024
1 parent 7d860e0 commit 8f29273
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/operator/operator/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func NewOperatorCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "operator",
Short: "Run the Kubernetes operator using kubebuilder.",
Args: func(cmd *cobra.Command, args []string) error {
Args: func(_ *cobra.Command, _ []string) error {
if config.seedimageImagePullPolicy != string(corev1.PullAlways) &&
config.seedimageImagePullPolicy != string(corev1.PullIfNotPresent) &&
config.seedimageImagePullPolicy != string(corev1.PullNever) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/register/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func newCommand(fs vfs.FS, client register.Client, stateHandler register.StateHa
Use: "elemental-register",
Short: "Elemental register command",
Long: "elemental-register registers a node with the elemental-operator via a config file or flags",
RunE: func(_ *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
// Version subcommand
if viper.GetBool("version") {
log.Infof("Register version %s, commit %s, commit date %s", version.Version, version.Commit, version.CommitDate)
Expand Down
4 changes: 2 additions & 2 deletions cmd/support/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func main() {
Use: "elemental-support",
Short: "Gathers logs about the running system",
Long: "elemental-support tries to gather as much info as possible with logs about the running system for troubleshooting purposes",
RunE: func(_ *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
if viper.GetBool("debug") {
log.EnableDebugLogging()
}
Expand Down Expand Up @@ -247,7 +247,7 @@ func compress(src string, buf io.Writer) error {
return err
}
} else if mode.IsDir() {
_ = filepath.Walk(src, func(file string, fi os.FileInfo, err error) error {
_ = filepath.Walk(src, func(file string, fi os.FileInfo, _ error) error {
// generate tar header
var header, _ = tar.FileInfoHeader(fi, file)
header.Name = strings.Replace(filepath.ToSlash(file), "/tmp/", "elemental-support-", 1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func sanitizeUserInput(data string) string {
func upgrade(resp http.ResponseWriter, req *http.Request) (*websocket.Conn, error) {
upgrader := websocket.Upgrader{
HandshakeTimeout: 5 * time.Second,
CheckOrigin: func(r *http.Request) bool { return true },
CheckOrigin: func(_ *http.Request) bool { return true },
}

conn, err := upgrader.Upgrade(resp, req, nil)
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,31 +147,31 @@ func ReadE2EConfig(configPath string) (*E2EConfig, error) { //nolint:gocyclo
}

func substituteVersions(config *E2EConfig) error {
nginxURL, err := envsubst.Eval(config.NginxURL, func(s string) string {
nginxURL, err := envsubst.Eval(config.NginxURL, func(_ string) string {
return config.NginxVersion
})
if err != nil {
return fmt.Errorf("failed to substiture nginx url: %w", err)
}
config.NginxURL = nginxURL

certManagerURL, err := envsubst.Eval(config.CertManagerChartURL, func(s string) string {
certManagerURL, err := envsubst.Eval(config.CertManagerChartURL, func(_ string) string {
return config.CertManagerVersion
})
if err != nil {
return fmt.Errorf("failed to substiture cert manager chart url: %w", err)
}
config.CertManagerChartURL = certManagerURL

rancherURL, err := envsubst.Eval(config.RancherChartURL, func(s string) string {
rancherURL, err := envsubst.Eval(config.RancherChartURL, func(_ string) string {
return config.RancherVersion
})
if err != nil {
return fmt.Errorf("failed to substiture rancher chart url: %w", err)
}
config.RancherChartURL = rancherURL

sysUpgradeControllerURL, err := envsubst.Eval(config.SystemUpgradeControllerURL, func(s string) string {
sysUpgradeControllerURL, err := envsubst.Eval(config.SystemUpgradeControllerURL, func(_ string) string {
return config.SystemUpgradeControllerVersion
})
if err != nil {
Expand Down

0 comments on commit 8f29273

Please sign in to comment.