Skip to content

Commit

Permalink
Call reusable action for go version updates (#296)
Browse files Browse the repository at this point in the history
* Create go-version.yaml

* Update linters.yaml

* gosec and linting

* gosec
  • Loading branch information
shaynafinocchiaro authored Oct 7, 2024
1 parent b8e364a commit 2402d34
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/go-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

# Reusable workflow to perform go version update on Golang based projects
name: Go Version Update

on:
workflow_dispatch:
repository_dispatch:
types: [go-update-workflow]

jobs:
# go version update
go-version-update:
uses: dell/common-github-actions/.github/workflows/go-version-workflow.yaml@main
name: Go Version Update
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
go mod vendor
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
uses: golangci/golangci-lint-action@v6
with:
version: latest
skip-cache: true
Expand Down
9 changes: 3 additions & 6 deletions cmd/karavictl/cmd/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ func GetRoles() (*roles.JSON, error) {
}

rolesRego := dataField.Data["common.rego"]
if err != nil {
return nil, err
}

rolesJSON := strings.Replace(rolesRego, "package karavi.common\ndefault roles = {}\nroles = ", "", 1)

Expand Down Expand Up @@ -207,7 +204,7 @@ func validatePowerFlexPool(storageSystemDetails System, storageSystemID string,
return err
}

if int(poolQuota.Quota) < 0 {
if poolQuota.Quota < 0 {
return errors.New("the specified quota needs to be a positive number")
}
return nil
Expand Down Expand Up @@ -237,7 +234,7 @@ func validatePowerMaxStorageResourcePool(ctx context.Context, storageSystemDetai
return err
}

if int(poolQuota.Quota) < 0 {
if poolQuota.Quota < 0 {
return errors.New("the specified quota needs to be a positive number")
}
return nil
Expand All @@ -260,7 +257,7 @@ func validatePowerScaleIsiPath(storageSystemDetails System, _ string, poolQuota
return err
}

if int(poolQuota.Quota) != 0 {
if poolQuota.Quota != 0 {
return errors.New("quota must be 0 as it is not enforced by CSM-Authorization")
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/karavictl/cmd/storage_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func NewStorageCreateCmd() *cobra.Command {
}

func readPassword(w io.Writer, prompt string, p *string) {
fmt.Fprintf(w, prompt)
fmt.Fprintf(w, "%s", prompt)
b, err := termReadPassword(int(syscall.Stdin))
if err != nil {
reportErrorAndExit(JSONOutput, w, err)
Expand Down

0 comments on commit 2402d34

Please sign in to comment.