Remove cert upload in kube-rootca-update-strategy

Removed the option "--cert-file" from the strategy to update K8s
RCA in the dcmanager client. The customization of K8s RCA is being
removed from the platform, keeping only the autogenerated option
for K8s RCA.

Test plan:
PASS: Deploy DC + SX subcloud.
PASS: Verified that "--cert-file" option is not available for
      "dcmanager kube-rootca-update-strategy create".

Story: 2011604
Task: 53488

Change-Id: I8d4d518b9d10193cb72a96911dd8acb37dfb9bbb
Signed-off-by: Marcelo de Castro Loebens <Marcelo.DeCastroLoebens@windriver.com>
This commit is contained in:
Marcelo de Castro Loebens
2025-12-11 11:17:15 -04:00
parent dfdd87053d
commit d062c55776
2 changed files with 4 additions and 11 deletions
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, 2024 Wind River Systems, Inc.
# Copyright (c) 2021, 2024-2025 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -11,4 +11,4 @@ SW_UPDATE_TYPE_KUBE_ROOTCA_UPDATE = "kube-rootca-update"
class KubeRootcaUpdateManager(SwUpdateManager):
def __init__(self, http_client):
super().__init__(http_client, update_type=SW_UPDATE_TYPE_KUBE_ROOTCA_UPDATE)
self.extra_args = ["subject", "expiry-date", "cert-file"]
self.extra_args = ["subject", "expiry-date"]
@@ -1,9 +1,8 @@
#
# Copyright (c) 2021, 2024 Wind River Systems, Inc.
# Copyright (c) 2021, 2024-2025 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import os
from dcmanagerclient.commands.v1 import sw_update_manager
@@ -20,7 +19,7 @@ class CreateKubeRootcaUpdateStrategy(
):
"""Create a kube rootca update strategy.
This strategy supports: expiry-date, subject and cert-file
This strategy supports: expiry-date and subject
"""
def get_parser(self, prog_name):
@@ -35,9 +34,6 @@ class CreateKubeRootcaUpdateStrategy(
required=False,
help="Expiry date for a generated certificate.",
)
self.add_argument(
"--cert-file", required=False, help="Path to a certificate to upload."
)
self.add_argument(
"--force",
required=False,
@@ -54,9 +50,6 @@ class CreateKubeRootcaUpdateStrategy(
# Note the "-" vs "_" when dealing with parsed_args
if parsed_args.expiry_date:
kwargs_dict["expiry-date"] = parsed_args.expiry_date
if parsed_args.cert_file:
# Need an absolute path for the cert-file
kwargs_dict["cert-file"] = os.path.abspath(parsed_args.cert_file)
if parsed_args.force:
kwargs_dict["force"] = "true"