Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
Signed-off-by: Coleen Iona Quadros <[email protected]>
  • Loading branch information
coleenquadros committed Feb 3, 2024
1 parent 62aa10b commit a6ef36a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ import (
)

const (
caMounthPath = "/etc/serving-certs-ca-bundle"
caVolName = "serving-certs-ca-bundle"
mtlsCertName = "observability-controller-open-cluster-management.io-observability-signer-client-cert"
mtlsCaName = "observability-managed-cluster-certs"
metricsCollectorName = "hub-metrics-collector-deployment"
caConfigmapName = "metrics-collector-serving-certs-ca-bundle"
restartLabel = "cert/time-restarted"
defaultInterval = "30s"
limitBytes = 1073741824
selectorKey = "component"
selectorValue = "metrics-collector"
caMounthPath = "/etc/serving-certs-ca-bundle"
caVolName = "serving-certs-ca-bundle"
mtlsCertName = "observability-controller-open-cluster-management.io-observability-signer-client-cert"
mtlsCaName = "observability-managed-cluster-certs"
metricsCollectorName = "hub-metrics-collector-deployment"
caConfigmapName = "hub-metrics-collector-serving-certs-ca-bundle"
restartLabel = "cert/time-restarted"
defaultInterval = "30s"
limitBytes = 1073741824
selectorKey = "component"
selectorValue = "metrics-collector"
HubClusterObsCertName = "observability-hub-cluster-certs"
)

var (
Expand Down Expand Up @@ -199,6 +200,28 @@ func getCommands(params HubCollectorParams) []string {
//}
return commands
}
func generateObservabilityServerCACertsforHub(client client.Client) (*corev1.Secret, error) {

Check failure on line 203 in operators/multiclusterobservability/controllers/placementrule/hub_metrics_collector.go

View workflow job for this annotation

GitHub Actions / Formatters + Linters (Static Analysis) for Go

func `generateObservabilityServerCACertsforHub` is unused (unused)
ca := &corev1.Secret{}
err := client.Get(context.TODO(), types.NamespacedName{Name: config.ServerCACerts,
Namespace: config.GetDefaultNamespace()}, ca)
if err != nil {
return nil, err
}

return &corev1.Secret{
TypeMeta: metav1.TypeMeta{
APIVersion: corev1.SchemeGroupVersion.String(),
Kind: "Secret",
},
ObjectMeta: metav1.ObjectMeta{
Name: HubClusterObsCertName,
Namespace: spokeNameSpace,
},
Data: map[string][]byte{
"ca.crt": ca.Data["tls.crt"],
},
}, nil
}

func createCAConfigmap(ctx context.Context, client client.Client) error {
cm := &corev1.ConfigMap{}
Expand Down Expand Up @@ -262,7 +285,7 @@ func GenerateMetricsCollectorForHub(client client.Client, ctx context.Context, m
Name: "mtlsca",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: mtlsCaName,
SecretName: HubClusterObsCertName,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ func generateObservabilityServerCACerts(client client.Client) (*corev1.Secret, e
return nil, err
}

log.Info("Coleen Creating observability server CA certs for namespace", "namespace", spokeNameSpace)
return &corev1.Secret{
TypeMeta: metav1.TypeMeta{
APIVersion: corev1.SchemeGroupVersion.String(),
Expand Down

0 comments on commit a6ef36a

Please sign in to comment.