-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add rpc interface for livestate in plugin architecture #5447
Add rpc interface for livestate in plugin architecture #5447
Conversation
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
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. |
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]; | ||
} |
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.
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 askind
to 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 <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
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.
GREAT
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.
👍🏻
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
GetLivestate
returns 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?: