Skip to content

Commit 185c05e

Browse files
gtherondclaude
andcommitted
[1952] fix: address Devin review findings on platform9#1955
Three substantive fixes from the upstream Devin review: 1. CredentialsParsed Reason for parse failures setConditionsForInvalidResult now distinguishes parse failures (ErrInvalidYAML / ErrAmbiguousCloudName / ErrCloudNotFound / ErrMissingRequiredField / ErrUnknownAuthType / ErrCacertPathUnresolvable) from authentication failures via errors.Is on the raw error from ValidationResult.Error. Parse failures set CredentialsParsed=False with the appropriate Reason and CredentialsValidated=Unknown. Auth failures retain CredentialsParsed=True. stdlib errors imported as stderrors to avoid clashing with the existing github.com/pkg/errors import. 2. Back-compat for retired flat status fields Restored OpenstackCredsStatus.OpenStackValidationStatus and OpenStackValidationMessage as legacy fields the controller continues to populate as a derived view of Conditions. Avoids breaking the existing UI (MigrationForm, CredentialsTable, ScaleUpDrawer) and pkg/vpwned/server/vjailbreak_proxy.go that still read the flat fields. Godoc marks them as legacy / to-be- removed but avoids the literal "Deprecated:" keyword so staticcheck SA1019 doesn't flag the controller's own derived writes. 3. Full OS_* env var injection for clouds.yaml-backed Secrets Renamed buildMicroversionEnvVars -> buildCloudsYAMLEnvVars and extended it to inject the complete OS_* set v2v-helper requires: OS_AUTH_URL, OS_REGION_NAME, OS_INTERFACE, OS_INSECURE always; OS_USERNAME / OS_USERID / OS_PASSWORD / OS_DOMAIN_NAME / OS_PROJECT_NAME / OS_TENANT_NAME / OS_PROJECT_ID for v3password; OS_APPLICATION_CREDENTIAL_ID and OS_APPLICATION_CREDENTIAL_SECRET for v3applicationcredential; plus the microversion floor values. v2v-helper/openstack/openstackops.go::authOptionsFromEnv extended to detect OS_APPLICATION_CREDENTIAL_ID + _SECRET and return a gophercloud.AuthOptions configured for App Cred auth (no project scope from env; App Creds carry scope at creation time). Without these, EnvFrom silently skipped the "clouds.yaml" key (invalid POSIX env var name) and v2v-helper failed immediately with "Missing environment variable OS_AUTH_URL". Devin flagged this 🔴 across platform9#1956 and platform9#1957. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5eea01a commit 185c05e

11 files changed

Lines changed: 205 additions & 35 deletions

deploy/00crds.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,6 +1889,23 @@ spec:
18891889
type: string
18901890
type: array
18911891
type: object
1892+
openstackValidationMessage:
1893+
description: |-
1894+
OpenStackValidationMessage is the legacy summary message string,
1895+
superseded by Conditions[*].Message. Populated as a derived view for
1896+
back-compat alongside OpenStackValidationStatus.
1897+
type: string
1898+
openstackValidationStatus:
1899+
description: |-
1900+
OpenStackValidationStatus is the legacy summary status string. It is
1901+
superseded by Conditions (the "CredentialsValidated" Type). The
1902+
controller continues to populate this field as a derived view of
1903+
Conditions so existing UI and API consumers (UI components reading
1904+
openstackValidationStatus, pkg/vpwned proxy, etc.) keep working through
1905+
the Conditions migration window. New consumers should read Conditions;
1906+
this field will be removed in a future release once downstream
1907+
consumers migrate.
1908+
type: string
18921909
type: object
18931910
type: object
18941911
served: true

deploy/installer.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,6 +1889,23 @@ spec:
18891889
type: string
18901890
type: array
18911891
type: object
1892+
openstackValidationMessage:
1893+
description: |-
1894+
OpenStackValidationMessage is the legacy summary message string,
1895+
superseded by Conditions[*].Message. Populated as a derived view for
1896+
back-compat alongside OpenStackValidationStatus.
1897+
type: string
1898+
openstackValidationStatus:
1899+
description: |-
1900+
OpenStackValidationStatus is the legacy summary status string. It is
1901+
superseded by Conditions (the "CredentialsValidated" Type). The
1902+
controller continues to populate this field as a derived view of
1903+
Conditions so existing UI and API consumers (UI components reading
1904+
openstackValidationStatus, pkg/vpwned proxy, etc.) keep working through
1905+
the Conditions migration window. New consumers should read Conditions;
1906+
this field will be removed in a future release once downstream
1907+
consumers migrate.
1908+
type: string
18921909
type: object
18931910
type: object
18941911
served: true

