Skip to content

Commit 128638e

Browse files
author
Michail Resvanis
committed
Filter out ocp certs from the external ones
When using RHACM to deploy disconnected IBU seed SNO clusters, the trusted-ca-bundle, which should only contain external to OCP CA certificates, can contain also OCP internal CA certificates. E.g.: - internal-loadbalancer-serving - service-network-serving-cert - localhost-serving-cert - external-loadbalancer-serving This change filters out all certs found in there with their subject containing openshift as the organisation unit (i.e. OU=openshift), as they are not external certs and should not be ignored by recert when regenerating and re-signing OCP certificates. Signed-off-by: Michail Resvanis <mresvani@redhat.com>
1 parent 0587575 commit 128638e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cluster_crypto/scanning/external_certs.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ pub(crate) async fn discover_external_certs(in_memory_etcd_client: Arc<InMemoryK
4646
}),
4747
_ => bail!("unexpected tag"),
4848
})
49+
.filter_map(|result| match result {
50+
Ok(subject) if !subject.contains("OU=openshift") => Some(Ok(subject)),
51+
Ok(_) => None,
52+
Err(e) => Some(Err(e)),
53+
})
4954
.collect::<Result<HashSet<_>>>()
5055
}
5156

0 commit comments

Comments
 (0)