Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Fix misplaced return.
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-barry committed Dec 1, 2023
1 parent 0cfd7fc commit 7f15aa8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions api/v1/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

const QTAP_BUNDLE = "qtap-ca-bundle.crt"
const QPOINT_ROOT_CA = "qpoint-qtap-ca.crt"
const QTAP_BUNDLE = "qtap-ca-bundle.crt" // final bundle includes all CAs (including Qpoint's CA)
const QPOINT_ROOT_CA = "qpoint-qtap-ca.crt" // this is the Qpoint CA
const DEFAULT_ENDPOINT = "https://api.qpoint.io"

type Registration struct {
Expand Down Expand Up @@ -138,7 +138,7 @@ func MutateCaInjection(pod *corev1.Pod, config *Config) error {

func EnsureAssetsInNamespace(config *Config) error {
// the goal is to ensure this exists already or we'll create it
qtapCaExists := false
qtapCaBundleExists := false

// qtap ca configmap reference
qtapCaConfigMap := &corev1.ConfigMap{}
Expand All @@ -150,11 +150,11 @@ func EnsureAssetsInNamespace(config *Config) error {
return fmt.Errorf("retrieving Qtap CA config map: %w", err)
}
} else {
qtapCaExists = true
qtapCaBundleExists = true
}

// if the qtap ca bundle already exists, we're gtg
if qtapCaExists {
if qtapCaBundleExists {
return nil
}

Expand Down Expand Up @@ -186,8 +186,9 @@ func EnsureAssetsInNamespace(config *Config) error {
} else {
return fmt.Errorf("missing configuration for Qpoint Root CA, check instructions")
}
} else {
return fmt.Errorf("retrieving Qtap CA config map: %w", err)
}
return fmt.Errorf("retrieving Qtap CA config map: %w", err)
}

// extract the root CA
Expand Down

0 comments on commit 7f15aa8

Please sign in to comment.