Skip to content

Commit c6ab8c1

Browse files
authored
docs: Add a --insecure flag for the Kubernetes native API migration script (#12286)
Signed-off-by: mprahl <[email protected]>
1 parent e094b5b commit c6ab8c1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/k8s-native/migration.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import argparse
1616
import requests
17+
import urllib3
1718
import yaml
1819
import os
1920
from pathlib import Path
@@ -32,6 +33,8 @@ def parse_args():
3233
help="KFP pipeline server host (e.g., https://<host>). Defaults to the value of the KFP_SERVER_HOST environment variable.")
3334
parser.add_argument("--token", default=os.getenv("KFP_BEARER_TOKEN"), help="Bearer token for authentication. Defaults to the value of the KFP_BEARER_TOKEN environment variable.")
3435
parser.add_argument("--ca-bundle", default=os.getenv("CA_BUNDLE"), help="Path to custom CA bundle file. Defaults to the value of the CA_BUNDLE environment variable")
36+
parser.add_argument("--insecure", "--skip-tls-verify", dest="skip_tls_verify", action="store_true",
37+
help="Skip TLS certificate verification for HTTPS requests (insecure)")
3538
parser.add_argument('--output', '-o', default=DEFAULT_OUTPUT_DIR, help="Output directory path where pipeline YAMLs will be written(e.g., '/path/to/exported-pipelines')")
3639
parser.add_argument('--namespace', default=DEFAULT_NAMESPACE, help="Namespace to filter pipelines from")
3740
parser.add_argument('--batch-size', type=int, default=20,
@@ -194,7 +197,11 @@ def migrate():
194197
headers = {"Content-Type": "application/json"}
195198
if args.token:
196199
headers["Authorization"] = f"Bearer {args.token}"
197-
verify = args.ca_bundle if args.ca_bundle else True
200+
verify = False if args.skip_tls_verify else (args.ca_bundle if args.ca_bundle else True)
201+
202+
# Suppress urllib3 warnings when explicitly running with insecure TLS
203+
if args.skip_tls_verify:
204+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
198205

199206
try:
200207
all_objects = []

0 commit comments

Comments
 (0)