From d92caaf07da63dea0eef017480f65e583b83cc23 Mon Sep 17 00:00:00 2001 From: Stefan Benz Date: Fri, 7 Oct 2022 14:01:06 +0200 Subject: [PATCH] fix: deprecated add endpoint and variable declaration --- docs/docs/apis/proto/system.md | 5 +++-- internal/command/instance.go | 4 ++-- internal/command/org.go | 4 ++-- proto/zitadel/system.proto | 4 +++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/docs/apis/proto/system.md b/docs/docs/apis/proto/system.md index 572b43a307..d18eb85dad 100644 --- a/docs/docs/apis/proto/system.md +++ b/docs/docs/apis/proto/system.md @@ -49,7 +49,7 @@ Returns the detail of an instance > **rpc** AddInstance([AddInstanceRequest](#addinstancerequest)) [AddInstanceResponse](#addinstanceresponse) -Creates a new instance with all needed setup data +deprecated: Creates a new instance with all needed setup data This might take some time @@ -74,7 +74,8 @@ Updates name of an existing instance > **rpc** CreateInstance([CreateInstanceRequest](#createinstancerequest)) [CreateInstanceResponse](#createinstanceresponse) - +Creates a new instance with all needed setup data +This might take some time diff --git a/internal/command/instance.go b/internal/command/instance.go index e33eb75c2a..9e096dc5bc 100644 --- a/internal/command/instance.go +++ b/internal/command/instance.go @@ -386,8 +386,8 @@ func (c *Commands) SetUpInstance(ctx context.Context, setup *InstanceSetup) (str return "", "", nil, nil, err } - pat := "" - machineKey := make([]byte, 0) + var pat string + var machineKey []byte if setup.Org.Machine != nil { if setup.Org.Machine.Pat { _, token, err := c.AddPersonalAccessToken(ctx, userID, orgID, setup.Org.Machine.PatExpirationDate, setup.Org.Machine.PatScopes, domain.UserTypeMachine) diff --git a/internal/command/org.go b/internal/command/org.go index fd7230d831..b809a5f157 100644 --- a/internal/command/org.go +++ b/internal/command/org.go @@ -70,8 +70,8 @@ func (c *Commands) setUpOrgWithIDs(ctx context.Context, o *OrgSetup, orgID, user return "", "", nil, nil, err } - pat := "" - machineKey := make([]byte, 0) + var pat string + var machineKey []byte if o.Machine != nil { if o.Machine.Pat { _, token, err := c.AddPersonalAccessToken(ctx, userID, orgID, o.Machine.PatExpirationDate, o.Machine.PatScopes, domain.UserTypeMachine) diff --git a/proto/zitadel/system.proto b/proto/zitadel/system.proto index a2175732cb..9a8dd983ec 100644 --- a/proto/zitadel/system.proto +++ b/proto/zitadel/system.proto @@ -122,7 +122,7 @@ service SystemService { }; } - // Creates a new instance with all needed setup data + //deprecated: Creates a new instance with all needed setup data // This might take some time rpc AddInstance(AddInstanceRequest) returns (AddInstanceResponse) { option (google.api.http) = { @@ -147,6 +147,8 @@ service SystemService { }; } + // Creates a new instance with all needed setup data + // This might take some time rpc CreateInstance(CreateInstanceRequest) returns (CreateInstanceResponse) { option (google.api.http) = { post: "/instances/_create"