From df7e74b3acc5b4fcf0cfcba7b90d1e707df1dd7b Mon Sep 17 00:00:00 2001 From: nyagamunene Date: Tue, 24 Sep 2024 14:02:04 +0300 Subject: [PATCH] Fix failing CI Signed-off-by: nyagamunene --- cli/utils.go | 6 ++++-- go.mod | 1 - service.go | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/utils.go b/cli/utils.go index 006cd80..c7e922f 100644 --- a/cli/utils.go +++ b/cli/utils.go @@ -6,6 +6,7 @@ package cli import ( "encoding/json" "fmt" + "io/fs" "os" "path/filepath" @@ -15,6 +16,8 @@ import ( "github.com/spf13/cobra" ) +const fileMode = fs.FileMode(600) + var ( // Limit query parameter. Limit uint64 = 10 @@ -86,8 +89,7 @@ func saveToFile(filename string, content []byte) error { } filePath := filepath.Join(cwd, filename) - - err = os.WriteFile(filePath, content, 0600) + err = os.WriteFile(filePath, content, fileMode) if err != nil { return fmt.Errorf("failed to write file %s: %w", filename, err) } diff --git a/go.mod b/go.mod index a98131f..d193323 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,6 @@ require ( github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f github.com/jackc/pgx/v5 v5.6.0 github.com/jmoiron/sqlx v1.4.0 - github.com/lib/pq v1.10.9 github.com/ory/dockertest/v3 v3.11.0 github.com/pelletier/go-toml v1.9.5 github.com/prometheus/client_golang v1.19.1 diff --git a/service.go b/service.go index 251cdbb..55b336d 100644 --- a/service.go +++ b/service.go @@ -573,7 +573,6 @@ func (s *service) getSubject(options SubjectOptions) pkix.Name { } func (s *service) rotateCA(ctx context.Context, ctype CertType) error { - switch ctype { case RootCA: certificates, err := s.repo.GetCAs(ctx)