forked from open-cluster-management-io/clusteradm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-add new subcommand to install built-in addons. -add new subcommand t…
…o enable addons. -implement application-manager addon for install and enable. Signed-off-by: Mike Ng <ming@redhat.com>
- Loading branch information
Showing
4,722 changed files
with
1,605,327 additions
and
10 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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,5 @@ | ||
#file extensions to ignore on top of .gitignore | ||
.copyrightignore | ||
_generated.go | ||
test/functional/resources/hive_v1_clusterdeployment_crd.yaml | ||
test/functional/resources/hive_v1_clusterdeployment_crd.yaml | ||
vendor |
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,23 @@ | ||
# Copyright Contributors to the Open Cluster Management project | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ main, release-* ] | ||
pull_request: | ||
branches: [ main, release-* ] | ||
|
||
jobs: | ||
integration-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Integration Tests | ||
run: make test-integration |
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 |
---|---|---|
|
@@ -19,6 +19,6 @@ test/out | |
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor | ||
#vendor | ||
|
||
.DS_Store |
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,53 @@ | ||
// Copyright Contributors to the Open Cluster Management project | ||
package addons | ||
|
||
import ( | ||
"fmt" | ||
|
||
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" | ||
clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" | ||
|
||
"github.com/spf13/cobra" | ||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
) | ||
|
||
var example = ` | ||
# Enable addons on a cluster | ||
%[1]s enable addons --names application-manager --clusters cluster1,cluster2 | ||
` | ||
|
||
// NewCmd... | ||
func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { | ||
o := newOptions(clusteradmFlags, streams) | ||
|
||
cmd := &cobra.Command{ | ||
Use: "addons", | ||
Short: "enable addons", | ||
Example: fmt.Sprintf(example, clusteradmhelpers.GetExampleHeader()), | ||
SilenceUsage: true, | ||
PreRunE: func(c *cobra.Command, args []string) error { | ||
clusteradmhelpers.DryRunMessage(clusteradmFlags.DryRun) | ||
|
||
return nil | ||
}, | ||
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.names, "names", "", "Names of the add-on to deploy (comma separated)") | ||
cmd.Flags().StringVar(&o.clusters, "clusters", "", "Names of the managed cluster to deploy the add-on to (comma separated)") | ||
cmd.Flags().StringVar(&o.outputFile, "output-file", "", "The generated resources will be copied in the specified file") | ||
|
||
return cmd | ||
} |
Oops, something went wrong.