Skip to content

Commit

Permalink
chore: do not require remoteOrgID for remote creation
Browse files Browse the repository at this point in the history
  • Loading branch information
DStrand1 committed Oct 25, 2022
1 parent e23b6f0 commit c9ed697
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions clients/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,18 @@ func (c Client) Create(ctx context.Context, params *CreateParams) error {
OrgID: orgID,
RemoteURL: params.RemoteURL,
RemoteAPIToken: params.RemoteAPIToken,
RemoteOrgID: params.RemoteOrgID,
AllowInsecureTLS: params.AllowInsecureTLS,
}

if params.Description != "" {
body.Description = &params.Description
}
if params.RemoteOrgID != "" {
body.RemoteOrgID = &params.RemoteOrgID
} else {
fmt.Fprintln(c.StdIO, "RemoteOrgID is required for remote connections to Cloud or OSS 2.x!")
fmt.Fprintln(c.StdIO, "Ignore this message if this remote connection is to a 1.x instance")
}

// send post request
res, err := c.PostRemoteConnection(ctx).RemoteConnectionCreationRequest(body).Execute()
Expand Down Expand Up @@ -215,7 +220,7 @@ func (c Client) printRemote(opts printRemoteOpts) error {
"Name": r.GetName(),
"Org ID": r.OrgID,
"Remote URL": r.RemoteURL,
"Remote Org ID": r.RemoteOrgID,
"Remote Org ID": r.GetRemoteOrgID(),
"Allow Insecure TLS": r.AllowInsecureTLS,
}
if opts.deleted {
Expand Down
1 change: 0 additions & 1 deletion cmd/influx/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func newRemoteCreateCmd() cli.Command {
&cli.StringFlag{
Name: "remote-org-id",
Usage: "The ID of the remote organization",
Required: true,
Destination: &params.RemoteOrgID,
},
&cli.BoolFlag{
Expand Down

0 comments on commit c9ed697

Please sign in to comment.