diff --git a/Makefile b/Makefile index ee132c29..a8084781 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ NAME=github.com/goto/entropy VERSION=$(shell git describe --tags --always --first-parent 2>/dev/null) COMMIT=$(shell git rev-parse --short HEAD) -PROTON_COMMIT="1d611a9efbfecfa54945906214b19b72e6fbb841" +PROTON_COMMIT="6258d554f5bc80e37ac8d5770ab4ff5a1f0ac5ca" BUILD_TIME=$(shell date) COVERAGE_DIR=coverage BUILD_DIR=dist diff --git a/buf.gen.yaml b/buf.gen.yaml index e50d1450..d6efdb7f 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -1,20 +1,21 @@ version: v1 plugins: - - remote: "buf.build/library/plugins/go:v1.27.1-1" + - plugin: buf.build/protocolbuffers/go:v1.30.0 out: proto opt: paths=source_relative - - remote: "buf.build/library/plugins/go-grpc:v1.1.0-2" + - plugin: buf.build/grpc/go:v1.3.0 out: proto opt: paths=source_relative,require_unimplemented_servers=true - - remote: buf.build/odpf/plugins/validate - out: "proto" - opt: "paths=source_relative,lang=go" - - remote: "buf.build/grpc-ecosystem/plugins/grpc-gateway:v2.11.3-1" + - plugin: buf.build/bufbuild/validate-go:v1.0.1 + out: proto + opt: + - paths=source_relative + - plugin: buf.build/grpc-ecosystem/gateway:v2.15.2 out: proto opt: - paths=source_relative - allow_repeated_fields_in_body=true - - remote: "buf.build/grpc-ecosystem/plugins/openapiv2:v2.11.3-1" + - plugin: buf.build/grpc-ecosystem/openapiv2:v2.15.2 out: proto opt: - allow_repeated_fields_in_body=true diff --git a/core/module/action.go b/core/module/action.go index ea2ed58a..3cc964a2 100644 --- a/core/module/action.go +++ b/core/module/action.go @@ -20,6 +20,7 @@ type ActionRequest struct { Name string `json:"name"` Params json.RawMessage `json:"params"` Labels map[string]string `json:"labels"` + UserID string } // ActionDesc is a descriptor for an action supported by a module. diff --git a/core/resource/resource.go b/core/resource/resource.go index 028cf891..736dd020 100644 --- a/core/resource/resource.go +++ b/core/resource/resource.go @@ -45,6 +45,8 @@ type Resource struct { Labels map[string]string `json:"labels"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` + UpdatedBy string `json:"updated_by"` + CreatedBy string `json:"created_by"` Spec Spec `json:"spec"` State State `json:"state"` } @@ -63,6 +65,7 @@ type Filter struct { type UpdateRequest struct { Spec Spec `json:"spec"` Labels map[string]string `json:"labels"` + UserID string } type RevisionsSelector struct { @@ -75,6 +78,7 @@ type Revision struct { Reason string `json:"reason"` Labels map[string]string `json:"labels"` CreatedAt time.Time `json:"created_at"` + CreatedBy string `json:"created_by"` Spec Spec `json:"spec"` } diff --git a/core/write.go b/core/write.go index 9966e621..186c4488 100644 --- a/core/write.go +++ b/core/write.go @@ -18,6 +18,7 @@ func (svc *Service) CreateResource(ctx context.Context, res resource.Resource) ( Name: module.CreateAction, Params: res.Spec.Configs, Labels: res.Labels, + UserID: res.CreatedBy, } res.Spec.Configs = nil @@ -35,6 +36,7 @@ func (svc *Service) UpdateResource(ctx context.Context, urn string, req resource Name: module.UpdateAction, Params: req.Spec.Configs, Labels: req.Labels, + UserID: req.UserID, }) } @@ -66,9 +68,12 @@ func (svc *Service) execAction(ctx context.Context, res resource.Resource, act m if isCreate(act.Name) { planned.CreatedAt = svc.clock() planned.UpdatedAt = planned.CreatedAt + planned.CreatedBy = act.UserID + planned.UpdatedBy = act.UserID } else { planned.CreatedAt = res.CreatedAt planned.UpdatedAt = svc.clock() + planned.UpdatedBy = act.UserID } reason := fmt.Sprintf("action:%s", act.Name) diff --git a/go.mod b/go.mod index 15807568..5b33f3f5 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/briandowns/spinner v1.18.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect github.com/charmbracelet/glamour v0.3.0 // indirect github.com/containerd/containerd v1.6.6 // indirect @@ -162,12 +162,12 @@ require ( go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.5.0 // indirect golang.org/x/net v0.5.0 // indirect - golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect + golang.org/x/oauth2 v0.4.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.4.0 // indirect golang.org/x/term v0.4.0 // indirect golang.org/x/text v0.6.0 // indirect - golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect + golang.org/x/time v0.1.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.6 // indirect diff --git a/go.sum b/go.sum index 4aafd103..f08db965 100644 --- a/go.sum +++ b/go.sum @@ -256,8 +256,9 @@ github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6 github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 h1:7aWHqerlJ41y6FOsEUvknqgXnGmJyJSbjhAWq5pO4F8= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/charmbracelet/glamour v0.3.0 h1:3H+ZrKlSg8s+WU6V7eF2eRVYt8lCueffbi7r2+ffGkc= @@ -1719,8 +1720,9 @@ golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1909,8 +1911,9 @@ golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 h1:M73Iuj3xbbb9Uk1DYhzydthsj6oOd6l9bpuFcNoUvTs= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/internal/server/server.go b/internal/server/server.go index 039d7dbc..3ebc1194 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -22,6 +22,7 @@ import ( "google.golang.org/grpc/reflection" "google.golang.org/protobuf/encoding/protojson" + "github.com/goto/entropy/internal/server/serverutils" modulesv1 "github.com/goto/entropy/internal/server/v1/modules" resourcesv1 "github.com/goto/entropy/internal/server/v1/resources" "github.com/goto/entropy/pkg/common" @@ -52,15 +53,18 @@ func Serve(ctx context.Context, httpAddr, grpcAddr string, nrApp *newrelic.Appli grpc.StatsHandler(&ocgrpc.ServerHandler{}), } grpcServer := grpc.NewServer(grpcOpts...) - rpcHTTPGateway := runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - UseProtoNames: true, - EmitUnpopulated: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - })) + rpcHTTPGateway := runtime.NewServeMux( + runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{ + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + EmitUnpopulated: true, + }, + UnmarshalOptions: protojson.UnmarshalOptions{ + DiscardUnknown: true, + }, + }), + runtime.WithMetadata(serverutils.ExtractRequestMetadata), + ) reflection.Register(grpcServer) diff --git a/internal/server/serverutils/context.go b/internal/server/serverutils/context.go new file mode 100644 index 00000000..92bfd0dc --- /dev/null +++ b/internal/server/serverutils/context.go @@ -0,0 +1,38 @@ +package serverutils + +import ( + "context" + "net/http" + "strings" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +const userIdHeader = "user-id" + +func GetUserIdentifier(ctx context.Context) (string, error) { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return "", status.Errorf(codes.DataLoss, "failed to get metadata") + } + + xrid := md[userIdHeader] + if len(xrid) == 0 { + return "", status.Errorf(codes.InvalidArgument, "missing '%s' header", userIdHeader) + } + + userId := strings.TrimSpace(xrid[0]) + if userId == "" { + return "", status.Errorf(codes.InvalidArgument, "empty '%s' header", userIdHeader) + } + + return userId, nil +} + +func ExtractRequestMetadata(_ context.Context, request *http.Request) metadata.MD { + header := request.Header.Get(userIdHeader) + md := metadata.Pairs(userIdHeader, header) + return md +} diff --git a/internal/server/v1/resources/mappers.go b/internal/server/v1/resources/mappers.go index 35fb5fd8..f486b4c1 100644 --- a/internal/server/v1/resources/mappers.go +++ b/internal/server/v1/resources/mappers.go @@ -155,6 +155,7 @@ func revisionToProto(revision resource.Revision) (*entropyv1beta1.ResourceRevisi Reason: revision.Reason, Labels: revision.Labels, CreatedAt: timestamppb.New(revision.CreatedAt), + CreatedBy: revision.CreatedBy, Spec: spec, }, nil } diff --git a/internal/server/v1/resources/server.go b/internal/server/v1/resources/server.go index b2f62be2..aa640599 100644 --- a/internal/server/v1/resources/server.go +++ b/internal/server/v1/resources/server.go @@ -41,6 +41,13 @@ func (server APIServer) CreateResource(ctx context.Context, request *entropyv1be return nil, serverutils.ToRPCError(err) } + userIdentifier, err := serverutils.GetUserIdentifier(ctx) + if err != nil { + return nil, serverutils.ToRPCError(err) + } + res.CreatedBy = userIdentifier + res.UpdatedBy = userIdentifier + result, err := server.resourceSvc.CreateResource(ctx, *res) if err != nil { return nil, serverutils.ToRPCError(err) @@ -62,9 +69,15 @@ func (server APIServer) UpdateResource(ctx context.Context, request *entropyv1be return nil, serverutils.ToRPCError(err) } + userIdentifier, err := serverutils.GetUserIdentifier(ctx) + if err != nil { + return nil, serverutils.ToRPCError(err) + } + updateRequest := resource.UpdateRequest{ Spec: *newSpec, Labels: request.Labels, + UserID: userIdentifier, } res, err := server.resourceSvc.UpdateResource(ctx, request.GetUrn(), updateRequest) @@ -139,10 +152,16 @@ func (server APIServer) ApplyAction(ctx context.Context, request *entropyv1beta1 return nil, err } + userIdentifier, err := serverutils.GetUserIdentifier(ctx) + if err != nil { + return nil, serverutils.ToRPCError(err) + } + action := module.ActionRequest{ Name: request.GetAction(), Params: paramsJSON, Labels: request.Labels, + UserID: userIdentifier, } updatedRes, err := server.resourceSvc.ApplyAction(ctx, request.GetUrn(), action) diff --git a/internal/server/v1/resources/server_test.go b/internal/server/v1/resources/server_test.go index 63d0ae5c..9353b16e 100644 --- a/internal/server/v1/resources/server_test.go +++ b/internal/server/v1/resources/server_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/structpb" @@ -148,7 +149,11 @@ func TestAPIServer_CreateResource(t *testing.T) { t.Parallel() srv := tt.setup(t) - got, err := srv.CreateResource(context.Background(), tt.request) + ctx := context.Background() + md := metadata.New(map[string]string{"user-id": "john.doe@goto.com"}) + ctx = metadata.NewIncomingContext(ctx, md) + + got, err := srv.CreateResource(ctx, tt.request) if tt.wantErr != nil { assert.Error(t, err) assert.Truef(t, errors.Is(err, tt.wantErr), "'%s' != '%s'", tt.wantErr, err) @@ -273,7 +278,11 @@ func TestAPIServer_UpdateResource(t *testing.T) { t.Parallel() srv := tt.setup(t) - got, err := srv.UpdateResource(context.Background(), tt.request) + ctx := context.Background() + md := metadata.New(map[string]string{"user-id": "john.doe@goto.com"}) + ctx = metadata.NewIncomingContext(ctx, md) + + got, err := srv.UpdateResource(ctx, tt.request) if tt.wantErr != nil { assert.Error(t, err) assert.True(t, errors.Is(err, tt.wantErr)) @@ -647,7 +656,11 @@ func TestAPIServer_ApplyAction(t *testing.T) { t.Parallel() srv := tt.setup(t) - got, err := srv.ApplyAction(context.Background(), tt.request) + ctx := context.Background() + md := metadata.New(map[string]string{"user-id": "john.doe@goto.com"}) + ctx = metadata.NewIncomingContext(ctx, md) + + got, err := srv.ApplyAction(ctx, tt.request) if tt.wantErr != nil { assert.Error(t, err) assert.True(t, errors.Is(err, tt.wantErr)) diff --git a/internal/store/postgres/resource_model.go b/internal/store/postgres/resource_model.go index 0f980010..386a4fd3 100644 --- a/internal/store/postgres/resource_model.go +++ b/internal/store/postgres/resource_model.go @@ -20,6 +20,8 @@ type resourceModel struct { Project string `db:"project"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` + CreatedBy string `db:"created_by"` + UpdatedBy string `db:"updated_by"` SpecConfigs []byte `db:"spec_configs"` StateStatus string `db:"state_status"` StateOutput []byte `db:"state_output"` @@ -30,7 +32,7 @@ type resourceModel struct { func readResourceRecord(ctx context.Context, r sqlx.QueryerContext, urn string, into *resourceModel) error { cols := []string{ - "id", "urn", "kind", "project", "name", "created_at", "updated_at", + "id", "urn", "kind", "project", "name", "created_at", "updated_at", "created_by", "updated_by", "spec_configs", "state_status", "state_output", "state_module_data", "state_next_sync", "state_sync_result", } diff --git a/internal/store/postgres/resource_store.go b/internal/store/postgres/resource_store.go index 093a1de5..b0b3ba45 100644 --- a/internal/store/postgres/resource_store.go +++ b/internal/store/postgres/resource_store.go @@ -55,6 +55,8 @@ func (st *Store) GetByURN(ctx context.Context, urn string) (*resource.Resource, Labels: tagsToLabelMap(tags), CreatedAt: rec.CreatedAt, UpdatedAt: rec.UpdatedAt, + CreatedBy: rec.CreatedBy, + UpdatedBy: rec.UpdatedBy, Spec: resource.Spec{ Configs: rec.SpecConfigs, Dependencies: deps, @@ -128,10 +130,11 @@ func (st *Store) Create(ctx context.Context, r resource.Resource, hooks ...resou } rev := resource.Revision{ - URN: r.URN, - Spec: r.Spec, - Labels: r.Labels, - Reason: "action:create", + URN: r.URN, + Spec: r.Spec, + Labels: r.Labels, + Reason: "action:create", + CreatedBy: r.UpdatedBy, } if err := insertRevision(ctx, tx, id, rev); err != nil { @@ -159,6 +162,7 @@ func (st *Store) Update(ctx context.Context, r resource.Resource, saveRevision b Where(sq.Eq{"id": id}). SetMap(map[string]interface{}{ "updated_at": sq.Expr("current_timestamp"), + "updated_by": r.UpdatedBy, "spec_configs": r.Spec.Configs, "state_status": r.State.Status, "state_output": r.State.Output, @@ -182,10 +186,11 @@ func (st *Store) Update(ctx context.Context, r resource.Resource, saveRevision b if saveRevision { rev := resource.Revision{ - URN: r.URN, - Spec: r.Spec, - Labels: r.Labels, - Reason: reason, + URN: r.URN, + Spec: r.Spec, + Labels: r.Labels, + Reason: reason, + CreatedBy: r.UpdatedBy, } if err := insertRevision(ctx, tx, id, rev); err != nil { @@ -326,10 +331,10 @@ func (st *Store) extendWaitTime(ctx context.Context, r sq.BaseRunner, urn string func insertResourceRecord(ctx context.Context, runner sqlx.QueryerContext, r resource.Resource) (int64, error) { builder := sq.Insert(tableResources). - Columns("urn", "kind", "project", "name", "created_at", "updated_at", + Columns("urn", "kind", "project", "name", "created_at", "updated_at", "created_by", "updated_by", "spec_configs", "state_status", "state_output", "state_module_data", "state_next_sync", "state_sync_result"). - Values(r.URN, r.Kind, r.Project, r.Name, r.CreatedAt, r.UpdatedAt, + Values(r.URN, r.Kind, r.Project, r.Name, r.CreatedAt, r.UpdatedAt, r.CreatedBy, r.UpdatedBy, r.Spec.Configs, r.State.Status, r.State.Output, r.State.ModuleData, r.State.NextSyncAt, syncResultAsJSON(r.State.SyncResult)). Suffix(`RETURNING "id"`) diff --git a/internal/store/postgres/revision_model.go b/internal/store/postgres/revision_model.go index dcd26111..03268bc5 100644 --- a/internal/store/postgres/revision_model.go +++ b/internal/store/postgres/revision_model.go @@ -11,6 +11,7 @@ type revisionModel struct { ID int64 `db:"id"` Reason string `db:"reason"` CreatedAt time.Time `db:"created_at"` + CreatedBy string `db:"created_by"` ResourceID int64 `db:"resource_id"` SpecConfigs []byte `db:"spec_configs"` } diff --git a/internal/store/postgres/revision_store.go b/internal/store/postgres/revision_store.go index 31c14145..bb1f989d 100644 --- a/internal/store/postgres/revision_store.go +++ b/internal/store/postgres/revision_store.go @@ -51,6 +51,7 @@ func (st *Store) Revisions(ctx context.Context, selector resource.RevisionsSelec URN: selector.URN, Reason: rm.Reason, CreatedAt: rm.CreatedAt, + CreatedBy: rm.CreatedBy, Spec: resource.Spec{ Configs: rm.SpecConfigs, Dependencies: deps, @@ -81,8 +82,8 @@ func (st *Store) Revisions(ctx context.Context, selector resource.RevisionsSelec func insertRevision(ctx context.Context, tx *sqlx.Tx, resID int64, rev resource.Revision) error { q := sq.Insert(tableRevisions). - Columns("resource_id", "reason", "spec_configs"). - Values(resID, rev.Reason, rev.Spec.Configs). + Columns("resource_id", "reason", "spec_configs", "created_by"). + Values(resID, rev.Reason, rev.Spec.Configs, rev.CreatedBy). Suffix(`RETURNING "id"`). PlaceholderFormat(sq.Dollar) diff --git a/internal/store/postgres/schema.sql b/internal/store/postgres/schema.sql index 3e2a8e8b..68f0b53e 100644 --- a/internal/store/postgres/schema.sql +++ b/internal/store/postgres/schema.sql @@ -68,4 +68,10 @@ CREATE TABLE IF NOT EXISTS revision_tags UNIQUE (revision_id, tag) ); CREATE INDEX IF NOT EXISTS idx_revision_tags_revision_id ON revision_tags (revision_id); -CREATE INDEX IF NOT EXISTS idx_revision_tags_tag ON revision_tags (tag); \ No newline at end of file +CREATE INDEX IF NOT EXISTS idx_revision_tags_tag ON revision_tags (tag); + +ALTER TABLE resources + ADD COLUMN IF NOT EXISTS created_by TEXT NOT NULL DEFAULT '', + ADD COLUMN IF NOT EXISTS updated_by TEXT NOT NULL DEFAULT ''; + +ALTER TABLE revisions ADD COLUMN IF NOT EXISTS created_by TEXT NOT NULL DEFAULT ''; \ No newline at end of file diff --git a/proto/entropy.swagger.yaml b/proto/entropy.swagger.yaml index cd86e5cd..102ac802 100644 --- a/proto/entropy.swagger.yaml +++ b/proto/entropy.swagger.yaml @@ -214,12 +214,12 @@ paths: schema: type: object properties: + new_spec: + $ref: '#/definitions/ResourceSpec' labels: type: object additionalProperties: type: string - new_spec: - $ref: '#/definitions/ResourceSpec' tags: - ResourceService /v1beta1/resources/{urn}/actions/{action}: @@ -258,10 +258,10 @@ paths: schema: type: object properties: - error: - $ref: '#/definitions/rpc.Status' result: $ref: '#/definitions/GetLogResponse' + error: + $ref: '#/definitions/rpc.Status' title: Stream result of GetLogResponse default: description: An unexpected error response. @@ -360,6 +360,7 @@ definitions: revisions: type: array items: + type: object $ref: '#/definitions/ResourceRevision' GetVersionRequest: type: object @@ -377,6 +378,7 @@ definitions: modules: type: array items: + type: object $ref: '#/definitions/Module' ListResourcesResponse: type: object @@ -384,6 +386,7 @@ definitions: resources: type: array items: + type: object $ref: '#/definitions/Resource' ListString: type: object @@ -412,19 +415,19 @@ definitions: Module: type: object properties: - configs: {} - created_at: + urn: type: string - format: date-time name: type: string project: type: string - updated_at: + created_at: type: string format: date-time - urn: + updated_at: type: string + format: date-time + configs: {} NullValue: type: string enum: @@ -440,28 +443,28 @@ definitions: Resource: type: object properties: - created_at: + urn: type: string - format: date-time kind: type: string + name: + type: string + project: + type: string labels: type: object additionalProperties: type: string - name: + created_at: type: string - project: + format: date-time + updated_at: type: string + format: date-time spec: $ref: '#/definitions/ResourceSpec' state: $ref: '#/definitions/ResourceState' - updated_at: - type: string - format: date-time - urn: - type: string ResourceDependency: type: object properties: @@ -476,20 +479,22 @@ definitions: ResourceRevision: type: object properties: - created_at: - type: string - format: date-time id: type: string + urn: + type: string labels: type: object additionalProperties: type: string - reason: + created_at: type: string + format: date-time spec: $ref: '#/definitions/ResourceSpec' - urn: + reason: + type: string + created_by: type: string ResourceSpec: type: object @@ -498,6 +503,7 @@ definitions: dependencies: type: array items: + type: object $ref: '#/definitions/ResourceDependency' description: |- dependencies can be used to refer to other existing resources @@ -505,19 +511,14 @@ definitions: ResourceState: type: object properties: - log_options: - $ref: '#/definitions/LogOptions' - module_data: - type: string - format: byte - next_sync_at: - type: string - format: date-time - output: {} status: $ref: '#/definitions/ResourceState.Status' - sync_last_error: + output: {} + module_data: type: string + format: byte + log_options: + $ref: '#/definitions/LogOptions' sync_retries: type: integer format: int32 @@ -525,6 +526,11 @@ definitions: information about the ongoing sync process. if status is ERROR / PENDING, this value can be used to understand the issue. + sync_last_error: + type: string + next_sync_at: + type: string + format: date-time ResourceState.Status: type: string enum: @@ -547,18 +553,18 @@ definitions: Version: type: object properties: - architecture: + version: + type: string + commit: type: string build_time: type: string format: date-time - commit: - type: string lang_version: type: string os: type: string - version: + architecture: type: string rpc.Status: type: object @@ -566,11 +572,12 @@ definitions: code: type: integer format: int32 + message: + type: string details: type: array items: + type: object $ref: '#/definitions/Any' - message: - type: string externalDocs: description: Common endpoints for all services diff --git a/proto/gotocompany/common/v1/service.pb.go b/proto/gotocompany/common/v1/service.pb.go index 5de1cb00..1672caf2 100644 --- a/proto/gotocompany/common/v1/service.pb.go +++ b/proto/gotocompany/common/v1/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.30.0 // protoc (unknown) // source: gotocompany/common/v1/service.proto @@ -249,16 +249,16 @@ var file_gotocompany_common_v1_service_proto_rawDesc = []byte{ 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x42, 0x8b, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x92, 0x41, 0x31, - 0x12, 0x07, 0x32, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x2a, 0x01, 0x01, 0x72, 0x23, 0x0a, 0x21, - 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, - 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6f, 0x6e, 0x42, 0x8b, 0x01, 0x92, 0x41, 0x31, 0x12, 0x07, 0x32, 0x05, 0x30, 0x2e, 0x31, + 0x2e, 0x30, 0x2a, 0x01, 0x01, 0x72, 0x23, 0x0a, 0x21, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x20, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, + 0x6c, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/gotocompany/common/v1/service.pb.gw.go b/proto/gotocompany/common/v1/service.pb.gw.go index 457b50f9..43e57236 100644 --- a/proto/gotocompany/common/v1/service.pb.gw.go +++ b/proto/gotocompany/common/v1/service.pb.gw.go @@ -102,7 +102,7 @@ func RegisterCommonServiceHandlerServer(ctx context.Context, mux *runtime.ServeM // RegisterCommonServiceHandlerFromEndpoint is same as RegisterCommonServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterCommonServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) + conn, err := grpc.DialContext(ctx, endpoint, opts...) if err != nil { return err } diff --git a/proto/gotocompany/common/v1/service.pb.validate.go b/proto/gotocompany/common/v1/service.pb.validate.go index 0588dd5f..05cb7d8e 100644 --- a/proto/gotocompany/common/v1/service.pb.validate.go +++ b/proto/gotocompany/common/v1/service.pb.validate.go @@ -89,6 +89,7 @@ func (m *GetVersionRequest) validate(all bool) error { if len(errors) > 0 { return GetVersionRequestMultiError(errors) } + return nil } @@ -219,6 +220,7 @@ func (m *GetVersionResponse) validate(all bool) error { if len(errors) > 0 { return GetVersionResponseMultiError(errors) } + return nil } @@ -358,6 +360,7 @@ func (m *Version) validate(all bool) error { if len(errors) > 0 { return VersionMultiError(errors) } + return nil } diff --git a/proto/gotocompany/common/v1/service_grpc.pb.go b/proto/gotocompany/common/v1/service_grpc.pb.go index 13c31ab3..ecad6c42 100644 --- a/proto/gotocompany/common/v1/service_grpc.pb.go +++ b/proto/gotocompany/common/v1/service_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: gotocompany/common/v1/service.proto package v1 @@ -14,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + CommonService_GetVersion_FullMethodName = "/gotocompany.common.v1.CommonService/GetVersion" +) + // CommonServiceClient is the client API for CommonService 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. @@ -31,7 +39,7 @@ func NewCommonServiceClient(cc grpc.ClientConnInterface) CommonServiceClient { func (c *commonServiceClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error) { out := new(GetVersionResponse) - err := c.cc.Invoke(ctx, "/gotocompany.common.v1.CommonService/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, CommonService_GetVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -76,7 +84,7 @@ func _CommonService_GetVersion_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.common.v1.CommonService/GetVersion", + FullMethod: CommonService_GetVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CommonServiceServer).GetVersion(ctx, req.(*GetVersionRequest)) diff --git a/proto/gotocompany/entropy/v1beta1/module.pb.go b/proto/gotocompany/entropy/v1beta1/module.pb.go index e4c447b2..dd6acd0f 100644 --- a/proto/gotocompany/entropy/v1beta1/module.pb.go +++ b/proto/gotocompany/entropy/v1beta1/module.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.30.0 // protoc (unknown) // source: gotocompany/entropy/v1beta1/module.proto diff --git a/proto/gotocompany/entropy/v1beta1/module.pb.gw.go b/proto/gotocompany/entropy/v1beta1/module.pb.gw.go index 16655f87..3d569e0e 100644 --- a/proto/gotocompany/entropy/v1beta1/module.pb.gw.go +++ b/proto/gotocompany/entropy/v1beta1/module.pb.gw.go @@ -410,7 +410,7 @@ func RegisterModuleServiceHandlerServer(ctx context.Context, mux *runtime.ServeM // RegisterModuleServiceHandlerFromEndpoint is same as RegisterModuleServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterModuleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) + conn, err := grpc.DialContext(ctx, endpoint, opts...) if err != nil { return err } diff --git a/proto/gotocompany/entropy/v1beta1/module.pb.validate.go b/proto/gotocompany/entropy/v1beta1/module.pb.validate.go index 52f2cb00..cce53c4b 100644 --- a/proto/gotocompany/entropy/v1beta1/module.pb.validate.go +++ b/proto/gotocompany/entropy/v1beta1/module.pb.validate.go @@ -152,6 +152,7 @@ func (m *Module) validate(all bool) error { if len(errors) > 0 { return ModuleMultiError(errors) } + return nil } @@ -252,6 +253,7 @@ func (m *ListModulesRequest) validate(all bool) error { if len(errors) > 0 { return ListModulesRequestMultiError(errors) } + return nil } @@ -387,6 +389,7 @@ func (m *ListModulesResponse) validate(all bool) error { if len(errors) > 0 { return ListModulesResponseMultiError(errors) } + return nil } @@ -490,6 +493,7 @@ func (m *GetModuleRequest) validate(all bool) error { if len(errors) > 0 { return GetModuleRequestMultiError(errors) } + return nil } @@ -618,6 +622,7 @@ func (m *GetModuleResponse) validate(all bool) error { if len(errors) > 0 { return GetModuleResponseMultiError(errors) } + return nil } @@ -748,6 +753,7 @@ func (m *CreateModuleRequest) validate(all bool) error { if len(errors) > 0 { return CreateModuleRequestMultiError(errors) } + return nil } @@ -878,6 +884,7 @@ func (m *CreateModuleResponse) validate(all bool) error { if len(errors) > 0 { return CreateModuleResponseMultiError(errors) } + return nil } @@ -1010,6 +1017,7 @@ func (m *UpdateModuleRequest) validate(all bool) error { if len(errors) > 0 { return UpdateModuleRequestMultiError(errors) } + return nil } @@ -1140,6 +1148,7 @@ func (m *UpdateModuleResponse) validate(all bool) error { if len(errors) > 0 { return UpdateModuleResponseMultiError(errors) } + return nil } @@ -1243,6 +1252,7 @@ func (m *DeleteModuleRequest) validate(all bool) error { if len(errors) > 0 { return DeleteModuleRequestMultiError(errors) } + return nil } @@ -1344,6 +1354,7 @@ func (m *DeleteModuleResponse) validate(all bool) error { if len(errors) > 0 { return DeleteModuleResponseMultiError(errors) } + return nil } diff --git a/proto/gotocompany/entropy/v1beta1/module_grpc.pb.go b/proto/gotocompany/entropy/v1beta1/module_grpc.pb.go index c469596d..a7015b3c 100644 --- a/proto/gotocompany/entropy/v1beta1/module_grpc.pb.go +++ b/proto/gotocompany/entropy/v1beta1/module_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: gotocompany/entropy/v1beta1/module.proto package entropyv1beta1 @@ -14,6 +18,14 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + ModuleService_ListModules_FullMethodName = "/gotocompany.entropy.v1beta1.ModuleService/ListModules" + ModuleService_GetModule_FullMethodName = "/gotocompany.entropy.v1beta1.ModuleService/GetModule" + ModuleService_CreateModule_FullMethodName = "/gotocompany.entropy.v1beta1.ModuleService/CreateModule" + ModuleService_UpdateModule_FullMethodName = "/gotocompany.entropy.v1beta1.ModuleService/UpdateModule" + ModuleService_DeleteModule_FullMethodName = "/gotocompany.entropy.v1beta1.ModuleService/DeleteModule" +) + // ModuleServiceClient is the client API for ModuleService 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. @@ -35,7 +47,7 @@ func NewModuleServiceClient(cc grpc.ClientConnInterface) ModuleServiceClient { func (c *moduleServiceClient) ListModules(ctx context.Context, in *ListModulesRequest, opts ...grpc.CallOption) (*ListModulesResponse, error) { out := new(ListModulesResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ModuleService/ListModules", in, out, opts...) + err := c.cc.Invoke(ctx, ModuleService_ListModules_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -44,7 +56,7 @@ func (c *moduleServiceClient) ListModules(ctx context.Context, in *ListModulesRe func (c *moduleServiceClient) GetModule(ctx context.Context, in *GetModuleRequest, opts ...grpc.CallOption) (*GetModuleResponse, error) { out := new(GetModuleResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ModuleService/GetModule", in, out, opts...) + err := c.cc.Invoke(ctx, ModuleService_GetModule_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -53,7 +65,7 @@ func (c *moduleServiceClient) GetModule(ctx context.Context, in *GetModuleReques func (c *moduleServiceClient) CreateModule(ctx context.Context, in *CreateModuleRequest, opts ...grpc.CallOption) (*CreateModuleResponse, error) { out := new(CreateModuleResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ModuleService/CreateModule", in, out, opts...) + err := c.cc.Invoke(ctx, ModuleService_CreateModule_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -62,7 +74,7 @@ func (c *moduleServiceClient) CreateModule(ctx context.Context, in *CreateModule func (c *moduleServiceClient) UpdateModule(ctx context.Context, in *UpdateModuleRequest, opts ...grpc.CallOption) (*UpdateModuleResponse, error) { out := new(UpdateModuleResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ModuleService/UpdateModule", in, out, opts...) + err := c.cc.Invoke(ctx, ModuleService_UpdateModule_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -71,7 +83,7 @@ func (c *moduleServiceClient) UpdateModule(ctx context.Context, in *UpdateModule func (c *moduleServiceClient) DeleteModule(ctx context.Context, in *DeleteModuleRequest, opts ...grpc.CallOption) (*DeleteModuleResponse, error) { out := new(DeleteModuleResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ModuleService/DeleteModule", in, out, opts...) + err := c.cc.Invoke(ctx, ModuleService_DeleteModule_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -132,7 +144,7 @@ func _ModuleService_ListModules_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ModuleService/ListModules", + FullMethod: ModuleService_ListModules_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ModuleServiceServer).ListModules(ctx, req.(*ListModulesRequest)) @@ -150,7 +162,7 @@ func _ModuleService_GetModule_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ModuleService/GetModule", + FullMethod: ModuleService_GetModule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ModuleServiceServer).GetModule(ctx, req.(*GetModuleRequest)) @@ -168,7 +180,7 @@ func _ModuleService_CreateModule_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ModuleService/CreateModule", + FullMethod: ModuleService_CreateModule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ModuleServiceServer).CreateModule(ctx, req.(*CreateModuleRequest)) @@ -186,7 +198,7 @@ func _ModuleService_UpdateModule_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ModuleService/UpdateModule", + FullMethod: ModuleService_UpdateModule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ModuleServiceServer).UpdateModule(ctx, req.(*UpdateModuleRequest)) @@ -204,7 +216,7 @@ func _ModuleService_DeleteModule_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ModuleService/DeleteModule", + FullMethod: ModuleService_DeleteModule_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ModuleServiceServer).DeleteModule(ctx, req.(*DeleteModuleRequest)) diff --git a/proto/gotocompany/entropy/v1beta1/resource.pb.go b/proto/gotocompany/entropy/v1beta1/resource.pb.go index d691250b..ceca945e 100644 --- a/proto/gotocompany/entropy/v1beta1/resource.pb.go +++ b/proto/gotocompany/entropy/v1beta1/resource.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.30.0 // protoc (unknown) // source: gotocompany/entropy/v1beta1/resource.proto @@ -1277,6 +1277,7 @@ type ResourceRevision struct { CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` Spec *ResourceSpec `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"` + CreatedBy string `protobuf:"bytes,7,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` } func (x *ResourceRevision) Reset() { @@ -1353,6 +1354,13 @@ func (x *ResourceRevision) GetReason() string { return "" } +func (x *ResourceRevision) GetCreatedBy() string { + if x != nil { + return x.CreatedBy + } + return "" +} + type GetResourceRevisionsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1663,7 +1671,7 @@ var file_gotocompany_entropy_v1beta1_resource_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x22, 0xd4, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x76, + 0x22, 0xf3, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x12, 0x51, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, @@ -1680,110 +1688,112 @@ var file_gotocompany_entropy_v1beta1_resource_proto_rawDesc = []byte{ 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 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, 0x2f, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 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, 0x2f, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x22, 0x6b, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x22, 0x6b, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x91, 0x0a, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x92, 0x01, 0x0a, 0x0d, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x31, 0x2e, 0x67, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, - 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, - 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x92, - 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x91, 0x0a, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x92, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x31, 0x2e, 0x67, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, + 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x92, 0x01, + 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, + 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, - 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x75, - 0x72, 0x6e, 0x7d, 0x12, 0x9f, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x72, + 0x6e, 0x7d, 0x12, 0x9f, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x22, 0x12, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, + 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x32, 0x18, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, + 0x7b, 0x75, 0x72, 0x6e, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, - 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x32, 0x18, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x2f, 0x7b, 0x75, 0x72, 0x6e, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, - 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, - 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, - 0x75, 0x72, 0x6e, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x75, + 0x72, 0x6e, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x72, 0x6e, - 0x7d, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x2a, 0x2e, - 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, - 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, - 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x72, 0x6e, 0x7d, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x30, 0x01, 0x12, - 0xb7, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x72, 0x6e, 0x7d, + 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x2a, 0x2e, 0x67, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, + 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, - 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x72, 0x6e, 0x7d, 0x2f, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x77, 0x0a, 0x26, 0x63, 0x6f, 0x6d, - 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x6e, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x6e, 0x2f, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x3b, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x2f, 0x7b, 0x75, 0x72, 0x6e, 0x7d, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x30, 0x01, 0x12, 0xb7, + 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, + 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x72, 0x6e, 0x7d, 0x2f, 0x72, + 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x77, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, + 0x67, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x6e, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x6e, 0x2f, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x3b, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/gotocompany/entropy/v1beta1/resource.pb.gw.go b/proto/gotocompany/entropy/v1beta1/resource.pb.gw.go index 99e32e79..3f28d8ed 100644 --- a/proto/gotocompany/entropy/v1beta1/resource.pb.gw.go +++ b/proto/gotocompany/entropy/v1beta1/resource.pb.gw.go @@ -274,7 +274,7 @@ func local_request_ResourceService_DeleteResource_0(ctx context.Context, marshal } var ( - filter_ResourceService_ApplyAction_0 = &utilities.DoubleArray{Encoding: map[string]int{"params": 0, "urn": 1, "action": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} + filter_ResourceService_ApplyAction_0 = &utilities.DoubleArray{Encoding: map[string]int{"params": 0, "urn": 1, "action": 2}, Base: []int{1, 2, 4, 6, 0, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 2, 3, 3, 4, 4}} ) func request_ResourceService_ApplyAction_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -380,7 +380,7 @@ func local_request_ResourceService_ApplyAction_0(ctx context.Context, marshaler } var ( - filter_ResourceService_GetLog_0 = &utilities.DoubleArray{Encoding: map[string]int{"urn": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_ResourceService_GetLog_0 = &utilities.DoubleArray{Encoding: map[string]int{"urn": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_ResourceService_GetLog_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (ResourceService_GetLogClient, runtime.ServerMetadata, error) { @@ -670,7 +670,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv // RegisterResourceServiceHandlerFromEndpoint is same as RegisterResourceServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterResourceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) + conn, err := grpc.DialContext(ctx, endpoint, opts...) if err != nil { return err } diff --git a/proto/gotocompany/entropy/v1beta1/resource.pb.validate.go b/proto/gotocompany/entropy/v1beta1/resource.pb.validate.go index 3fce543e..7e59e8e8 100644 --- a/proto/gotocompany/entropy/v1beta1/resource.pb.validate.go +++ b/proto/gotocompany/entropy/v1beta1/resource.pb.validate.go @@ -64,6 +64,7 @@ func (m *ResourceDependency) validate(all bool) error { if len(errors) > 0 { return ResourceDependencyMultiError(errors) } + return nil } @@ -228,6 +229,7 @@ func (m *ResourceSpec) validate(all bool) error { if len(errors) > 0 { return ResourceSpecMultiError(errors) } + return nil } @@ -326,6 +328,7 @@ func (m *ListString) validate(all bool) error { if len(errors) > 0 { return ListStringMultiError(errors) } + return nil } @@ -470,6 +473,7 @@ func (m *LogOptions) validate(all bool) error { if len(errors) > 0 { return LogOptionsMultiError(errors) } + return nil } @@ -663,6 +667,7 @@ func (m *ResourceState) validate(all bool) error { if len(errors) > 0 { return ResourceStateMultiError(errors) } + return nil } @@ -888,6 +893,7 @@ func (m *Resource) validate(all bool) error { if len(errors) > 0 { return ResourceMultiError(errors) } + return nil } @@ -992,6 +998,7 @@ func (m *ListResourcesRequest) validate(all bool) error { if len(errors) > 0 { return ListResourcesRequestMultiError(errors) } + return nil } @@ -1127,6 +1134,7 @@ func (m *ListResourcesResponse) validate(all bool) error { if len(errors) > 0 { return ListResourcesResponseMultiError(errors) } + return nil } @@ -1230,6 +1238,7 @@ func (m *GetResourceRequest) validate(all bool) error { if len(errors) > 0 { return GetResourceRequestMultiError(errors) } + return nil } @@ -1360,6 +1369,7 @@ func (m *GetResourceResponse) validate(all bool) error { if len(errors) > 0 { return GetResourceResponseMultiError(errors) } + return nil } @@ -1490,6 +1500,7 @@ func (m *CreateResourceRequest) validate(all bool) error { if len(errors) > 0 { return CreateResourceRequestMultiError(errors) } + return nil } @@ -1620,6 +1631,7 @@ func (m *CreateResourceResponse) validate(all bool) error { if len(errors) > 0 { return CreateResourceResponseMultiError(errors) } + return nil } @@ -1754,6 +1766,7 @@ func (m *UpdateResourceRequest) validate(all bool) error { if len(errors) > 0 { return UpdateResourceRequestMultiError(errors) } + return nil } @@ -1884,6 +1897,7 @@ func (m *UpdateResourceResponse) validate(all bool) error { if len(errors) > 0 { return UpdateResourceResponseMultiError(errors) } + return nil } @@ -1987,6 +2001,7 @@ func (m *DeleteResourceRequest) validate(all bool) error { if len(errors) > 0 { return DeleteResourceRequestMultiError(errors) } + return nil } @@ -2088,6 +2103,7 @@ func (m *DeleteResourceResponse) validate(all bool) error { if len(errors) > 0 { return DeleteResourceResponseMultiError(errors) } + return nil } @@ -2224,6 +2240,7 @@ func (m *ApplyActionRequest) validate(all bool) error { if len(errors) > 0 { return ApplyActionRequestMultiError(errors) } + return nil } @@ -2354,6 +2371,7 @@ func (m *ApplyActionResponse) validate(all bool) error { if len(errors) > 0 { return ApplyActionResponseMultiError(errors) } + return nil } @@ -2459,6 +2477,7 @@ func (m *LogChunk) validate(all bool) error { if len(errors) > 0 { return LogChunkMultiError(errors) } + return nil } @@ -2561,6 +2580,7 @@ func (m *GetLogRequest) validate(all bool) error { if len(errors) > 0 { return GetLogRequestMultiError(errors) } + return nil } @@ -2689,6 +2709,7 @@ func (m *GetLogResponse) validate(all bool) error { if len(errors) > 0 { return GetLogResponseMultiError(errors) } + return nil } @@ -2851,9 +2872,12 @@ func (m *ResourceRevision) validate(all bool) error { // no validation rules for Reason + // no validation rules for CreatedBy + if len(errors) > 0 { return ResourceRevisionMultiError(errors) } + return nil } @@ -2955,6 +2979,7 @@ func (m *GetResourceRevisionsRequest) validate(all bool) error { if len(errors) > 0 { return GetResourceRevisionsRequestMultiError(errors) } + return nil } @@ -3091,6 +3116,7 @@ func (m *GetResourceRevisionsResponse) validate(all bool) error { if len(errors) > 0 { return GetResourceRevisionsResponseMultiError(errors) } + return nil } diff --git a/proto/gotocompany/entropy/v1beta1/resource_grpc.pb.go b/proto/gotocompany/entropy/v1beta1/resource_grpc.pb.go index 4bb55330..2520fddc 100644 --- a/proto/gotocompany/entropy/v1beta1/resource_grpc.pb.go +++ b/proto/gotocompany/entropy/v1beta1/resource_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: gotocompany/entropy/v1beta1/resource.proto package entropyv1beta1 @@ -14,6 +18,17 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + ResourceService_ListResources_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/ListResources" + ResourceService_GetResource_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/GetResource" + ResourceService_CreateResource_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/CreateResource" + ResourceService_UpdateResource_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/UpdateResource" + ResourceService_DeleteResource_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/DeleteResource" + ResourceService_ApplyAction_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/ApplyAction" + ResourceService_GetLog_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/GetLog" + ResourceService_GetResourceRevisions_FullMethodName = "/gotocompany.entropy.v1beta1.ResourceService/GetResourceRevisions" +) + // ResourceServiceClient is the client API for ResourceService 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. @@ -38,7 +53,7 @@ func NewResourceServiceClient(cc grpc.ClientConnInterface) ResourceServiceClient func (c *resourceServiceClient) ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) { out := new(ListResourcesResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ResourceService/ListResources", in, out, opts...) + err := c.cc.Invoke(ctx, ResourceService_ListResources_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -47,7 +62,7 @@ func (c *resourceServiceClient) ListResources(ctx context.Context, in *ListResou func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) { out := new(GetResourceResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ResourceService/GetResource", in, out, opts...) + err := c.cc.Invoke(ctx, ResourceService_GetResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -56,7 +71,7 @@ func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResource func (c *resourceServiceClient) CreateResource(ctx context.Context, in *CreateResourceRequest, opts ...grpc.CallOption) (*CreateResourceResponse, error) { out := new(CreateResourceResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ResourceService/CreateResource", in, out, opts...) + err := c.cc.Invoke(ctx, ResourceService_CreateResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -65,7 +80,7 @@ func (c *resourceServiceClient) CreateResource(ctx context.Context, in *CreateRe func (c *resourceServiceClient) UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) { out := new(UpdateResourceResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ResourceService/UpdateResource", in, out, opts...) + err := c.cc.Invoke(ctx, ResourceService_UpdateResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -74,7 +89,7 @@ func (c *resourceServiceClient) UpdateResource(ctx context.Context, in *UpdateRe func (c *resourceServiceClient) DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*DeleteResourceResponse, error) { out := new(DeleteResourceResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ResourceService/DeleteResource", in, out, opts...) + err := c.cc.Invoke(ctx, ResourceService_DeleteResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -83,7 +98,7 @@ func (c *resourceServiceClient) DeleteResource(ctx context.Context, in *DeleteRe func (c *resourceServiceClient) ApplyAction(ctx context.Context, in *ApplyActionRequest, opts ...grpc.CallOption) (*ApplyActionResponse, error) { out := new(ApplyActionResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ResourceService/ApplyAction", in, out, opts...) + err := c.cc.Invoke(ctx, ResourceService_ApplyAction_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -91,7 +106,7 @@ func (c *resourceServiceClient) ApplyAction(ctx context.Context, in *ApplyAction } func (c *resourceServiceClient) GetLog(ctx context.Context, in *GetLogRequest, opts ...grpc.CallOption) (ResourceService_GetLogClient, error) { - stream, err := c.cc.NewStream(ctx, &ResourceService_ServiceDesc.Streams[0], "/gotocompany.entropy.v1beta1.ResourceService/GetLog", opts...) + stream, err := c.cc.NewStream(ctx, &ResourceService_ServiceDesc.Streams[0], ResourceService_GetLog_FullMethodName, opts...) if err != nil { return nil, err } @@ -124,7 +139,7 @@ func (x *resourceServiceGetLogClient) Recv() (*GetLogResponse, error) { func (c *resourceServiceClient) GetResourceRevisions(ctx context.Context, in *GetResourceRevisionsRequest, opts ...grpc.CallOption) (*GetResourceRevisionsResponse, error) { out := new(GetResourceRevisionsResponse) - err := c.cc.Invoke(ctx, "/gotocompany.entropy.v1beta1.ResourceService/GetResourceRevisions", in, out, opts...) + err := c.cc.Invoke(ctx, ResourceService_GetResourceRevisions_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -197,7 +212,7 @@ func _ResourceService_ListResources_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ResourceService/ListResources", + FullMethod: ResourceService_ListResources_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).ListResources(ctx, req.(*ListResourcesRequest)) @@ -215,7 +230,7 @@ func _ResourceService_GetResource_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ResourceService/GetResource", + FullMethod: ResourceService_GetResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).GetResource(ctx, req.(*GetResourceRequest)) @@ -233,7 +248,7 @@ func _ResourceService_CreateResource_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ResourceService/CreateResource", + FullMethod: ResourceService_CreateResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).CreateResource(ctx, req.(*CreateResourceRequest)) @@ -251,7 +266,7 @@ func _ResourceService_UpdateResource_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ResourceService/UpdateResource", + FullMethod: ResourceService_UpdateResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).UpdateResource(ctx, req.(*UpdateResourceRequest)) @@ -269,7 +284,7 @@ func _ResourceService_DeleteResource_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ResourceService/DeleteResource", + FullMethod: ResourceService_DeleteResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).DeleteResource(ctx, req.(*DeleteResourceRequest)) @@ -287,7 +302,7 @@ func _ResourceService_ApplyAction_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ResourceService/ApplyAction", + FullMethod: ResourceService_ApplyAction_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).ApplyAction(ctx, req.(*ApplyActionRequest)) @@ -326,7 +341,7 @@ func _ResourceService_GetResourceRevisions_Handler(srv interface{}, ctx context. } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gotocompany.entropy.v1beta1.ResourceService/GetResourceRevisions", + FullMethod: ResourceService_GetResourceRevisions_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ResourceServiceServer).GetResourceRevisions(ctx, req.(*GetResourceRevisionsRequest))