-
Notifications
You must be signed in to change notification settings - Fork 63
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: Dominique Vernier <[email protected]>
- Loading branch information
Showing
19 changed files
with
592 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
[comment]: # ( Copyright Contributors to the Open Cluster Management project ) | ||
# Release Content | ||
|
||
- Add support for non-bootstrap token enabled environment [issue 16](https://github.com/open-cluster-management-io/clusteradm/issues/16) | ||
- Add support for non-bootstrap token enabled environment [issue 16](https://github.com/open-cluster-management-io/clusteradm/issues/16) | ||
- Avoid to run the `clusteradm init` twice on the hub [issue 21](https://github.com/open-cluster-management-io/clusteradm/issues/21) | ||
- Add command `clusteradm get token` [issue 22](https://github.com/open-cluster-management-io/clusteradm/issues/22) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.1.0-alpha | ||
0.1.0-alpha.3 |
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,21 @@ | ||
// Copyright Contributors to the Open Cluster Management project | ||
package get | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
"open-cluster-management.io/clusteradm/pkg/cmd/get/token" | ||
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" | ||
) | ||
|
||
// NewCmd provides a cobra command wrapping NewCmdImportCluster | ||
func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "get", | ||
Short: "get a resource", | ||
} | ||
|
||
cmd.AddCommand(token.NewCmd(clusteradmFlags, streams)) | ||
|
||
return cmd | ||
} |
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,50 @@ | ||
// Copyright Contributors to the Open Cluster Management project | ||
package token | ||
|
||
import ( | ||
"fmt" | ||
|
||
"open-cluster-management.io/clusteradm/pkg/helpers" | ||
|
||
"github.com/spf13/cobra" | ||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" | ||
) | ||
|
||
var example = ` | ||
# Get the bootstrap token | ||
%[1]s get token | ||
` | ||
|
||
// NewCmd ... | ||
func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { | ||
o := newOptions(clusteradmFlags, streams) | ||
|
||
cmd := &cobra.Command{ | ||
Use: "token", | ||
Short: "get the bootsrap token", | ||
Example: fmt.Sprintf(example, helpers.GetExampleHeader()), | ||
SilenceUsage: true, | ||
PreRun: func(c *cobra.Command, args []string) { | ||
helpers.DryRunMessage(o.ClusteradmFlags.DryRun) | ||
}, | ||
RunE: func(c *cobra.Command, args []string) error { | ||
if err := o.complete(c, args); err != nil { | ||
return err | ||
} | ||
if err := o.validate(); err != nil { | ||
return err | ||
} | ||
if err := o.run(); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
|
||
cmd.Flags().StringVar(&o.outputFile, "output-file", "", "The generated resources will be copied in the specified file") | ||
cmd.Flags().BoolVar(&o.useBootstrapToken, "use-bootstrap-token", false, "If set then the boostrap token will used instead of a service account token") | ||
|
||
return cmd | ||
} |
Oops, something went wrong.