Skip to content

Commit 5eea01a

Browse files
gtherondclaude
andcommitted
[1952] feat(controller): inject OS_*_API_VERSION env vars from clouds.yaml
Completes the microversion floor wiring end-to-end. T020 (PR #1) made v2v-helper read OS_COMPUTE_API_VERSION / OS_VOLUME_API_VERSION / OS_IMAGE_API_VERSION / OS_NETWORK_API_VERSION / OS_IDENTITY_API_VERSION and feed them through pkg/common/microversion.Floor. This commit fills the producer side: when the credential Secret is clouds.yaml-keyed, the controller parses the per-service api_version fields out of the selected cloud entry and injects them as explicit Env vars on the v2v-helper Job spec. Legacy OS_*-keyed Secrets are unchanged — the EnvFrom block auto-loads any OS_*_API_VERSION keys that happen to be present. Changes: - pkg/utils/clouds_yaml.go: MicroversionsToEnvVars(map) returns []EnvVarPair with deterministic ordering (compute, volume, image, network, identity). Empty values and unknown service names are silently skipped. - pkg/utils/clouds_yaml_test.go: 5 table-driven cases covering nil, empty, two services, all five services, empty-value skip, and unknown-service skip. - internal/controller/migrationplan_controller.go: CreateJob takes a new openstackCloudName parameter. After the existing envVars init, buildMicroversionEnvVars (new) reads the Secret, dispatches via SecretContainsCloudsYAML, runs ParseCloudsYAML against the cloudName, and appends the env vars to the Job spec. Errors at this step are logged but non-fatal — the legacy EnvFrom path remains in play. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent eb57d11 commit 5eea01a

6 files changed

Lines changed: 158 additions & 0 deletions

graphify-out/cache/ast/4708019252efc3aeeaa7667f07146635894b04bc04c0b1c4c89c3238a3b2ab40.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"nodes": [{"id": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "label": "clouds_yaml.go", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L1"}, {"id": "utils_clouds_yaml_secretcontainscloudsyaml", "label": "SecretContainsCloudsYAML()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L48"}, {"id": "utils_clouds_yaml_microversionstoenvvars", "label": "MicroversionsToEnvVars()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L64"}, {"id": "utils_envvarpair", "label": "EnvVarPair", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L85"}, {"id": "utils_clouds_yaml_servicemicroversionenvname", "label": "serviceMicroversionEnvName()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L90"}, {"id": "utils_cloudconfig", "label": "CloudConfig", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L96"}, {"id": "utils_cloudsfile", "label": "cloudsFile", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L134"}, {"id": "utils_cloudentry", "label": "cloudEntry", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L138"}, {"id": "utils_authblock", "label": "authBlock", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L152"}, {"id": "utils_clouds_yaml_parsecloudsyaml", "label": "ParseCloudsYAML()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L178"}, {"id": "utils_clouds_yaml_cloudnames", "label": "CloudNames()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L217"}, {"id": "utils_clouds_yaml_parsecloudsfile", "label": "parseCloudsFile()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L225"}, {"id": "utils_clouds_yaml_selectcloud", "label": "selectCloud()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L236"}, {"id": "utils_clouds_yaml_buildauthoptions", "label": "buildAuthOptions()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L254"}, {"id": "utils_clouds_yaml_collectmicroversions", "label": "collectMicroversions()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L284"}, {"id": "utils_clouds_yaml_lookslikeinlinecert", "label": "looksLikeInlineCert()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L308"}, {"id": "utils_clouds_yaml_sortedkeys", "label": "sortedKeys()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L313"}], "edges": [{"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "go_pkg_errors", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L4", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "go_pkg_fmt", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L5", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "go_pkg_sort", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L6", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "go_pkg_strings", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L7", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "go_pkg_github_com_gophercloud_gophercloud_v2", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L9", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "go_pkg_gopkg_in_yaml_v3", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L10", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_secretcontainscloudsyaml", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L48", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_microversionstoenvvars", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L64", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_envvarpair", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L85", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_servicemicroversionenvname", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L90", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_cloudconfig", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L96", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_cloudsfile", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L134", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_cloudentry", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L138", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_authblock", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L152", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_parsecloudsyaml", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L178", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_cloudnames", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L217", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_parsecloudsfile", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L225", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_selectcloud", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L236", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_buildauthoptions", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L254", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_collectmicroversions", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L284", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_lookslikeinlinecert", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L308", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_pkg_utils_clouds_yaml_go", "target": "utils_clouds_yaml_sortedkeys", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L313", "weight": 1.0}, {"source": "utils_clouds_yaml_microversionstoenvvars", "target": "utils_clouds_yaml_servicemicroversionenvname", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L75", "weight": 1.0}, {"source": "utils_clouds_yaml_parsecloudsyaml", "target": "utils_clouds_yaml_parsecloudsfile", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L179", "weight": 1.0}, {"source": "utils_clouds_yaml_parsecloudsyaml", "target": "utils_clouds_yaml_selectcloud", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L184", "weight": 1.0}, {"source": "utils_clouds_yaml_parsecloudsyaml", "target": "utils_clouds_yaml_lookslikeinlinecert", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L198", "weight": 1.0}, {"source": "utils_clouds_yaml_parsecloudsyaml", "target": "utils_clouds_yaml_collectmicroversions", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L208", "weight": 1.0}, {"source": "utils_clouds_yaml_parsecloudsyaml", "target": "utils_clouds_yaml_buildauthoptions", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L210", "weight": 1.0}, {"source": "utils_clouds_yaml_cloudnames", "target": "utils_clouds_yaml_parsecloudsfile", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L218", "weight": 1.0}, {"source": "utils_clouds_yaml_cloudnames", "target": "utils_clouds_yaml_sortedkeys", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L222", "weight": 1.0}, {"source": "utils_clouds_yaml_selectcloud", "target": "utils_clouds_yaml_sortedkeys", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L244", "weight": 1.0}], "raw_calls": [{"caller_nid": "utils_clouds_yaml_secretcontainscloudsyaml", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L50"}, {"caller_nid": "utils_clouds_yaml_microversionstoenvvars", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L65"}, {"caller_nid": "utils_clouds_yaml_microversionstoenvvars", "callee": "make", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L68"}, {"caller_nid": "utils_clouds_yaml_microversionstoenvvars", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L68"}, {"caller_nid": "utils_clouds_yaml_microversionstoenvvars", "callee": "append", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L74"}, {"caller_nid": "utils_clouds_yaml_servicemicroversionenvname", "callee": "ToUpper", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L91"}, {"caller_nid": "utils_clouds_yaml_parsecloudsyaml", "callee": "Errorf", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L191"}, {"caller_nid": "utils_clouds_yaml_parsecloudsyaml", "callee": "Errorf", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L195"}, {"caller_nid": "utils_clouds_yaml_parsecloudsyaml", "callee": "Errorf", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L199"}, {"caller_nid": "utils_clouds_yaml_parsecloudsfile", "callee": "Unmarshal", "is_member_call": true, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L227"}, {"caller_nid": "utils_clouds_yaml_parsecloudsfile", "callee": "Errorf", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L228"}, {"caller_nid": "utils_clouds_yaml_parsecloudsfile", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L230"}, {"caller_nid": "utils_clouds_yaml_parsecloudsfile", "callee": "Errorf", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L231"}, {"caller_nid": "utils_clouds_yaml_selectcloud", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L238"}, {"caller_nid": "utils_clouds_yaml_selectcloud", "callee": "Errorf", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L243"}, {"caller_nid": "utils_clouds_yaml_selectcloud", "callee": "Join", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L244"}, {"caller_nid": "utils_clouds_yaml_selectcloud", "callee": "Errorf", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L248"}, {"caller_nid": "utils_clouds_yaml_selectcloud", "callee": "Join", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L249"}, {"caller_nid": "utils_clouds_yaml_lookslikeinlinecert", "callee": "TrimSpace", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L309"}, {"caller_nid": "utils_clouds_yaml_lookslikeinlinecert", "callee": "HasPrefix", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L310"}, {"caller_nid": "utils_clouds_yaml_sortedkeys", "callee": "make", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L314"}, {"caller_nid": "utils_clouds_yaml_sortedkeys", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L314"}, {"caller_nid": "utils_clouds_yaml_sortedkeys", "callee": "append", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L316"}, {"caller_nid": "utils_clouds_yaml_sortedkeys", "callee": "Strings", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/pkg/utils/clouds_yaml.go", "source_location": "L318"}]}

graphify-out/cache/ast/ed0421b8a35fff59b49b85c033eb4df25109ed7442e7f4432095ca7db7867263.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)