-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Kosiewski <[email protected]>
- Loading branch information
Thomas Kosiewski
committed
Sep 21, 2023
1 parent
fff3cf4
commit 6904aed
Showing
26 changed files
with
317 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//go:build !pro | ||
// +build !pro | ||
|
||
package logout | ||
|
||
import ( | ||
"github.com/loft-sh/vcluster/cmd/vclusterctl/flags" | ||
"github.com/loft-sh/vcluster/pkg/constants" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewLogoutCmd(*flags.GlobalFlags) (*cobra.Command, error) { | ||
return nil, constants.ErrOnlyInPro | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//go:build pro | ||
// +build pro | ||
|
||
package logout | ||
|
||
import ( | ||
"fmt" | ||
|
||
loftctl "github.com/loft-sh/loftctl/v3/cmd/loftctl/cmd" | ||
loftctlflags "github.com/loft-sh/loftctl/v3/cmd/loftctl/flags" | ||
"github.com/loft-sh/vcluster/cmd/vclusterctl/flags" | ||
"github.com/loft-sh/vcluster/pkg/pro" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewLogoutCmd(globalFlags *flags.GlobalFlags) (*cobra.Command, error) { | ||
loftctlGlobalFlags := &loftctlflags.GlobalFlags{ | ||
Silent: globalFlags.Silent, | ||
Debug: globalFlags.Debug, | ||
LogOutput: globalFlags.LogOutput, | ||
} | ||
|
||
if globalFlags.Config != "" { | ||
loftctlGlobalFlags.Config = globalFlags.Config | ||
} else { | ||
var err error | ||
loftctlGlobalFlags.Config, err = pro.GetLoftConfigFilePath() | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to get vcluster pro configuration file path: %w", err) | ||
} | ||
} | ||
|
||
logoutCmd := loftctl.NewLogoutCmd(loftctlGlobalFlags) | ||
|
||
logoutCmd.Use = "logout" | ||
logoutCmd.Long = `######################################################## | ||
Log out of vCluster.Pro | ||
Example: | ||
vcluster logout | ||
######################################################## | ||
` | ||
|
||
return logoutCmd, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package constants | ||
|
||
import "errors" | ||
|
||
var ( | ||
ErrOnlyInPro = errors.New("this command is only available in vcluster pro") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
vendor/github.com/loft-sh/api/v3/pkg/apis/storage/v1/project_types.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
vendor/github.com/loft-sh/api/v3/pkg/apis/storage/v1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.