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: Scoped clusters #7039

Merged
merged 25 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5789d14
Application retry prefill & validation
plakyda1 Aug 5, 2021
039eeb4
Retry strategy, Application + Applications
plakyda1 Jul 30, 2021
8d2f79c
Retry strategy under flag
plakyda1 Aug 4, 2021
7ed502b
Application retry prefill & validation
plakyda1 Aug 5, 2021
c7d30ca
Rebase
plakyda1 Aug 5, 2021
c84d856
Merge remote-tracking branch 'origin/master'
pasha-codefresh Aug 9, 2021
de12e1f
Merge remote-tracking branch 'origin/master'
pasha-codefresh Aug 17, 2021
99b8f2c
Merge remote-tracking branch 'origin/master'
pasha-codefresh Aug 20, 2021
5ee537c
scoped cluster, WIP
pasha-codefresh Aug 20, 2021
b546e10
scoped cluster, WIP
pasha-codefresh Aug 21, 2021
d451e2d
revert
pasha-codefresh Aug 21, 2021
7c0c27e
revert
pasha-codefresh Aug 21, 2021
6b505d0
fix proto generation
pasha-codefresh Aug 21, 2021
d92fe81
change types
pasha-codefresh Aug 21, 2021
e6e28f9
scoped clusters, WIP
pasha-codefresh Aug 22, 2021
18b5eed
render scoped cluster list and fix iteration
pasha-codefresh Aug 23, 2021
42e1f74
fix way how we build destination
pasha-codefresh Aug 23, 2021
c6939f1
revert cli changes
pasha-codefresh Aug 23, 2021
595b82c
fix import order
pasha-codefresh Aug 23, 2021
75ba09a
Merge branches 'master' and 'scoped-clusters' of github.com:pasha-cod…
pasha-codefresh Aug 24, 2021
1c15279
verify that project can be changed only with specific permissions
pasha-codefresh Aug 24, 2021
16bc698
fix typos
pasha-codefresh Aug 24, 2021
11c0f33
fix typo
pasha-codefresh Aug 24, 2021
e54b36c
fix cluster tests
pasha-codefresh Aug 24, 2021
731c562
handle namespaced mode in proper way
pasha-codefresh Aug 24, 2021
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
10 changes: 10 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3708,6 +3708,12 @@
"projectDetailedProjectsResponse": {
"type": "object",
"properties": {
"clusters": {
"type": "array",
"items": {
"$ref": "#/definitions/v1alpha1Cluster"
}
},
"globalProjects": {
"type": "array",
"items": {
Expand Down Expand Up @@ -5181,6 +5187,10 @@
"type": "string"
}
},
"project": {
"type": "string",
"title": "Reference between project and cluster that allow you automatically to be added as item inside Destinations project entity"
},
"refreshRequestedAt": {
"$ref": "#/definitions/v1Time"
},
Expand Down
9 changes: 7 additions & 2 deletions cmd/argocd/commands/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ import (
"text/tabwriter"

"github.com/mattn/go-isatty"
"k8s.io/client-go/kubernetes"

"github.com/argoproj/argo-cd/v2/util/cli"

log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"

cmdutil "github.com/argoproj/argo-cd/v2/cmd/util"
"github.com/argoproj/argo-cd/v2/common"
argocdclient "github.com/argoproj/argo-cd/v2/pkg/apiclient"
clusterpkg "github.com/argoproj/argo-cd/v2/pkg/apiclient/cluster"
argoappv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/util/cli"
"github.com/argoproj/argo-cd/v2/util/clusterauth"
"github.com/argoproj/argo-cd/v2/util/errors"
"github.com/argoproj/argo-cd/v2/util/io"
Expand Down Expand Up @@ -135,6 +137,9 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie
if clusterOpts.Shard >= 0 {
clst.Shard = &clusterOpts.Shard
}
if clusterOpts.Project != "" {
clst.Project = clusterOpts.Project
}
clstCreateReq := clusterpkg.ClusterCreateRequest{
Cluster: clst,
Upsert: clusterOpts.Upsert,
Expand Down
2 changes: 2 additions & 0 deletions cmd/util/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ type ClusterOptions struct {
Namespaces []string
ClusterResources bool
Name string
Project string
Shard int64
ExecProviderCommand string
ExecProviderArgs []string
Expand All @@ -126,6 +127,7 @@ func AddClusterFlags(command *cobra.Command, opts *ClusterOptions) {
command.Flags().StringArrayVar(&opts.Namespaces, "namespace", nil, "List of namespaces which are allowed to manage")
command.Flags().BoolVar(&opts.ClusterResources, "cluster-resources", false, "Indicates if cluster level resources should be managed. The setting is used only if list of managed namespaces is not empty.")
command.Flags().StringVar(&opts.Name, "name", "", "Overwrite the cluster name")
command.Flags().StringVar(&opts.Project, "project", "", "project of the cluster")
command.Flags().Int64Var(&opts.Shard, "shard", -1, "Cluster shard number; inferred from hostname if not set")
command.Flags().StringVar(&opts.ExecProviderCommand, "exec-command", "", "Command to run to provide client credentials to the cluster. You may need to build a custom ArgoCD image to ensure the command is available at runtime.")
command.Flags().StringArrayVar(&opts.ExecProviderArgs, "exec-command-args", nil, "Arguments to supply to the --exec-command executable")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ argocd admin cluster generate-spec CONTEXT [flags]
--name string Overwrite the cluster name
--namespace stringArray List of namespaces which are allowed to manage
-o, --output string Output format. One of: json|yaml (default "yaml")
--project string project of the cluster
--service-account string System namespace service account to use for kubernetes resource management. If not set then default "argocd-manager" SA will be used (default "argocd-manager")
--shard int Cluster shard number; inferred from hostname if not set (default -1)
--system-namespace string Use different system namespace (default "kube-system")
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/commands/argocd_cluster_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ argocd cluster add CONTEXT [flags]
--kubeconfig string use a particular kubeconfig file
--name string Overwrite the cluster name
--namespace stringArray List of namespaces which are allowed to manage
--project string project of the cluster
--service-account string System namespace service account to use for kubernetes resource management. If not set then default "argocd-manager" SA will be created
--shard int Cluster shard number; inferred from hostname if not set (default -1)
--system-namespace string Use different system namespace (default "kube-system")
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ clean_swagger() {
}

echo "If additional types are added, the number of expected collisions may need to be increased"
EXPECTED_COLLISION_COUNT=57
EXPECTED_COLLISION_COUNT=64
collect_swagger server ${EXPECTED_COLLISION_COUNT}
clean_swagger server
clean_swagger reposerver
Expand Down
186 changes: 125 additions & 61 deletions pkg/apiclient/project/project.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading