@@ -116,6 +116,7 @@ capl_resources = [
116
116
"linodeobjectstoragebuckets.infrastructure.cluster.x-k8s.io:customresourcedefinition" ,
117
117
"linodeobjectstoragekeys.infrastructure.cluster.x-k8s.io:customresourcedefinition" ,
118
118
"capl-mutating-webhook-configuration:mutatingwebhookconfiguration" ,
119
+ "capl-ca:secret" ,
119
120
"capl-linodeclustertemplate-editor-role:clusterrole" ,
120
121
"capl-linodeclustertemplate-viewer-role:clusterrole" ,
121
122
"capl-linodemachine-editor-role:clusterrole" ,
@@ -176,8 +177,8 @@ for resource in manager_yaml:
176
177
resource ["stringData" ]["dnsToken" ] = os .getenv ("LINODE_DNS_TOKEN" )
177
178
if os .getenv ("LINODE_URL" ):
178
179
resource ["stringData" ]["LINODE_URL" ] = os .getenv ("LINODE_URL" )
179
- if os . getenv ( "LINODE_CA_BASE64" ) :
180
- resource ["stringData " ]["SSL_CERT_DIR " ] = "/tmp/linode-ca"
180
+ if resource [ "metadata" ][ "name" ] == "capl-ca" :
181
+ resource ["data " ]["cacert.pem " ] = os . getenv ( "LINODE_CA_BASE64" )
181
182
if resource ["metadata" ]["name" ] == "capl-akamai-edgerc-secret" :
182
183
resource ["stringData" ]["AKAMAI_HOST" ] = os .getenv ("AKAMAI_HOST" )
183
184
resource ["stringData" ]["AKAMAI_CLIENT_TOKEN" ] = os .getenv ("AKAMAI_CLIENT_TOKEN" )
@@ -195,22 +196,9 @@ for resource in manager_yaml:
195
196
resource ["spec" ]["template" ]["spec" ].pop ("securityContext" )
196
197
for container in resource ["spec" ]["template" ]["spec" ]["containers" ]:
197
198
container .pop ("securityContext" )
198
- if container ["name" ] == "manager" :
199
- if os .getenv ("LINODE_CA_BASE64" ):
200
- container ["volumeMounts" ].append ({"mountPath" : "/tmp/linode-ca" , "name" : "linode-ca" , "readOnly" : True })
201
- if os .getenv ("LINODE_CA_BASE64" ):
202
- resource ["spec" ]["template" ]["spec" ]["volumes" ].append ({"name" : "linode-ca" , "secret" : {"defaultMode" : 420 , "secretName" : "linode-ca" }})
203
199
204
200
k8s_yaml (encode_yaml_stream (manager_yaml ))
205
201
206
- if os .getenv ("LINODE_CA_BASE64" ):
207
- ca_secret = k8s_yaml (secret_from_dict (
208
- "linode-ca" ,
209
- namespace = "capl-system" ,
210
- inputs = {"cacert.pem" : decode_base64 (os .getenv ("LINODE_CA_BASE64" ))}
211
- ))
212
- capl_resources .append ("linode-ca:secret" )
213
-
214
202
if os .getenv ("SKIP_DOCKER_BUILD" , "false" ) != "true" and debug != "true" :
215
203
docker_build (
216
204
"docker.io/linode/cluster-api-provider-linode" ,
0 commit comments