From 95225cf22309b5d87131a9715d464ea8ec7edc8f Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Wed, 23 Jun 2021 12:07:59 +0300 Subject: [PATCH] added default gitsource name (#12) * added default gitsource name * added rollout to eventsource * updated argocd to v2.0.4 * updated version to v0.0.17 --- Makefile | 2 +- cmd/commands/runtime.go | 18 +++++++++++++++++- manifests/argo-cd/kustomization.yaml | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3c4362d91..28d41cea3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v0.0.16 +VERSION=v0.0.17 OUT_DIR=dist YEAR?=$(shell date +"%Y") diff --git a/cmd/commands/runtime.go b/cmd/commands/runtime.go index 192e5d261..d82b591ea 100644 --- a/cmd/commands/runtime.go +++ b/cmd/commands/runtime.go @@ -168,6 +168,14 @@ func RunRuntimeCreate(ctx context.Context, opts *RuntimeCreateOptions) error { return fmt.Errorf("failed to create components-reporter: %w", err) } + if opts.gsCreateOpts.Owner == "" { + opts.gsCreateOpts.Owner = opts.insCreateOpts.Owner + } + + if opts.gsCreateOpts.Repo == "" { + opts.gsCreateOpts.Repo = opts.insCreateOpts.Repo + "-git-source" + } + if opts.gsCreateOpts.Token == "" { opts.gsCreateOpts.Token = opts.insCreateOpts.Token } @@ -538,6 +546,13 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon Namespace: runtimeName, Selectors: selectors, }, + "rollout": { + Group: "argoproj.io", + Version: "v1alpha1", + Resource: "rollouts", + Namespace: runtimeName, + Selectors: selectors, + }, }, }) if err := insFs.WriteYamls(insFs.Join(resPath, "event-source.yaml"), eventSource); err != nil { @@ -551,7 +566,7 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon EventBusName: store.Get().EventBusName, TriggerURL: cfConfig.GetCurrentContext().URL + store.Get().EventReportingEndpoint, Triggers: []string{ - "clusterWorkflowTemplate", + // "clusterWorkflowTemplate", "workflowTemplate", "workflow", "appProject", @@ -559,6 +574,7 @@ func createGitSource(ctx context.Context, insCloneOpts *git.CloneOptions, gsClon "eventBus", "eventSource", "sensor", + "rollout", }, }) if err = insFs.WriteYamls(insFs.Join(resPath, "sensor.yaml"), sensor); err != nil { diff --git a/manifests/argo-cd/kustomization.yaml b/manifests/argo-cd/kustomization.yaml index 88b2fddea..f4f212656 100644 --- a/manifests/argo-cd/kustomization.yaml +++ b/manifests/argo-cd/kustomization.yaml @@ -1,5 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - https://raw.githubusercontent.com/argoproj/argo-cd/v2.0.3/manifests/install.yaml + - https://raw.githubusercontent.com/argoproj/argo-cd/v2.0.4/manifests/install.yaml - https://raw.githubusercontent.com/argoproj-labs/applicationset/master/manifests/install.yaml # TODO: switch to the next release when available