Skip to content

Commit

Permalink
Fix golangci-lint findings
Browse files Browse the repository at this point in the history
```
redefines-builtin-id: redefinition of the built-in function new
```
  • Loading branch information
plkokanov committed Dec 13, 2024
1 parent bb39f80 commit ac93282
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pkg/admission/validator/shoot.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ func NewShootValidator(apiReader client.Reader, decoder runtime.Decoder) extensi
}

// Validate validates the given shoot object.
func (s *shoot) Validate(ctx context.Context, new, _ client.Object) error {
shoot, ok := new.(*core.Shoot)
func (s *shoot) Validate(ctx context.Context, newObj, _ client.Object) error {
shoot, ok := newObj.(*core.Shoot)
if !ok {
return fmt.Errorf("wrong object type %T", new)
return fmt.Errorf("wrong object type %T", newObj)
}

var ext *core.Extension
Expand Down
10 changes: 5 additions & 5 deletions pkg/webhook/operatingsystemconfig/ensurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type ensurer struct {
}

// EnsureAdditionalFiles ensures that the rsyslog configuration files are added to the <new> files.
func (e *ensurer) EnsureAdditionalFiles(ctx context.Context, gctx gcontext.GardenContext, new, _ *[]extensionsv1alpha1.File) error {
func (e *ensurer) EnsureAdditionalFiles(ctx context.Context, gctx gcontext.GardenContext, newFiles, _ *[]extensionsv1alpha1.File) error {
cluster, err := gctx.GetCluster(ctx)
if err != nil {
return err
Expand Down Expand Up @@ -75,7 +75,7 @@ func (e *ensurer) EnsureAdditionalFiles(ctx context.Context, gctx gcontext.Garde
return fmt.Errorf("failed to get rsyslog files: %w", err)
}
for _, file := range rsyslogFiles {
*new = extensionswebhook.EnsureFileWithPath(*new, file)
*newFiles = extensionswebhook.EnsureFileWithPath(*newFiles, file)
}

if shootRsyslogRelpConfig.AuditConfig == nil || shootRsyslogRelpConfig.AuditConfig.Enabled {
Expand All @@ -84,14 +84,14 @@ func (e *ensurer) EnsureAdditionalFiles(ctx context.Context, gctx gcontext.Garde
return fmt.Errorf("failed to get audit files: %w", err)
}
for _, file := range auditFiles {
*new = extensionswebhook.EnsureFileWithPath(*new, file)
*newFiles = extensionswebhook.EnsureFileWithPath(*newFiles, file)
}
}

return nil
}

func (e *ensurer) EnsureAdditionalUnits(_ context.Context, _ gcontext.GardenContext, new, _ *[]extensionsv1alpha1.Unit) error {
*new = extensionswebhook.EnsureUnitWithName(*new, getRsyslogConfiguratorUnit())
func (e *ensurer) EnsureAdditionalUnits(_ context.Context, _ gcontext.GardenContext, newUnits, _ *[]extensionsv1alpha1.Unit) error {
*newUnits = extensionswebhook.EnsureUnitWithName(*newUnits, getRsyslogConfiguratorUnit())
return nil
}

0 comments on commit ac93282

Please sign in to comment.