Skip to content
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

Merged

Conversation

ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Dec 24, 2024

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?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Yoshiki Fujikane <[email protected]>
Copy link

codecov bot commented Dec 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.22%. Comparing base (511ee8f) to head (f478a1a).
Report is 11 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

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];
}
Copy link
Member Author

@ffjlabo ffjlabo Dec 24, 2024

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 as kind to show resource type.
  • resource_metadata: We decided to add metadata as string map to add platform specific values freely (such as api_version, namespace)

Signed-off-by: Yoshiki Fujikane <[email protected]>
@ffjlabo ffjlabo marked this pull request as ready for review December 24, 2024 10:13
Signed-off-by: Yoshiki Fujikane <[email protected]>
Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT

Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@ffjlabo ffjlabo merged commit 39b06ed into master Dec 25, 2024
25 checks passed
@ffjlabo ffjlabo deleted the add-rpc-interface-for-livestate-in-plugin-architecture branch December 25, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants