Skip to content

Commit

Permalink
chore: couple of wording fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
  • Loading branch information
jsilvela committed May 23, 2024
1 parent 5736a4f commit 4cc8e97
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/manager/instance/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func NewCmd() *cobra.Command {
cmd.Flags().StringVar(&namespace, "namespace", os.Getenv("NAMESPACE"), "The namespace of "+
"the cluster and of the Pod in k8s")
cmd.Flags().BoolVar(&tlsStatus, "tls-status", false,
"Enable TLS communicating with the operator")
"Enable TLS for communicating with the operator")
return cmd
}

Expand Down
3 changes: 2 additions & 1 deletion internal/management/controller/instance_startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ import (
)

// refreshServerCertificateFiles gets the latest server certificates files from the
// secrets. Returns true if configuration has been changed
// secrets, and may set the instance certificate if it was missing our outdated.
// Returns true if configuration has been changed or the instance has been updated
func (r *InstanceReconciler) refreshServerCertificateFiles(ctx context.Context, cluster *apiv1.Cluster) (bool, error) {
contextLogger := log.FromContext(ctx)

Expand Down
4 changes: 2 additions & 2 deletions pkg/certs/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type contextKey string
// contextKeyTLSConfig is the context key holding the TLS configuration
const contextKeyTLSConfig contextKey = "tlsConfig"

// newTLSConfigFromSecret creates a tls.Config from the given ca secret and serverName pair
// newTLSConfigFromSecret creates a tls.Config from the given CA secret and serverName pair
func newTLSConfigFromSecret(
ctx context.Context,
cli client.Client,
Expand All @@ -42,7 +42,7 @@ func newTLSConfigFromSecret(
secret := &v1.Secret{}
err := cli.Get(ctx, caSecret, secret)
if err != nil {
return nil, fmt.Errorf("while getting secret %s: %w", caSecret.Name, err)
return nil, fmt.Errorf("while getting caSecret %s: %w", caSecret.Name, err)
}

caCertificate, ok := secret.Data[CACertKey]
Expand Down
2 changes: 1 addition & 1 deletion pkg/certs/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7Qe3X7Q6WZpXqlXkq0Bd
tlsConfig, err := newTLSConfigFromSecret(ctx, c, caSecret, serverName)
Expect(err).To(HaveOccurred())
Expect(tlsConfig).To(BeNil())
Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("while getting secret %s", caSecret.Name)))
Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("while getting caSecret %s", caSecret.Name)))
})
})

Expand Down

0 comments on commit 4cc8e97

Please sign in to comment.