Skip to content

Commit

Permalink
Change CA config maps label name. Require second app.kubernetes.io/pa…
Browse files Browse the repository at this point in the history
…rt-of=che.eclipse.org label

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
  • Loading branch information
mmorhun committed Nov 23, 2020
1 parent 686ee49 commit 5508b9d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/deploy/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const (
CheTLSSelfSignedCertificateSecretName = "self-signed-certificate"
DefaultCheTLSSecretName = "che-tls"

// CheAllCACertsConfigMapName is the name of config map which contains all additional trusted by Che TLS CA certificates
CheAllCACertsConfigMapName = "che-ca-certs-merged"
// CheCACertsConfigMapLabelKey is the label key which marks config map with additional CA certificates
CheCACertsConfigMapLabelKey = "che-ca-certs"
CheCACertsConfigMapLabelKey = "app.kubernetes.io/component"
// CheCACertsConfigMapLabelKey is the label value which marks config map with additional CA certificates
CheCACertsConfigMapLabelValue = "true"
CheCACertsConfigMapLabelValue = "ca-bundle"
// CheAllCACertsConfigMapName is the name of config map which contains all additional trusted by Che TLS CA certificates
CheAllCACertsConfigMapName = "che-ca-certs-merged"
// CheMergedCAConfigMapRevisionsLabelKey is label name which holds versions of included config maps in format: cm-name1=ver1,cm-name2=ver2
CheMergedCAConfigMapRevisionsLabelKey = "included-cm"

Expand Down Expand Up @@ -564,9 +564,10 @@ func SyncAdditionalCACertsConfigMapToCluster(cr *orgv1.CheCluster, deployContext
func getCACertsConfigMaps(deployContext *DeployContext) ([]corev1.ConfigMap, error) {
CACertsConfigMapList := &corev1.ConfigMapList{}

labelSelectorRequirement, _ := labels.NewRequirement(CheCACertsConfigMapLabelKey, selection.Equals, []string{CheCACertsConfigMapLabelValue})
caBundleLabelSelectorRequirement, _ := labels.NewRequirement(CheCACertsConfigMapLabelKey, selection.Equals, []string{CheCACertsConfigMapLabelValue})
cheComponetLabelSelectorRequirement, _ := labels.NewRequirement("app.kubernetes.io/part-of", selection.Equals, []string{"che.eclipse.org"})
listOptions := &client.ListOptions{
LabelSelector: labels.NewSelector().Add(*labelSelectorRequirement),
LabelSelector: labels.NewSelector().Add(*cheComponetLabelSelectorRequirement).Add(*caBundleLabelSelectorRequirement),
}
if err := deployContext.ClusterAPI.Client.List(context.TODO(), CACertsConfigMapList, listOptions); err != nil {
return nil, err
Expand Down

0 comments on commit 5508b9d

Please sign in to comment.