Skip to content

Commit

Permalink
Read trusted CA configmaps only from installation namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
  • Loading branch information
mmorhun committed Oct 6, 2021
1 parent 072f3c0 commit 2195827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion controllers/checlusterbackup/backup_data_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ func backupConfigMaps(bctx *BackupContext, destDir string) (bool, error) {
return true, err
}

fakeDeployContext := &deploy.DeployContext{ClusterAPI: deploy.ClusterAPI{Client: bctx.r.client}}
fakeDeployContext := &deploy.DeployContext{
ClusterAPI: deploy.ClusterAPI{Client: bctx.r.client},
CheCluster: bctx.cheCR,
}
caBundlesConfigmaps, err := deploy.GetCACertsConfigMaps(fakeDeployContext)
if err != nil {
return false, err
Expand Down
1 change: 1 addition & 0 deletions pkg/deploy/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ func GetCACertsConfigMaps(deployContext *DeployContext) ([]corev1.ConfigMap, err
cheComponetLabelSelectorRequirement, _ := labels.NewRequirement(KubernetesPartOfLabelKey, selection.Equals, []string{CheEclipseOrg})
listOptions := &client.ListOptions{
LabelSelector: labels.NewSelector().Add(*cheComponetLabelSelectorRequirement).Add(*caBundleLabelSelectorRequirement),
Namespace: deployContext.CheCluster.GetNamespace(),
}
if err := deployContext.ClusterAPI.Client.List(context.TODO(), CACertsConfigMapList, listOptions); err != nil {
return nil, err
Expand Down

0 comments on commit 2195827

Please sign in to comment.