Commit 185c05e
[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
File tree
- deploy
- graphify-out/cache/ast
- k8s/migration
- api/v1alpha1
- config/crd/bases
- internal/controller
- v2v-helper/openstack
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1889 | 1889 | | |
1890 | 1890 | | |
1891 | 1891 | | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
1892 | 1909 | | |
1893 | 1910 | | |
1894 | 1911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1889 | 1889 | | |
1890 | 1890 | | |
1891 | 1891 | | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
1892 | 1909 | | |
1893 | 1910 | | |
1894 | 1911 | | |
| |||
Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
145 | 161 | | |
146 | 162 | | |
147 | 163 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
359 | 376 | | |
360 | 377 | | |
361 | 378 | | |
| |||
Lines changed: 60 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
| 1040 | + | |
1041 | 1041 | | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1048 | 1055 | | |
1049 | 1056 | | |
1050 | 1057 | | |
| |||
1059 | 1066 | | |
1060 | 1067 | | |
1061 | 1068 | | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1065 | 1075 | | |
1066 | | - | |
1067 | | - | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1068 | 1104 | | |
1069 | 1105 | | |
| 1106 | + | |
1070 | 1107 | | |
1071 | 1108 | | |
1072 | 1109 | | |
| |||
1126 | 1163 | | |
1127 | 1164 | | |
1128 | 1165 | | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1135 | 1174 | | |
1136 | | - | |
| 1175 | + | |
1137 | 1176 | | |
1138 | | - | |
| 1177 | + | |
1139 | 1178 | | |
1140 | 1179 | | |
1141 | | - | |
| 1180 | + | |
1142 | 1181 | | |
1143 | 1182 | | |
1144 | 1183 | | |
| |||
0 commit comments