Skip to content

Commit

Permalink
Support k8s secrets in console pod
Browse files Browse the repository at this point in the history
  • Loading branch information
cniackz committed Oct 7, 2023
1 parent 1b88332 commit 2798870
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pkg/certs/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,23 @@ func NewConfigDirFromCtx(ctx *cli.Context, option string, getDefaultDir func() s
}

func getPublicCertFile() string {
return filepath.Join(GlobalCertsDir.Get(), PublicCertFile)
publicCertFile := filepath.Join(GlobalCertsDir.Get(), PublicCertFile)
TLSCertFile := filepath.Join(GlobalCertsDir.Get(), TLSCertFile)
if isFile(publicCertFile) {
return publicCertFile
} else {

Check failure on line 180 in pkg/certs/certs.go

View workflow job for this annotation

GitHub Actions / lint (1.21.x, ubuntu-latest)

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
return TLSCertFile
}
}

func getPrivateKeyFile() string {
return filepath.Join(GlobalCertsDir.Get(), PrivateKeyFile)
privateKeyFile := filepath.Join(GlobalCertsDir.Get(), PrivateKeyFile)
TLSPrivateKey := filepath.Join(GlobalCertsDir.Get(), TLSKeyFile)
if isFile(privateKeyFile) {
return privateKeyFile
} else {

Check failure on line 190 in pkg/certs/certs.go

View workflow job for this annotation

GitHub Actions / lint (1.21.x, ubuntu-latest)

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
return TLSPrivateKey
}
}

// EnvCertPassword is the environment variable which contains the password used
Expand Down
6 changes: 6 additions & 0 deletions pkg/certs/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const (
// PublicCertFile Public certificate file for HTTPS.
PublicCertFile = "public.crt"

// TLSCertFile Public certificate file for HTTPS.
TLSCertFile = "tls.crt"

// PrivateKeyFile Private key file for HTTPS.
PrivateKeyFile = "private.key"

// TLSKeyFile Private key file for HTTPS.
TLSKeyFile = "tls.key"
)

0 comments on commit 2798870

Please sign in to comment.