Skip to content

Commit 641d085

Browse files
bump argocd-autopilot v0.3.0 (#332)
* bump argocd-autopilot v0.3.0
1 parent 0ae3b72 commit 641d085

File tree

13 files changed

+982
-791
lines changed

13 files changed

+982
-791
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.so
66
*.dylib
77
coverage.txt
8+
.dccache
89

910
# Test binary, built with `go test -c`
1011
*.test

.golangci.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
# options for analysis running
55
run:
6+
# https://github.com/golangci/golangci-lint/issues/2649
7+
# enable go 1.17 linting, will not allow generics
8+
go: "1.17"
9+
610
# default concurrency is a available CPU number
711
concurrency: 4
812

@@ -30,4 +34,4 @@ linters-settings:
3034

3135
gocyclo:
3236
# minimal code complexity to report, 30 by default (but we recommend 10-20)
33-
min-complexity: 18
37+
min-complexity: 18

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.16.3-alpine3.13 as base
1+
FROM golang:1.18.0-alpine3.15 as base
22

33
WORKDIR /go/src/github.com/codefresh-io/cli-v2
44

@@ -26,7 +26,7 @@ RUN go mod verify
2626

2727
############################### CLI ###############################
2828
### Compile
29-
FROM golang:1.16.3-alpine3.13 as codefresh-build
29+
FROM golang:1.18.0-alpine3.15 as codefresh-build
3030

3131
WORKDIR /go/src/github.com/codefresh-io/cli-v2
3232

@@ -44,7 +44,7 @@ ARG SEGMENT_WRITE_KEY
4444
RUN make local DEV_MODE=false SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
4545

4646
### Run
47-
FROM alpine:3.13 as codefresh
47+
FROM alpine:3.15 as codefresh
4848

4949
WORKDIR /go/src/github.com/codefresh-io/cli-v2
5050

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.296
1+
VERSION=v0.0.297
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")
@@ -173,7 +173,7 @@ $(GOBIN)/mockery:
173173
$(GOBIN)/golangci-lint:
174174
@mkdir dist || true
175175
@echo installing: golangci-lint
176-
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.36.0
176+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.45.2
177177

178178
.PHONY: flatten-manifests-base-paths
179179
flatten-manifests-base-paths:

build/Dockerfile.helper

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17.8-alpine3.15
1+
FROM golang:1.18.0-alpine3.15
22

33
RUN apk -U add --no-cache \
44
bash \
@@ -19,7 +19,9 @@ RUN curl -L https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_
1919
&& rm gh.tar.gz \
2020
&& rm -rf gh_${GH_VERSION}_linux_amd64
2121

22-
RUN curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash \
23-
&& mv /go/kustomize /usr/bin
22+
RUN curl -Ls https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv4.5.3/kustomize_v4.5.3_linux_amd64.tar.gz --output kustomize.tar.gz \
23+
&& tar -xzf kustomize.tar.gz \
24+
&& mv ./kustomize /usr/bin \
25+
&& rm kustomize.tar.gz
2426

2527
ENTRYPOINT [ "/bin/bash" ]

cmd/commands/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func runClusterAdd(ctx context.Context, opts *ClusterAddOptions) error {
138138
return nil
139139
}
140140

141-
return opts.kubeFactory.Apply(ctx, "", manifests)
141+
return opts.kubeFactory.Apply(ctx, manifests)
142142
}
143143

