feat: add ApplicationSet listResourceEvents API (#25537)

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Co-authored-by: Alexy Mantha <alexy@mantha.dev>
This commit is contained in:
Peter Jiang
2025-12-19 01:04:26 -08:00
committed by GitHub
parent 6f21978637
commit 5859065650
7 changed files with 466 additions and 73 deletions

View File

@@ -17,6 +17,7 @@ import (
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io"
v1 "k8s.io/api/core/v1"
math "math"
math_bits "math/bits"
)
@@ -499,49 +500,52 @@ func init() {
}
var fileDescriptor_eacb9df0ce5738fa = []byte{
// 664 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0xcf, 0x6b, 0xd4, 0x40,
0x14, 0xc7, 0x99, 0xb6, 0x6c, 0xb7, 0xd3, 0xa2, 0x30, 0x60, 0xbb, 0x46, 0x5d, 0x97, 0x80, 0xb5,
0xb6, 0x76, 0x42, 0x5b, 0x4f, 0xf5, 0xe4, 0x0f, 0x28, 0x85, 0x22, 0x9a, 0x15, 0x05, 0x3d, 0xc8,
0x34, 0xfb, 0x48, 0x63, 0xb3, 0xc9, 0x38, 0x33, 0x09, 0x94, 0xe2, 0x45, 0xf0, 0xec, 0x41, 0xf4,
0x0f, 0xd0, 0x8b, 0x7f, 0x80, 0x77, 0x0f, 0x5e, 0x3c, 0x0a, 0xfe, 0x03, 0x52, 0xfc, 0x33, 0x3c,
0x48, 0x26, 0xd9, 0x6d, 0x33, 0xec, 0x8f, 0x82, 0xd1, 0x5b, 0x5e, 0x66, 0xf2, 0xde, 0x67, 0xbe,
0xef, 0xe5, 0xcb, 0xe0, 0x65, 0x09, 0x22, 0x05, 0xe1, 0x30, 0xce, 0xc3, 0xc0, 0x63, 0x2a, 0x88,
0x23, 0x09, 0xca, 0x08, 0x29, 0x17, 0xb1, 0x8a, 0xc9, 0x99, 0xf2, 0x5b, 0xeb, 0xa2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,
0x7b, 0xde, 0x1a, 0x7b, 0x45, 0x33, 0x5d, 0xb1, 0x5b, 0xc3, 0x98, 0x7a, 0x16, 0xbc, 0x89, 0x96,
0xc9, 0x07, 0x84, 0xa7, 0x32, 0x67, 0x24, 0x57, 0x47, 0x57, 0xe9, 0xbb, 0xa7, 0x75, 0xbf, 0x4a,
0x01, 0xb3, 0xb4, 0xf6, 0x65, 0x0d, 0x7c, 0x9e, 0x2c, 0x0c, 0x01, 0x26, 0x9f, 0x11, 0xae, 0xe5,
0xae, 0x44, 0x56, 0x46, 0x63, 0x96, 0xbc, 0xab, 0xe2, 0x5e, 0x3b, 0x1a, 0xf3, 0x9a, 0x3d, 0x0c,
0x73, 0xd3, 0x34, 0xb1, 0xd7, 0x08, 0xd7, 0x72, 0x1f, 0x1a, 0x87, 0x5d, 0x72, 0x2b, 0x6b, 0xcc,
0x28, 0xf7, 0x1b, 0x5d, 0x0c, 0xdf, 0xf2, 0xb8, 0xe1, 0xfb, 0x82, 0xf0, 0x9c, 0x0b, 0x32, 0x4e,
0x84, 0x07, 0x99, 0x75, 0x8d, 0xeb, 0x75, 0xdf, 0xde, 0xaa, 0xed, 0x75, 0x96, 0xd6, 0xbe, 0xa1,
0x99, 0x29, 0xb9, 0x3e, 0x9a, 0xd9, 0x11, 0x05, 0xef, 0xaa, 0x12, 0x00, 0xb7, 0xb7, 0xbf, 0x1d,
0x35, 0xd1, 0xf7, 0xa3, 0x26, 0xfa, 0x79, 0xd4, 0x44, 0x4f, 0x6e, 0x9e, 0xee, 0x02, 0xe2, 0x85,
0x01, 0x44, 0xe6, 0x8d, 0x67, 0xb7, 0xa6, 0xaf, 0x1d, 0x1b, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff,
0xc5, 0x6a, 0x1d, 0x1e, 0x20, 0x09, 0x00, 0x00,
// 720 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0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0xe5, 0x78, 0xcc, 0x9c, 0x77, 0x8d, 0x78, 0xd6, 0xae, 0xc1, 0xbc, 0xe4, 0x0c,
0xc2, 0x5c, 0xb7, 0x4d, 0xec, 0x25, 0xc2, 0x85, 0xd4, 0x87, 0x86, 0x61, 0xe7, 0xdc, 0xaa, 0x3c,
0x44, 0xca, 0xbd, 0x41, 0x67, 0xe2, 0x5b, 0x1e, 0x26, 0xbe, 0x2f, 0x08, 0x4f, 0x7b, 0x20, 0x59,
0x47, 0x04, 0xa0, 0xad, 0x6b, 0xd8, 0xac, 0x7b, 0xf6, 0x36, 0xda, 0x59, 0xeb, 0xb4, 0xce, 0x15,
0xc3, 0x4c, 0xc9, 0xe5, 0xe3, 0x99, 0x5d, 0x91, 0xf1, 0xd6, 0x94, 0x06, 0x7e, 0x8d, 0x30, 0xd1,
0x52, 0xe9, 0x9e, 0xe2, 0x76, 0x02, 0xb1, 0x92, 0x27, 0xfe, 0xe7, 0xe7, 0x68, 0x7a, 0xad, 0xd1,
0xa8, 0x54, 0x5f, 0x6b, 0x68, 0x52, 0xa7, 0x26, 0x87, 0xd1, 0x5f, 0xcd, 0x30, 0x2d, 0x92, 0xf9,
0x21, 0x4c, 0x60, 0xaa, 0xde, 0xd8, 0xfc, 0x76, 0x50, 0x41, 0xdf, 0x0f, 0x2a, 0xe8, 0xe7, 0x41,
0x05, 0x3d, 0xba, 0x76, 0xb2, 0xdb, 0x50, 0xd0, 0x8a, 0x20, 0xb6, 0xaf, 0x68, 0xdb, 0x05, 0x73,
0x07, 0x5a, 0xfb, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xae, 0xa7, 0x68, 0xe3, 0xd1, 0x09, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -568,6 +572,8 @@ type ApplicationSetServiceClient interface {
Delete(ctx context.Context, in *ApplicationSetDeleteRequest, opts ...grpc.CallOption) (*ApplicationSetResponse, error)
// ResourceTree returns resource tree
ResourceTree(ctx context.Context, in *ApplicationSetTreeQuery, opts ...grpc.CallOption) (*v1alpha1.ApplicationSetTree, error)
// ListResourceEvents returns a list of event resources
ListResourceEvents(ctx context.Context, in *ApplicationSetGetQuery, opts ...grpc.CallOption) (*v1.EventList, error)
}
type applicationSetServiceClient struct {
@@ -632,6 +638,15 @@ func (c *applicationSetServiceClient) ResourceTree(ctx context.Context, in *Appl
return out, nil
}
func (c *applicationSetServiceClient) ListResourceEvents(ctx context.Context, in *ApplicationSetGetQuery, opts ...grpc.CallOption) (*v1.EventList, error) {
out := new(v1.EventList)
err := c.cc.Invoke(ctx, "/applicationset.ApplicationSetService/ListResourceEvents", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ApplicationSetServiceServer is the server API for ApplicationSetService service.
type ApplicationSetServiceServer interface {
// Get returns an applicationset by name
@@ -646,6 +661,8 @@ type ApplicationSetServiceServer interface {
Delete(context.Context, *ApplicationSetDeleteRequest) (*ApplicationSetResponse, error)
// ResourceTree returns resource tree
ResourceTree(context.Context, *ApplicationSetTreeQuery) (*v1alpha1.ApplicationSetTree, error)
// ListResourceEvents returns a list of event resources
ListResourceEvents(context.Context, *ApplicationSetGetQuery) (*v1.EventList, error)
}
// UnimplementedApplicationSetServiceServer can be embedded to have forward compatible implementations.
@@ -670,6 +687,9 @@ func (*UnimplementedApplicationSetServiceServer) Delete(ctx context.Context, req
func (*UnimplementedApplicationSetServiceServer) ResourceTree(ctx context.Context, req *ApplicationSetTreeQuery) (*v1alpha1.ApplicationSetTree, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResourceTree not implemented")
}
func (*UnimplementedApplicationSetServiceServer) ListResourceEvents(ctx context.Context, req *ApplicationSetGetQuery) (*v1.EventList, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListResourceEvents not implemented")
}
func RegisterApplicationSetServiceServer(s *grpc.Server, srv ApplicationSetServiceServer) {
s.RegisterService(&_ApplicationSetService_serviceDesc, srv)
@@ -783,6 +803,24 @@ func _ApplicationSetService_ResourceTree_Handler(srv interface{}, ctx context.Co
return interceptor(ctx, in, info, handler)
}
func _ApplicationSetService_ListResourceEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ApplicationSetGetQuery)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApplicationSetServiceServer).ListResourceEvents(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/applicationset.ApplicationSetService/ListResourceEvents",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApplicationSetServiceServer).ListResourceEvents(ctx, req.(*ApplicationSetGetQuery))
}
return interceptor(ctx, in, info, handler)
}
var _ApplicationSetService_serviceDesc = grpc.ServiceDesc{
ServiceName: "applicationset.ApplicationSetService",
HandlerType: (*ApplicationSetServiceServer)(nil),
@@ -811,6 +849,10 @@ var _ApplicationSetService_serviceDesc = grpc.ServiceDesc{
MethodName: "ResourceTree",
Handler: _ApplicationSetService_ResourceTree_Handler,
},
{
MethodName: "ListResourceEvents",
Handler: _ApplicationSetService_ListResourceEvents_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "server/applicationset/applicationset.proto",

View File

@@ -371,6 +371,78 @@ func local_request_ApplicationSetService_ResourceTree_0(ctx context.Context, mar
}
var (
filter_ApplicationSetService_ListResourceEvents_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
func request_ApplicationSetService_ListResourceEvents_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ApplicationSetGetQuery
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
protoReq.Name, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_ListResourceEvents_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListResourceEvents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ApplicationSetService_ListResourceEvents_0(ctx context.Context, marshaler runtime.Marshaler, server ApplicationSetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ApplicationSetGetQuery
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
protoReq.Name, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ApplicationSetService_ListResourceEvents_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListResourceEvents(ctx, &protoReq)
return msg, metadata, err
}
// RegisterApplicationSetServiceHandlerServer registers the http handlers for service ApplicationSetService to "mux".
// UnaryRPC :call ApplicationSetServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -515,6 +587,29 @@ func RegisterApplicationSetServiceHandlerServer(ctx context.Context, mux *runtim
})
mux.Handle("GET", pattern_ApplicationSetService_ListResourceEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ApplicationSetService_ListResourceEvents_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ApplicationSetService_ListResourceEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@@ -676,6 +771,26 @@ func RegisterApplicationSetServiceHandlerClient(ctx context.Context, mux *runtim
})
mux.Handle("GET", pattern_ApplicationSetService_ListResourceEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ApplicationSetService_ListResourceEvents_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ApplicationSetService_ListResourceEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@@ -691,6 +806,8 @@ var (
pattern_ApplicationSetService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "applicationsets", "name"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_ApplicationSetService_ResourceTree_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "applicationsets", "name", "resource-tree"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_ApplicationSetService_ListResourceEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "applicationsets", "name", "events"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
@@ -705,4 +822,6 @@ var (
forward_ApplicationSetService_Delete_0 = runtime.ForwardResponseMessage
forward_ApplicationSetService_ResourceTree_0 = runtime.ForwardResponseMessage
forward_ApplicationSetService_ListResourceEvents_0 = runtime.ForwardResponseMessage
)