Skip to content

Commit

Permalink
Bump linter to 1.61.0 (#1068)
Browse files Browse the repository at this point in the history
* Bump linter to 1.61.0

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* linter

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

---------

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
  • Loading branch information
rubenvp8510 authored Oct 22, 2024
1 parent 7dcf94c commit a312f46
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
args: -v
version: v1.56.1
version: v1.61.0
6 changes: 4 additions & 2 deletions cmd/gather/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
rbacv1 "k8s.io/api/rbac/v1"
)

const defaultDirectoryPermissions = 0750

type cluster struct {
config *config.Config
apiAvailabilityCache map[schema.GroupVersionResource]bool
Expand Down Expand Up @@ -105,7 +107,7 @@ func (c *cluster) getPodLogs(podName, namespace, container string) {

// GetOperatorDeploymentInfo gets the operator deployment info from the cluster.
func (c *cluster) GetOperatorDeploymentInfo() error {
err := os.MkdirAll(c.config.CollectionDir, os.ModePerm)
err := os.MkdirAll(c.config.CollectionDir, defaultDirectoryPermissions)
if err != nil {
return err
}
Expand All @@ -132,7 +134,7 @@ func (c *cluster) GetOLMInfo() error {
}

outputDir := filepath.Join(c.config.CollectionDir, "olm")
err := os.MkdirAll(outputDir, os.ModePerm)
err := os.MkdirAll(outputDir, defaultDirectoryPermissions)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/gather/cluster/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

func createTempoStackFolder(collectionDir string, tempoStack *tempov1alpha1.TempoStack) (string, error) {
outputDir := filepath.Join(collectionDir, "namespaces", tempoStack.Namespace, "tempostack", tempoStack.Name)
err := os.MkdirAll(outputDir, os.ModePerm)
err := os.MkdirAll(outputDir, defaultDirectoryPermissions)
if err != nil {
return "", err
}
Expand All @@ -31,7 +31,7 @@ func createTempoStackFolder(collectionDir string, tempoStack *tempov1alpha1.Temp

func createTempoMonolithicFolder(collectionDir string, tempoMonolith *tempov1alpha1.TempoMonolithic) (string, error) {
outputDir := filepath.Join(collectionDir, "namespaces", tempoMonolith.Namespace, "tempomonolithic", tempoMonolith.Name)
err := os.MkdirAll(outputDir, os.ModePerm)
err := os.MkdirAll(outputDir, defaultDirectoryPermissions)
if err != nil {
return "", err
}
Expand Down Expand Up @@ -72,7 +72,7 @@ func writeLogToFile(outputDir, podName, container string, p cgocorev1.PodInterfa
}
}()

err = os.MkdirAll(outputDir, os.ModePerm)
err = os.MkdirAll(outputDir, defaultDirectoryPermissions)
if err != nil {
log.Fatalln(err)
return
Expand Down
5 changes: 4 additions & 1 deletion cmd/generate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ func build(params manifestutils.Params) ([]client.Object, error) {

func toYAMLManifest(scheme *runtime.Scheme, objects []client.Object, out io.Writer) error {
for _, obj := range objects {
fmt.Fprintln(out, "---")
_, err := fmt.Fprintln(out, "---")
if err != nil {
return err
}

// set Group, Version and Kind
types, _, err := scheme.ObjectKinds(obj)
Expand Down
2 changes: 1 addition & 1 deletion controllers/tempo/tempostack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (r *TempoStackReconciler) Reconcile(ctx context.Context, req ctrl.Request)
//
// - For any other error: Set the status condition to Failed,
// the Reason to "FailedReconciliation" and the message to the error message.
func (r *TempoStackReconciler) handleReconcileStatus(ctx context.Context, log logr.Logger, tempo v1alpha1.TempoStack, reconcileError error) (ctrl.Result, error) {
func (r *TempoStackReconciler) handleReconcileStatus(ctx context.Context, log logr.Logger, tempo v1alpha1.TempoStack, reconcileError error) (ctrl.Result, error) { //nolint:unparam
// First refresh components
newStatus, rerr := status.GetComponentsStatus(ctx, r, tempo)
if rerr != nil {
Expand Down

0 comments on commit a312f46

Please sign in to comment.