Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow writing to stdout in Konnect mode #829

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/common_konnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ func dumpKonnectV2(ctx context.Context) error {
if err != nil {
return err
}
if dumpCmdKongStateFile == "-" {
return fmt.Errorf("writing to stdout is not supported in Konnect mode")
}
if dumpConfig.KonnectRuntimeGroup == "" {
dumpConfig.KonnectRuntimeGroup = defaultRuntimeGroupName
}
Expand Down
5 changes: 0 additions & 5 deletions cmd/konnect_diff.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

Expand All @@ -24,9 +22,6 @@ func newKonnectDiffCmd() *cobra.Command {
that will be created, updated, or deleted.` + konnectAlphaState,
Args: validateNoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if konnectDumpCmdKongStateFile == "-" {
return fmt.Errorf("writing to stdout is not supported in Konnect mode")
}
_ = sendAnalytics("konnect-diff", "", modeKonnect)
if konnectConfig.Address == defaultKonnectURL {
konnectConfig.Address = defaultLegacyKonnectURL
Expand Down
4 changes: 0 additions & 4 deletions cmd/konnect_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ func newKonnectDumpCmd() *cobra.Command {
httpClient := utils.HTTPClient()
_ = sendAnalytics("konnect-dump", "", modeKonnect)

if konnectDumpCmdKongStateFile == "-" {
return fmt.Errorf("writing to stdout is not supported in Konnect mode")
}

if yes, err := utils.ConfirmFileOverwrite(konnectDumpCmdKongStateFile, dumpCmdStateFormat, assumeYes); err != nil {
return err
} else if !yes {
Expand Down
5 changes: 0 additions & 5 deletions cmd/konnect_sync.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

Expand All @@ -16,9 +14,6 @@ func newKonnectSyncCmd() *cobra.Command {
to get Konnect's state in sync with the input state.` + konnectAlphaState,
Args: validateNoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if konnectDumpCmdKongStateFile == "-" {
return fmt.Errorf("writing to stdout is not supported in Konnect mode")
}
_ = sendAnalytics("konnect-sync", "", modeKonnect)
if konnectConfig.Address == defaultKonnectURL {
konnectConfig.Address = defaultLegacyKonnectURL
Expand Down