Skip to content

Commit 96b98ee

Browse files
committed
chore: apply copilot feedback
Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com>
1 parent 3058fd7 commit 96b98ee

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ jobs:
3131
# Build Go binary
3232
- run: go build -v cmd/main.go
3333

34-
# Compile test packages without running them to warm the build cache.
35-
# The test job restores this cache and only needs to execute the binaries.
36-
- run: go test -run=^$ ./...
34+
- run: go test ./...
3735

3836
lint:
3937
name: Lint

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ $(GOLANGCI_LINT): $(LOCALBIN)
222222
@[ -f $(GOLANGCI_LINT) ] || { \
223223
set -e; \
224224
echo "Downloading golangci-lint $(GOLANGCI_LINT_VERSION)" ;\
225-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(LOCALBIN) $(GOLANGCI_LINT_VERSION) ;\
225+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/$(GOLANGCI_LINT_VERSION)/install.sh | sh -s -- -b $(LOCALBIN) $(GOLANGCI_LINT_VERSION) ;\
226226
mv $(LOCALBIN)/golangci-lint $(GOLANGCI_LINT) ;\
227227
}
228228

internal/command/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package command
1818

1919
import (
2020
"fmt"
21+
"io"
2122
"net/http"
2223
"strings"
2324
"time"
@@ -69,7 +70,8 @@ type clientAdapter struct {
6970
func (c *clientAdapter) GetAllMetadataFields(r v1.ApiGetMetadataFieldsRequest) ([]v1.CSSCMSDataModelModelsMetadataType, error) {
7071
fields, resp, err := c.getAllMetadataFields(r)
7172
if resp != nil && resp.Body != nil {
72-
resp.Body.Close()
73+
_, _ = io.Copy(io.Discard, resp.Body)
74+
_ = resp.Body.Close()
7375
}
7476
return fields, err
7577
}

policy/roles.rego

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package main
22

3+
import rego.v1
4+
35
# Roles are namespace-scoped resources. A Role without a namespace will be
46
# silently defaulted by the API server, which can result in permissions being
57
# granted in an unintended namespace. Require every Role to declare its

policy/serviceaccounts.rego

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package main
22

3+
import rego.v1
4+
35
# ServiceAccounts are namespace-scoped resources. A ServiceAccount without a namespace will be
46
# silently defaulted by the API server, which can result in permissions being
57
# granted in an unintended namespace. Require every ServiceAccount to declare its

0 commit comments

Comments
 (0)