fix(edas): add retry and k8s API fallback for service selector resolu…#6782
fix(edas): add retry and k8s API fallback for service selector resolu…#6782luobily wants to merge 1 commit into
Conversation
|
No assignee specified! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 294b11962b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var cfg Config | ||
| configFile := filepath.Join(configDir, "config") | ||
| data, _ := os.ReadFile(configFile) | ||
| json.Unmarshal(data, &cfg) |
There was a problem hiding this comment.
The standard CLI config is not JSON: command.GetGlobalConfig decodes it with yaml.NewDecoder and SetGlobalConfig writes it with yaml.Marshal in tools/cli/command/erda.go. With a normal ~/.erda.d/config such as host: ..., this json.Unmarshal leaves cfg.Host empty without returning a checked error, so the following metadata request is built with an empty scheme/host and resp.Body is dereferenced after a failed client.Get. This makes the new batch-create helper fail for normal CLI users; decode the config as YAML or reuse the existing config loader.
Useful? React with 👍 / 👎.
|
|
||
| type SessionInfo struct { | ||
| Token string `json:"token"` | ||
| SessionID string `json:"sessionId"` |
There was a problem hiding this comment.
Match the stored session cookie field
Existing CLI sessions store the cookie under json:"sessionid" via status.StatusInfo in tools/cli/status/status.go, but this new struct looks for sessionId. In deployments or accounts that rely on the OPENAPISESSION cookie rather than a token, unmarshalling leaves SessionID empty and both the project lookup and application creation requests are sent unauthenticated even though the user has logged in. Reuse status.StatusInfo or change the tag to match the stored field.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6782 +/- ##
==========================================
- Coverage 15.82% 15.82% -0.01%
==========================================
Files 3998 3998
Lines 328174 328199 +25
==========================================
- Hits 51939 51938 -1
- Misses 270338 270366 +28
+ Partials 5897 5895 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
4d943c5 to
e2bc644
Compare
…tion When creating/updating EDAS services, the deployment query via EDAS API can intermittently fail or timeout, causing the service selector to fall back to labels that don't exist on pods. This adds: - EDAS API retry (3 attempts with 5s interval) - k8s API fallback (list+contains match) when EDAS API is exhausted - nil check for orderList to prevent panic
What this PR does / why we need it:
Which issue(s) this PR fixes:
Specified Reviewers:
/assign
ChangeLog
Need cherry-pick to release versions?