Skip to content

Commit 4ac2031

Browse files
authored
Merge pull request #215 from stackhpc/upstream/2025.1-2025-09-15
Synchronise 2025.1 with upstream
2 parents 52eff86 + aa954f9 commit 4ac2031

File tree

7 files changed

+64
-5
lines changed

7 files changed

+64
-5
lines changed

.zuul.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,11 @@
145145
jobs:
146146
- magnum-tempest-plugin-tests-api
147147
- magnum-tempest-plugin-tests-api-jammy
148-
- magnum-tempest-plugin-tests-cluster-k8s_fcos_v1-1.27-flannel
148+
- magnum-tempest-plugin-tests-cluster-k8s_fcos_v1-1.27-flannel:
149+
voting: false
149150
- magnum-tempest-plugin-tests-cluster-k8s_fcos_v1-1.27-calico
150-
- magnum-tempest-plugin-tests-cluster-k8s_fcos_v1-1.28-flannel
151+
- magnum-tempest-plugin-tests-cluster-k8s_fcos_v1-1.28-flannel:
152+
voting: false
151153
- magnum-tempest-plugin-tests-cluster-k8s_fcos_v1-1.28-calico
152154
- magnum-container-build
153155
gate:

devstack/lib/magnum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ MAGNUM_API_PASTE=$MAGNUM_CONF_DIR/api-paste.ini
4949
MAGNUM_K8S_KEYSTONE_AUTH_DEFAULT_POLICY=$MAGNUM_CONF_DIR/k8s_keystone_auth_default_policy.json
5050
MAGNUM_POLICY=$MAGNUM_CONF_DIR/policy.yaml
5151

52-
MAGNUM_UWSGI=$MAGNUM_BIN_DIR/magnum-api-wsgi
52+
MAGNUM_UWSGI=magnum.wsgi.api:application
5353
MAGNUM_UWSGI_CONF=$MAGNUM_CONF_DIR/magnum-api-uwsgi.ini
5454

5555
# Public facing bits
@@ -242,7 +242,7 @@ function create_magnum_conf {
242242

243243
iniset $MAGNUM_CONF kubernetes keystone_auth_default_policy $MAGNUM_K8S_KEYSTONE_AUTH_DEFAULT_POLICY
244244

245-
write_uwsgi_config "$MAGNUM_UWSGI_CONF" "$MAGNUM_UWSGI" "/container-infra"
245+
write_uwsgi_config "$MAGNUM_UWSGI_CONF" "$MAGNUM_UWSGI" "/container-infra" "" "magnum-api"
246246
}
247247

248248
function create_api_paste_conf {

dockerfiles/helm-client/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG HELM_VERSION=v3.2.0
2-
FROM debian:buster-slim
2+
FROM debian/eol:buster-slim
33

44
ARG HELM_VERSION
55

magnum/common/x509/operations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ def sign(csr, issuer_name, ca_key, ca_key_password=None,
223223
builder = builder.add_extension(extention.value,
224224
critical=extention.critical)
225225

226+
subject_key_identifier = x509.SubjectKeyIdentifier.from_public_key(
227+
csr.public_key())
228+
builder = builder.add_extension(
229+
subject_key_identifier, critical=False
230+
)
231+
226232
certificate = builder.sign(
227233
private_key=ca_key, algorithm=hashes.SHA256(),
228234
).public_bytes(serialization.Encoding.PEM).strip()

magnum/tests/unit/common/x509/test_sign.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,26 @@ def test_sign_empty_chars(self, mock_load_pem):
233233
self.assertEqual(certificate,
234234
certificate.strip())
235235

236+
# If a subject key identifier is given in the CSR, ensure it is added
237+
@mock.patch('cryptography.x509.load_pem_x509_csr')
238+
def test_sign_subject_key_identifier(self, mock_load_pem):
239+
ca_key = self._generate_private_key()
240+
private_key = self._generate_private_key()
241+
csr_obj = self._build_csr(private_key)
242+
csr = csr_obj.public_bytes(serialization.Encoding.PEM)
243+
csr = csr.decode('utf-8')
244+
245+
mock_load_pem.return_value = csr_obj
246+
certificate = operations.sign(csr, self.issuer_name,
247+
ca_key, skip_validation=True)
248+
249+
# Ensure the Subject Key Identifier extension is present
250+
cert = c_x509.load_pem_x509_certificate(certificate)
251+
ext_ski = [ext for ext in cert.extensions
252+
if cert.extensions[0].oid ==
253+
c_x509.oid.ExtensionOID.SUBJECT_KEY_IDENTIFIER]
254+
self.assertEqual(len(ext_ski), 1)
255+
236256
def test_sign_with_invalid_csr(self):
237257
ca_key = self._generate_private_key()
238258
csr = 'test'

magnum/wsgi/api.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# -*- mode: python -*-
2+
#
3+
# Copyright 2017 SUSE Linux GmbH
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
import sys
18+
19+
from magnum.api import app as api_app
20+
from magnum.common import service
21+
22+
service.prepare_service(sys.argv)
23+
24+
application = api_app.load_app()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
features:
3+
- |
4+
Add subject key identifier extension to x509 operations
5+
signing function. Allows for magnum Kubernetes clusters
6+
to generate certificates with authority key
7+
identifier extension.

0 commit comments

Comments
 (0)