Skip to content

Commit 604febe

Browse files
authored
Support custom CA in trust-manager (#18397)
1 parent c5059f2 commit 604febe

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

install/installer/pkg/components/cluster/certmanager.go

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ func certmanager(ctx *common.RenderContext) ([]runtime.Object, error) {
2323
issuerName := "gitpod-self-signed-issuer"
2424
secretCAName := "gitpod-identity-trust-root"
2525

26+
gitpodCaBundleSources := []trust.BundleSource{
27+
{
28+
UseDefaultCAs: pointer.Bool(true),
29+
},
30+
{
31+
Secret: &trust.SourceObjectKeySelector{
32+
Name: secretCAName,
33+
KeySelector: trust.KeySelector{Key: "ca.crt"},
34+
},
35+
},
36+
}
37+
38+
if ctx.Config.CustomCACert != nil {
39+
gitpodCaBundleSources = append(gitpodCaBundleSources, trust.BundleSource{
40+
Secret: &trust.SourceObjectKeySelector{
41+
Name: ctx.Config.CustomCACert.Name,
42+
KeySelector: trust.KeySelector{Key: "ca.crt"},
43+
},
44+
})
45+
}
46+
2647
// TODO (gpl): This is a workaround to untangle the refactoring of existing infrastructure from
2748
// moving forward with this change
2849
caCertificateNamespace := "cert-manager" // this is the default we want to converge on, eventually
@@ -129,17 +150,7 @@ func certmanager(ctx *common.RenderContext) ([]runtime.Object, error) {
129150
Name: "gitpod-ca-bundle",
130151
},
131152
Spec: trust.BundleSpec{
132-
Sources: []trust.BundleSource{
133-
{
134-
UseDefaultCAs: pointer.Bool(true),
135-
},
136-
{
137-
Secret: &trust.SourceObjectKeySelector{
138-
Name: secretCAName,
139-
KeySelector: trust.KeySelector{Key: "ca.crt"},
140-
},
141-
},
142-
},
153+
Sources: gitpodCaBundleSources,
143154
Target: trust.BundleTarget{
144155
ConfigMap: &trust.KeySelector{
145156
Key: "ca-certificates.crt",

0 commit comments

Comments
 (0)