From efd445f43e12a32912e9ebbff13544ac43b8e053 Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Thu, 26 Sep 2024 14:37:26 +0530 Subject: [PATCH 1/7] :sparkles: Added checks for owned cluster added checks for owned cluster, while creating and listing --- .../adapters/infra-service/infra-service.go | 15 ++ apps/console/internal/domain/environment.go | 26 ++ .../internal/domain/ports/infra-service.go | 10 + apps/infra/internal/app/grpc-server.go | 1 + apps/infra/internal/domain/clusters.go | 5 + apps/infra/protobufs/infra.proto | 1 + apps/infra/protobufs/infra/infra.pb.go | 241 ++++++++++-------- constants/constants.go | 5 + 8 files changed, 192 insertions(+), 112 deletions(-) diff --git a/apps/console/internal/app/adapters/infra-service/infra-service.go b/apps/console/internal/app/adapters/infra-service/infra-service.go index b11212b81..068ab703c 100644 --- a/apps/console/internal/app/adapters/infra-service/infra-service.go +++ b/apps/console/internal/app/adapters/infra-service/infra-service.go @@ -30,6 +30,21 @@ func (s *InfraService) EnsureGlobalVPNConnection(ctx context.Context, args ports return nil } +func (s *InfraService) GetClusterLabels(ctx context.Context, args ports.IsClusterLabelsIn) (map[string]string, error) { + cl, err := s.infraClient.GetCluster(ctx, &infra.GetClusterIn{ + UserId: args.UserId, + UserName: args.UserName, + UserEmail: args.UserEmail, + AccountName: args.AccountName, + ClusterName: args.ClusterName, + }) + if err != nil { + return nil, err + } + + return cl.Labels, nil +} + var _ ports.InfraService = (*InfraService)(nil) func NewInfraService(infraClient infra.InfraClient) ports.InfraService { diff --git a/apps/console/internal/domain/environment.go b/apps/console/internal/domain/environment.go index 8a3cb6679..e1a0c5848 100644 --- a/apps/console/internal/domain/environment.go +++ b/apps/console/internal/domain/environment.go @@ -18,6 +18,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/kloudlite/api/apps/console/internal/domain/ports" "github.com/kloudlite/api/apps/console/internal/entities" fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" "github.com/kloudlite/api/pkg/repos" @@ -134,10 +135,34 @@ func (d *domain) findEnvironmentByTargetNs(ctx ConsoleContext, targetNs string) } func (d *domain) CreateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CreateEnvironment); err != nil { + return nil, errors.NewE(err) + } + if strings.TrimSpace(env.ClusterName) == "" { return nil, fmt.Errorf("clustername must be set while creating environments") } + labels, err := d.infraSvc.GetClusterLabels(ctx, ports.IsClusterLabelsIn{ + UserId: string(ctx.UserId), + UserEmail: ctx.UserEmail, + UserName: ctx.UserName, + AccountName: ctx.AccountName, + ClusterName: env.ClusterName, + }) + if err != nil { + return nil, errors.NewE(err) + } + + if lUID, ok := labels[constants.ClusterLabelLocalUuidKey]; ok && lUID != "" { + if s, ok := labels[constants.ClusterLabelUserIdKey]; ok && s != string(ctx.UserId) { + return nil, fmt.Errorf("it's owned cluster, but you are not the owner") + } + + env.Labels[constants.ClusterLabelLocalUuidKey] = lUID + env.Labels[constants.ClusterLabelUserIdKey] = string(ctx.UserId) + } + env.EnsureGVK() if err := d.k8sClient.ValidateObject(ctx, &env.Environment); err != nil { return nil, errors.NewE(err) @@ -160,6 +185,7 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, env entities.Environment) UserName: ctx.UserName, UserEmail: ctx.UserEmail, } + env.LastUpdatedBy = env.CreatedBy env.AccountName = ctx.AccountName diff --git a/apps/console/internal/domain/ports/infra-service.go b/apps/console/internal/domain/ports/infra-service.go index c3ea80100..d3063b57f 100644 --- a/apps/console/internal/domain/ports/infra-service.go +++ b/apps/console/internal/domain/ports/infra-service.go @@ -4,6 +4,16 @@ import "context" type InfraService interface { EnsureGlobalVPNConnection(ctx context.Context, args EnsureGlobalVPNConnectionIn) error + GetClusterLabels(ctx context.Context, args IsClusterLabelsIn) (map[string]string, error) +} + +type IsClusterLabelsIn struct { + UserId string + UserEmail string + UserName string + + AccountName string + ClusterName string } type EnsureGlobalVPNConnectionIn struct { diff --git a/apps/infra/internal/app/grpc-server.go b/apps/infra/internal/app/grpc-server.go index 73395dc88..037aaaf2e 100644 --- a/apps/infra/internal/app/grpc-server.go +++ b/apps/infra/internal/app/grpc-server.go @@ -103,6 +103,7 @@ func (g *grpcServer) GetCluster(ctx context.Context, in *infra.GetClusterIn) (*i } return "" }(), + Labels: c.Labels, }, nil } diff --git a/apps/infra/internal/domain/clusters.go b/apps/infra/internal/domain/clusters.go index 898f55b40..1e912fda1 100644 --- a/apps/infra/internal/domain/clusters.go +++ b/apps/infra/internal/domain/clusters.go @@ -14,6 +14,7 @@ import ( fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" "github.com/kloudlite/api/common" "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/constants" "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" ct "github.com/kloudlite/operator/apis/common-types" "github.com/kloudlite/operator/operators/resource-watcher/types" @@ -894,6 +895,10 @@ func (d *domain) ListClusters(ctx InfraContext, mf map[string]repos.MatchFilter, f := repos.Filter{ fields.AccountName: ctx.AccountName, fields.MetadataNamespace: accNs, + "$or": []map[string]any{ + {fmt.Sprintf("%s.%s", fc.MetadataLabels, constants.ClusterLabelUserIdKey): ctx.UserId}, + {fmt.Sprintf("%s.%s", fc.MetadataLabels, constants.ClusterLabelLocalUuidKey): nil}, + }, } pr, err := d.clusterRepo.FindPaginated(ctx, d.clusterRepo.MergeMatchFilters(f, mf), pagination) diff --git a/apps/infra/protobufs/infra.proto b/apps/infra/protobufs/infra.proto index 068d71d7d..c32c56f8e 100644 --- a/apps/infra/protobufs/infra.proto +++ b/apps/infra/protobufs/infra.proto @@ -29,6 +29,7 @@ message GetClusterOut { string IACJobName = 3; string IACJobNamespace = 4; + map labels = 5; } message GetNodepoolIn { diff --git a/apps/infra/protobufs/infra/infra.pb.go b/apps/infra/protobufs/infra/infra.pb.go index 81dfa38bb..540466eed 100644 --- a/apps/infra/protobufs/infra/infra.pb.go +++ b/apps/infra/protobufs/infra/infra.pb.go @@ -105,10 +105,11 @@ type GetClusterOut struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MessageQueueTopic string `protobuf:"bytes,1,opt,name=messageQueueTopic,proto3" json:"messageQueueTopic,omitempty"` - DnsHost string `protobuf:"bytes,2,opt,name=dnsHost,proto3" json:"dnsHost,omitempty"` - IACJobName string `protobuf:"bytes,3,opt,name=IACJobName,proto3" json:"IACJobName,omitempty"` - IACJobNamespace string `protobuf:"bytes,4,opt,name=IACJobNamespace,proto3" json:"IACJobNamespace,omitempty"` + MessageQueueTopic string `protobuf:"bytes,1,opt,name=messageQueueTopic,proto3" json:"messageQueueTopic,omitempty"` + DnsHost string `protobuf:"bytes,2,opt,name=dnsHost,proto3" json:"dnsHost,omitempty"` + IACJobName string `protobuf:"bytes,3,opt,name=IACJobName,proto3" json:"IACJobName,omitempty"` + IACJobNamespace string `protobuf:"bytes,4,opt,name=IACJobNamespace,proto3" json:"IACJobNamespace,omitempty"` + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *GetClusterOut) Reset() { @@ -171,6 +172,13 @@ func (x *GetClusterOut) GetIACJobNamespace() string { return "" } +func (x *GetClusterOut) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + type GetNodepoolIn struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -744,7 +752,7 @@ var file_infra_proto_rawDesc = []byte{ 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x90, 0x02, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, @@ -754,56 +762,34 @@ var file_infra_proto_rawDesc = []byte{ 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xc9, 0x01, 0x0a, 0x0d, 0x47, 0x65, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, - 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, - 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, - 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, - 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, - 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, - 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, - 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x10, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x39, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, - 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x22, 0x95, 0x01, 0x0a, 0x15, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x49, 0x6e, 0x12, 0x20, 0x0a, 0x0b, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc9, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, + 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x61, - 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, - 0x74, 0x4f, 0x75, 0x74, 0x22, 0xcf, 0x02, 0x0a, 0x1b, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, + 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, + 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, 0x4a, + 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x22, 0xa7, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, + 0x74, 0x73, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, @@ -812,44 +798,73 @@ var file_infra_proto_rawDesc = []byte{ 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x39, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, - 0x5f, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x17, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x18, 0x64, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x5f, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x64, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, - 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x32, 0xfd, 0x02, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, - 0x12, 0x2b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, - 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, - 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2e, 0x0a, - 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x2e, 0x47, - 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x1a, 0x0f, 0x2e, 0x47, - 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, - 0x0d, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x10, - 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x49, 0x6e, - 0x1a, 0x11, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, - 0x4f, 0x75, 0x74, 0x12, 0x3f, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0d, 0x2e, 0x47, 0x65, - 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x4f, 0x75, 0x74, 0x12, 0x46, 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x16, 0x2e, 0x4d, 0x61, - 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, - 0x74, 0x49, 0x6e, 0x1a, 0x17, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x58, 0x0a, 0x19, - 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x45, 0x6e, 0x73, 0x75, - 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x1a, 0x1d, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, - 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x69, 0x6e, 0x66, 0x72, - 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x10, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x39, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x75, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x22, 0x95, 0x01, 0x0a, 0x15, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x49, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x61, 0x72, + 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, + 0x4f, 0x75, 0x74, 0x22, 0xcf, 0x02, 0x0a, 0x1b, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x39, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x5f, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x17, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x18, 0x64, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x5f, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x64, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x32, 0xfd, 0x02, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x12, + 0x2b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x2e, + 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, 0x47, + 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2e, 0x0a, 0x0b, + 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x2e, 0x47, 0x65, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x1a, 0x0f, 0x2e, 0x47, 0x65, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x10, 0x2e, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x49, 0x6e, 0x1a, + 0x11, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, + 0x75, 0x74, 0x12, 0x3f, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x4f, 0x75, 0x74, 0x12, 0x46, 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x16, 0x2e, 0x4d, 0x61, 0x72, + 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, + 0x49, 0x6e, 0x1a, 0x17, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x58, 0x0a, 0x19, 0x45, + 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, + 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x1a, 0x1d, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -864,7 +879,7 @@ func file_infra_proto_rawDescGZIP() []byte { return file_infra_proto_rawDescData } -var file_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_infra_proto_goTypes = []interface{}{ (*GetClusterIn)(nil), // 0: GetClusterIn (*GetClusterOut)(nil), // 1: GetClusterOut @@ -877,27 +892,29 @@ var file_infra_proto_goTypes = []interface{}{ (*MarkClusterOnlineAtOut)(nil), // 8: MarkClusterOnlineAtOut (*EnsureGlobalVPNConnectionIn)(nil), // 9: EnsureGlobalVPNConnectionIn (*EnsureGlobalVPNConnectionOut)(nil), // 10: EnsureGlobalVPNConnectionOut - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + nil, // 11: GetClusterOut.LabelsEntry + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp } var file_infra_proto_depIdxs = []int32{ - 11, // 0: MarkClusterOnlineAtIn.timestamp:type_name -> google.protobuf.Timestamp - 0, // 1: Infra.GetCluster:input_type -> GetClusterIn - 2, // 2: Infra.GetNodepool:input_type -> GetNodepoolIn - 4, // 3: Infra.ClusterExists:input_type -> ClusterExistsIn - 0, // 4: Infra.GetClusterKubeconfig:input_type -> GetClusterIn - 7, // 5: Infra.MarkClusterOnlineAt:input_type -> MarkClusterOnlineAtIn - 9, // 6: Infra.EnsureGlobalVPNConnection:input_type -> EnsureGlobalVPNConnectionIn - 1, // 7: Infra.GetCluster:output_type -> GetClusterOut - 3, // 8: Infra.GetNodepool:output_type -> GetNodepoolOut - 5, // 9: Infra.ClusterExists:output_type -> ClusterExistsOut - 6, // 10: Infra.GetClusterKubeconfig:output_type -> GetClusterKubeconfigOut - 8, // 11: Infra.MarkClusterOnlineAt:output_type -> MarkClusterOnlineAtOut - 10, // 12: Infra.EnsureGlobalVPNConnection:output_type -> EnsureGlobalVPNConnectionOut - 7, // [7:13] is the sub-list for method output_type - 1, // [1:7] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 11, // 0: GetClusterOut.labels:type_name -> GetClusterOut.LabelsEntry + 12, // 1: MarkClusterOnlineAtIn.timestamp:type_name -> google.protobuf.Timestamp + 0, // 2: Infra.GetCluster:input_type -> GetClusterIn + 2, // 3: Infra.GetNodepool:input_type -> GetNodepoolIn + 4, // 4: Infra.ClusterExists:input_type -> ClusterExistsIn + 0, // 5: Infra.GetClusterKubeconfig:input_type -> GetClusterIn + 7, // 6: Infra.MarkClusterOnlineAt:input_type -> MarkClusterOnlineAtIn + 9, // 7: Infra.EnsureGlobalVPNConnection:input_type -> EnsureGlobalVPNConnectionIn + 1, // 8: Infra.GetCluster:output_type -> GetClusterOut + 3, // 9: Infra.GetNodepool:output_type -> GetNodepoolOut + 5, // 10: Infra.ClusterExists:output_type -> ClusterExistsOut + 6, // 11: Infra.GetClusterKubeconfig:output_type -> GetClusterKubeconfigOut + 8, // 12: Infra.MarkClusterOnlineAt:output_type -> MarkClusterOnlineAtOut + 10, // 13: Infra.EnsureGlobalVPNConnection:output_type -> EnsureGlobalVPNConnectionOut + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_infra_proto_init() } @@ -1045,7 +1062,7 @@ func file_infra_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_infra_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/constants/constants.go b/constants/constants.go index 555c2425b..aed6dab00 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -2,6 +2,11 @@ package constants import "fmt" +const ( + ClusterLabelUserIdKey string = "kloudlite.io/userid" + ClusterLabelLocalUuidKey string = "kloudlite.io/local-uuid" +) + type ResourceType string const ( From df2affe6b842c867ae5dbb6da27894e7e55507e8 Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Thu, 26 Sep 2024 17:55:53 +0530 Subject: [PATCH 2/7] :construction: Added owner checks to model --- apps/infra/internal/domain/clusters.go | 5 ++--- apps/infra/internal/entities/cluster.go | 8 ++++++++ .../entities/field-constants/generated_constants.go | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/infra/internal/domain/clusters.go b/apps/infra/internal/domain/clusters.go index 1e912fda1..372e01a1c 100644 --- a/apps/infra/internal/domain/clusters.go +++ b/apps/infra/internal/domain/clusters.go @@ -14,7 +14,6 @@ import ( fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" "github.com/kloudlite/api/common" "github.com/kloudlite/api/common/fields" - "github.com/kloudlite/api/constants" "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" ct "github.com/kloudlite/operator/apis/common-types" "github.com/kloudlite/operator/operators/resource-watcher/types" @@ -896,8 +895,8 @@ func (d *domain) ListClusters(ctx InfraContext, mf map[string]repos.MatchFilter, fields.AccountName: ctx.AccountName, fields.MetadataNamespace: accNs, "$or": []map[string]any{ - {fmt.Sprintf("%s.%s", fc.MetadataLabels, constants.ClusterLabelUserIdKey): ctx.UserId}, - {fmt.Sprintf("%s.%s", fc.MetadataLabels, constants.ClusterLabelLocalUuidKey): nil}, + {fc.ClusterOwnedBy: ctx.UserId}, + {fc.ClusterOwnedBy: nil}, }, } diff --git a/apps/infra/internal/entities/cluster.go b/apps/infra/internal/entities/cluster.go index 2722f51de..ff6c0a323 100644 --- a/apps/infra/internal/entities/cluster.go +++ b/apps/infra/internal/entities/cluster.go @@ -25,6 +25,8 @@ type Cluster struct { SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` LastOnlineAt *time.Time `json:"lastOnlineAt,omitempty" graphql:"noinput"` + + OwnedBy *string `json:"ownedBy,omitempty"` } func (c *Cluster) GetDisplayName() string { @@ -57,4 +59,10 @@ var ClusterIndices = []repos.IndexField{ }, Unique: true, }, + { + Field: []repos.IndexKey{ + {Key: fc.ClusterOwnedBy, Value: repos.IndexAsc}, + }, + Unique: false, + }, } diff --git a/apps/infra/internal/entities/field-constants/generated_constants.go b/apps/infra/internal/entities/field-constants/generated_constants.go index bb2281349..84829baf6 100644 --- a/apps/infra/internal/entities/field-constants/generated_constants.go +++ b/apps/infra/internal/entities/field-constants/generated_constants.go @@ -88,6 +88,7 @@ const ( const ( ClusterGlobalVPN = "globalVPN" ClusterLastOnlineAt = "lastOnlineAt" + ClusterOwnedBy = "ownedBy" ClusterSpec = "spec" ClusterSpecAccountId = "spec.accountId" ClusterSpecAccountName = "spec.accountName" From 034825a0a3aed15a100a1c8b80c2b0f5a943286f Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Thu, 26 Sep 2024 18:03:44 +0530 Subject: [PATCH 3/7] :construction: Changed label key for owned by --- .../adapters/infra-service/infra-service.go | 6 +- apps/console/internal/domain/environment.go | 12 +- .../internal/domain/ports/infra-service.go | 2 +- apps/infra/internal/app/grpc-server.go | 7 +- apps/infra/protobufs/infra.proto | 2 +- apps/infra/protobufs/infra/infra.pb.go | 265 +++++++++--------- apps/infra/protobufs/infra/infra_grpc.pb.go | 37 +-- constants/constants.go | 2 +- 8 files changed, 159 insertions(+), 174 deletions(-) diff --git a/apps/console/internal/app/adapters/infra-service/infra-service.go b/apps/console/internal/app/adapters/infra-service/infra-service.go index 068ab703c..419460f8f 100644 --- a/apps/console/internal/app/adapters/infra-service/infra-service.go +++ b/apps/console/internal/app/adapters/infra-service/infra-service.go @@ -30,7 +30,7 @@ func (s *InfraService) EnsureGlobalVPNConnection(ctx context.Context, args ports return nil } -func (s *InfraService) GetClusterLabels(ctx context.Context, args ports.IsClusterLabelsIn) (map[string]string, error) { +func (s *InfraService) GetClusterOwnedBy(ctx context.Context, args ports.IsClusterLabelsIn) (string, error) { cl, err := s.infraClient.GetCluster(ctx, &infra.GetClusterIn{ UserId: args.UserId, UserName: args.UserName, @@ -39,10 +39,10 @@ func (s *InfraService) GetClusterLabels(ctx context.Context, args ports.IsCluste ClusterName: args.ClusterName, }) if err != nil { - return nil, err + return "", err } - return cl.Labels, nil + return cl.OwnedBy, nil } var _ ports.InfraService = (*InfraService)(nil) diff --git a/apps/console/internal/domain/environment.go b/apps/console/internal/domain/environment.go index e1a0c5848..3226aecde 100644 --- a/apps/console/internal/domain/environment.go +++ b/apps/console/internal/domain/environment.go @@ -143,7 +143,7 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, env entities.Environment) return nil, fmt.Errorf("clustername must be set while creating environments") } - labels, err := d.infraSvc.GetClusterLabels(ctx, ports.IsClusterLabelsIn{ + ownedBy, err := d.infraSvc.GetClusterOwnedBy(ctx, ports.IsClusterLabelsIn{ UserId: string(ctx.UserId), UserEmail: ctx.UserEmail, UserName: ctx.UserName, @@ -154,14 +154,10 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, env entities.Environment) return nil, errors.NewE(err) } - if lUID, ok := labels[constants.ClusterLabelLocalUuidKey]; ok && lUID != "" { - if s, ok := labels[constants.ClusterLabelUserIdKey]; ok && s != string(ctx.UserId) { - return nil, fmt.Errorf("it's owned cluster, but you are not the owner") - } - - env.Labels[constants.ClusterLabelLocalUuidKey] = lUID - env.Labels[constants.ClusterLabelUserIdKey] = string(ctx.UserId) + if ownedBy != "" && ownedBy != string(ctx.UserId) { + return nil, fmt.Errorf("it's owned cluster, but you are not the owner") } + env.Labels[constants.ClusterLabelOwnedBy] = string(ctx.UserId) env.EnsureGVK() if err := d.k8sClient.ValidateObject(ctx, &env.Environment); err != nil { diff --git a/apps/console/internal/domain/ports/infra-service.go b/apps/console/internal/domain/ports/infra-service.go index d3063b57f..6f39759ff 100644 --- a/apps/console/internal/domain/ports/infra-service.go +++ b/apps/console/internal/domain/ports/infra-service.go @@ -4,7 +4,7 @@ import "context" type InfraService interface { EnsureGlobalVPNConnection(ctx context.Context, args EnsureGlobalVPNConnectionIn) error - GetClusterLabels(ctx context.Context, args IsClusterLabelsIn) (map[string]string, error) + GetClusterOwnedBy(ctx context.Context, args IsClusterLabelsIn) (string, error) } type IsClusterLabelsIn struct { diff --git a/apps/infra/internal/app/grpc-server.go b/apps/infra/internal/app/grpc-server.go index 037aaaf2e..6c5fd412f 100644 --- a/apps/infra/internal/app/grpc-server.go +++ b/apps/infra/internal/app/grpc-server.go @@ -103,7 +103,12 @@ func (g *grpcServer) GetCluster(ctx context.Context, in *infra.GetClusterIn) (*i } return "" }(), - Labels: c.Labels, + OwnedBy: func() string { + if c.OwnedBy != nil { + return *c.OwnedBy + } + return "" + }(), }, nil } diff --git a/apps/infra/protobufs/infra.proto b/apps/infra/protobufs/infra.proto index c32c56f8e..efe128fc9 100644 --- a/apps/infra/protobufs/infra.proto +++ b/apps/infra/protobufs/infra.proto @@ -29,7 +29,7 @@ message GetClusterOut { string IACJobName = 3; string IACJobNamespace = 4; - map labels = 5; + string OwnedBy = 5; } message GetNodepoolIn { diff --git a/apps/infra/protobufs/infra/infra.pb.go b/apps/infra/protobufs/infra/infra.pb.go index 540466eed..2ce67f1b3 100644 --- a/apps/infra/protobufs/infra/infra.pb.go +++ b/apps/infra/protobufs/infra/infra.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v4.24.4 +// protoc-gen-go v1.30.0 +// protoc v5.28.1 // source: infra.proto package infra @@ -105,11 +105,11 @@ type GetClusterOut struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MessageQueueTopic string `protobuf:"bytes,1,opt,name=messageQueueTopic,proto3" json:"messageQueueTopic,omitempty"` - DnsHost string `protobuf:"bytes,2,opt,name=dnsHost,proto3" json:"dnsHost,omitempty"` - IACJobName string `protobuf:"bytes,3,opt,name=IACJobName,proto3" json:"IACJobName,omitempty"` - IACJobNamespace string `protobuf:"bytes,4,opt,name=IACJobNamespace,proto3" json:"IACJobNamespace,omitempty"` - Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + MessageQueueTopic string `protobuf:"bytes,1,opt,name=messageQueueTopic,proto3" json:"messageQueueTopic,omitempty"` + DnsHost string `protobuf:"bytes,2,opt,name=dnsHost,proto3" json:"dnsHost,omitempty"` + IACJobName string `protobuf:"bytes,3,opt,name=IACJobName,proto3" json:"IACJobName,omitempty"` + IACJobNamespace string `protobuf:"bytes,4,opt,name=IACJobNamespace,proto3" json:"IACJobNamespace,omitempty"` + OwnedBy string `protobuf:"bytes,5,opt,name=OwnedBy,proto3" json:"OwnedBy,omitempty"` } func (x *GetClusterOut) Reset() { @@ -172,11 +172,11 @@ func (x *GetClusterOut) GetIACJobNamespace() string { return "" } -func (x *GetClusterOut) GetLabels() map[string]string { +func (x *GetClusterOut) GetOwnedBy() string { if x != nil { - return x.Labels + return x.OwnedBy } - return nil + return "" } type GetNodepoolIn struct { @@ -752,7 +752,7 @@ var file_infra_proto_rawDesc = []byte{ 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x90, 0x02, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, @@ -762,109 +762,104 @@ var file_infra_proto_rawDesc = []byte{ 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x47, 0x65, 0x74, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, - 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc9, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, - 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, 0x4a, - 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x22, 0xa7, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, - 0x74, 0x73, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, - 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, - 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x77, 0x6e, + 0x65, 0x64, 0x42, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x77, 0x6e, 0x65, + 0x64, 0x42, 0x79, 0x22, 0xc9, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, + 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, + 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, + 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6e, + 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, + 0x5a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x41, 0x43, 0x4a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x49, 0x41, 0x43, 0x4a, + 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x0f, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x49, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, + 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x10, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x22, 0x39, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, + 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, + 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x95, 0x01, 0x0a, + 0x15, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x41, 0x74, 0x49, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x10, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x39, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x75, - 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x22, 0x95, 0x01, 0x0a, 0x15, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x49, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x61, 0x72, - 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, - 0x4f, 0x75, 0x74, 0x22, 0xcf, 0x02, 0x0a, 0x1b, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, - 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, - 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x6c, 0x6f, - 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x39, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x5f, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x17, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x18, 0x64, 0x69, - 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x5f, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x64, 0x69, - 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x32, 0xfd, 0x02, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x12, - 0x2b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x2e, - 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2e, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x2e, 0x47, 0x65, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x1a, 0x0f, 0x2e, 0x47, 0x65, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x10, 0x2e, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x49, 0x6e, 0x1a, - 0x11, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, - 0x75, 0x74, 0x12, 0x3f, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x4f, 0x75, 0x74, 0x12, 0x46, 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x16, 0x2e, 0x4d, 0x61, 0x72, - 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, - 0x49, 0x6e, 0x1a, 0x17, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x58, 0x0a, 0x19, 0x45, - 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, - 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x1a, 0x1d, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x4f, 0x75, 0x74, 0x22, 0xcf, + 0x02, 0x0a, 0x1b, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, + 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, + 0x4e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x18, 0x64, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x5f, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x64, 0x69, + 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x64, 0x64, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, + 0x68, 0x41, 0x64, 0x64, 0x72, 0x5f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, + 0x68, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0x1e, 0x0a, 0x1c, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, + 0x32, 0xfd, 0x02, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x10, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x49, 0x6e, 0x1a, 0x11, 0x2e, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x3f, 0x0a, + 0x14, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x75, 0x74, 0x12, 0x46, + 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, + 0x69, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x16, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x49, 0x6e, 0x1a, 0x17, 0x2e, + 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, + 0x65, 0x41, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x58, 0x0a, 0x19, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x6e, 0x1a, 0x1d, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, + 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -879,7 +874,7 @@ func file_infra_proto_rawDescGZIP() []byte { return file_infra_proto_rawDescData } -var file_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_infra_proto_goTypes = []interface{}{ (*GetClusterIn)(nil), // 0: GetClusterIn (*GetClusterOut)(nil), // 1: GetClusterOut @@ -892,29 +887,27 @@ var file_infra_proto_goTypes = []interface{}{ (*MarkClusterOnlineAtOut)(nil), // 8: MarkClusterOnlineAtOut (*EnsureGlobalVPNConnectionIn)(nil), // 9: EnsureGlobalVPNConnectionIn (*EnsureGlobalVPNConnectionOut)(nil), // 10: EnsureGlobalVPNConnectionOut - nil, // 11: GetClusterOut.LabelsEntry - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp } var file_infra_proto_depIdxs = []int32{ - 11, // 0: GetClusterOut.labels:type_name -> GetClusterOut.LabelsEntry - 12, // 1: MarkClusterOnlineAtIn.timestamp:type_name -> google.protobuf.Timestamp - 0, // 2: Infra.GetCluster:input_type -> GetClusterIn - 2, // 3: Infra.GetNodepool:input_type -> GetNodepoolIn - 4, // 4: Infra.ClusterExists:input_type -> ClusterExistsIn - 0, // 5: Infra.GetClusterKubeconfig:input_type -> GetClusterIn - 7, // 6: Infra.MarkClusterOnlineAt:input_type -> MarkClusterOnlineAtIn - 9, // 7: Infra.EnsureGlobalVPNConnection:input_type -> EnsureGlobalVPNConnectionIn - 1, // 8: Infra.GetCluster:output_type -> GetClusterOut - 3, // 9: Infra.GetNodepool:output_type -> GetNodepoolOut - 5, // 10: Infra.ClusterExists:output_type -> ClusterExistsOut - 6, // 11: Infra.GetClusterKubeconfig:output_type -> GetClusterKubeconfigOut - 8, // 12: Infra.MarkClusterOnlineAt:output_type -> MarkClusterOnlineAtOut - 10, // 13: Infra.EnsureGlobalVPNConnection:output_type -> EnsureGlobalVPNConnectionOut - 8, // [8:14] is the sub-list for method output_type - 2, // [2:8] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 11, // 0: MarkClusterOnlineAtIn.timestamp:type_name -> google.protobuf.Timestamp + 0, // 1: Infra.GetCluster:input_type -> GetClusterIn + 2, // 2: Infra.GetNodepool:input_type -> GetNodepoolIn + 4, // 3: Infra.ClusterExists:input_type -> ClusterExistsIn + 0, // 4: Infra.GetClusterKubeconfig:input_type -> GetClusterIn + 7, // 5: Infra.MarkClusterOnlineAt:input_type -> MarkClusterOnlineAtIn + 9, // 6: Infra.EnsureGlobalVPNConnection:input_type -> EnsureGlobalVPNConnectionIn + 1, // 7: Infra.GetCluster:output_type -> GetClusterOut + 3, // 8: Infra.GetNodepool:output_type -> GetNodepoolOut + 5, // 9: Infra.ClusterExists:output_type -> ClusterExistsOut + 6, // 10: Infra.GetClusterKubeconfig:output_type -> GetClusterKubeconfigOut + 8, // 11: Infra.MarkClusterOnlineAt:output_type -> MarkClusterOnlineAtOut + 10, // 12: Infra.EnsureGlobalVPNConnection:output_type -> EnsureGlobalVPNConnectionOut + 7, // [7:13] is the sub-list for method output_type + 1, // [1:7] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_infra_proto_init() } @@ -1062,7 +1055,7 @@ func file_infra_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_infra_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/apps/infra/protobufs/infra/infra_grpc.pb.go b/apps/infra/protobufs/infra/infra_grpc.pb.go index 1d2d625c6..a2add32cd 100644 --- a/apps/infra/protobufs/infra/infra_grpc.pb.go +++ b/apps/infra/protobufs/infra/infra_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.24.4 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v5.28.1 // source: infra.proto package infra @@ -18,15 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Infra_GetCluster_FullMethodName = "/Infra/GetCluster" - Infra_GetNodepool_FullMethodName = "/Infra/GetNodepool" - Infra_ClusterExists_FullMethodName = "/Infra/ClusterExists" - Infra_GetClusterKubeconfig_FullMethodName = "/Infra/GetClusterKubeconfig" - Infra_MarkClusterOnlineAt_FullMethodName = "/Infra/MarkClusterOnlineAt" - Infra_EnsureGlobalVPNConnection_FullMethodName = "/Infra/EnsureGlobalVPNConnection" -) - // InfraClient is the client API for Infra service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -49,7 +40,7 @@ func NewInfraClient(cc grpc.ClientConnInterface) InfraClient { func (c *infraClient) GetCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) { out := new(GetClusterOut) - err := c.cc.Invoke(ctx, Infra_GetCluster_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/GetCluster", in, out, opts...) if err != nil { return nil, err } @@ -58,7 +49,7 @@ func (c *infraClient) GetCluster(ctx context.Context, in *GetClusterIn, opts ... func (c *infraClient) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts ...grpc.CallOption) (*GetNodepoolOut, error) { out := new(GetNodepoolOut) - err := c.cc.Invoke(ctx, Infra_GetNodepool_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/GetNodepool", in, out, opts...) if err != nil { return nil, err } @@ -67,7 +58,7 @@ func (c *infraClient) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts . func (c *infraClient) ClusterExists(ctx context.Context, in *ClusterExistsIn, opts ...grpc.CallOption) (*ClusterExistsOut, error) { out := new(ClusterExistsOut) - err := c.cc.Invoke(ctx, Infra_ClusterExists_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/ClusterExists", in, out, opts...) if err != nil { return nil, err } @@ -76,7 +67,7 @@ func (c *infraClient) ClusterExists(ctx context.Context, in *ClusterExistsIn, op func (c *infraClient) GetClusterKubeconfig(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterKubeconfigOut, error) { out := new(GetClusterKubeconfigOut) - err := c.cc.Invoke(ctx, Infra_GetClusterKubeconfig_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/GetClusterKubeconfig", in, out, opts...) if err != nil { return nil, err } @@ -85,7 +76,7 @@ func (c *infraClient) GetClusterKubeconfig(ctx context.Context, in *GetClusterIn func (c *infraClient) MarkClusterOnlineAt(ctx context.Context, in *MarkClusterOnlineAtIn, opts ...grpc.CallOption) (*MarkClusterOnlineAtOut, error) { out := new(MarkClusterOnlineAtOut) - err := c.cc.Invoke(ctx, Infra_MarkClusterOnlineAt_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/MarkClusterOnlineAt", in, out, opts...) if err != nil { return nil, err } @@ -94,7 +85,7 @@ func (c *infraClient) MarkClusterOnlineAt(ctx context.Context, in *MarkClusterOn func (c *infraClient) EnsureGlobalVPNConnection(ctx context.Context, in *EnsureGlobalVPNConnectionIn, opts ...grpc.CallOption) (*EnsureGlobalVPNConnectionOut, error) { out := new(EnsureGlobalVPNConnectionOut) - err := c.cc.Invoke(ctx, Infra_EnsureGlobalVPNConnection_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/EnsureGlobalVPNConnection", in, out, opts...) if err != nil { return nil, err } @@ -159,7 +150,7 @@ func _Infra_GetCluster_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_GetCluster_FullMethodName, + FullMethod: "/Infra/GetCluster", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetCluster(ctx, req.(*GetClusterIn)) @@ -177,7 +168,7 @@ func _Infra_GetNodepool_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_GetNodepool_FullMethodName, + FullMethod: "/Infra/GetNodepool", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetNodepool(ctx, req.(*GetNodepoolIn)) @@ -195,7 +186,7 @@ func _Infra_ClusterExists_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_ClusterExists_FullMethodName, + FullMethod: "/Infra/ClusterExists", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).ClusterExists(ctx, req.(*ClusterExistsIn)) @@ -213,7 +204,7 @@ func _Infra_GetClusterKubeconfig_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_GetClusterKubeconfig_FullMethodName, + FullMethod: "/Infra/GetClusterKubeconfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetClusterKubeconfig(ctx, req.(*GetClusterIn)) @@ -231,7 +222,7 @@ func _Infra_MarkClusterOnlineAt_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_MarkClusterOnlineAt_FullMethodName, + FullMethod: "/Infra/MarkClusterOnlineAt", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).MarkClusterOnlineAt(ctx, req.(*MarkClusterOnlineAtIn)) @@ -249,7 +240,7 @@ func _Infra_EnsureGlobalVPNConnection_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_EnsureGlobalVPNConnection_FullMethodName, + FullMethod: "/Infra/EnsureGlobalVPNConnection", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).EnsureGlobalVPNConnection(ctx, req.(*EnsureGlobalVPNConnectionIn)) diff --git a/constants/constants.go b/constants/constants.go index aed6dab00..27cf845d4 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -3,7 +3,7 @@ package constants import "fmt" const ( - ClusterLabelUserIdKey string = "kloudlite.io/userid" + ClusterLabelOwnedBy string = "kloudlite.io/owned-by" ClusterLabelLocalUuidKey string = "kloudlite.io/local-uuid" ) From c9c4d6ee48ffa7070f60792f82b1a996be9180ff Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Thu, 26 Sep 2024 18:35:42 +0530 Subject: [PATCH 4/7] :bug: Fixed issues --- .../internal/app/graph/generated/generated.go | 1945 ++++++++++++----- .../app/graph/helmrelease.resolvers.go | 6 + .../internal/app/graph/model/models_gen.go | 162 +- .../internal/app/graph/nodepool.resolvers.go | 6 + .../graph/struct-to-graphql/cluster.graphqls | 2 + .../struct-to-graphql/common-types.graphqls | 69 +- .../struct-to-graphql/helmrelease.graphqls | 1 + .../graph/struct-to-graphql/nodepool.graphqls | 1 + apps/infra/internal/domain/clusters.go | 9 + apps/infra/internal/entities/cluster.go | 2 +- apps/infra/protobufs/infra/infra.pb.go | 4 +- apps/infra/protobufs/infra/infra_grpc.pb.go | 37 +- 12 files changed, 1564 insertions(+), 680 deletions(-) diff --git a/apps/infra/internal/app/graph/generated/generated.go b/apps/infra/internal/app/graph/generated/generated.go index 2dcfb60b8..014e26a20 100644 --- a/apps/infra/internal/app/graph/generated/generated.go +++ b/apps/infra/internal/app/graph/generated/generated.go @@ -176,6 +176,7 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int + OwnedBy func(childComplexity int) int RecordVersion func(childComplexity int) int Spec func(childComplexity int) int Status func(childComplexity int) int @@ -260,6 +261,11 @@ type ComplexityRoot struct { PublicEndpoint func(childComplexity int) int } + Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr struct { + AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int + } + Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials struct { ServiceAccountJSON func(childComplexity int) int } @@ -651,6 +657,7 @@ type ComplexityRoot struct { ClusterName func(childComplexity int) int CreatedBy func(childComplexity int) int CreationTime func(childComplexity int) int + DispatchAddr func(childComplexity int) int DisplayName func(childComplexity int) int ID func(childComplexity int) int Kind func(childComplexity int) int @@ -792,6 +799,11 @@ type ComplexityRoot struct { Path func(childComplexity int) int } + K8s__io___api___core___v1__ModifyVolumeStatus struct { + Status func(childComplexity int) int + TargetVolumeAttributesClassName func(childComplexity int) int + } + K8s__io___api___core___v1__NFSVolumeSource struct { Path func(childComplexity int) int ReadOnly func(childComplexity int) int @@ -855,23 +867,26 @@ type ComplexityRoot struct { } K8s__io___api___core___v1__PersistentVolumeClaimSpec struct { - AccessModes func(childComplexity int) int - DataSource func(childComplexity int) int - DataSourceRef func(childComplexity int) int - Resources func(childComplexity int) int - Selector func(childComplexity int) int - StorageClassName func(childComplexity int) int - VolumeMode func(childComplexity int) int - VolumeName func(childComplexity int) int + AccessModes func(childComplexity int) int + DataSource func(childComplexity int) int + DataSourceRef func(childComplexity int) int + Resources func(childComplexity int) int + Selector func(childComplexity int) int + StorageClassName func(childComplexity int) int + VolumeAttributesClassName func(childComplexity int) int + VolumeMode func(childComplexity int) int + VolumeName func(childComplexity int) int } K8s__io___api___core___v1__PersistentVolumeClaimStatus struct { - AccessModes func(childComplexity int) int - AllocatedResourceStatuses func(childComplexity int) int - AllocatedResources func(childComplexity int) int - Capacity func(childComplexity int) int - Conditions func(childComplexity int) int - Phase func(childComplexity int) int + AccessModes func(childComplexity int) int + AllocatedResourceStatuses func(childComplexity int) int + AllocatedResources func(childComplexity int) int + Capacity func(childComplexity int) int + Conditions func(childComplexity int) int + CurrentVolumeAttributesClassName func(childComplexity int) int + ModifyVolumeStatus func(childComplexity int) int + Phase func(childComplexity int) int } K8s__io___api___core___v1__PersistentVolumeSpec struct { @@ -903,6 +918,7 @@ type ComplexityRoot struct { ScaleIo func(childComplexity int) int StorageClassName func(childComplexity int) int Storageos func(childComplexity int) int + VolumeAttributesClassName func(childComplexity int) int VolumeMode func(childComplexity int) int VsphereVolume func(childComplexity int) int } @@ -926,6 +942,8 @@ type ComplexityRoot struct { K8s__io___api___core___v1__PodAffinityTerm struct { LabelSelector func(childComplexity int) int + MatchLabelKeys func(childComplexity int) int + MismatchLabelKeys func(childComplexity int) int NamespaceSelector func(childComplexity int) int Namespaces func(childComplexity int) int TopologyKey func(childComplexity int) int @@ -967,16 +985,6 @@ type ComplexityRoot struct { User func(childComplexity int) int } - K8s__io___api___core___v1__ResourceClaim struct { - Name func(childComplexity int) int - } - - K8s__io___api___core___v1__ResourceRequirements struct { - Claims func(childComplexity int) int - Limits func(childComplexity int) int - Requests func(childComplexity int) int - } - K8s__io___api___core___v1__ScaleIOPersistentVolumeSource struct { FsType func(childComplexity int) int Gateway func(childComplexity int) int @@ -1035,6 +1043,11 @@ type ComplexityRoot struct { Required func(childComplexity int) int } + K8s__io___api___core___v1__VolumeResourceRequirements struct { + Limits func(childComplexity int) int + Requests func(childComplexity int) int + } + K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource struct { FsType func(childComplexity int) int StoragePolicyID func(childComplexity int) int @@ -1201,6 +1214,7 @@ type ComplexityRoot struct { ClusterName func(childComplexity int) int CreatedBy func(childComplexity int) int CreationTime func(childComplexity int) int + DispatchAddr func(childComplexity int) int DisplayName func(childComplexity int) int ID func(childComplexity int) int Kind func(childComplexity int) int @@ -1445,6 +1459,7 @@ type GlobalVPNDeviceResolver interface { } type HelmReleaseResolver interface { CreationTime(ctx context.Context, obj *entities.HelmRelease) (string, error) + DispatchAddr(ctx context.Context, obj *entities.HelmRelease) (*model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr, error) ID(ctx context.Context, obj *entities.HelmRelease) (repos.ID, error) @@ -1508,6 +1523,7 @@ type NodeResolver interface { } type NodePoolResolver interface { CreationTime(ctx context.Context, obj *entities.NodePool) (string, error) + DispatchAddr(ctx context.Context, obj *entities.NodePool) (*model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr, error) ID(ctx context.Context, obj *entities.NodePool) (repos.ID, error) @@ -1590,6 +1606,7 @@ type CloudProviderSecretInResolver interface { } type ClusterInResolver interface { Metadata(ctx context.Context, obj *entities.Cluster, data *v1.ObjectMeta) error + Spec(ctx context.Context, obj *entities.Cluster, data *model.GithubComKloudliteOperatorApisClustersV1ClusterSpecIn) error } type GlobalVPNDeviceInResolver interface { @@ -2072,6 +2089,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Cluster.ObjectMeta(childComplexity), true + case "Cluster.ownedBy": + if e.complexity.Cluster.OwnedBy == nil { + break + } + + return e.complexity.Cluster.OwnedBy(childComplexity), true + case "Cluster.recordVersion": if e.complexity.Cluster.RecordVersion == nil { break @@ -2415,6 +2439,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__ClusterVisbility.PublicEndpoint(childComplexity), true + case "Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr.accountName": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr.AccountName == nil { + break + } + + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr.AccountName(childComplexity), true + + case "Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr.clusterName": + if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr.ClusterName == nil { + break + } + + return e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr.ClusterName(childComplexity), true + case "Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials.serviceAccountJSON": if e.complexity.Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials.ServiceAccountJSON == nil { break @@ -4158,6 +4196,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.HelmRelease.CreationTime(childComplexity), true + case "HelmRelease.dispatchAddr": + if e.complexity.HelmRelease.DispatchAddr == nil { + break + } + + return e.complexity.HelmRelease.DispatchAddr(childComplexity), true + case "HelmRelease.displayName": if e.complexity.HelmRelease.DisplayName == nil { break @@ -4774,6 +4819,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8s__io___api___core___v1__LocalVolumeSource.Path(childComplexity), true + case "K8s__io___api___core___v1__ModifyVolumeStatus.status": + if e.complexity.K8s__io___api___core___v1__ModifyVolumeStatus.Status == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__ModifyVolumeStatus.Status(childComplexity), true + + case "K8s__io___api___core___v1__ModifyVolumeStatus.targetVolumeAttributesClassName": + if e.complexity.K8s__io___api___core___v1__ModifyVolumeStatus.TargetVolumeAttributesClassName == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__ModifyVolumeStatus.TargetVolumeAttributesClassName(childComplexity), true + case "K8s__io___api___core___v1__NFSVolumeSource.path": if e.complexity.K8s__io___api___core___v1__NFSVolumeSource.Path == nil { break @@ -5040,6 +5099,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.StorageClassName(childComplexity), true + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.volumeAttributesClassName": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.VolumeAttributesClassName == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.VolumeAttributesClassName(childComplexity), true + case "K8s__io___api___core___v1__PersistentVolumeClaimSpec.volumeMode": if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimSpec.VolumeMode == nil { break @@ -5089,6 +5155,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Conditions(childComplexity), true + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.currentVolumeAttributesClassName": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.CurrentVolumeAttributesClassName == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.CurrentVolumeAttributesClassName(childComplexity), true + + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.modifyVolumeStatus": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.ModifyVolumeStatus == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.ModifyVolumeStatus(childComplexity), true + case "K8s__io___api___core___v1__PersistentVolumeClaimStatus.phase": if e.complexity.K8s__io___api___core___v1__PersistentVolumeClaimStatus.Phase == nil { break @@ -5292,6 +5372,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.Storageos(childComplexity), true + case "K8s__io___api___core___v1__PersistentVolumeSpec.volumeAttributesClassName": + if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.VolumeAttributesClassName == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.VolumeAttributesClassName(childComplexity), true + case "K8s__io___api___core___v1__PersistentVolumeSpec.volumeMode": if e.complexity.K8s__io___api___core___v1__PersistentVolumeSpec.VolumeMode == nil { break @@ -5369,6 +5456,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8s__io___api___core___v1__PodAffinityTerm.LabelSelector(childComplexity), true + case "K8s__io___api___core___v1__PodAffinityTerm.matchLabelKeys": + if e.complexity.K8s__io___api___core___v1__PodAffinityTerm.MatchLabelKeys == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__PodAffinityTerm.MatchLabelKeys(childComplexity), true + + case "K8s__io___api___core___v1__PodAffinityTerm.mismatchLabelKeys": + if e.complexity.K8s__io___api___core___v1__PodAffinityTerm.MismatchLabelKeys == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__PodAffinityTerm.MismatchLabelKeys(childComplexity), true + case "K8s__io___api___core___v1__PodAffinityTerm.namespaceSelector": if e.complexity.K8s__io___api___core___v1__PodAffinityTerm.NamespaceSelector == nil { break @@ -5537,34 +5638,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8s__io___api___core___v1__RBDPersistentVolumeSource.User(childComplexity), true - case "K8s__io___api___core___v1__ResourceClaim.name": - if e.complexity.K8s__io___api___core___v1__ResourceClaim.Name == nil { - break - } - - return e.complexity.K8s__io___api___core___v1__ResourceClaim.Name(childComplexity), true - - case "K8s__io___api___core___v1__ResourceRequirements.claims": - if e.complexity.K8s__io___api___core___v1__ResourceRequirements.Claims == nil { - break - } - - return e.complexity.K8s__io___api___core___v1__ResourceRequirements.Claims(childComplexity), true - - case "K8s__io___api___core___v1__ResourceRequirements.limits": - if e.complexity.K8s__io___api___core___v1__ResourceRequirements.Limits == nil { - break - } - - return e.complexity.K8s__io___api___core___v1__ResourceRequirements.Limits(childComplexity), true - - case "K8s__io___api___core___v1__ResourceRequirements.requests": - if e.complexity.K8s__io___api___core___v1__ResourceRequirements.Requests == nil { - break - } - - return e.complexity.K8s__io___api___core___v1__ResourceRequirements.Requests(childComplexity), true - case "K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.fsType": if e.complexity.K8s__io___api___core___v1__ScaleIOPersistentVolumeSource.FsType == nil { break @@ -5803,6 +5876,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8s__io___api___core___v1__VolumeNodeAffinity.Required(childComplexity), true + case "K8s__io___api___core___v1__VolumeResourceRequirements.limits": + if e.complexity.K8s__io___api___core___v1__VolumeResourceRequirements.Limits == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__VolumeResourceRequirements.Limits(childComplexity), true + + case "K8s__io___api___core___v1__VolumeResourceRequirements.requests": + if e.complexity.K8s__io___api___core___v1__VolumeResourceRequirements.Requests == nil { + break + } + + return e.complexity.K8s__io___api___core___v1__VolumeResourceRequirements.Requests(childComplexity), true + case "K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.fsType": if e.complexity.K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource.FsType == nil { break @@ -6689,6 +6776,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.NodePool.CreationTime(childComplexity), true + case "NodePool.dispatchAddr": + if e.complexity.NodePool.DispatchAddr == nil { + break + } + + return e.complexity.NodePool.DispatchAddr(childComplexity), true + case "NodePool.displayName": if e.complexity.NodePool.DisplayName == nil { break @@ -7682,6 +7776,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputK8s__io___api___core___v1__HostPathVolumeSourceIn, ec.unmarshalInputK8s__io___api___core___v1__ISCSIPersistentVolumeSourceIn, ec.unmarshalInputK8s__io___api___core___v1__LocalVolumeSourceIn, + ec.unmarshalInputK8s__io___api___core___v1__ModifyVolumeStatusIn, ec.unmarshalInputK8s__io___api___core___v1__NFSVolumeSourceIn, ec.unmarshalInputK8s__io___api___core___v1__NamespaceConditionIn, ec.unmarshalInputK8s__io___api___core___v1__NamespaceSpecIn, @@ -7704,8 +7799,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputK8s__io___api___core___v1__PreferredSchedulingTermIn, ec.unmarshalInputK8s__io___api___core___v1__QuobyteVolumeSourceIn, ec.unmarshalInputK8s__io___api___core___v1__RBDPersistentVolumeSourceIn, - ec.unmarshalInputK8s__io___api___core___v1__ResourceClaimIn, - ec.unmarshalInputK8s__io___api___core___v1__ResourceRequirementsIn, ec.unmarshalInputK8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn, ec.unmarshalInputK8s__io___api___core___v1__SecretReferenceIn, ec.unmarshalInputK8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn, @@ -7714,6 +7807,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputK8s__io___api___core___v1__TypedLocalObjectReferenceIn, ec.unmarshalInputK8s__io___api___core___v1__TypedObjectReferenceIn, ec.unmarshalInputK8s__io___api___core___v1__VolumeNodeAffinityIn, + ec.unmarshalInputK8s__io___api___core___v1__VolumeResourceRequirementsIn, ec.unmarshalInputK8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn, ec.unmarshalInputK8s__io___api___core___v1__WeightedPodAffinityTermIn, ec.unmarshalInputK8s__io___api___storage___v1__VolumeAttachmentSourceIn, @@ -8126,6 +8220,7 @@ input CloudProviderSecretIn { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata! @goField(name: "objectMeta") + ownedBy: String recordVersion: Int! spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec! status: Github__com___kloudlite___operator___pkg___operator__Status @@ -8150,6 +8245,7 @@ input ClusterIn { globalVPN: String kind: String metadata: MetadataIn! + ownedBy: String spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn! } @@ -8181,6 +8277,11 @@ type Github__com___kloudlite___api___apps___infra___internal___entities__Cluster publicEndpoint: String } +type Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr @shareable { + accountName: String! + clusterName: String! +} + type Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials @shareable { serviceAccountJSON: String! } @@ -8609,6 +8710,11 @@ type K8s__io___api___core___v1__LocalVolumeSource @shareable { path: String! } +type K8s__io___api___core___v1__ModifyVolumeStatus @shareable { + status: K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus! + targetVolumeAttributesClassName: String +} + type K8s__io___api___core___v1__NFSVolumeSource @shareable { path: String! readOnly: Boolean @@ -8675,9 +8781,10 @@ type K8s__io___api___core___v1__PersistentVolumeClaimSpec @shareable { accessModes: [String!] dataSource: K8s__io___api___core___v1__TypedLocalObjectReference dataSourceRef: K8s__io___api___core___v1__TypedObjectReference - resources: K8s__io___api___core___v1__ResourceRequirements + resources: K8s__io___api___core___v1__VolumeResourceRequirements selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector storageClassName: String + volumeAttributesClassName: String volumeMode: String volumeName: String } @@ -8688,6 +8795,8 @@ type K8s__io___api___core___v1__PersistentVolumeClaimStatus @shareable { allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimCondition!] + currentVolumeAttributesClassName: String + modifyVolumeStatus: K8s__io___api___core___v1__ModifyVolumeStatus phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase } @@ -8720,6 +8829,7 @@ type K8s__io___api___core___v1__PersistentVolumeSpec @shareable { scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSource storageClassName: String storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSource + volumeAttributesClassName: String volumeMode: String vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource } @@ -8743,6 +8853,8 @@ type K8s__io___api___core___v1__PodAffinity @shareable { type K8s__io___api___core___v1__PodAffinityTerm @shareable { labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + matchLabelKeys: [String!] + mismatchLabelKeys: [String!] namespaces: [String!] namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector topologyKey: String! @@ -8784,16 +8896,6 @@ type K8s__io___api___core___v1__RBDPersistentVolumeSource @shareable { user: String } -type K8s__io___api___core___v1__ResourceClaim @shareable { - name: String! -} - -type K8s__io___api___core___v1__ResourceRequirements @shareable { - claims: [K8s__io___api___core___v1__ResourceClaim!] - limits: Map - requests: Map -} - type K8s__io___api___core___v1__ScaleIOPersistentVolumeSource @shareable { fsType: String gateway: String! @@ -8852,6 +8954,11 @@ type K8s__io___api___core___v1__VolumeNodeAffinity @shareable { required: K8s__io___api___core___v1__NodeSelector } +type K8s__io___api___core___v1__VolumeResourceRequirements @shareable { + limits: Map + requests: Map +} + type K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource @shareable { fsType: String storagePolicyID: String @@ -9169,6 +9276,11 @@ input K8s__io___api___core___v1__LocalVolumeSourceIn { path: String! } +input K8s__io___api___core___v1__ModifyVolumeStatusIn { + status: K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus! + targetVolumeAttributesClassName: String +} + input K8s__io___api___core___v1__NFSVolumeSourceIn { path: String! readOnly: Boolean @@ -9235,9 +9347,10 @@ input K8s__io___api___core___v1__PersistentVolumeClaimSpecIn { accessModes: [String!] dataSource: K8s__io___api___core___v1__TypedLocalObjectReferenceIn dataSourceRef: K8s__io___api___core___v1__TypedObjectReferenceIn - resources: K8s__io___api___core___v1__ResourceRequirementsIn + resources: K8s__io___api___core___v1__VolumeResourceRequirementsIn selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn storageClassName: String + volumeAttributesClassName: String volumeMode: String volumeName: String } @@ -9248,6 +9361,8 @@ input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn { allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimConditionIn!] + currentVolumeAttributesClassName: String + modifyVolumeStatus: K8s__io___api___core___v1__ModifyVolumeStatusIn phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase } @@ -9280,6 +9395,7 @@ input K8s__io___api___core___v1__PersistentVolumeSpecIn { scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn storageClassName: String storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn + volumeAttributesClassName: String volumeMode: String vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn } @@ -9303,6 +9419,8 @@ input K8s__io___api___core___v1__PodAffinityIn { input K8s__io___api___core___v1__PodAffinityTermIn { labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + matchLabelKeys: [String!] + mismatchLabelKeys: [String!] namespaces: [String!] namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn topologyKey: String! @@ -9344,16 +9462,6 @@ input K8s__io___api___core___v1__RBDPersistentVolumeSourceIn { user: String } -input K8s__io___api___core___v1__ResourceClaimIn { - name: String! -} - -input K8s__io___api___core___v1__ResourceRequirementsIn { - claims: [K8s__io___api___core___v1__ResourceClaimIn!] - limits: Map - requests: Map -} - input K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn { fsType: String gateway: String! @@ -9412,6 +9520,11 @@ input K8s__io___api___core___v1__VolumeNodeAffinityIn { required: K8s__io___api___core___v1__NodeSelectorIn } +input K8s__io___api___core___v1__VolumeResourceRequirementsIn { + limits: Map + requests: Map +} + input K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn { fsType: String storagePolicyID: String @@ -9560,9 +9673,17 @@ enum K8s__io___api___core___v1__NodeSelectorOperator { enum K8s__io___api___core___v1__PersistentVolumeClaimConditionType { FileSystemResizePending + ModifyingVolume + ModifyVolumeError Resizing } +enum K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus { + Infeasible + InProgress + Pending +} + enum K8s__io___api___core___v1__PersistentVolumeClaimPhase { Bound Lost @@ -9771,6 +9892,7 @@ input GlobalVPNDeviceIn { clusterName: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! + dispatchAddr: Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr displayName: String! id: ID! kind: String @@ -9908,6 +10030,7 @@ input NodeIn { clusterName: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! + dispatchAddr: Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr displayName: String! id: ID! kind: String @@ -14131,6 +14254,47 @@ func (ec *executionContext) fieldContext_Cluster_metadata(_ context.Context, fie return fc, nil } +func (ec *executionContext) _Cluster_ownedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Cluster_ownedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Cluster_ownedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Cluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Cluster_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Cluster) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Cluster_recordVersion(ctx, field) if err != nil { @@ -14610,6 +14774,8 @@ func (ec *executionContext) fieldContext_ClusterEdge_node(_ context.Context, fie return ec.fieldContext_Cluster_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Cluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_Cluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_Cluster_recordVersion(ctx, field) case "spec": @@ -16530,6 +16696,94 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___ return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_accountName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_accountName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AccountName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_accountName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_clusterName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ClusterName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_clusterName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials_serviceAccountJSON(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesGCPSecretCredentials) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials_serviceAccountJSON(ctx, field) if err != nil { @@ -27801,6 +28055,53 @@ func (ec *executionContext) fieldContext_HelmRelease_creationTime(_ context.Cont return fc, nil } +func (ec *executionContext) _HelmRelease_dispatchAddr(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HelmRelease_dispatchAddr(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.HelmRelease().DispatchAddr(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HelmRelease_dispatchAddr(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HelmRelease", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_accountName(ctx, field) + case "clusterName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_clusterName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _HelmRelease_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.HelmRelease) (ret graphql.Marshaler) { fc, err := ec.fieldContext_HelmRelease_displayName(ctx, field) if err != nil { @@ -28443,6 +28744,8 @@ func (ec *executionContext) fieldContext_HelmReleaseEdge_node(_ context.Context, return ec.fieldContext_HelmRelease_createdBy(ctx, field) case "creationTime": return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_HelmRelease_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_HelmRelease_displayName(ctx, field) case "id": @@ -31698,6 +32001,91 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__LocalVolumeS return fc, nil } +func (ec *executionContext) _K8s__io___api___core___v1__ModifyVolumeStatus_status(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ModifyVolumeStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ModifyVolumeStatus_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus) + fc.Result = res + return ec.marshalNK8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ModifyVolumeStatus_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ModifyVolumeStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__ModifyVolumeStatus_targetVolumeAttributesClassName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ModifyVolumeStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__ModifyVolumeStatus_targetVolumeAttributesClassName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TargetVolumeAttributesClassName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ModifyVolumeStatus_targetVolumeAttributesClassName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__ModifyVolumeStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _K8s__io___api___core___v1__NFSVolumeSource_path(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1NFSVolumeSource) (ret graphql.Marshaler) { fc, err := ec.fieldContext_K8s__io___api___core___v1__NFSVolumeSource_path(ctx, field) if err != nil { @@ -33245,9 +33633,9 @@ func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpe if resTmp == nil { return graphql.Null } - res := resTmp.(*model.K8sIoAPICoreV1ResourceRequirements) + res := resTmp.(*model.K8sIoAPICoreV1VolumeResourceRequirements) fc.Result = res - return ec.marshalOK8s__io___api___core___v1__ResourceRequirements2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirements(ctx, field.Selections, res) + return ec.marshalOK8s__io___api___core___v1__VolumeResourceRequirements2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeResourceRequirements(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_resources(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -33258,14 +33646,12 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVo IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "claims": - return ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_claims(ctx, field) case "limits": - return ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_limits(ctx, field) + return ec.fieldContext_K8s__io___api___core___v1__VolumeResourceRequirements_limits(ctx, field) case "requests": - return ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_requests(ctx, field) + return ec.fieldContext_K8s__io___api___core___v1__VolumeResourceRequirements_requests(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ResourceRequirements", field.Name) + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__VolumeResourceRequirements", field.Name) }, } return fc, nil @@ -33359,6 +33745,47 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVo return fc, nil } +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeAttributesClassName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeAttributesClassName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeAttributesClassName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeAttributesClassName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimSpec) (ret graphql.Marshaler) { fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx, field) if err != nil { @@ -33660,6 +34087,94 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVo return fc, nil } +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_currentVolumeAttributesClassName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_currentVolumeAttributesClassName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CurrentVolumeAttributesClassName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_currentVolumeAttributesClassName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_modifyVolumeStatus(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_modifyVolumeStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ModifyVolumeStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sIoAPICoreV1ModifyVolumeStatus) + fc.Result = res + return ec.marshalOK8s__io___api___core___v1__ModifyVolumeStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ModifyVolumeStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_modifyVolumeStatus(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeClaimStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "status": + return ec.fieldContext_K8s__io___api___core___v1__ModifyVolumeStatus_status(ctx, field) + case "targetVolumeAttributesClassName": + return ec.fieldContext_K8s__io___api___core___v1__ModifyVolumeStatus_targetVolumeAttributesClassName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ModifyVolumeStatus", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeClaimStatus) (ret graphql.Marshaler) { fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx, field) if err != nil { @@ -35123,6 +35638,47 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVo return fc, nil } +func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_volumeAttributesClassName(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeAttributesClassName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VolumeAttributesClassName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeAttributesClassName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PersistentVolumeSpec", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PersistentVolumeSpec) (ret graphql.Marshaler) { fc, err := ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field) if err != nil { @@ -35549,6 +36105,10 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinity_ switch field.Name { case "labelSelector": return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field) + case "matchLabelKeys": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_matchLabelKeys(ctx, field) + case "mismatchLabelKeys": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_mismatchLabelKeys(ctx, field) case "namespaces": return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) case "namespaceSelector": @@ -35609,6 +36169,88 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinityT return fc, nil } +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm_matchLabelKeys(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_matchLabelKeys(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MatchLabelKeys, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinityTerm_matchLabelKeys(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinityTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm_mismatchLabelKeys(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinityTerm) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_mismatchLabelKeys(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MismatchLabelKeys, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAffinityTerm_mismatchLabelKeys(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__PodAffinityTerm", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1PodAffinityTerm) (ret graphql.Marshaler) { fc, err := ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) if err != nil { @@ -35826,6 +36468,10 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__PodAntiAffin switch field.Name { case "labelSelector": return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field) + case "matchLabelKeys": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_matchLabelKeys(ctx, field) + case "mismatchLabelKeys": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_mismatchLabelKeys(ctx, field) case "namespaces": return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) case "namespaceSelector": @@ -36651,177 +37297,6 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__RBDPersisten return fc, nil } -func (ec *executionContext) _K8s__io___api___core___v1__ResourceClaim_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceClaim) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceClaim_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ResourceClaim_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "K8s__io___api___core___v1__ResourceClaim", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements_claims(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_claims(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Claims, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.K8sIoAPICoreV1ResourceClaim) - fc.Result = res - return ec.marshalOK8s__io___api___core___v1__ResourceClaim2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ResourceRequirements_claims(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "K8s__io___api___core___v1__ResourceRequirements", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_K8s__io___api___core___v1__ResourceClaim_name(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__ResourceClaim", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements_limits(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_limits(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Limits, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ResourceRequirements_limits(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "K8s__io___api___core___v1__ResourceRequirements", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements_requests(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ResourceRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_K8s__io___api___core___v1__ResourceRequirements_requests(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Requests, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_K8s__io___api___core___v1__ResourceRequirements_requests(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "K8s__io___api___core___v1__ResourceRequirements", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) (ret graphql.Marshaler) { fc, err := ec.fieldContext_K8s__io___api___core___v1__ScaleIOPersistentVolumeSource_fsType(ctx, field) if err != nil { @@ -38266,6 +38741,88 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__VolumeNodeAf return fc, nil } +func (ec *executionContext) _K8s__io___api___core___v1__VolumeResourceRequirements_limits(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VolumeResourceRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__VolumeResourceRequirements_limits(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Limits, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__VolumeResourceRequirements_limits(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__VolumeResourceRequirements", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8s__io___api___core___v1__VolumeResourceRequirements_requests(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VolumeResourceRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8s__io___api___core___v1__VolumeResourceRequirements_requests(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Requests, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8s__io___api___core___v1__VolumeResourceRequirements_requests(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8s__io___api___core___v1__VolumeResourceRequirements", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_fsType(ctx context.Context, field graphql.CollectedField, obj *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) (ret graphql.Marshaler) { fc, err := ec.fieldContext_K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource_fsType(ctx, field) if err != nil { @@ -38474,6 +39031,10 @@ func (ec *executionContext) fieldContext_K8s__io___api___core___v1__WeightedPodA switch field.Name { case "labelSelector": return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field) + case "matchLabelKeys": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_matchLabelKeys(ctx, field) + case "mismatchLabelKeys": + return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_mismatchLabelKeys(ctx, field) case "namespaces": return ec.fieldContext_K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field) case "namespaceSelector": @@ -38623,6 +39184,8 @@ func (ec *executionContext) fieldContext_K8s__io___api___storage___v1__VolumeAtt return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx, field) case "storageos": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx, field) + case "volumeAttributesClassName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeAttributesClassName(ctx, field) case "volumeMode": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field) case "vsphereVolume": @@ -40081,6 +40644,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_createCluster(ctx contex return ec.fieldContext_Cluster_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Cluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_Cluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_Cluster_recordVersion(ctx, field) case "spec": @@ -40199,6 +40764,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_updateCluster(ctx contex return ec.fieldContext_Cluster_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Cluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_Cluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_Cluster_recordVersion(ctx, field) case "spec": @@ -41982,6 +42549,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_createNodePool(ctx conte return ec.fieldContext_NodePool_createdBy(ctx, field) case "creationTime": return ec.fieldContext_NodePool_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_NodePool_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_NodePool_displayName(ctx, field) case "id": @@ -42094,6 +42663,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_updateNodePool(ctx conte return ec.fieldContext_NodePool_createdBy(ctx, field) case "creationTime": return ec.fieldContext_NodePool_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_NodePool_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_NodePool_displayName(ctx, field) case "id": @@ -42287,6 +42858,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_createHelmRelease(ctx co return ec.fieldContext_HelmRelease_createdBy(ctx, field) case "creationTime": return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_HelmRelease_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_HelmRelease_displayName(ctx, field) case "id": @@ -42399,6 +42972,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_updateHelmRelease(ctx co return ec.fieldContext_HelmRelease_createdBy(ctx, field) case "creationTime": return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_HelmRelease_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_HelmRelease_displayName(ctx, field) case "id": @@ -44709,6 +45284,53 @@ func (ec *executionContext) fieldContext_NodePool_creationTime(_ context.Context return fc, nil } +func (ec *executionContext) _NodePool_dispatchAddr(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodePool_dispatchAddr(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.NodePool().DispatchAddr(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodePool_dispatchAddr(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodePool", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "accountName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_accountName(ctx, field) + case "clusterName": + return ec.fieldContext_Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_clusterName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _NodePool_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.NodePool) (ret graphql.Marshaler) { fc, err := ec.fieldContext_NodePool_displayName(ctx, field) if err != nil { @@ -45344,6 +45966,8 @@ func (ec *executionContext) fieldContext_NodePoolEdge_node(_ context.Context, fi return ec.fieldContext_NodePool_createdBy(ctx, field) case "creationTime": return ec.fieldContext_NodePool_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_NodePool_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_NodePool_displayName(ctx, field) case "id": @@ -46325,6 +46949,8 @@ func (ec *executionContext) fieldContext_PersistentVolume_spec(_ context.Context return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx, field) case "storageos": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx, field) + case "volumeAttributesClassName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeAttributesClassName(ctx, field) case "volumeMode": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field) case "vsphereVolume": @@ -47085,6 +47711,8 @@ func (ec *executionContext) fieldContext_PersistentVolumeClaim_spec(_ context.Co return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_selector(ctx, field) case "storageClassName": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_storageClassName(ctx, field) + case "volumeAttributesClassName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeAttributesClassName(ctx, field) case "volumeMode": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx, field) case "volumeName": @@ -47142,6 +47770,10 @@ func (ec *executionContext) fieldContext_PersistentVolumeClaim_status(_ context. return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_capacity(ctx, field) case "conditions": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_conditions(ctx, field) + case "currentVolumeAttributesClassName": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_currentVolumeAttributesClassName(ctx, field) + case "modifyVolumeStatus": + return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_modifyVolumeStatus(ctx, field) case "phase": return ec.fieldContext_K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx, field) } @@ -48052,6 +48684,8 @@ func (ec *executionContext) fieldContext_Query_infra_getCluster(ctx context.Cont return ec.fieldContext_Cluster_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Cluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_Cluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_Cluster_recordVersion(ctx, field) case "spec": @@ -48932,6 +49566,8 @@ func (ec *executionContext) fieldContext_Query_infra_getNodePool(ctx context.Con return ec.fieldContext_NodePool_createdBy(ctx, field) case "creationTime": return ec.fieldContext_NodePool_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_NodePool_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_NodePool_displayName(ctx, field) case "id": @@ -49597,6 +50233,8 @@ func (ec *executionContext) fieldContext_Query_infra_getHelmRelease(ctx context. return ec.fieldContext_HelmRelease_createdBy(ctx, field) case "creationTime": return ec.fieldContext_HelmRelease_creationTime(ctx, field) + case "dispatchAddr": + return ec.fieldContext_HelmRelease_dispatchAddr(ctx, field) case "displayName": return ec.fieldContext_HelmRelease_displayName(ctx, field) case "id": @@ -53715,7 +54353,7 @@ func (ec *executionContext) unmarshalInputClusterIn(ctx context.Context, obj int asMap[k] = v } - fieldsInOrder := [...]string{"apiVersion", "displayName", "globalVPN", "kind", "metadata", "spec"} + fieldsInOrder := [...]string{"apiVersion", "displayName", "globalVPN", "kind", "metadata", "ownedBy", "spec"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -53759,6 +54397,13 @@ func (ec *executionContext) unmarshalInputClusterIn(ctx context.Context, obj int if err = ec.resolvers.ClusterIn().Metadata(ctx, &it, data); err != nil { return it, err } + case "ownedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnedBy = data case "spec": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisClustersV1ClusterSpecIn(ctx, v) @@ -55790,6 +56435,40 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__LocalVolume return it, nil } +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ModifyVolumeStatusIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ModifyVolumeStatusIn, error) { + var it model.K8sIoAPICoreV1ModifyVolumeStatusIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"status", "targetVolumeAttributesClassName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNK8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "targetVolumeAttributesClassName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetVolumeAttributesClassName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TargetVolumeAttributesClassName = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__NFSVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1NFSVolumeSourceIn, error) { var it model.K8sIoAPICoreV1NFSVolumeSourceIn asMap := map[string]interface{}{} @@ -56221,7 +56900,7 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentV asMap[k] = v } - fieldsInOrder := [...]string{"accessModes", "dataSource", "dataSourceRef", "resources", "selector", "storageClassName", "volumeMode", "volumeName"} + fieldsInOrder := [...]string{"accessModes", "dataSource", "dataSourceRef", "resources", "selector", "storageClassName", "volumeAttributesClassName", "volumeMode", "volumeName"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -56251,7 +56930,7 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentV it.DataSourceRef = data case "resources": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resources")) - data, err := ec.unmarshalOK8s__io___api___core___v1__ResourceRequirementsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirementsIn(ctx, v) + data, err := ec.unmarshalOK8s__io___api___core___v1__VolumeResourceRequirementsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeResourceRequirementsIn(ctx, v) if err != nil { return it, err } @@ -56270,6 +56949,13 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentV return it, err } it.StorageClassName = data + case "volumeAttributesClassName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeAttributesClassName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VolumeAttributesClassName = data case "volumeMode": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeMode")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) @@ -56297,7 +56983,7 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentV asMap[k] = v } - fieldsInOrder := [...]string{"accessModes", "allocatedResources", "allocatedResourceStatuses", "capacity", "conditions", "phase"} + fieldsInOrder := [...]string{"accessModes", "allocatedResources", "allocatedResourceStatuses", "capacity", "conditions", "currentVolumeAttributesClassName", "modifyVolumeStatus", "phase"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -56339,6 +57025,20 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentV return it, err } it.Conditions = data + case "currentVolumeAttributesClassName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("currentVolumeAttributesClassName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CurrentVolumeAttributesClassName = data + case "modifyVolumeStatus": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("modifyVolumeStatus")) + data, err := ec.unmarshalOK8s__io___api___core___v1__ModifyVolumeStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ModifyVolumeStatusIn(ctx, v) + if err != nil { + return it, err + } + it.ModifyVolumeStatus = data case "phase": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phase")) data, err := ec.unmarshalOK8s__io___api___core___v1__PersistentVolumeClaimPhase2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimPhase(ctx, v) @@ -56359,7 +57059,7 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentV asMap[k] = v } - fieldsInOrder := [...]string{"accessModes", "awsElasticBlockStore", "azureDisk", "azureFile", "capacity", "cephfs", "cinder", "claimRef", "csi", "fc", "flexVolume", "flocker", "gcePersistentDisk", "glusterfs", "hostPath", "iscsi", "local", "mountOptions", "nfs", "nodeAffinity", "persistentVolumeReclaimPolicy", "photonPersistentDisk", "portworxVolume", "quobyte", "rbd", "scaleIO", "storageClassName", "storageos", "volumeMode", "vsphereVolume"} + fieldsInOrder := [...]string{"accessModes", "awsElasticBlockStore", "azureDisk", "azureFile", "capacity", "cephfs", "cinder", "claimRef", "csi", "fc", "flexVolume", "flocker", "gcePersistentDisk", "glusterfs", "hostPath", "iscsi", "local", "mountOptions", "nfs", "nodeAffinity", "persistentVolumeReclaimPolicy", "photonPersistentDisk", "portworxVolume", "quobyte", "rbd", "scaleIO", "storageClassName", "storageos", "volumeAttributesClassName", "volumeMode", "vsphereVolume"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -56562,6 +57262,13 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PersistentV return it, err } it.Storageos = data + case "volumeAttributesClassName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeAttributesClassName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VolumeAttributesClassName = data case "volumeMode": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("volumeMode")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) @@ -56705,7 +57412,7 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PodAffinity asMap[k] = v } - fieldsInOrder := [...]string{"labelSelector", "namespaces", "namespaceSelector", "topologyKey"} + fieldsInOrder := [...]string{"labelSelector", "matchLabelKeys", "mismatchLabelKeys", "namespaces", "namespaceSelector", "topologyKey"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -56719,6 +57426,20 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__PodAffinity return it, err } it.LabelSelector = data + case "matchLabelKeys": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchLabelKeys")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.MatchLabelKeys = data + case "mismatchLabelKeys": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mismatchLabelKeys")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.MismatchLabelKeys = data case "namespaces": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespaces")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) @@ -56993,74 +57714,6 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__RBDPersiste return it, nil } -func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ResourceClaimIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ResourceClaimIn, error) { - var it model.K8sIoAPICoreV1ResourceClaimIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ResourceRequirementsIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ResourceRequirementsIn, error) { - var it model.K8sIoAPICoreV1ResourceRequirementsIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"claims", "limits", "requests"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "claims": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claims")) - data, err := ec.unmarshalOK8s__io___api___core___v1__ResourceClaimIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimInᚄ(ctx, v) - if err != nil { - return it, err - } - it.Claims = data - case "limits": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limits")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - it.Limits = data - case "requests": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requests")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - it.Requests = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn, error) { var it model.K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn asMap := map[string]interface{}{} @@ -57384,75 +58037,109 @@ func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TypedLocalO return it, nil } -func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TypedObjectReferenceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1TypedObjectReferenceIn, error) { - var it model.K8sIoAPICoreV1TypedObjectReferenceIn +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__TypedObjectReferenceIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1TypedObjectReferenceIn, error) { + var it model.K8sIoAPICoreV1TypedObjectReferenceIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"apiGroup", "kind", "name", "namespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "apiGroup": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiGroup")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.APIGroup = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "namespace": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Namespace = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__VolumeNodeAffinityIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1VolumeNodeAffinityIn, error) { + var it model.K8sIoAPICoreV1VolumeNodeAffinityIn asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"apiGroup", "kind", "name", "namespace"} + fieldsInOrder := [...]string{"required"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "apiGroup": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiGroup")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.APIGroup = data - case "kind": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Kind = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "namespace": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + case "required": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("required")) + data, err := ec.unmarshalOK8s__io___api___core___v1__NodeSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorIn(ctx, v) if err != nil { return it, err } - it.Namespace = data + it.Required = data } } return it, nil } -func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__VolumeNodeAffinityIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1VolumeNodeAffinityIn, error) { - var it model.K8sIoAPICoreV1VolumeNodeAffinityIn +func (ec *executionContext) unmarshalInputK8s__io___api___core___v1__VolumeResourceRequirementsIn(ctx context.Context, obj interface{}) (model.K8sIoAPICoreV1VolumeResourceRequirementsIn, error) { + var it model.K8sIoAPICoreV1VolumeResourceRequirementsIn asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"required"} + fieldsInOrder := [...]string{"limits", "requests"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "required": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("required")) - data, err := ec.unmarshalOK8s__io___api___core___v1__NodeSelectorIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NodeSelectorIn(ctx, v) + case "limits": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limits")) + data, err := ec.unmarshalOMap2map(ctx, v) if err != nil { return it, err } - it.Required = data + it.Limits = data + case "requests": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requests")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Requests = data } } @@ -59595,6 +60282,8 @@ func (ec *executionContext) _Cluster(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "ownedBy": + out.Values[i] = ec._Cluster_ownedBy(ctx, field, obj) case "recordVersion": out.Values[i] = ec._Cluster_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -60419,6 +61108,50 @@ func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___inte return out } +var github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddrImplementors = []string{"Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr"} + +func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddrImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr") + case "accountName": + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_accountName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "clusterName": + out.Values[i] = ec._Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr_clusterName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentialsImplementors = []string{"Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials"} func (ec *executionContext) _Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsInfraInternalEntitiesGCPSecretCredentials) graphql.Marshaler { @@ -63681,6 +64414,39 @@ func (ec *executionContext) _HelmRelease(ctx context.Context, sel ast.SelectionS continue } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "dispatchAddr": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._HelmRelease_dispatchAddr(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "displayName": out.Values[i] = ec._HelmRelease_displayName(ctx, field, obj) @@ -64670,6 +65436,47 @@ func (ec *executionContext) _K8s__io___api___core___v1__LocalVolumeSource(ctx co return out } +var k8s__io___api___core___v1__ModifyVolumeStatusImplementors = []string{"K8s__io___api___core___v1__ModifyVolumeStatus"} + +func (ec *executionContext) _K8s__io___api___core___v1__ModifyVolumeStatus(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ModifyVolumeStatus) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ModifyVolumeStatusImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ModifyVolumeStatus") + case "status": + out.Values[i] = ec._K8s__io___api___core___v1__ModifyVolumeStatus_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "targetVolumeAttributesClassName": + out.Values[i] = ec._K8s__io___api___core___v1__ModifyVolumeStatus_targetVolumeAttributesClassName(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var k8s__io___api___core___v1__NFSVolumeSourceImplementors = []string{"K8s__io___api___core___v1__NFSVolumeSource"} func (ec *executionContext) _K8s__io___api___core___v1__NFSVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1NFSVolumeSource) graphql.Marshaler { @@ -65124,6 +65931,8 @@ func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSpe out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_selector(ctx, field, obj) case "storageClassName": out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_storageClassName(ctx, field, obj) + case "volumeAttributesClassName": + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeAttributesClassName(ctx, field, obj) case "volumeMode": out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimSpec_volumeMode(ctx, field, obj) case "volumeName": @@ -65172,6 +65981,10 @@ func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeClaimSta out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_capacity(ctx, field, obj) case "conditions": out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_conditions(ctx, field, obj) + case "currentVolumeAttributesClassName": + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_currentVolumeAttributesClassName(ctx, field, obj) + case "modifyVolumeStatus": + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_modifyVolumeStatus(ctx, field, obj) case "phase": out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeClaimStatus_phase(ctx, field, obj) default: @@ -65264,6 +66077,8 @@ func (ec *executionContext) _K8s__io___api___core___v1__PersistentVolumeSpec(ctx out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_storageClassName(ctx, field, obj) case "storageos": out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_storageos(ctx, field, obj) + case "volumeAttributesClassName": + out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_volumeAttributesClassName(ctx, field, obj) case "volumeMode": out.Values[i] = ec._K8s__io___api___core___v1__PersistentVolumeSpec_volumeMode(ctx, field, obj) case "vsphereVolume": @@ -65425,6 +66240,10 @@ func (ec *executionContext) _K8s__io___api___core___v1__PodAffinityTerm(ctx cont out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PodAffinityTerm") case "labelSelector": out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_labelSelector(ctx, field, obj) + case "matchLabelKeys": + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_matchLabelKeys(ctx, field, obj) + case "mismatchLabelKeys": + out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_mismatchLabelKeys(ctx, field, obj) case "namespaces": out.Values[i] = ec._K8s__io___api___core___v1__PodAffinityTerm_namespaces(ctx, field, obj) case "namespaceSelector": @@ -65538,135 +66357,27 @@ func (ec *executionContext) _K8s__io___api___core___v1__PortworxVolumeSource(ctx return out } -var k8s__io___api___core___v1__PreferredSchedulingTermImplementors = []string{"K8s__io___api___core___v1__PreferredSchedulingTerm"} - -func (ec *executionContext) _K8s__io___api___core___v1__PreferredSchedulingTerm(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PreferredSchedulingTerm) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PreferredSchedulingTermImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PreferredSchedulingTerm") - case "preference": - out.Values[i] = ec._K8s__io___api___core___v1__PreferredSchedulingTerm_preference(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "weight": - out.Values[i] = ec._K8s__io___api___core___v1__PreferredSchedulingTerm_weight(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var k8s__io___api___core___v1__QuobyteVolumeSourceImplementors = []string{"K8s__io___api___core___v1__QuobyteVolumeSource"} - -func (ec *executionContext) _K8s__io___api___core___v1__QuobyteVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__QuobyteVolumeSourceImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__QuobyteVolumeSource") - case "group": - out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_group(ctx, field, obj) - case "readOnly": - out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_readOnly(ctx, field, obj) - case "registry": - out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_registry(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "tenant": - out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_tenant(ctx, field, obj) - case "user": - out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_user(ctx, field, obj) - case "volume": - out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_volume(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var k8s__io___api___core___v1__RBDPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__RBDPersistentVolumeSource"} +var k8s__io___api___core___v1__PreferredSchedulingTermImplementors = []string{"K8s__io___api___core___v1__PreferredSchedulingTerm"} -func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__RBDPersistentVolumeSourceImplementors) +func (ec *executionContext) _K8s__io___api___core___v1__PreferredSchedulingTerm(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1PreferredSchedulingTerm) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__PreferredSchedulingTermImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__RBDPersistentVolumeSource") - case "fsType": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_fsType(ctx, field, obj) - case "image": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_image(ctx, field, obj) + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__PreferredSchedulingTerm") + case "preference": + out.Values[i] = ec._K8s__io___api___core___v1__PreferredSchedulingTerm_preference(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "keyring": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_keyring(ctx, field, obj) - case "monitors": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_monitors(ctx, field, obj) + case "weight": + out.Values[i] = ec._K8s__io___api___core___v1__PreferredSchedulingTerm_weight(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "pool": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_pool(ctx, field, obj) - case "readOnly": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_readOnly(ctx, field, obj) - case "secretRef": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_secretRef(ctx, field, obj) - case "user": - out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_user(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -65690,19 +66401,32 @@ func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSourc return out } -var k8s__io___api___core___v1__ResourceClaimImplementors = []string{"K8s__io___api___core___v1__ResourceClaim"} +var k8s__io___api___core___v1__QuobyteVolumeSourceImplementors = []string{"K8s__io___api___core___v1__QuobyteVolumeSource"} -func (ec *executionContext) _K8s__io___api___core___v1__ResourceClaim(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ResourceClaim) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ResourceClaimImplementors) +func (ec *executionContext) _K8s__io___api___core___v1__QuobyteVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1QuobyteVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__QuobyteVolumeSourceImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ResourceClaim") - case "name": - out.Values[i] = ec._K8s__io___api___core___v1__ResourceClaim_name(ctx, field, obj) + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__QuobyteVolumeSource") + case "group": + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_group(ctx, field, obj) + case "readOnly": + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_readOnly(ctx, field, obj) + case "registry": + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_registry(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "tenant": + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_tenant(ctx, field, obj) + case "user": + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_user(ctx, field, obj) + case "volume": + out.Values[i] = ec._K8s__io___api___core___v1__QuobyteVolumeSource_volume(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -65729,23 +66453,39 @@ func (ec *executionContext) _K8s__io___api___core___v1__ResourceClaim(ctx contex return out } -var k8s__io___api___core___v1__ResourceRequirementsImplementors = []string{"K8s__io___api___core___v1__ResourceRequirements"} +var k8s__io___api___core___v1__RBDPersistentVolumeSourceImplementors = []string{"K8s__io___api___core___v1__RBDPersistentVolumeSource"} -func (ec *executionContext) _K8s__io___api___core___v1__ResourceRequirements(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1ResourceRequirements) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__ResourceRequirementsImplementors) +func (ec *executionContext) _K8s__io___api___core___v1__RBDPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1RBDPersistentVolumeSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__RBDPersistentVolumeSourceImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__ResourceRequirements") - case "claims": - out.Values[i] = ec._K8s__io___api___core___v1__ResourceRequirements_claims(ctx, field, obj) - case "limits": - out.Values[i] = ec._K8s__io___api___core___v1__ResourceRequirements_limits(ctx, field, obj) - case "requests": - out.Values[i] = ec._K8s__io___api___core___v1__ResourceRequirements_requests(ctx, field, obj) + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__RBDPersistentVolumeSource") + case "fsType": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_fsType(ctx, field, obj) + case "image": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_image(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "keyring": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_keyring(ctx, field, obj) + case "monitors": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_monitors(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pool": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_pool(ctx, field, obj) + case "readOnly": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_readOnly(ctx, field, obj) + case "secretRef": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_secretRef(ctx, field, obj) + case "user": + out.Values[i] = ec._K8s__io___api___core___v1__RBDPersistentVolumeSource_user(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -66133,6 +66873,44 @@ func (ec *executionContext) _K8s__io___api___core___v1__VolumeNodeAffinity(ctx c return out } +var k8s__io___api___core___v1__VolumeResourceRequirementsImplementors = []string{"K8s__io___api___core___v1__VolumeResourceRequirements"} + +func (ec *executionContext) _K8s__io___api___core___v1__VolumeResourceRequirements(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1VolumeResourceRequirements) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__VolumeResourceRequirementsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__VolumeResourceRequirements") + case "limits": + out.Values[i] = ec._K8s__io___api___core___v1__VolumeResourceRequirements_limits(ctx, field, obj) + case "requests": + out.Values[i] = ec._K8s__io___api___core___v1__VolumeResourceRequirements_requests(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var k8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceImplementors = []string{"K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource"} func (ec *executionContext) _K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) graphql.Marshaler { @@ -67676,6 +68454,39 @@ func (ec *executionContext) _NodePool(ctx context.Context, sel ast.SelectionSet, continue } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "dispatchAddr": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._NodePool_dispatchAddr(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "displayName": out.Values[i] = ec._NodePool_displayName(ctx, field, obj) @@ -71369,6 +72180,16 @@ func (ec *executionContext) marshalNK8s__io___api___core___v1__PersistentVolumeC return v } +func (ec *executionContext) unmarshalNK8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus(ctx context.Context, v interface{}) (model.K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus, error) { + var res model.K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNK8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus2githubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus(ctx context.Context, sel ast.SelectionSet, v model.K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus) graphql.Marshaler { + return v +} + func (ec *executionContext) marshalNK8s__io___api___core___v1__PodAffinityTerm2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1PodAffinityTerm(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1PodAffinityTerm) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -71399,21 +72220,6 @@ func (ec *executionContext) unmarshalNK8s__io___api___core___v1__PreferredSchedu return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNK8s__io___api___core___v1__ResourceClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaim(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ResourceClaim) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._K8s__io___api___core___v1__ResourceClaim(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNK8s__io___api___core___v1__ResourceClaimIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ResourceClaimIn, error) { - res, err := ec.unmarshalInputK8s__io___api___core___v1__ResourceClaimIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNK8s__io___api___core___v1__Taint2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Taint(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1Taint) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -72751,6 +73557,13 @@ func (ec *executionContext) unmarshalOGithub__com___kloudlite___api___apps___inf return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr(ctx, sel, v) +} + func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesGCPSecretCredentials(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsInfraInternalEntitiesGCPSecretCredentials) graphql.Marshaler { if v == nil { return graphql.Null @@ -73472,6 +74285,21 @@ func (ec *executionContext) unmarshalOK8s__io___api___core___v1__LocalVolumeSour return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOK8s__io___api___core___v1__ModifyVolumeStatus2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ModifyVolumeStatus(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ModifyVolumeStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__ModifyVolumeStatus(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__ModifyVolumeStatusIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ModifyVolumeStatusIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ModifyVolumeStatusIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__ModifyVolumeStatusIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) marshalOK8s__io___api___core___v1__NFSVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1NFSVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1NFSVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null @@ -74095,88 +74923,6 @@ func (ec *executionContext) unmarshalOK8s__io___api___core___v1__RBDPersistentVo return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOK8s__io___api___core___v1__ResourceClaim2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.K8sIoAPICoreV1ResourceClaim) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNK8s__io___api___core___v1__ResourceClaim2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaim(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) unmarshalOK8s__io___api___core___v1__ResourceClaimIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimInᚄ(ctx context.Context, v interface{}) ([]*model.K8sIoAPICoreV1ResourceClaimIn, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*model.K8sIoAPICoreV1ResourceClaimIn, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNK8s__io___api___core___v1__ResourceClaimIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceClaimIn(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalOK8s__io___api___core___v1__ResourceRequirements2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirements(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ResourceRequirements) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._K8s__io___api___core___v1__ResourceRequirements(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOK8s__io___api___core___v1__ResourceRequirementsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ResourceRequirementsIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1ResourceRequirementsIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputK8s__io___api___core___v1__ResourceRequirementsIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalOK8s__io___api___core___v1__ScaleIOPersistentVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1ScaleIOPersistentVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1ScaleIOPersistentVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null @@ -74433,6 +75179,21 @@ func (ec *executionContext) unmarshalOK8s__io___api___core___v1__VolumeNodeAffin return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOK8s__io___api___core___v1__VolumeResourceRequirements2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeResourceRequirements(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1VolumeResourceRequirements) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8s__io___api___core___v1__VolumeResourceRequirements(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOK8s__io___api___core___v1__VolumeResourceRequirementsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VolumeResourceRequirementsIn(ctx context.Context, v interface{}) (*model.K8sIoAPICoreV1VolumeResourceRequirementsIn, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputK8s__io___api___core___v1__VolumeResourceRequirementsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) marshalOK8s__io___api___core___v1__VsphereVirtualDiskVolumeSource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1VsphereVirtualDiskVolumeSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sIoAPICoreV1VsphereVirtualDiskVolumeSource) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/apps/infra/internal/app/graph/helmrelease.resolvers.go b/apps/infra/internal/app/graph/helmrelease.resolvers.go index 073ed5f96..63dff8140 100644 --- a/apps/infra/internal/app/graph/helmrelease.resolvers.go +++ b/apps/infra/internal/app/graph/helmrelease.resolvers.go @@ -6,6 +6,7 @@ package graph import ( "context" + "fmt" "github.com/kloudlite/api/pkg/errors" "time" @@ -26,6 +27,11 @@ func (r *helmReleaseResolver) CreationTime(ctx context.Context, obj *entities.He return obj.CreationTime.Format(time.RFC3339), nil } +// DispatchAddr is the resolver for the dispatchAddr field. +func (r *helmReleaseResolver) DispatchAddr(ctx context.Context, obj *entities.HelmRelease) (*model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr, error) { + panic(fmt.Errorf("not implemented: DispatchAddr - dispatchAddr")) +} + // ID is the resolver for the id field. func (r *helmReleaseResolver) ID(ctx context.Context, obj *entities.HelmRelease) (repos.ID, error) { if obj == nil { diff --git a/apps/infra/internal/app/graph/model/models_gen.go b/apps/infra/internal/app/graph/model/models_gen.go index 9314b21eb..cfad554f2 100644 --- a/apps/infra/internal/app/graph/model/models_gen.go +++ b/apps/infra/internal/app/graph/model/models_gen.go @@ -123,6 +123,11 @@ type GithubComKloudliteAPIAppsInfraInternalEntitiesClusterVisbilityIn struct { Mode GithubComKloudliteAPIAppsInfraInternalEntitiesClusterVisibilityMode `json:"mode"` } +type GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr struct { + AccountName string `json:"accountName"` + ClusterName string `json:"clusterName"` +} + type GithubComKloudliteAPIAppsInfraInternalEntitiesGCPSecretCredentials struct { ServiceAccountJSON string `json:"serviceAccountJSON"` } @@ -769,6 +774,16 @@ type K8sIoAPICoreV1LocalVolumeSourceIn struct { Path string `json:"path"` } +type K8sIoAPICoreV1ModifyVolumeStatus struct { + Status K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus `json:"status"` + TargetVolumeAttributesClassName *string `json:"targetVolumeAttributesClassName,omitempty"` +} + +type K8sIoAPICoreV1ModifyVolumeStatusIn struct { + Status K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus `json:"status"` + TargetVolumeAttributesClassName *string `json:"targetVolumeAttributesClassName,omitempty"` +} + type K8sIoAPICoreV1NFSVolumeSource struct { Path string `json:"path"` ReadOnly *bool `json:"readOnly,omitempty"` @@ -894,43 +909,49 @@ type K8sIoAPICoreV1PersistentVolumeClaimConditionIn struct { } type K8sIoAPICoreV1PersistentVolumeClaimSpec struct { - AccessModes []string `json:"accessModes,omitempty"` - DataSource *K8sIoAPICoreV1TypedLocalObjectReference `json:"dataSource,omitempty"` - DataSourceRef *K8sIoAPICoreV1TypedObjectReference `json:"dataSourceRef,omitempty"` - Resources *K8sIoAPICoreV1ResourceRequirements `json:"resources,omitempty"` - Selector *K8sIoApimachineryPkgApisMetaV1LabelSelector `json:"selector,omitempty"` - StorageClassName *string `json:"storageClassName,omitempty"` - VolumeMode *string `json:"volumeMode,omitempty"` - VolumeName *string `json:"volumeName,omitempty"` + AccessModes []string `json:"accessModes,omitempty"` + DataSource *K8sIoAPICoreV1TypedLocalObjectReference `json:"dataSource,omitempty"` + DataSourceRef *K8sIoAPICoreV1TypedObjectReference `json:"dataSourceRef,omitempty"` + Resources *K8sIoAPICoreV1VolumeResourceRequirements `json:"resources,omitempty"` + Selector *K8sIoApimachineryPkgApisMetaV1LabelSelector `json:"selector,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` + VolumeMode *string `json:"volumeMode,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` } type K8sIoAPICoreV1PersistentVolumeClaimSpecIn struct { - AccessModes []string `json:"accessModes,omitempty"` - DataSource *K8sIoAPICoreV1TypedLocalObjectReferenceIn `json:"dataSource,omitempty"` - DataSourceRef *K8sIoAPICoreV1TypedObjectReferenceIn `json:"dataSourceRef,omitempty"` - Resources *K8sIoAPICoreV1ResourceRequirementsIn `json:"resources,omitempty"` - Selector *K8sIoApimachineryPkgApisMetaV1LabelSelectorIn `json:"selector,omitempty"` - StorageClassName *string `json:"storageClassName,omitempty"` - VolumeMode *string `json:"volumeMode,omitempty"` - VolumeName *string `json:"volumeName,omitempty"` + AccessModes []string `json:"accessModes,omitempty"` + DataSource *K8sIoAPICoreV1TypedLocalObjectReferenceIn `json:"dataSource,omitempty"` + DataSourceRef *K8sIoAPICoreV1TypedObjectReferenceIn `json:"dataSourceRef,omitempty"` + Resources *K8sIoAPICoreV1VolumeResourceRequirementsIn `json:"resources,omitempty"` + Selector *K8sIoApimachineryPkgApisMetaV1LabelSelectorIn `json:"selector,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` + VolumeMode *string `json:"volumeMode,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` } type K8sIoAPICoreV1PersistentVolumeClaimStatus struct { - AccessModes []string `json:"accessModes,omitempty"` - AllocatedResources map[string]interface{} `json:"allocatedResources,omitempty"` - AllocatedResourceStatuses map[string]interface{} `json:"allocatedResourceStatuses,omitempty"` - Capacity map[string]interface{} `json:"capacity,omitempty"` - Conditions []*K8sIoAPICoreV1PersistentVolumeClaimCondition `json:"conditions,omitempty"` - Phase *K8sIoAPICoreV1PersistentVolumeClaimPhase `json:"phase,omitempty"` + AccessModes []string `json:"accessModes,omitempty"` + AllocatedResources map[string]interface{} `json:"allocatedResources,omitempty"` + AllocatedResourceStatuses map[string]interface{} `json:"allocatedResourceStatuses,omitempty"` + Capacity map[string]interface{} `json:"capacity,omitempty"` + Conditions []*K8sIoAPICoreV1PersistentVolumeClaimCondition `json:"conditions,omitempty"` + CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty"` + ModifyVolumeStatus *K8sIoAPICoreV1ModifyVolumeStatus `json:"modifyVolumeStatus,omitempty"` + Phase *K8sIoAPICoreV1PersistentVolumeClaimPhase `json:"phase,omitempty"` } type K8sIoAPICoreV1PersistentVolumeClaimStatusIn struct { - AccessModes []string `json:"accessModes,omitempty"` - AllocatedResources map[string]interface{} `json:"allocatedResources,omitempty"` - AllocatedResourceStatuses map[string]interface{} `json:"allocatedResourceStatuses,omitempty"` - Capacity map[string]interface{} `json:"capacity,omitempty"` - Conditions []*K8sIoAPICoreV1PersistentVolumeClaimConditionIn `json:"conditions,omitempty"` - Phase *K8sIoAPICoreV1PersistentVolumeClaimPhase `json:"phase,omitempty"` + AccessModes []string `json:"accessModes,omitempty"` + AllocatedResources map[string]interface{} `json:"allocatedResources,omitempty"` + AllocatedResourceStatuses map[string]interface{} `json:"allocatedResourceStatuses,omitempty"` + Capacity map[string]interface{} `json:"capacity,omitempty"` + Conditions []*K8sIoAPICoreV1PersistentVolumeClaimConditionIn `json:"conditions,omitempty"` + CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty"` + ModifyVolumeStatus *K8sIoAPICoreV1ModifyVolumeStatusIn `json:"modifyVolumeStatus,omitempty"` + Phase *K8sIoAPICoreV1PersistentVolumeClaimPhase `json:"phase,omitempty"` } type K8sIoAPICoreV1PersistentVolumeSpec struct { @@ -962,6 +983,7 @@ type K8sIoAPICoreV1PersistentVolumeSpec struct { ScaleIo *K8sIoAPICoreV1ScaleIOPersistentVolumeSource `json:"scaleIO,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"` Storageos *K8sIoAPICoreV1StorageOSPersistentVolumeSource `json:"storageos,omitempty"` + VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` VolumeMode *string `json:"volumeMode,omitempty"` VsphereVolume *K8sIoAPICoreV1VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty"` } @@ -995,6 +1017,7 @@ type K8sIoAPICoreV1PersistentVolumeSpecIn struct { ScaleIo *K8sIoAPICoreV1ScaleIOPersistentVolumeSourceIn `json:"scaleIO,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"` Storageos *K8sIoAPICoreV1StorageOSPersistentVolumeSourceIn `json:"storageos,omitempty"` + VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` VolumeMode *string `json:"volumeMode,omitempty"` VsphereVolume *K8sIoAPICoreV1VsphereVirtualDiskVolumeSourceIn `json:"vsphereVolume,omitempty"` } @@ -1035,6 +1058,8 @@ type K8sIoAPICoreV1PodAffinityIn struct { type K8sIoAPICoreV1PodAffinityTerm struct { LabelSelector *K8sIoApimachineryPkgApisMetaV1LabelSelector `json:"labelSelector,omitempty"` + MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` + MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"` Namespaces []string `json:"namespaces,omitempty"` NamespaceSelector *K8sIoApimachineryPkgApisMetaV1LabelSelector `json:"namespaceSelector,omitempty"` TopologyKey string `json:"topologyKey"` @@ -1042,6 +1067,8 @@ type K8sIoAPICoreV1PodAffinityTerm struct { type K8sIoAPICoreV1PodAffinityTermIn struct { LabelSelector *K8sIoApimachineryPkgApisMetaV1LabelSelectorIn `json:"labelSelector,omitempty"` + MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` + MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"` Namespaces []string `json:"namespaces,omitempty"` NamespaceSelector *K8sIoApimachineryPkgApisMetaV1LabelSelectorIn `json:"namespaceSelector,omitempty"` TopologyKey string `json:"topologyKey"` @@ -1119,26 +1146,6 @@ type K8sIoAPICoreV1RBDPersistentVolumeSourceIn struct { User *string `json:"user,omitempty"` } -type K8sIoAPICoreV1ResourceClaim struct { - Name string `json:"name"` -} - -type K8sIoAPICoreV1ResourceClaimIn struct { - Name string `json:"name"` -} - -type K8sIoAPICoreV1ResourceRequirements struct { - Claims []*K8sIoAPICoreV1ResourceClaim `json:"claims,omitempty"` - Limits map[string]interface{} `json:"limits,omitempty"` - Requests map[string]interface{} `json:"requests,omitempty"` -} - -type K8sIoAPICoreV1ResourceRequirementsIn struct { - Claims []*K8sIoAPICoreV1ResourceClaimIn `json:"claims,omitempty"` - Limits map[string]interface{} `json:"limits,omitempty"` - Requests map[string]interface{} `json:"requests,omitempty"` -} - type K8sIoAPICoreV1ScaleIOPersistentVolumeSource struct { FsType *string `json:"fsType,omitempty"` Gateway string `json:"gateway"` @@ -1255,6 +1262,16 @@ type K8sIoAPICoreV1VolumeNodeAffinityIn struct { Required *K8sIoAPICoreV1NodeSelectorIn `json:"required,omitempty"` } +type K8sIoAPICoreV1VolumeResourceRequirements struct { + Limits map[string]interface{} `json:"limits,omitempty"` + Requests map[string]interface{} `json:"requests,omitempty"` +} + +type K8sIoAPICoreV1VolumeResourceRequirementsIn struct { + Limits map[string]interface{} `json:"limits,omitempty"` + Requests map[string]interface{} `json:"requests,omitempty"` +} + type K8sIoAPICoreV1VsphereVirtualDiskVolumeSource struct { FsType *string `json:"fsType,omitempty"` StoragePolicyID *string `json:"storagePolicyID,omitempty"` @@ -1971,17 +1988,21 @@ type K8sIoAPICoreV1PersistentVolumeClaimConditionType string const ( K8sIoAPICoreV1PersistentVolumeClaimConditionTypeFileSystemResizePending K8sIoAPICoreV1PersistentVolumeClaimConditionType = "FileSystemResizePending" + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeModifyingVolume K8sIoAPICoreV1PersistentVolumeClaimConditionType = "ModifyingVolume" + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeModifyVolumeError K8sIoAPICoreV1PersistentVolumeClaimConditionType = "ModifyVolumeError" K8sIoAPICoreV1PersistentVolumeClaimConditionTypeResizing K8sIoAPICoreV1PersistentVolumeClaimConditionType = "Resizing" ) var AllK8sIoAPICoreV1PersistentVolumeClaimConditionType = []K8sIoAPICoreV1PersistentVolumeClaimConditionType{ K8sIoAPICoreV1PersistentVolumeClaimConditionTypeFileSystemResizePending, + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeModifyingVolume, + K8sIoAPICoreV1PersistentVolumeClaimConditionTypeModifyVolumeError, K8sIoAPICoreV1PersistentVolumeClaimConditionTypeResizing, } func (e K8sIoAPICoreV1PersistentVolumeClaimConditionType) IsValid() bool { switch e { - case K8sIoAPICoreV1PersistentVolumeClaimConditionTypeFileSystemResizePending, K8sIoAPICoreV1PersistentVolumeClaimConditionTypeResizing: + case K8sIoAPICoreV1PersistentVolumeClaimConditionTypeFileSystemResizePending, K8sIoAPICoreV1PersistentVolumeClaimConditionTypeModifyingVolume, K8sIoAPICoreV1PersistentVolumeClaimConditionTypeModifyVolumeError, K8sIoAPICoreV1PersistentVolumeClaimConditionTypeResizing: return true } return false @@ -2008,6 +2029,49 @@ func (e K8sIoAPICoreV1PersistentVolumeClaimConditionType) MarshalGQL(w io.Writer fmt.Fprint(w, strconv.Quote(e.String())) } +type K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus string + +const ( + K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusInfeasible K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus = "Infeasible" + K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusInProgress K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus = "InProgress" + K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusPending K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus = "Pending" +) + +var AllK8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus = []K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus{ + K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusInfeasible, + K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusInProgress, + K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusPending, +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus) IsValid() bool { + switch e { + case K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusInfeasible, K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusInProgress, K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatusPending: + return true + } + return false +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus) String() string { + return string(e) +} + +func (e *K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus", str) + } + return nil +} + +func (e K8sIoAPICoreV1PersistentVolumeClaimModifyVolumeStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type K8sIoAPICoreV1PersistentVolumeClaimPhase string const ( diff --git a/apps/infra/internal/app/graph/nodepool.resolvers.go b/apps/infra/internal/app/graph/nodepool.resolvers.go index e59d72f8d..eb55c2ff2 100644 --- a/apps/infra/internal/app/graph/nodepool.resolvers.go +++ b/apps/infra/internal/app/graph/nodepool.resolvers.go @@ -6,6 +6,7 @@ package graph import ( "context" + "fmt" "github.com/kloudlite/api/pkg/errors" "time" @@ -25,6 +26,11 @@ func (r *nodePoolResolver) CreationTime(ctx context.Context, obj *entities.NodeP return obj.CreationTime.Format(time.RFC3339), nil } +// DispatchAddr is the resolver for the dispatchAddr field. +func (r *nodePoolResolver) DispatchAddr(ctx context.Context, obj *entities.NodePool) (*model.GithubComKloudliteAPIAppsInfraInternalEntitiesDispatchAddr, error) { + panic(fmt.Errorf("not implemented: DispatchAddr - dispatchAddr")) +} + // ID is the resolver for the id field. func (r *nodePoolResolver) ID(ctx context.Context, obj *entities.NodePool) (repos.ID, error) { if obj == nil { diff --git a/apps/infra/internal/app/graph/struct-to-graphql/cluster.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/cluster.graphqls index 027ac9df5..529a504a2 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/cluster.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/cluster.graphqls @@ -11,6 +11,7 @@ type Cluster @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata! @goField(name: "objectMeta") + ownedBy: String recordVersion: Int! spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec! status: Github__com___kloudlite___operator___pkg___operator__Status @@ -35,6 +36,7 @@ input ClusterIn { globalVPN: String kind: String metadata: MetadataIn! + ownedBy: String spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecIn! } diff --git a/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls index 75bc292fb..085b7793e 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -25,6 +25,11 @@ type Github__com___kloudlite___api___apps___infra___internal___entities__Cluster publicEndpoint: String } +type Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr @shareable { + accountName: String! + clusterName: String! +} + type Github__com___kloudlite___api___apps___infra___internal___entities__GCPSecretCredentials @shareable { serviceAccountJSON: String! } @@ -453,6 +458,11 @@ type K8s__io___api___core___v1__LocalVolumeSource @shareable { path: String! } +type K8s__io___api___core___v1__ModifyVolumeStatus @shareable { + status: K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus! + targetVolumeAttributesClassName: String +} + type K8s__io___api___core___v1__NFSVolumeSource @shareable { path: String! readOnly: Boolean @@ -519,9 +529,10 @@ type K8s__io___api___core___v1__PersistentVolumeClaimSpec @shareable { accessModes: [String!] dataSource: K8s__io___api___core___v1__TypedLocalObjectReference dataSourceRef: K8s__io___api___core___v1__TypedObjectReference - resources: K8s__io___api___core___v1__ResourceRequirements + resources: K8s__io___api___core___v1__VolumeResourceRequirements selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector storageClassName: String + volumeAttributesClassName: String volumeMode: String volumeName: String } @@ -532,6 +543,8 @@ type K8s__io___api___core___v1__PersistentVolumeClaimStatus @shareable { allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimCondition!] + currentVolumeAttributesClassName: String + modifyVolumeStatus: K8s__io___api___core___v1__ModifyVolumeStatus phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase } @@ -564,6 +577,7 @@ type K8s__io___api___core___v1__PersistentVolumeSpec @shareable { scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSource storageClassName: String storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSource + volumeAttributesClassName: String volumeMode: String vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource } @@ -587,6 +601,8 @@ type K8s__io___api___core___v1__PodAffinity @shareable { type K8s__io___api___core___v1__PodAffinityTerm @shareable { labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector + matchLabelKeys: [String!] + mismatchLabelKeys: [String!] namespaces: [String!] namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector topologyKey: String! @@ -628,16 +644,6 @@ type K8s__io___api___core___v1__RBDPersistentVolumeSource @shareable { user: String } -type K8s__io___api___core___v1__ResourceClaim @shareable { - name: String! -} - -type K8s__io___api___core___v1__ResourceRequirements @shareable { - claims: [K8s__io___api___core___v1__ResourceClaim!] - limits: Map - requests: Map -} - type K8s__io___api___core___v1__ScaleIOPersistentVolumeSource @shareable { fsType: String gateway: String! @@ -696,6 +702,11 @@ type K8s__io___api___core___v1__VolumeNodeAffinity @shareable { required: K8s__io___api___core___v1__NodeSelector } +type K8s__io___api___core___v1__VolumeResourceRequirements @shareable { + limits: Map + requests: Map +} + type K8s__io___api___core___v1__VsphereVirtualDiskVolumeSource @shareable { fsType: String storagePolicyID: String @@ -1013,6 +1024,11 @@ input K8s__io___api___core___v1__LocalVolumeSourceIn { path: String! } +input K8s__io___api___core___v1__ModifyVolumeStatusIn { + status: K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus! + targetVolumeAttributesClassName: String +} + input K8s__io___api___core___v1__NFSVolumeSourceIn { path: String! readOnly: Boolean @@ -1079,9 +1095,10 @@ input K8s__io___api___core___v1__PersistentVolumeClaimSpecIn { accessModes: [String!] dataSource: K8s__io___api___core___v1__TypedLocalObjectReferenceIn dataSourceRef: K8s__io___api___core___v1__TypedObjectReferenceIn - resources: K8s__io___api___core___v1__ResourceRequirementsIn + resources: K8s__io___api___core___v1__VolumeResourceRequirementsIn selector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn storageClassName: String + volumeAttributesClassName: String volumeMode: String volumeName: String } @@ -1092,6 +1109,8 @@ input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn { allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimConditionIn!] + currentVolumeAttributesClassName: String + modifyVolumeStatus: K8s__io___api___core___v1__ModifyVolumeStatusIn phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase } @@ -1124,6 +1143,7 @@ input K8s__io___api___core___v1__PersistentVolumeSpecIn { scaleIO: K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn storageClassName: String storageos: K8s__io___api___core___v1__StorageOSPersistentVolumeSourceIn + volumeAttributesClassName: String volumeMode: String vsphereVolume: K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn } @@ -1147,6 +1167,8 @@ input K8s__io___api___core___v1__PodAffinityIn { input K8s__io___api___core___v1__PodAffinityTermIn { labelSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn + matchLabelKeys: [String!] + mismatchLabelKeys: [String!] namespaces: [String!] namespaceSelector: K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorIn topologyKey: String! @@ -1188,16 +1210,6 @@ input K8s__io___api___core___v1__RBDPersistentVolumeSourceIn { user: String } -input K8s__io___api___core___v1__ResourceClaimIn { - name: String! -} - -input K8s__io___api___core___v1__ResourceRequirementsIn { - claims: [K8s__io___api___core___v1__ResourceClaimIn!] - limits: Map - requests: Map -} - input K8s__io___api___core___v1__ScaleIOPersistentVolumeSourceIn { fsType: String gateway: String! @@ -1256,6 +1268,11 @@ input K8s__io___api___core___v1__VolumeNodeAffinityIn { required: K8s__io___api___core___v1__NodeSelectorIn } +input K8s__io___api___core___v1__VolumeResourceRequirementsIn { + limits: Map + requests: Map +} + input K8s__io___api___core___v1__VsphereVirtualDiskVolumeSourceIn { fsType: String storagePolicyID: String @@ -1404,9 +1421,17 @@ enum K8s__io___api___core___v1__NodeSelectorOperator { enum K8s__io___api___core___v1__PersistentVolumeClaimConditionType { FileSystemResizePending + ModifyingVolume + ModifyVolumeError Resizing } +enum K8s__io___api___core___v1__PersistentVolumeClaimModifyVolumeStatus { + Infeasible + InProgress + Pending +} + enum K8s__io___api___core___v1__PersistentVolumeClaimPhase { Bound Lost diff --git a/apps/infra/internal/app/graph/struct-to-graphql/helmrelease.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/helmrelease.graphqls index c99dec297..fa05613d0 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/helmrelease.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/helmrelease.graphqls @@ -4,6 +4,7 @@ type HelmRelease @shareable { clusterName: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! + dispatchAddr: Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr displayName: String! id: ID! kind: String diff --git a/apps/infra/internal/app/graph/struct-to-graphql/nodepool.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/nodepool.graphqls index 4a956681a..aaa4a71d8 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/nodepool.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/nodepool.graphqls @@ -4,6 +4,7 @@ type NodePool @shareable { clusterName: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! + dispatchAddr: Github__com___kloudlite___api___apps___infra___internal___entities__DispatchAddr displayName: String! id: ID! kind: String diff --git a/apps/infra/internal/domain/clusters.go b/apps/infra/internal/domain/clusters.go index 372e01a1c..16faad548 100644 --- a/apps/infra/internal/domain/clusters.go +++ b/apps/infra/internal/domain/clusters.go @@ -14,6 +14,7 @@ import ( fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" "github.com/kloudlite/api/common" "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/constants" "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" ct "github.com/kloudlite/operator/apis/common-types" "github.com/kloudlite/operator/operators/resource-watcher/types" @@ -166,6 +167,14 @@ func (d *domain) CreateCluster(ctx InfraContext, cluster entities.Cluster) (*ent return nil, ErrClusterAlreadyExists{ClusterName: cluster.Name, AccountName: ctx.AccountName} } + if s, ok := cluster.GetLabels()[constants.ClusterLabelOwnedBy]; ok { + if s != string(ctx.UserId) { + return nil, errors.Newf("provided wrong owner for cluster %q, expected %q", cluster.Name, ctx.UserId) + } + + cluster.OwnedBy = &s + } + cluster.AccountName = ctx.AccountName out, err := d.accountsSvc.GetAccount(ctx, string(ctx.UserId), ctx.AccountName) if err != nil { diff --git a/apps/infra/internal/entities/cluster.go b/apps/infra/internal/entities/cluster.go index ff6c0a323..3deda8549 100644 --- a/apps/infra/internal/entities/cluster.go +++ b/apps/infra/internal/entities/cluster.go @@ -26,7 +26,7 @@ type Cluster struct { LastOnlineAt *time.Time `json:"lastOnlineAt,omitempty" graphql:"noinput"` - OwnedBy *string `json:"ownedBy,omitempty"` + OwnedBy *string `json:"ownedBy,omitempty", graphql:"noinput"` } func (c *Cluster) GetDisplayName() string { diff --git a/apps/infra/protobufs/infra/infra.pb.go b/apps/infra/protobufs/infra/infra.pb.go index 2ce67f1b3..6dad93d3f 100644 --- a/apps/infra/protobufs/infra/infra.pb.go +++ b/apps/infra/protobufs/infra/infra.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v5.28.1 +// protoc-gen-go v1.32.0 +// protoc v4.24.4 // source: infra.proto package infra diff --git a/apps/infra/protobufs/infra/infra_grpc.pb.go b/apps/infra/protobufs/infra/infra_grpc.pb.go index a2add32cd..1d2d625c6 100644 --- a/apps/infra/protobufs/infra/infra_grpc.pb.go +++ b/apps/infra/protobufs/infra/infra_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v5.28.1 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 // source: infra.proto package infra @@ -18,6 +18,15 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Infra_GetCluster_FullMethodName = "/Infra/GetCluster" + Infra_GetNodepool_FullMethodName = "/Infra/GetNodepool" + Infra_ClusterExists_FullMethodName = "/Infra/ClusterExists" + Infra_GetClusterKubeconfig_FullMethodName = "/Infra/GetClusterKubeconfig" + Infra_MarkClusterOnlineAt_FullMethodName = "/Infra/MarkClusterOnlineAt" + Infra_EnsureGlobalVPNConnection_FullMethodName = "/Infra/EnsureGlobalVPNConnection" +) + // InfraClient is the client API for Infra service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -40,7 +49,7 @@ func NewInfraClient(cc grpc.ClientConnInterface) InfraClient { func (c *infraClient) GetCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) { out := new(GetClusterOut) - err := c.cc.Invoke(ctx, "/Infra/GetCluster", in, out, opts...) + err := c.cc.Invoke(ctx, Infra_GetCluster_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -49,7 +58,7 @@ func (c *infraClient) GetCluster(ctx context.Context, in *GetClusterIn, opts ... func (c *infraClient) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts ...grpc.CallOption) (*GetNodepoolOut, error) { out := new(GetNodepoolOut) - err := c.cc.Invoke(ctx, "/Infra/GetNodepool", in, out, opts...) + err := c.cc.Invoke(ctx, Infra_GetNodepool_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -58,7 +67,7 @@ func (c *infraClient) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts . func (c *infraClient) ClusterExists(ctx context.Context, in *ClusterExistsIn, opts ...grpc.CallOption) (*ClusterExistsOut, error) { out := new(ClusterExistsOut) - err := c.cc.Invoke(ctx, "/Infra/ClusterExists", in, out, opts...) + err := c.cc.Invoke(ctx, Infra_ClusterExists_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -67,7 +76,7 @@ func (c *infraClient) ClusterExists(ctx context.Context, in *ClusterExistsIn, op func (c *infraClient) GetClusterKubeconfig(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterKubeconfigOut, error) { out := new(GetClusterKubeconfigOut) - err := c.cc.Invoke(ctx, "/Infra/GetClusterKubeconfig", in, out, opts...) + err := c.cc.Invoke(ctx, Infra_GetClusterKubeconfig_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -76,7 +85,7 @@ func (c *infraClient) GetClusterKubeconfig(ctx context.Context, in *GetClusterIn func (c *infraClient) MarkClusterOnlineAt(ctx context.Context, in *MarkClusterOnlineAtIn, opts ...grpc.CallOption) (*MarkClusterOnlineAtOut, error) { out := new(MarkClusterOnlineAtOut) - err := c.cc.Invoke(ctx, "/Infra/MarkClusterOnlineAt", in, out, opts...) + err := c.cc.Invoke(ctx, Infra_MarkClusterOnlineAt_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -85,7 +94,7 @@ func (c *infraClient) MarkClusterOnlineAt(ctx context.Context, in *MarkClusterOn func (c *infraClient) EnsureGlobalVPNConnection(ctx context.Context, in *EnsureGlobalVPNConnectionIn, opts ...grpc.CallOption) (*EnsureGlobalVPNConnectionOut, error) { out := new(EnsureGlobalVPNConnectionOut) - err := c.cc.Invoke(ctx, "/Infra/EnsureGlobalVPNConnection", in, out, opts...) + err := c.cc.Invoke(ctx, Infra_EnsureGlobalVPNConnection_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -150,7 +159,7 @@ func _Infra_GetCluster_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Infra/GetCluster", + FullMethod: Infra_GetCluster_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetCluster(ctx, req.(*GetClusterIn)) @@ -168,7 +177,7 @@ func _Infra_GetNodepool_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Infra/GetNodepool", + FullMethod: Infra_GetNodepool_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetNodepool(ctx, req.(*GetNodepoolIn)) @@ -186,7 +195,7 @@ func _Infra_ClusterExists_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Infra/ClusterExists", + FullMethod: Infra_ClusterExists_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).ClusterExists(ctx, req.(*ClusterExistsIn)) @@ -204,7 +213,7 @@ func _Infra_GetClusterKubeconfig_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Infra/GetClusterKubeconfig", + FullMethod: Infra_GetClusterKubeconfig_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetClusterKubeconfig(ctx, req.(*GetClusterIn)) @@ -222,7 +231,7 @@ func _Infra_MarkClusterOnlineAt_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Infra/MarkClusterOnlineAt", + FullMethod: Infra_MarkClusterOnlineAt_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).MarkClusterOnlineAt(ctx, req.(*MarkClusterOnlineAtIn)) @@ -240,7 +249,7 @@ func _Infra_EnsureGlobalVPNConnection_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Infra/EnsureGlobalVPNConnection", + FullMethod: Infra_EnsureGlobalVPNConnection_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).EnsureGlobalVPNConnection(ctx, req.(*EnsureGlobalVPNConnectionIn)) From b6de13cd9447d595465e265d955f93ca59b1df58 Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Thu, 26 Sep 2024 19:01:59 +0530 Subject: [PATCH 5/7] :construction: Changed to byok --- .../adapters/infra-service/infra-service.go | 2 +- apps/console/internal/domain/environment.go | 2 +- .../internal/domain/ports/infra-service.go | 2 +- .../internal/app/graph/generated/generated.go | 71 +++++++++++++++- .../struct-to-graphql/byokcluster.graphqls | 2 + apps/infra/internal/app/grpc-server.go | 28 +++++++ apps/infra/internal/domain/byok-clusters.go | 19 ++++- apps/infra/internal/entities/byok-cluster.go | 8 ++ .../field-constants/generated_constants.go | 1 + apps/infra/protobufs/infra.proto | 1 + apps/infra/protobufs/infra/infra.pb.go | 83 ++++++++++--------- apps/infra/protobufs/infra/infra_grpc.pb.go | 73 +++++++++++----- 12 files changed, 225 insertions(+), 67 deletions(-) diff --git a/apps/console/internal/app/adapters/infra-service/infra-service.go b/apps/console/internal/app/adapters/infra-service/infra-service.go index 419460f8f..df0ba16f6 100644 --- a/apps/console/internal/app/adapters/infra-service/infra-service.go +++ b/apps/console/internal/app/adapters/infra-service/infra-service.go @@ -30,7 +30,7 @@ func (s *InfraService) EnsureGlobalVPNConnection(ctx context.Context, args ports return nil } -func (s *InfraService) GetClusterOwnedBy(ctx context.Context, args ports.IsClusterLabelsIn) (string, error) { +func (s *InfraService) GetByokClusterOwnedBy(ctx context.Context, args ports.IsClusterLabelsIn) (string, error) { cl, err := s.infraClient.GetCluster(ctx, &infra.GetClusterIn{ UserId: args.UserId, UserName: args.UserName, diff --git a/apps/console/internal/domain/environment.go b/apps/console/internal/domain/environment.go index 3226aecde..cb813d269 100644 --- a/apps/console/internal/domain/environment.go +++ b/apps/console/internal/domain/environment.go @@ -143,7 +143,7 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, env entities.Environment) return nil, fmt.Errorf("clustername must be set while creating environments") } - ownedBy, err := d.infraSvc.GetClusterOwnedBy(ctx, ports.IsClusterLabelsIn{ + ownedBy, err := d.infraSvc.GetByokClusterOwnedBy(ctx, ports.IsClusterLabelsIn{ UserId: string(ctx.UserId), UserEmail: ctx.UserEmail, UserName: ctx.UserName, diff --git a/apps/console/internal/domain/ports/infra-service.go b/apps/console/internal/domain/ports/infra-service.go index 6f39759ff..052ada408 100644 --- a/apps/console/internal/domain/ports/infra-service.go +++ b/apps/console/internal/domain/ports/infra-service.go @@ -4,7 +4,7 @@ import "context" type InfraService interface { EnsureGlobalVPNConnection(ctx context.Context, args EnsureGlobalVPNConnectionIn) error - GetClusterOwnedBy(ctx context.Context, args IsClusterLabelsIn) (string, error) + GetByokClusterOwnedBy(ctx context.Context, args IsClusterLabelsIn) (string, error) } type IsClusterLabelsIn struct { diff --git a/apps/infra/internal/app/graph/generated/generated.go b/apps/infra/internal/app/graph/generated/generated.go index 014e26a20..a817e42bf 100644 --- a/apps/infra/internal/app/graph/generated/generated.go +++ b/apps/infra/internal/app/graph/generated/generated.go @@ -102,6 +102,7 @@ type ComplexityRoot struct { MarkedForDeletion func(childComplexity int) int MessageQueueTopicName func(childComplexity int) int ObjectMeta func(childComplexity int) int + OwnedBy func(childComplexity int) int RecordVersion func(childComplexity int) int SyncStatus func(childComplexity int) int UpdateTime func(childComplexity int) int @@ -1595,6 +1596,7 @@ type VolumeAttachmentResolver interface { type BYOKClusterInResolver interface { Metadata(ctx context.Context, obj *entities.BYOKCluster, data *v1.ObjectMeta) error + Visibility(ctx context.Context, obj *entities.BYOKCluster, data *model.GithubComKloudliteAPIAppsInfraInternalEntitiesClusterVisbilityIn) error } type CloudProviderSecretInResolver interface { @@ -1760,6 +1762,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.BYOKCluster.ObjectMeta(childComplexity), true + case "BYOKCluster.ownedBy": + if e.complexity.BYOKCluster.OwnedBy == nil { + break + } + + return e.complexity.BYOKCluster.OwnedBy(childComplexity), true + case "BYOKCluster.recordVersion": if e.complexity.BYOKCluster.RecordVersion == nil { break @@ -8136,6 +8145,7 @@ extend type GlobalVPNDevice { markedForDeletion: Boolean messageQueueTopicName: String! metadata: Metadata! @goField(name: "objectMeta") + ownedBy: String recordVersion: Int! syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! @@ -8156,6 +8166,7 @@ type BYOKClusterPaginatedRecords @shareable { input BYOKClusterIn { displayName: String! metadata: MetadataIn! + ownedBy: String visibility: Github__com___kloudlite___api___apps___infra___internal___entities__ClusterVisbilityIn! } @@ -12057,6 +12068,47 @@ func (ec *executionContext) fieldContext_BYOKCluster_metadata(_ context.Context, return fc, nil } +func (ec *executionContext) _BYOKCluster_ownedBy(ctx context.Context, field graphql.CollectedField, obj *entities.BYOKCluster) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BYOKCluster_ownedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BYOKCluster_ownedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BYOKCluster", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _BYOKCluster_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.BYOKCluster) (ret graphql.Marshaler) { fc, err := ec.fieldContext_BYOKCluster_recordVersion(ctx, field) if err != nil { @@ -12406,6 +12458,8 @@ func (ec *executionContext) fieldContext_BYOKClusterEdge_node(_ context.Context, return ec.fieldContext_BYOKCluster_messageQueueTopicName(ctx, field) case "metadata": return ec.fieldContext_BYOKCluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_BYOKCluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_BYOKCluster_recordVersion(ctx, field) case "syncStatus": @@ -41593,6 +41647,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_createBYOKCluster(ctx co return ec.fieldContext_BYOKCluster_messageQueueTopicName(ctx, field) case "metadata": return ec.fieldContext_BYOKCluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_BYOKCluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_BYOKCluster_recordVersion(ctx, field) case "syncStatus": @@ -41709,6 +41765,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_updateBYOKCluster(ctx co return ec.fieldContext_BYOKCluster_messageQueueTopicName(ctx, field) case "metadata": return ec.fieldContext_BYOKCluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_BYOKCluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_BYOKCluster_recordVersion(ctx, field) case "syncStatus": @@ -48892,6 +48950,8 @@ func (ec *executionContext) fieldContext_Query_infra_getBYOKCluster(ctx context. return ec.fieldContext_BYOKCluster_messageQueueTopicName(ctx, field) case "metadata": return ec.fieldContext_BYOKCluster_metadata(ctx, field) + case "ownedBy": + return ec.fieldContext_BYOKCluster_ownedBy(ctx, field) case "recordVersion": return ec.fieldContext_BYOKCluster_recordVersion(ctx, field) case "syncStatus": @@ -54211,7 +54271,7 @@ func (ec *executionContext) unmarshalInputBYOKClusterIn(ctx context.Context, obj asMap[k] = v } - fieldsInOrder := [...]string{"displayName", "metadata", "visibility"} + fieldsInOrder := [...]string{"displayName", "metadata", "ownedBy", "visibility"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -54234,6 +54294,13 @@ func (ec *executionContext) unmarshalInputBYOKClusterIn(ctx context.Context, obj if err = ec.resolvers.BYOKClusterIn().Metadata(ctx, &it, data); err != nil { return it, err } + case "ownedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnedBy = data case "visibility": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibility")) data, err := ec.unmarshalNGithub__com___kloudlite___api___apps___infra___internal___entities__ClusterVisbilityIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsInfraInternalEntitiesClusterVisbilityIn(ctx, v) @@ -59401,6 +59468,8 @@ func (ec *executionContext) _BYOKCluster(ctx context.Context, sel ast.SelectionS if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "ownedBy": + out.Values[i] = ec._BYOKCluster_ownedBy(ctx, field, obj) case "recordVersion": out.Values[i] = ec._BYOKCluster_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { diff --git a/apps/infra/internal/app/graph/struct-to-graphql/byokcluster.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/byokcluster.graphqls index 113a14d98..2a9038a5b 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/byokcluster.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/byokcluster.graphqls @@ -12,6 +12,7 @@ type BYOKCluster @shareable { markedForDeletion: Boolean messageQueueTopicName: String! metadata: Metadata! @goField(name: "objectMeta") + ownedBy: String recordVersion: Int! syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! @@ -32,6 +33,7 @@ type BYOKClusterPaginatedRecords @shareable { input BYOKClusterIn { displayName: String! metadata: MetadataIn! + ownedBy: String visibility: Github__com___kloudlite___api___apps___infra___internal___entities__ClusterVisbilityIn! } diff --git a/apps/infra/internal/app/grpc-server.go b/apps/infra/internal/app/grpc-server.go index 6c5fd412f..468749176 100644 --- a/apps/infra/internal/app/grpc-server.go +++ b/apps/infra/internal/app/grpc-server.go @@ -69,6 +69,34 @@ func (g *grpcServer) GetClusterKubeconfig(ctx context.Context, in *infra.GetClus return &infra.GetClusterKubeconfigOut{Kubeconfig: creds.Data[c.Spec.Output.KeyKubeconfig]}, nil } +// GetCluster implements infra.InfraServer. +func (g *grpcServer) GetByokCluster(ctx context.Context, in *infra.GetClusterIn) (*infra.GetClusterOut, error) { + infraCtx := domain.InfraContext{ + Context: ctx, + UserId: repos.ID(in.UserId), + UserEmail: in.UserEmail, + UserName: in.UserName, + AccountName: in.AccountName, + } + c, err := g.d.GetBYOKCluster(infraCtx, in.ClusterName) + if err != nil { + return nil, errors.NewE(err) + } + + if c == nil { + return nil, errors.Newf("cluster %s not found", in.ClusterName) + } + + return &infra.GetClusterOut{ + OwnedBy: func() string { + if c.OwnedBy != nil { + return *c.OwnedBy + } + return "" + }(), + }, nil +} + // GetCluster implements infra.InfraServer. func (g *grpcServer) GetCluster(ctx context.Context, in *infra.GetClusterIn) (*infra.GetClusterOut, error) { infraCtx := domain.InfraContext{ diff --git a/apps/infra/internal/domain/byok-clusters.go b/apps/infra/internal/domain/byok-clusters.go index 83575b958..e6fcf2fb6 100644 --- a/apps/infra/internal/domain/byok-clusters.go +++ b/apps/infra/internal/domain/byok-clusters.go @@ -10,6 +10,7 @@ import ( fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" "github.com/kloudlite/api/common" "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/constants" "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/console" "github.com/kloudlite/api/pkg/errors" fn "github.com/kloudlite/api/pkg/functions" @@ -63,6 +64,14 @@ func (d *domain) CreateBYOKCluster(ctx InfraContext, cluster entities.BYOKCluste return nil, errors.NewE(err) } + if s, ok := cluster.GetLabels()[constants.ClusterLabelOwnedBy]; ok { + if s != string(ctx.UserId) { + return nil, errors.Newf("provided wrong owner for cluster %q, expected %q", cluster.Name, ctx.UserId) + } + + cluster.OwnedBy = &s + } + cluster.Namespace = accNs if cluster.GlobalVPN == "" { @@ -147,7 +156,15 @@ func (d *domain) ListBYOKCluster(ctx InfraContext, search map[string]repos.Match return nil, errors.NewE(err) } - pRecords, err := d.byokClusterRepo.FindPaginated(ctx, d.byokClusterRepo.MergeMatchFilters(entities.ListBYOKClusterFilter(ctx.AccountName), search), pagination) + f := repos.Filter{ + fields.AccountName: ctx.AccountName, + "$or": []map[string]any{ + {fc.BYOKClusterOwnedBy: ctx.UserId}, + {fc.BYOKClusterOwnedBy: nil}, + }, + } + + pRecords, err := d.byokClusterRepo.FindPaginated(ctx, d.byokClusterRepo.MergeMatchFilters(f, search), pagination) if err != nil { return nil, errors.NewE(err) } diff --git a/apps/infra/internal/entities/byok-cluster.go b/apps/infra/internal/entities/byok-cluster.go index 5e8387340..d1cc08186 100644 --- a/apps/infra/internal/entities/byok-cluster.go +++ b/apps/infra/internal/entities/byok-cluster.go @@ -44,6 +44,8 @@ type BYOKCluster struct { Kubeconfig t.EncodedString `json:"kubeconfig" graphql:"ignore"` LastOnlineAt *time.Time `json:"lastOnlineAt,omitempty" graphql:"noinput"` + + OwnedBy *string `json:"ownedBy,omitempty", graphql:"noinput"` } func (c *BYOKCluster) GetDisplayName() string { @@ -71,6 +73,12 @@ var BYOKClusterIndices = []repos.IndexField{ }, Unique: true, }, + { + Field: []repos.IndexKey{ + {Key: fc.BYOKClusterOwnedBy, Value: repos.IndexAsc}, + }, + Unique: false, + }, } func UniqueBYOKClusterFilter(accountName string, clusterName string) repos.Filter { diff --git a/apps/infra/internal/entities/field-constants/generated_constants.go b/apps/infra/internal/entities/field-constants/generated_constants.go index 84829baf6..0a7638ffd 100644 --- a/apps/infra/internal/entities/field-constants/generated_constants.go +++ b/apps/infra/internal/entities/field-constants/generated_constants.go @@ -44,6 +44,7 @@ const ( BYOKClusterKubeconfigValue = "kubeconfig.value" BYOKClusterLastOnlineAt = "lastOnlineAt" BYOKClusterMessageQueueTopicName = "messageQueueTopicName" + BYOKClusterOwnedBy = "ownedBy" BYOKClusterVisibility = "visibility" BYOKClusterVisibilityMode = "visibility.mode" BYOKClusterVisibilityPublicEndpoint = "visibility.publicEndpoint" diff --git a/apps/infra/protobufs/infra.proto b/apps/infra/protobufs/infra.proto index efe128fc9..a6c8cc719 100644 --- a/apps/infra/protobufs/infra.proto +++ b/apps/infra/protobufs/infra.proto @@ -6,6 +6,7 @@ option go_package = "./infra"; service Infra { rpc GetCluster(GetClusterIn) returns (GetClusterOut); + rpc GetByokCluster(GetClusterIn) returns (GetClusterOut); rpc GetNodepool(GetNodepoolIn) returns (GetNodepoolOut); rpc ClusterExists(ClusterExistsIn) returns (ClusterExistsOut); rpc GetClusterKubeconfig(GetClusterIn) returns (GetClusterKubeconfigOut); diff --git a/apps/infra/protobufs/infra/infra.pb.go b/apps/infra/protobufs/infra/infra.pb.go index 6dad93d3f..38d96839c 100644 --- a/apps/infra/protobufs/infra/infra.pb.go +++ b/apps/infra/protobufs/infra/infra.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v4.24.4 +// protoc-gen-go v1.30.0 +// protoc v5.28.1 // source: infra.proto package infra @@ -834,32 +834,35 @@ var file_infra_proto_rawDesc = []byte{ 0x68, 0x41, 0x64, 0x64, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, - 0x32, 0xfd, 0x02, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x47, 0x65, + 0x32, 0xae, 0x03, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, - 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, - 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, - 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x10, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x49, 0x6e, 0x1a, 0x11, 0x2e, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x3f, 0x0a, - 0x14, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x75, 0x74, 0x12, 0x46, - 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, - 0x69, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x16, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x49, 0x6e, 0x1a, 0x17, 0x2e, - 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, - 0x65, 0x41, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x58, 0x0a, 0x19, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, - 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, - 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x1a, 0x1d, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, - 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, - 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x79, + 0x6f, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x12, 0x2e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x70, 0x6f, 0x6f, 0x6c, 0x4f, 0x75, 0x74, 0x12, 0x34, 0x0a, 0x0d, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x10, 0x2e, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x49, 0x6e, 0x1a, 0x11, 0x2e, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x3f, + 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0d, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x6e, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x75, 0x74, 0x12, + 0x46, 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, + 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x16, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x49, 0x6e, 0x1a, 0x17, + 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x41, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x58, 0x0a, 0x19, 0x45, 0x6e, 0x73, 0x75, 0x72, + 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x6e, 0x1a, 0x1d, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x56, 0x50, 0x4e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, + 0x74, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -892,19 +895,21 @@ var file_infra_proto_goTypes = []interface{}{ var file_infra_proto_depIdxs = []int32{ 11, // 0: MarkClusterOnlineAtIn.timestamp:type_name -> google.protobuf.Timestamp 0, // 1: Infra.GetCluster:input_type -> GetClusterIn - 2, // 2: Infra.GetNodepool:input_type -> GetNodepoolIn - 4, // 3: Infra.ClusterExists:input_type -> ClusterExistsIn - 0, // 4: Infra.GetClusterKubeconfig:input_type -> GetClusterIn - 7, // 5: Infra.MarkClusterOnlineAt:input_type -> MarkClusterOnlineAtIn - 9, // 6: Infra.EnsureGlobalVPNConnection:input_type -> EnsureGlobalVPNConnectionIn - 1, // 7: Infra.GetCluster:output_type -> GetClusterOut - 3, // 8: Infra.GetNodepool:output_type -> GetNodepoolOut - 5, // 9: Infra.ClusterExists:output_type -> ClusterExistsOut - 6, // 10: Infra.GetClusterKubeconfig:output_type -> GetClusterKubeconfigOut - 8, // 11: Infra.MarkClusterOnlineAt:output_type -> MarkClusterOnlineAtOut - 10, // 12: Infra.EnsureGlobalVPNConnection:output_type -> EnsureGlobalVPNConnectionOut - 7, // [7:13] is the sub-list for method output_type - 1, // [1:7] is the sub-list for method input_type + 0, // 2: Infra.GetByokCluster:input_type -> GetClusterIn + 2, // 3: Infra.GetNodepool:input_type -> GetNodepoolIn + 4, // 4: Infra.ClusterExists:input_type -> ClusterExistsIn + 0, // 5: Infra.GetClusterKubeconfig:input_type -> GetClusterIn + 7, // 6: Infra.MarkClusterOnlineAt:input_type -> MarkClusterOnlineAtIn + 9, // 7: Infra.EnsureGlobalVPNConnection:input_type -> EnsureGlobalVPNConnectionIn + 1, // 8: Infra.GetCluster:output_type -> GetClusterOut + 1, // 9: Infra.GetByokCluster:output_type -> GetClusterOut + 3, // 10: Infra.GetNodepool:output_type -> GetNodepoolOut + 5, // 11: Infra.ClusterExists:output_type -> ClusterExistsOut + 6, // 12: Infra.GetClusterKubeconfig:output_type -> GetClusterKubeconfigOut + 8, // 13: Infra.MarkClusterOnlineAt:output_type -> MarkClusterOnlineAtOut + 10, // 14: Infra.EnsureGlobalVPNConnection:output_type -> EnsureGlobalVPNConnectionOut + 8, // [8:15] is the sub-list for method output_type + 1, // [1:8] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name diff --git a/apps/infra/protobufs/infra/infra_grpc.pb.go b/apps/infra/protobufs/infra/infra_grpc.pb.go index 1d2d625c6..e1c4bb67d 100644 --- a/apps/infra/protobufs/infra/infra_grpc.pb.go +++ b/apps/infra/protobufs/infra/infra_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.24.4 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v5.28.1 // source: infra.proto package infra @@ -18,20 +18,12 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Infra_GetCluster_FullMethodName = "/Infra/GetCluster" - Infra_GetNodepool_FullMethodName = "/Infra/GetNodepool" - Infra_ClusterExists_FullMethodName = "/Infra/ClusterExists" - Infra_GetClusterKubeconfig_FullMethodName = "/Infra/GetClusterKubeconfig" - Infra_MarkClusterOnlineAt_FullMethodName = "/Infra/MarkClusterOnlineAt" - Infra_EnsureGlobalVPNConnection_FullMethodName = "/Infra/EnsureGlobalVPNConnection" -) - // InfraClient is the client API for Infra service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type InfraClient interface { GetCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) + GetByokCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts ...grpc.CallOption) (*GetNodepoolOut, error) ClusterExists(ctx context.Context, in *ClusterExistsIn, opts ...grpc.CallOption) (*ClusterExistsOut, error) GetClusterKubeconfig(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterKubeconfigOut, error) @@ -49,7 +41,16 @@ func NewInfraClient(cc grpc.ClientConnInterface) InfraClient { func (c *infraClient) GetCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) { out := new(GetClusterOut) - err := c.cc.Invoke(ctx, Infra_GetCluster_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/GetCluster", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infraClient) GetByokCluster(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterOut, error) { + out := new(GetClusterOut) + err := c.cc.Invoke(ctx, "/Infra/GetByokCluster", in, out, opts...) if err != nil { return nil, err } @@ -58,7 +59,7 @@ func (c *infraClient) GetCluster(ctx context.Context, in *GetClusterIn, opts ... func (c *infraClient) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts ...grpc.CallOption) (*GetNodepoolOut, error) { out := new(GetNodepoolOut) - err := c.cc.Invoke(ctx, Infra_GetNodepool_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/GetNodepool", in, out, opts...) if err != nil { return nil, err } @@ -67,7 +68,7 @@ func (c *infraClient) GetNodepool(ctx context.Context, in *GetNodepoolIn, opts . func (c *infraClient) ClusterExists(ctx context.Context, in *ClusterExistsIn, opts ...grpc.CallOption) (*ClusterExistsOut, error) { out := new(ClusterExistsOut) - err := c.cc.Invoke(ctx, Infra_ClusterExists_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/ClusterExists", in, out, opts...) if err != nil { return nil, err } @@ -76,7 +77,7 @@ func (c *infraClient) ClusterExists(ctx context.Context, in *ClusterExistsIn, op func (c *infraClient) GetClusterKubeconfig(ctx context.Context, in *GetClusterIn, opts ...grpc.CallOption) (*GetClusterKubeconfigOut, error) { out := new(GetClusterKubeconfigOut) - err := c.cc.Invoke(ctx, Infra_GetClusterKubeconfig_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/GetClusterKubeconfig", in, out, opts...) if err != nil { return nil, err } @@ -85,7 +86,7 @@ func (c *infraClient) GetClusterKubeconfig(ctx context.Context, in *GetClusterIn func (c *infraClient) MarkClusterOnlineAt(ctx context.Context, in *MarkClusterOnlineAtIn, opts ...grpc.CallOption) (*MarkClusterOnlineAtOut, error) { out := new(MarkClusterOnlineAtOut) - err := c.cc.Invoke(ctx, Infra_MarkClusterOnlineAt_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/MarkClusterOnlineAt", in, out, opts...) if err != nil { return nil, err } @@ -94,7 +95,7 @@ func (c *infraClient) MarkClusterOnlineAt(ctx context.Context, in *MarkClusterOn func (c *infraClient) EnsureGlobalVPNConnection(ctx context.Context, in *EnsureGlobalVPNConnectionIn, opts ...grpc.CallOption) (*EnsureGlobalVPNConnectionOut, error) { out := new(EnsureGlobalVPNConnectionOut) - err := c.cc.Invoke(ctx, Infra_EnsureGlobalVPNConnection_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/Infra/EnsureGlobalVPNConnection", in, out, opts...) if err != nil { return nil, err } @@ -106,6 +107,7 @@ func (c *infraClient) EnsureGlobalVPNConnection(ctx context.Context, in *EnsureG // for forward compatibility type InfraServer interface { GetCluster(context.Context, *GetClusterIn) (*GetClusterOut, error) + GetByokCluster(context.Context, *GetClusterIn) (*GetClusterOut, error) GetNodepool(context.Context, *GetNodepoolIn) (*GetNodepoolOut, error) ClusterExists(context.Context, *ClusterExistsIn) (*ClusterExistsOut, error) GetClusterKubeconfig(context.Context, *GetClusterIn) (*GetClusterKubeconfigOut, error) @@ -121,6 +123,9 @@ type UnimplementedInfraServer struct { func (UnimplementedInfraServer) GetCluster(context.Context, *GetClusterIn) (*GetClusterOut, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCluster not implemented") } +func (UnimplementedInfraServer) GetByokCluster(context.Context, *GetClusterIn) (*GetClusterOut, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetByokCluster not implemented") +} func (UnimplementedInfraServer) GetNodepool(context.Context, *GetNodepoolIn) (*GetNodepoolOut, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNodepool not implemented") } @@ -159,7 +164,7 @@ func _Infra_GetCluster_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_GetCluster_FullMethodName, + FullMethod: "/Infra/GetCluster", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetCluster(ctx, req.(*GetClusterIn)) @@ -167,6 +172,24 @@ func _Infra_GetCluster_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Infra_GetByokCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetClusterIn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfraServer).GetByokCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Infra/GetByokCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfraServer).GetByokCluster(ctx, req.(*GetClusterIn)) + } + return interceptor(ctx, in, info, handler) +} + func _Infra_GetNodepool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetNodepoolIn) if err := dec(in); err != nil { @@ -177,7 +200,7 @@ func _Infra_GetNodepool_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_GetNodepool_FullMethodName, + FullMethod: "/Infra/GetNodepool", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetNodepool(ctx, req.(*GetNodepoolIn)) @@ -195,7 +218,7 @@ func _Infra_ClusterExists_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_ClusterExists_FullMethodName, + FullMethod: "/Infra/ClusterExists", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).ClusterExists(ctx, req.(*ClusterExistsIn)) @@ -213,7 +236,7 @@ func _Infra_GetClusterKubeconfig_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_GetClusterKubeconfig_FullMethodName, + FullMethod: "/Infra/GetClusterKubeconfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).GetClusterKubeconfig(ctx, req.(*GetClusterIn)) @@ -231,7 +254,7 @@ func _Infra_MarkClusterOnlineAt_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_MarkClusterOnlineAt_FullMethodName, + FullMethod: "/Infra/MarkClusterOnlineAt", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).MarkClusterOnlineAt(ctx, req.(*MarkClusterOnlineAtIn)) @@ -249,7 +272,7 @@ func _Infra_EnsureGlobalVPNConnection_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Infra_EnsureGlobalVPNConnection_FullMethodName, + FullMethod: "/Infra/EnsureGlobalVPNConnection", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(InfraServer).EnsureGlobalVPNConnection(ctx, req.(*EnsureGlobalVPNConnectionIn)) @@ -268,6 +291,10 @@ var Infra_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetCluster", Handler: _Infra_GetCluster_Handler, }, + { + MethodName: "GetByokCluster", + Handler: _Infra_GetByokCluster_Handler, + }, { MethodName: "GetNodepool", Handler: _Infra_GetNodepool_Handler, From 8af438e25a357df82b2b289bf8a15ccec5f56f7b Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Fri, 27 Sep 2024 12:29:04 +0530 Subject: [PATCH 6/7] :sparkles: Added app rollout --- apps/console/internal/app/webhook-consumer.go | 24 ++++++---- apps/console/internal/domain/api.go | 3 +- apps/console/internal/domain/app.go | 45 +++++++++++++++++++ .../console/internal/domain/registry-image.go | 2 +- 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/apps/console/internal/app/webhook-consumer.go b/apps/console/internal/app/webhook-consumer.go index d46ac3642..081570440 100644 --- a/apps/console/internal/app/webhook-consumer.go +++ b/apps/console/internal/app/webhook-consumer.go @@ -3,6 +3,8 @@ package app import ( "context" "encoding/json" + "fmt" + "github.com/kloudlite/api/apps/console/internal/domain" "github.com/kloudlite/api/pkg/errors" "github.com/kloudlite/api/pkg/logging" @@ -18,25 +20,29 @@ func processWebhooks(consumer WebhookConsumer, d domain.Domain, logger logging.L logger.Infof("finished processing message") }() - webhook := &domain.ImageHookPayload{} - if err := json.Unmarshal(msg.Payload, &webhook); err != nil { + hook := &domain.ImageHookPayload{} + if err := json.Unmarshal(msg.Payload, &hook); err != nil { logger.Errorf(err, "could not unmarshal into *ImageHookPayload") return errors.NewE(err) } - if webhook.Image == "" || webhook.AccountName == "" { + if hook.Image == "" || hook.AccountName == "" { return errors.Newf("invalid webhook payload") } - hook := &domain.ImageHookPayload{ - Image: webhook.Image, - AccountName: webhook.AccountName, - Meta: webhook.Meta, - } - _, err := d.CreateRegistryImage(context.TODO(), hook.AccountName, hook.Image, hook.Meta) + _, err := d.UpsertRegistryImage(context.TODO(), hook.AccountName, hook.Image, hook.Meta) if err != nil { logger.Errorf(err, "could not process image hook") return errors.NewE(err) } + + // domain.NewConsoleContext(ctx, userId repos.ID, accountName string) + dctx := domain.NewConsoleContext(context.TODO(), "sys-user:apply-on-error-worker", hook.AccountName) + + if err := d.RolloutAppsByImage(dctx, fmt.Sprintf("%s:%s", hook.Image, hook.Image)); err != nil { + logger.Errorf(err, "could not rollout apps by image") + return errors.NewE(err) + } + return nil }, msgTypes.ConsumeOpts{ OnError: func(err error) error { diff --git a/apps/console/internal/domain/api.go b/apps/console/internal/domain/api.go index 2c50d6065..a66dadaf0 100644 --- a/apps/console/internal/domain/api.go +++ b/apps/console/internal/domain/api.go @@ -183,7 +183,7 @@ type Domain interface { GetRegistryImageURL(ctx ConsoleContext) (*entities.RegistryImageURL, error) GetRegistryImage(ctx ConsoleContext, image string) (*entities.RegistryImage, error) DeleteRegistryImage(ctx ConsoleContext, image string) error - CreateRegistryImage(ctx context.Context, accountName string, image string, meta map[string]any) (*entities.RegistryImage, error) + UpsertRegistryImage(ctx context.Context, accountName string, image string, meta map[string]any) (*entities.RegistryImage, error) ListRegistryImages(ctx ConsoleContext, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.RegistryImage], error) SearchRegistryImages(ctx ConsoleContext, query string) ([]*entities.RegistryImage, error) @@ -203,6 +203,7 @@ type Domain interface { OnAppUpdateMessage(ctx ResourceContext, app entities.App, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncApp(ctx ResourceContext, name string) error + RolloutAppsByImage(ctx ConsoleContext, imageName string) error ListConfigs(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Config], error) GetConfig(ctx ResourceContext, name string) (*entities.Config, error) diff --git a/apps/console/internal/domain/app.go b/apps/console/internal/domain/app.go index db23bca45..cf49ef64f 100644 --- a/apps/console/internal/domain/app.go +++ b/apps/console/internal/domain/app.go @@ -345,3 +345,48 @@ func (d *domain) ResyncApp(ctx ResourceContext, name string) error { } return d.resyncK8sResource(ctx, a.EnvironmentName, a.SyncStatus.Action, &a.App, a.RecordVersion) } + +func (d *domain) listAppsByImage(ctx ResourceContext, image string) ([]*entities.App, error) { + apps, err := d.appRepo.Find(ctx, repos.Query{ + Filter: repos.Filter{ + fields.AccountName: ctx.AccountName, + fmt.Sprintf("%s.image", fc.AppSpecContainers): image, + fmt.Sprintf("%s.imagePullPolicy", fc.AppSpecContainers): "Always", + }, + Sort: nil, + }) + if err != nil { + return nil, errors.NewE(err) + } + return apps, nil +} + +func (d *domain) RolloutAppsByImage(ctx ResourceContext, imageName string) error { + + iName, iTag := getImageNameTag(imageName) + + apps, err := d.listAppsByImage(ctx, fmt.Sprintf("%s:%s", iName, iTag)) + if err != nil { + return errors.NewE(err) + } + + // for the latest + apps2, err := d.listAppsByImage(ctx, iName) + if err != nil { + return errors.NewE(err) + } + + for _, app := range apps { + if err := d.resyncK8sResource(ctx, app.EnvironmentName, app.SyncStatus.Action, &app.App, app.RecordVersion); err != nil { + return errors.NewE(err) + } + } + + for _, app := range apps2 { + if err := d.resyncK8sResource(ctx, app.EnvironmentName, app.SyncStatus.Action, &app.App, app.RecordVersion); err != nil { + return errors.NewE(err) + } + } + + return nil +} diff --git a/apps/console/internal/domain/registry-image.go b/apps/console/internal/domain/registry-image.go index 73c8c144b..0d84cbc9c 100644 --- a/apps/console/internal/domain/registry-image.go +++ b/apps/console/internal/domain/registry-image.go @@ -79,7 +79,7 @@ func (d *domain) GetRegistryImageURL(ctx ConsoleContext) (*entities.RegistryImag }, nil } -func (d *domain) CreateRegistryImage(ctx context.Context, accountName string, image string, meta map[string]any) (*entities.RegistryImage, error) { +func (d *domain) UpsertRegistryImage(ctx context.Context, accountName string, image string, meta map[string]any) (*entities.RegistryImage, error) { imageName, imageTag := getImageNameTag(image) createdImage, err := d.registryImageRepo.Upsert(ctx, repos.Filter{ From 84eb43bc8f5337025ab99943f281c7d1ccbd2fb5 Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Fri, 27 Sep 2024 12:32:06 +0530 Subject: [PATCH 7/7] :sparkles: Added app rollout on image push --- apps/console/internal/domain/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/console/internal/domain/app.go b/apps/console/internal/domain/app.go index cf49ef64f..7c8fe86b1 100644 --- a/apps/console/internal/domain/app.go +++ b/apps/console/internal/domain/app.go @@ -346,7 +346,7 @@ func (d *domain) ResyncApp(ctx ResourceContext, name string) error { return d.resyncK8sResource(ctx, a.EnvironmentName, a.SyncStatus.Action, &a.App, a.RecordVersion) } -func (d *domain) listAppsByImage(ctx ResourceContext, image string) ([]*entities.App, error) { +func (d *domain) listAppsByImage(ctx ConsoleContext, image string) ([]*entities.App, error) { apps, err := d.appRepo.Find(ctx, repos.Query{ Filter: repos.Filter{ fields.AccountName: ctx.AccountName, @@ -361,7 +361,7 @@ func (d *domain) listAppsByImage(ctx ResourceContext, image string) ([]*entities return apps, nil } -func (d *domain) RolloutAppsByImage(ctx ResourceContext, imageName string) error { +func (d *domain) RolloutAppsByImage(ctx ConsoleContext, imageName string) error { iName, iTag := getImageNameTag(imageName)