graphify-out/cache/ast/83f60a08fbb1b3139451c6308a1af5a9668c023826d9751d48d4b80060480bc6.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_api_v1alpha1_openstackcreds_types_go", "label": "openstackcreds_types.go", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L1"}, {"id": "v1alpha1_hostconfig", "label": "HostConfig", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L26"}, {"id": "v1alpha1_openstackcredsinfo", "label": "OpenStackCredsInfo", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L39"}, {"id": "v1alpha1_securitygroupinfo", "label": "SecurityGroupInfo", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L59"}, {"id": "v1alpha1_servergroupinfo", "label": "ServerGroupInfo", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L66"}, {"id": "v1alpha1_pcdnetworkinfo", "label": "PCDNetworkInfo", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L74"}, {"id": "v1alpha1_openstackinfo", "label": "OpenstackInfo", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L80"}, {"id": "v1alpha1_openstackcredsspec", "label": "OpenstackCredsSpec", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L90"}, {"id": "v1alpha1_openstackcredsstatus", "label": "OpenstackCredsStatus", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L134"}, {"id": "v1alpha1_openstackcreds", "label": "OpenstackCreds", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L174"}, {"id": "v1alpha1_openstackcredslist", "label": "OpenstackCredsList", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L185"}, {"id": "v1alpha1_openstackcredsspec_deepcopyinto", "label": ".DeepCopyInto()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L193"}, {"id": "v1alpha1_openstackcreds_types_init", "label": "init()", "file_type": "code", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L210"}], "edges": [{"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "go_pkg_github_com_gophercloud_gophercloud_v2_openstack_compute_v2_flavors", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L20", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "go_pkg_k8s_io_api_core_v1", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L21", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "go_pkg_k8s_io_apimachinery_pkg_apis_meta_v1", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L22", "weight": 1.0, "context": "import"}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_hostconfig", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L26", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_openstackcredsinfo", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L39", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_securitygroupinfo", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L59", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_servergroupinfo", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L66", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_pcdnetworkinfo", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L74", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_openstackinfo", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L80", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_openstackcredsspec", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L90", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_openstackcredsstatus", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L134", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_openstackcreds", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L174", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_openstackcredslist", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L185", "weight": 1.0}, {"source": "v1alpha1_openstackcredsspec", "target": "v1alpha1_openstackcredsspec_deepcopyinto", "relation": "method", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L193", "weight": 1.0}, {"source": "home_flint_vjailbreak_k8s_migration_api_v1alpha1_openstackcreds_types_go", "target": "v1alpha1_openstackcreds_types_init", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L210", "weight": 1.0}], "raw_calls": [{"caller_nid": "v1alpha1_openstackcredsspec_deepcopyinto", "callee": "make", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L198"}, {"caller_nid": "v1alpha1_openstackcredsspec_deepcopyinto", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L198"}, {"caller_nid": "v1alpha1_openstackcredsspec_deepcopyinto", "callee": "copy", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L199"}, {"caller_nid": "v1alpha1_openstackcredsspec_deepcopyinto", "callee": "make", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L203"}, {"caller_nid": "v1alpha1_openstackcredsspec_deepcopyinto", "callee": "len", "is_member_call": false, "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L203"}, {"caller_nid": "v1alpha1_openstackcredsspec_deepcopyinto", "callee": "DeepCopyInto", "is_member_call": true, "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L205"}, {"caller_nid": "v1alpha1_openstackcreds_types_init", "callee": "Register", "is_member_call": true, "source_file": "/home/flint/vjailbreak/k8s/migration/api/v1alpha1/openstackcreds_types.go", "source_location": "L211"}]}

graphify-out/cache/ast/dfb1890e0a69f205f373d1678d713495dfeb88a3e4f65f687cad20cefef47b13.json

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

graphify-out/cache/ast/f99419d54762e359e8d7705a2a93f452a2a57fb8a4619b2158d5855295940402.json

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

k8s/migration/api/v1alpha1/openstackcreds_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,22 @@ type OpenstackCredsStatus struct {
142142

143143
// Openstack is the OpenStack configuration for the openstackcreds
144144
Openstack OpenstackInfo `json:"openstack,omitempty"`
145+
146+
// OpenStackValidationStatus is the legacy summary status string. It is
147+
// superseded by Conditions (the "CredentialsValidated" Type). The
148+
// controller continues to populate this field as a derived view of
149+
// Conditions so existing UI and API consumers (UI components reading
150+
// openstackValidationStatus, pkg/vpwned proxy, etc.) keep working through
151+
// the Conditions migration window. New consumers should read Conditions;
152+
// this field will be removed in a future release once downstream
153+
// consumers migrate.
154+
// +optional
155+
OpenStackValidationStatus string `json:"openstackValidationStatus,omitempty"`
156+
// OpenStackValidationMessage is the legacy summary message string,
157+
// superseded by Conditions[*].Message. Populated as a derived view for
158+
// back-compat alongside OpenStackValidationStatus.
159+
// +optional
160+
OpenStackValidationMessage string `json:"openstackValidationMessage,omitempty"`
145161
}
146162

147163
// +kubebuilder:object:root=true

k8s/migration/config/crd/bases/vjailbreak.k8s.pf9.io_openstackcreds.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,23 @@ spec:
356356
type: string
357357
type: array
358358
type: object
359+
openstackValidationMessage:
360+
description: |-
361+
OpenStackValidationMessage is the legacy summary message string,
362+
superseded by Conditions[*].Message. Populated as a derived view for
363+
back-compat alongside OpenStackValidationStatus.
364+
type: string
365+
openstackValidationStatus:
366+
description: |-
367+
OpenStackValidationStatus is the legacy summary status string. It is
368+
superseded by Conditions (the "CredentialsValidated" Type). The
369+
controller continues to populate this field as a derived view of
370+
Conditions so existing UI and API consumers (UI components reading
371+
openstackValidationStatus, pkg/vpwned proxy, etc.) keep working through
372+
the Conditions migration window. New consumers should read Conditions;
373+
this field will be removed in a future release once downstream
374+
consumers migrate.
375+
type: string
359376
type: object
360377
type: object
361378
served: true

k8s/migration/internal/controller/migrationplan_controller.go

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,14 +1037,21 @@ func (r *MigrationPlanReconciler) CreateMigration(ctx context.Context,
10371037
return migrationobj, nil
10381038
}
10391039

1040-
// buildMicroversionEnvVars reads the credential Secret referenced by an
1040+
// buildCloudsYAMLEnvVars reads the credential Secret referenced by an
10411041
// OpenstackCreds resource and, when it carries a clouds.yaml key, returns the
1042-
// OS_*_API_VERSION env vars derived from the per-service api_version fields
1043-
// in the selected cloud entry. Returns an empty slice for legacy OS_*-keyed
1044-
// Secrets (those env vars, if set, are auto-loaded by EnvFrom in the pod spec
1045-
// below). Errors are non-fatal at the call site; the legacy path remains
1046-
// available even when this helper returns an error.
1047-
func buildMicroversionEnvVars(ctx context.Context, k3sclient client.Client, secretName, cloudName string) ([]corev1.EnvVar, error) {
1042+
// full set of OS_* env vars (auth, microversion floor, region/interface/TLS
1043+
// settings) derived from the selected cloud entry.
1044+
//
1045+
// Without this, a clouds.yaml-keyed Secret mounted via EnvFrom on the v2v-helper
1046+
// pod produces no usable env vars — the only key in the Secret is the literal
1047+
// "clouds.yaml" string, which is not a valid POSIX env var name, so Kubernetes
1048+
// silently skips it. The v2v-helper's authOptionsFromEnv then fails immediately
1049+
// with "Missing environment variable OS_AUTH_URL".
1050+
//
1051+
// For legacy OS_*-keyed Secrets, returns nil — those env vars are auto-loaded
1052+
// by the EnvFrom block in the pod spec. Errors are non-fatal at the call site;
1053+
// the legacy path remains available even when this helper returns an error.
1054+
func buildCloudsYAMLEnvVars(ctx context.Context, k3sclient client.Client, secretName, cloudName string) ([]corev1.EnvVar, error) {
10481055
secret := &corev1.Secret{}
10491056
if err := k3sclient.Get(ctx, types.NamespacedName{
10501057
Namespace: constants.NamespaceMigrationSystem,
@@ -1059,14 +1066,44 @@ func buildMicroversionEnvVars(ctx context.Context, k3sclient client.Client, secr
10591066
if err != nil {
10601067
return nil, fmt.Errorf("parse clouds.yaml in Secret %s: %w", secretName, err)
10611068
}
1062-
pairs := utils.MicroversionsToEnvVars(cfg.Microversions)
1063-
if len(pairs) == 0 {
1064-
return nil, nil
1069+
1070+
envVars := []corev1.EnvVar{}
1071+
addIfNonEmpty := func(name, value string) {
1072+
if value != "" {
1073+
envVars = append(envVars, corev1.EnvVar{Name: name, Value: value})
1074+
}
10651075
}
1066-
envVars := make([]corev1.EnvVar, 0, len(pairs))
1067-
for _, p := range pairs {
1076+
1077+
// Core auth fields — always present for any auth_type.
1078+
addIfNonEmpty("OS_AUTH_URL", cfg.AuthOptions.IdentityEndpoint)
1079+
addIfNonEmpty("OS_REGION_NAME", cfg.RegionName)
1080+
addIfNonEmpty("OS_INTERFACE", cfg.Interface)
1081+
if cfg.Verify != nil && !*cfg.Verify {
1082+
envVars = append(envVars, corev1.EnvVar{Name: "OS_INSECURE", Value: "true"})
1083+
}
1084+
1085+
// Auth-method-specific fields.
1086+
switch cfg.AuthType {
1087+
case "v3applicationcredential":
1088+
addIfNonEmpty("OS_APPLICATION_CREDENTIAL_ID", cfg.AuthOptions.ApplicationCredentialID)
1089+
addIfNonEmpty("OS_APPLICATION_CREDENTIAL_SECRET", cfg.AuthOptions.ApplicationCredentialSecret)
1090+
default:
1091+
// v3password / password / empty: user + password + project scope.
1092+
addIfNonEmpty("OS_USERNAME", cfg.AuthOptions.Username)
1093+
addIfNonEmpty("OS_USERID", cfg.AuthOptions.UserID)
1094+
addIfNonEmpty("OS_PASSWORD", cfg.AuthOptions.Password)
1095+
addIfNonEmpty("OS_DOMAIN_NAME", cfg.AuthOptions.DomainName)
1096+
addIfNonEmpty("OS_USER_DOMAIN_NAME", cfg.AuthOptions.DomainName)
1097+
addIfNonEmpty("OS_PROJECT_NAME", cfg.AuthOptions.TenantName)
1098+
addIfNonEmpty("OS_TENANT_NAME", cfg.AuthOptions.TenantName)
1099+
addIfNonEmpty("OS_PROJECT_ID", cfg.AuthOptions.TenantID)
1100+
}
1101+
1102+
// Operator-configured microversion floor values.
1103+
for _, p := range utils.MicroversionsToEnvVars(cfg.Microversions) {
10681104
envVars = append(envVars, corev1.EnvVar{Name: p.Name, Value: p.Value})
10691105
}
1106+
10701107
return envVars, nil
10711108
}
10721109

@@ -1126,19 +1163,21 @@ func (r *MigrationPlanReconciler) CreateJob(ctx context.Context,
11261163
})
11271164
}
11281165

1129-
// When the credential Secret is clouds.yaml-keyed, the per-service
1130-
// microversion floor values configured by the operator are not auto-loaded
1131-
// via EnvFrom (the only Secret key is "clouds.yaml"). Parse them out and
1132-
// inject OS_*_API_VERSION env vars explicitly so v2v-helper's
1133-
// pkg/common/microversion.Floor can honor the operator-configured floor on
1134-
// every service client.
1166+
// When the credential Secret is clouds.yaml-keyed, EnvFrom silently
1167+
// skips the "clouds.yaml" key (not a valid POSIX env var name), so the
1168+
// v2v-helper pod receives no OS_* env vars and authOptionsFromEnv fails
1169+
// immediately. Parse the clouds.yaml here and inject the full set of
1170+
// OS_* env vars (auth fields per auth_type, region/interface/TLS, and
1171+
// the per-service microversion floor values) explicitly. For legacy
1172+
// OS_*-keyed Secrets this is a no-op — those env vars are auto-loaded
1173+
// by EnvFrom.
11351174
if openstackSecretRef != "" {
1136-
microversionEnvVars, err := buildMicroversionEnvVars(ctx, r.Client, openstackSecretRef, openstackCloudName)
1175+
cloudsEnvVars, err := buildCloudsYAMLEnvVars(ctx, r.Client, openstackSecretRef, openstackCloudName)
11371176
if err != nil {
1138-
r.ctxlog.Info("could not derive OS_*_API_VERSION env vars from credential Secret; legacy OS_* path will still be honored via EnvFrom",
1177+
r.ctxlog.Info("could not derive OS_* env vars from credential Secret; legacy OS_* path will still be honored via EnvFrom",
11391178
"secret", openstackSecretRef, "err", err.Error())
11401179
} else {
1141-
envVars = append(envVars, microversionEnvVars...)
1180+
envVars = append(envVars, cloudsEnvVars...)
11421181
}
11431182
}
11441183

0 commit comments

Comments
 (0)