Add rpc interface for livestate in plugin architecture#5447
Merged
Conversation
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5447 +/- ##
==========================================
+ Coverage 26.09% 26.22% +0.13%
==========================================
Files 451 452 +1
Lines 48824 48872 +48
==========================================
+ Hits 12741 12819 +78
+ Misses 35065 35027 -38
- Partials 1018 1026 +8 ☔ View full report in Codecov by Sentry. |
ffjlabo
commented
Dec 24, 2024
Comment on lines
+90
to
+116
| message ResourceState { | ||
| enum HealthStatus { | ||
| UNKNOWN = 0; | ||
| HEALTHY = 1; | ||
| UNHEALTHY = 2; | ||
| } | ||
|
|
||
| // The unique ID. | ||
| string id = 1 [(validate.rules).string.min_len = 1]; | ||
| // The sorted list of unique IDs of the parents. | ||
| repeated string parent_ids = 2; | ||
| // The name of resource. | ||
| string name = 3 [(validate.rules).string.min_len = 1]; | ||
| // The type of this resource. | ||
| string resource_type = 4; | ||
| // The metadata of this resource. | ||
| map<string, string> resource_metadata = 5; | ||
| // The health status of this resource. | ||
| HealthStatus health_status = 6 [(validate.rules).enum.defined_only = true]; | ||
| // The description of the health status. | ||
| string health_description = 7; | ||
|
|
||
| // The timestamp when this resource was created. | ||
| int64 created_at = 10 [(validate.rules).int64.gt = 0]; | ||
| // The timestamp of the last time when this resource was updated. | ||
| int64 updated_at = 11 [(validate.rules).int64.gt = 0]; | ||
| } |
Member
Author
There was a problem hiding this comment.
The diff compared to the existing livestate resource state for k8s, ecs, lambda, cloud run.
Deleted
owner_ids: no longer used by any kinds of application.api_version,kind,namespace: these naming are k8s specific and we need to adopt the platform-neutral field for plugin architecture.
Added
resource_type: We decide to use it askindto show resource type.resource_metadata: We decided to add metadata as string map to add platform specific values freely (such asapi_version,namespace)
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Added rpc definition for livestate features in the plugin architecture.
The proto files are below.
pkg/plugin/api/v1alpha1/livestate/api.proto: define it as another file with deployment/api.proto to separate by features.pkg/model/application_live_state.proto: the actual application livestate.The rpc
GetLivestatereturns the actual state and the sync state at one time.I'll update the RFC later.
Why we need it:
We will support livestate feature in the plugin architecture.
Which issue(s) this PR fixes:
Part of #5363
Does this PR introduce a user-facing change?: