Skip to content

Commit

Permalink
Fix Manifests (#6)
Browse files Browse the repository at this point in the history
* don't infer appTypes
* updated to autopilot 0.2.4
* updated to applicationset@master
  • Loading branch information
ATGardner authored Jun 16, 2021
1 parent ad4efaf commit 700640b
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=v0.0.12
VERSION=v0.0.13
OUT_DIR=dist
YEAR?=$(shell date +"%Y")

Expand Down
11 changes: 6 additions & 5 deletions cmd/commands/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ func RunRuntimeCreate(ctx context.Context, opts *RuntimeCreateOptions) error {
return err
}

if err = createApp(ctx, installOpts, opts.RuntimeName, "events", store.Get().ArgoEventsManifestsURL, opts.RuntimeName); err != nil {
if err = createApp(ctx, installOpts, opts.RuntimeName, "events", store.Get().ArgoEventsManifestsURL, application.AppTypeKustomize, opts.RuntimeName); err != nil {
return fmt.Errorf("failed to create application events: %w", err)
}

if err = createApp(ctx, installOpts, opts.RuntimeName, "rollouts", store.Get().ArgoRolloutsManifestsURL, opts.RuntimeName); err != nil {
if err = createApp(ctx, installOpts, opts.RuntimeName, "rollouts", store.Get().ArgoRolloutsManifestsURL, application.AppTypeKustomize, opts.RuntimeName); err != nil {
return fmt.Errorf("failed to create application rollouts: %w", err)
}

if err = createApp(ctx, installOpts, opts.RuntimeName, "workflows", store.Get().ArgoWorkflowsManifestsURL, opts.RuntimeName); err != nil {
if err = createApp(ctx, installOpts, opts.RuntimeName, "workflows", store.Get().ArgoWorkflowsManifestsURL, application.AppTypeKustomize, opts.RuntimeName); err != nil {
return fmt.Errorf("failed to create application workflows: %w", err)
}

Expand All @@ -175,7 +175,7 @@ func createCodefreshResources(ctx context.Context, cloneOpts *git.CloneOptions,
}

resPath := cloneOpts.FS.Join(apstore.Default.AppsDir, store.Get().ComponentsReporterName, opts.RuntimeName, "resources")
if err := createApp(ctx, cloneOpts, opts.RuntimeName, store.Get().ComponentsReporterName, cloneOpts.URL()+"/"+resPath, opts.RuntimeName); err != nil {
if err := createApp(ctx, cloneOpts, opts.RuntimeName, store.Get().ComponentsReporterName, cloneOpts.URL()+"/"+resPath, application.AppTypeDirectory, opts.RuntimeName); err != nil {
return err
}

Expand Down Expand Up @@ -205,13 +205,14 @@ func createCodefreshResources(ctx context.Context, cloneOpts *git.CloneOptions,
})
}

func createApp(ctx context.Context, cloneOpts *git.CloneOptions, projectName, appName, appURL, namespace string) error {
func createApp(ctx context.Context, cloneOpts *git.CloneOptions, projectName, appName, appURL, appType, namespace string) error {
return apcmd.RunAppCreate(ctx, &apcmd.AppCreateOptions{
CloneOpts: cloneOpts,
ProjectName: projectName,
AppOpts: &application.CreateOptions{
AppName: appName,
AppSpecifier: appURL,
AppType: appType,
DestNamespace: namespace,
},
})
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/argoproj-labs/applicationset v0.1.0
github.com/argoproj-labs/argocd-autopilot v0.2.1
github.com/argoproj-labs/argocd-autopilot v0.2.4
github.com/argoproj/argo-cd/v2 v2.0.3
github.com/argoproj/argo-events v0.17.1-0.20210527154554-3f05846796c2
github.com/briandowns/spinner v1.13.0
Expand All @@ -19,11 +19,13 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.21.1
k8s.io/apimachinery v0.21.1
)

replace (
github.com/argoproj-labs/applicationset => github.com/argoproj-labs/applicationset v0.0.0-20210614145856-2c62537a8e5a
k8s.io/api => k8s.io/api v0.21.1
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.1
k8s.io/apimachinery => k8s.io/apimachinery v0.21.1
Expand Down
Loading

0 comments on commit 700640b

Please sign in to comment.