Skip to content

make create-kubeconfig merge preserve some keys#1103

Open
scratchmex wants to merge 2 commits into
oracle:masterfrom
scratchmex:issue-1102--create-kubeconfig-merge
Open

make create-kubeconfig merge preserve some keys#1103
scratchmex wants to merge 2 commits into
oracle:masterfrom
scratchmex:issue-1102--create-kubeconfig-merge

Conversation

@scratchmex

Copy link
Copy Markdown
Member

this changes the behavior of create-kubeconfig merge to preserve proxy-url and namespace keys. these entries are convenient for DEX

closes #1102

changes

  • preserve .contexts[].context.namespace and .clusters[].cluster.proxy-url when merging
  • add unit tests for this use case
  • gitignore .venv

validation

  • ran
$ OCI_CLI_CONFIG_FILE=test.conf .venv/bin/python -m pytest services/container_engine/tests/unit/test_kubeconfig_merge.py -v
================== test session starts ===================
platform darwin -- Python 3.11.15, pytest-7.1.2, pluggy-0.13.0 -- /Users/ivang/code/oci-cli/.venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/ivang/code/oci-cli, configfile: tox.ini
plugins: forked-1.0.2, xdist-1.22.2, cov-2.5.1
collected 2 items

services/container_engine/tests/unit/test_kubeconfig_merge.py::TestKubeconfigMerge::test_preserves_namespace_when_updating_context PASSED              [ 50%]
services/container_engine/tests/unit/test_kubeconfig_merge.py::TestKubeconfigMerge::test_preserves_proxy_url_when_updating_cluster PASSED              [100%]

=================== 2 passed in 0.01s ====================
# test.conf
[DEFAULT]
fingerprint=a:b:c
key_file=/tmp/somepath
tenancy=ocid1.tenancy.oc1..xyz
region=eu-zurich-1
security_token_file=/tmp/somepath
  • ran .venv/bin/python -m oci_cli.cli ce cluster create-kubeconfig --token-version 2.0.0 --kube-endpoint PRIVATE_ENDPOINT --cluster-id ocid1.cluster.oc1.eu-zurich-1.xyz --region eu-zurich-1

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oci ce cluster create-kubeconfig does not preserve some keys after "merging"

1 participant