144144
func createAddClusterKustomization(ingressUrl, contextName, server, csdpToken, version string) *kusttypes.Kustomization {

cmd/commands/git-source.go

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,6 @@ func createCronExampleTrigger() (*sensorsv1alpha1.Trigger, error) {
414414
Template: &sensorsv1alpha1.TriggerTemplate{
415415
Name: store.Get().CronExampleTriggerTemplateName,
416416
ArgoWorkflow: &sensorsv1alpha1.ArgoWorkflowTrigger{
417-
GroupVersionResource: metav1.GroupVersionResource{
418-
Group: "argoproj.io",
419-
Version: "v1alpha1",
420-
Resource: store.Get().WorkflowResourceName,
421-
},
422417
Operation: sensorsv1alpha1.Submit,
423418
Source: &sensorsv1alpha1.ArtifactLocation{
424419
Resource: &workflowResource,
@@ -661,9 +656,9 @@ func RunGitSourceEdit(ctx context.Context, opts *GitSourceEditOptions) error {
661656
return fmt.Errorf("failed to read the %s of git-source: %s. Err: %w", fileName, opts.GsName, err)
662657
}
663658

664-
c.SrcPath = opts.GsCloneOpts.Path()
665-
c.SrcRepoURL = opts.GsCloneOpts.URL()
666-
c.SrcTargetRevision = opts.GsCloneOpts.Revision()
659+
c.Config.SrcPath = opts.GsCloneOpts.Path()
660+
c.Config.SrcRepoURL = opts.GsCloneOpts.URL()
661+
c.Config.SrcTargetRevision = opts.GsCloneOpts.Revision()
667662

668663
err = fs.WriteJson(fileName, c)
669664
if err != nil {
@@ -687,28 +682,26 @@ func createDemoWorkflowTemplate(gsFs fs.FS) error {
687682
ObjectMeta: metav1.ObjectMeta{
688683
Name: store.Get().CronExampleTriggerTemplateName,
689684
},
690-
Spec: wfv1alpha1.WorkflowTemplateSpec{
691-
WorkflowSpec: wfv1alpha1.WorkflowSpec{
692-
Arguments: wfv1alpha1.Arguments{
693-
Parameters: []wfv1alpha1.Parameter{{Name: "message"}},
694-
},
695-
Entrypoint: "whalesay",
696-
ServiceAccountName: store.Get().CodefreshSA,
697-
PodGC: &wfv1alpha1.PodGC{
698-
Strategy: wfv1alpha1.PodGCOnWorkflowCompletion,
699-
},
700-
Templates: []wfv1alpha1.Template{
701-
{
702-
Name: "whalesay",
703-
Inputs: wfv1alpha1.Inputs{
704-
Parameters: []wfv1alpha1.Parameter{{Name: "message", Value: wfv1alpha1.AnyStringPtr("hello world")}},
705-
Artifacts: wfv1alpha1.Artifacts{},
706-
},
707-
Container: &corev1.Container{
708-
Image: "docker/whalesay:latest",
709-
Command: []string{"cowsay"},
710-
Args: []string{"{{inputs.parameters.message}}"},
711-
},
685+
Spec: wfv1alpha1.WorkflowSpec{
686+
Arguments: wfv1alpha1.Arguments{
687+
Parameters: []wfv1alpha1.Parameter{{Name: "message"}},
688+
},
689+
Entrypoint: "whalesay",
690+
ServiceAccountName: store.Get().CodefreshSA,
691+
PodGC: &wfv1alpha1.PodGC{
692+
Strategy: wfv1alpha1.PodGCOnWorkflowCompletion,
693+
},
694+
Templates: []wfv1alpha1.Template{
695+
{
696+
Name: "whalesay",
697+
Inputs: wfv1alpha1.Inputs{
698+
Parameters: []wfv1alpha1.Parameter{{Name: "message", Value: wfv1alpha1.AnyStringPtr("hello world")}},
699+
Artifacts: wfv1alpha1.Artifacts{},
700+
},
701+
Container: &corev1.Container{
702+
Image: "docker/whalesay:latest",
703+
Command: []string{"cowsay"},
704+
Args: []string{"{{inputs.parameters.message}}"},
712705
},
713706
},
714707
},
@@ -888,11 +881,6 @@ func createGithubExampleTrigger() sensorsv1alpha1.Trigger {
888881
Template: &sensorsv1alpha1.TriggerTemplate{
889882
Name: store.Get().GithubExampleTriggerTemplateName,
890883
ArgoWorkflow: &sensorsv1alpha1.ArgoWorkflowTrigger{
891-
GroupVersionResource: metav1.GroupVersionResource{
892-
Group: "argoproj.io",
893-
Version: "v1alpha1",
894-
Resource: store.Get().WorkflowResourceName,
895-
},
896884
Operation: sensorsv1alpha1.Submit,
897885
Source: &sensorsv1alpha1.ArtifactLocation{
898886
Resource: &workflowResource,

cmd/commands/runtime.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,18 @@ import (
4444
"github.com/codefresh-io/go-sdk/pkg/codefresh"
4545
"github.com/codefresh-io/go-sdk/pkg/codefresh/model"
4646
apmodel "github.com/codefresh-io/go-sdk/pkg/codefresh/model/app-proxy"
47+
"golang.org/x/text/cases"
48+
"golang.org/x/text/language"
4749

4850
"github.com/Masterminds/semver/v3"
49-
appset "github.com/argoproj-labs/applicationset/api/v1alpha1"
5051
apcmd "github.com/argoproj-labs/argocd-autopilot/cmd/commands"
5152
"github.com/argoproj-labs/argocd-autopilot/pkg/application"
5253
"github.com/argoproj-labs/argocd-autopilot/pkg/fs"
5354
"github.com/argoproj-labs/argocd-autopilot/pkg/git"
5455
"github.com/argoproj-labs/argocd-autopilot/pkg/kube"
5556
apstore "github.com/argoproj-labs/argocd-autopilot/pkg/store"
5657
aputil "github.com/argoproj-labs/argocd-autopilot/pkg/util"
58+
appset "github.com/argoproj/applicationset/api/v1alpha1"
5759
argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
5860
argocdv1alpha1cs "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned"
5961
aev1alpha1 "github.com/argoproj/argo-events/pkg/apis/eventsource/v1alpha1"
@@ -70,8 +72,8 @@ import (
7072
rbacv1 "k8s.io/api/rbac/v1"
7173
kerrors "k8s.io/apimachinery/pkg/api/errors"
7274
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
73-
kustid "sigs.k8s.io/kustomize/api/resid"
7475
kusttypes "sigs.k8s.io/kustomize/api/types"
76+
kustid "sigs.k8s.io/kustomize/kyaml/resid"
7577
)
7678

7779
type (
@@ -1812,7 +1814,7 @@ func createWorkflowsIngress(ctx context.Context, opts *RuntimeInstallOptions, rt
18121814
kust.Resources = append(kust.Resources, "ingress.yaml")
18131815
kust.Patches = append(kust.Patches, kusttypes.Patch{
18141816
Target: &kusttypes.Selector{
1815-
KrmId: kusttypes.KrmId{
1817+
ResId: kustid.ResId{
18161818
Gvk: kustid.Gvk{
18171819
Group: appsv1.SchemeGroupVersion.Group,
18181820
Version: appsv1.SchemeGroupVersion.Version,
@@ -1914,7 +1916,7 @@ func createEventsReporter(ctx context.Context, cloneOpts *git.CloneOptions, opts
19141916
return fmt.Errorf("failed to create argocd token secret: %w", err)
19151917
}
19161918

1917-
if err = opts.KubeFactory.Apply(ctx, opts.RuntimeName, aputil.JoinManifests(runtimeTokenSecret, argoTokenSecret)); err != nil {
1919+
if err = opts.KubeFactory.Apply(ctx, aputil.JoinManifests(runtimeTokenSecret, argoTokenSecret)); err != nil {
19181920
return fmt.Errorf("failed to create codefresh token: %w", err)
19191921
}
19201922

@@ -2000,9 +2002,10 @@ func createReporter(ctx context.Context, cloneOpts *git.CloneOptions, opts *Runt
20002002
return err
20012003
}
20022004

2003-
log.G(ctx).Info("Pushing Codefresh ", strings.Title(reporterCreateOpts.reporterName), " manifests")
2005+
titleCase := cases.Title(language.AmericanEnglish)
2006+
log.G(ctx).Info("Pushing Codefresh ", titleCase.String(reporterCreateOpts.reporterName), " manifests")
20042007

2005-
pushMessage := "Created Codefresh" + strings.Title(reporterCreateOpts.reporterName) + "Reporter"
2008+
pushMessage := "Created Codefresh" + titleCase.String(reporterCreateOpts.reporterName) + "Reporter"
20062009

20072010
return apu.PushWithMessage(ctx, r, pushMessage)
20082011
}

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cf version
2323

2424
```bash
2525
# download and extract the binary
26-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.296/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.297/cf-linux-amd64.tar.gz | tar zx
2727

2828
# move the binary to your $PATH
2929
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636

3737
```bash
3838
# download and extract the binary
39-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.296/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.297/cf-darwin-amd64.tar.gz | tar zx
4040

4141
# move the binary to your $PATH
4242
mv ./cf-darwin-amd64 /usr/local/bin/cf

0 commit comments

Comments
 (0)