-
Notifications
You must be signed in to change notification settings - Fork 117
feat: add k8s settings update notification in deployment status #5396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ngs drift detection
|
@ivyjeong13 I am not sure if it is better to add an "Update k8s setting" item to the dots menu; however, I lean toward that. What do you think? |
thedadams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would also need to run go generate to fix the Go listing.
pkg/api/handlers/mcp.go
Outdated
| if err := req.Storage.Status().Update(req.Context(), &server); err != nil { | ||
| return fmt.Errorf("failed to update server status: %w", err) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically, we wouldn't want to do this in the API. Instead, let the controller update the field.
I think it's fine if you want to ensure the value is true when returning from the API, but better to let the controller update the database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be deleted.
The way our controller framework works, the two controllers you wrote (one for servers and one for catalog entries) will do the correct thing when the k8s settings change.
| } | ||
|
|
||
| // DetectK8sSettingsDrift detects when servers created from this catalog entry need redeployment with new K8s settings | ||
| func DetectK8sSettingsDrift(req router.Request, _ router.Response) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be deleted.
The way our controller framework works, the controller you added for MCP servers will do the right thing.
pkg/mcp/details.go
Outdated
| func isServerNotRunningError(err error) bool { | ||
| if err == nil { | ||
| return false | ||
| } | ||
| return strings.Contains(err.Error(), "is not running") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to create a type for this and use errors.As or errors.Is then match on the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if the change I made is what you mean
| // NeedsUpdate indicates whether this composite catalog entry's component snapshots have drifted from their sources. | ||
| NeedsUpdate bool `json:"needsUpdate,omitempty"` | ||
| // NeedsK8sUpdate indicates whether servers created from this catalog entry need redeployment with new K8s settings | ||
| NeedsK8sUpdate bool `json:"needsK8sUpdate,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on what I saw in the implementation, this can be removed. It seems like it was used to track when all servers deployed from this entry should be upgraded, but that is already handled by the MCP server controllers.
apiclient/types/mcpserver.go
Outdated
| PowerUserWorkspaceID string `json:"powerUserWorkspaceID,omitempty"` | ||
| PowerUserID string `json:"powerUserID,omitempty"` | ||
| NeedsUpdate bool `json:"needsUpdate,omitempty"` | ||
| NeedsK8sUpdate bool `json:"needsK8sUpdate,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this can also be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I delete this I do get the following error in mcp.go line 159
unknown field NeedsK8sUpdate in struct literal of type "github.com/obot-platform/obot/apiclient/types".MCPServerCatalogEntry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to track this for catalog entries. There are no deployments for catalog entries, so this field and all of its references should be removed.
|
can I get a quick loom of this working end to end, including updating the k8s settings for the server and seeing it successfully redeploy |
|
Yep, working on that |
|
@ryu-man - looking good. a couple things:
Then end goal here is if i have a ton of seves and change the default k8s resources, i can easily update them all. |
|
@cjellick Working on that |
@cjellick loom for request changes. |
|
@cjellick Currently, if a user selects only "Kubernetes Upgrade Available," those servers with both server and Kubernetes will not be included, because currently the table filters allow matches only against a single value. if this PR can wait a little bit longer, I can work on a solution; otherwise, this can tracked in a separate PR if necessary |
|
@ryu-man this pr can wait for you to find a solution. Regarding your loom, here's some feedback:
Let me see a loom for that bc I'm not 100% sure itll look good. Also, since we now have explicit text for the status, i think we can just drop the upgrade icons...they were there so that that column could do "double duty" of health status and upgrade status. so now I think we need two separate columns:
|
- allow multi-values filteration - remove updates icons - use colors on rows to indicate updates
|
@cjellick loom for the above requested changes + new status filteration approach |
Addresses #4997
/admin/mcp-servers/c/[x]/instance/[y]/details route