Skip to content

Commit

Permalink
Argocd v2.3.1 (#247)
Browse files Browse the repository at this point in the history
* * updated argocd dependencies to v2.3.1
* upgraded to golang v1.17
* removed packr dependency
* moved to use applicationset argocd addon as dependency

* codegen

* fix apply with namespace

* fix tests

* wip

* fix codegen
  • Loading branch information
roi-codefresh authored Mar 14, 2022
1 parent 7bb7e5d commit f3823d3
Show file tree
Hide file tree
Showing 17 changed files with 1,006 additions and 419 deletions.
3 changes: 1 addition & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
coverage:
status:
patch: off
project:
default:
# allow test coverage to drop by 2%
threshold: 2
threshold: "2%"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dist/
.DS_Store
.AppleDouble
.LSOverride
.dccache

# Icon must end with two \r
Icon
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.3-alpine3.13 as base
FROM golang:1.17.8-alpine3.15 as base

WORKDIR /go/src/github.com/argoproj-labs/argocd-autopilot

Expand All @@ -21,7 +21,7 @@ RUN go mod verify

############################### CLI ###############################
### Compile
FROM golang:1.16.3-alpine3.13 as autopilot-build
FROM golang:1.17.8-alpine3.15 as autopilot-build

WORKDIR /go/src/github.com/argoproj-labs/argocd-autopilot

Expand All @@ -38,7 +38,7 @@ ENV GOBIN /go/bin
RUN make local DEV_MODE=false

### Run
FROM alpine:3.13 as autopilot
FROM alpine:3.15 as autopilot

WORKDIR /go/src/github.com/argoproj-labs/argocd-autopilot

Expand Down
2 changes: 1 addition & 1 deletion cmd/commands/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/argoproj-labs/argocd-autopilot/pkg/store"
"github.com/argoproj-labs/argocd-autopilot/pkg/util"

appset "github.com/argoproj-labs/applicationset/api/v1alpha1"
appset "github.com/argoproj/applicationset/api/v1alpha1"
argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/ghodss/yaml"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion cmd/commands/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/argoproj-labs/argocd-autopilot/pkg/store"
"github.com/argoproj-labs/argocd-autopilot/pkg/util"

appset "github.com/argoproj-labs/applicationset/api/v1alpha1"
appset "github.com/argoproj/applicationset/api/v1alpha1"
argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/ghodss/yaml"
"github.com/go-git/go-billy/v5/memfs"
Expand Down
2 changes: 1 addition & 1 deletion cmd/commands/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/argoproj-labs/argocd-autopilot/pkg/store"
"github.com/argoproj-labs/argocd-autopilot/pkg/util"

appset "github.com/argoproj-labs/applicationset/api/v1alpha1"
appset "github.com/argoproj/applicationset/api/v1alpha1"
argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/ghodss/yaml"
"github.com/go-git/go-billy/v5/memfs"
Expand Down
6 changes: 3 additions & 3 deletions cmd/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/argoproj-labs/argocd-autopilot/pkg/store"
"github.com/argoproj-labs/argocd-autopilot/pkg/util"

appset "github.com/argoproj-labs/applicationset/api/v1alpha1"
appset "github.com/argoproj/applicationset/api/v1alpha1"
argocdcommon "github.com/argoproj/argo-cd/v2/common"
argocdsettings "github.com/argoproj/argo-cd/v2/util/settings"
"github.com/ghodss/yaml"
Expand Down Expand Up @@ -234,7 +234,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error {
// apply built manifest to k8s cluster
log.G(ctx).Infof("using context: \"%s\", namespace: \"%s\"", opts.KubeContextName, opts.Namespace)
log.G(ctx).Infof("applying bootstrap manifests to cluster...")
if err = opts.KubeFactory.Apply(ctx, opts.Namespace, util.JoinManifests(manifests.namespace, manifests.applyManifests, manifests.repoCreds)); err != nil {
if err = opts.KubeFactory.Apply(ctx, util.JoinManifests(manifests.namespace, manifests.applyManifests, manifests.repoCreds)); err != nil {
return fmt.Errorf("failed to apply bootstrap manifests to cluster: %w", err)
}

Expand Down Expand Up @@ -266,7 +266,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error {

// apply "Argo-CD" Application that references "bootstrap/argo-cd"
log.G(ctx).Infof("applying argo-cd bootstrap application")
if err = opts.KubeFactory.Apply(ctx, opts.Namespace, manifests.bootstrapApp); err != nil {
if err = opts.KubeFactory.Apply(ctx, manifests.bootstrapApp); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth" // used for authentication with cloud providers
)

//go:generate sh -c "echo generating command docs... && cd .. && go run ./hack/cmd-docs/main.go"
//go:generate sh -c "echo generating command docs... && cd .. && ARGOCD_CONFIG_DIR=/home/user/.config/argocd go run ./hack/cmd-docs/main.go"

func main() {
ctx := context.Background()
Expand Down
5 changes: 4 additions & 1 deletion docs/commands/argocd-autopilot_project_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ argocd-autopilot project create [PROJECT] [flags]
### Options

```
--annotation stringArray Set metadata annotations (e.g. --annotation key=value)
--auth-token string Authentication token
--aws-cluster-name string AWS Cluster name if set then aws cli eks token command will be used to access cluster
--aws-role-arn string Optional AWS role arn. If set then AWS IAM Authenticator assumes a role to perform cluster operations instead of the default AWS credential provider chain.
--client-crt string Client certificate file
--client-crt-key string Client certificate key file
--cluster-resources Indicates if cluster level resources should be managed. The setting is used only if list of managed namespaces is not empty.
--config string Path to Argo CD config (default "/home/user/.argocd/config")
--config string Path to Argo CD config (default "/home/user/.config/argocd/config")
--core If set to true then CLI talks directly to Kubernetes instead of talking to Argo CD API server
--dest-kube-context string The default destination kubernetes context for applications in this project
--dry-run If true, print manifests instead of applying them to the cluster (nothing will be commited to git)
Expand All @@ -53,10 +54,12 @@ argocd-autopilot project create [PROJECT] [flags]
--http-retry-max int Maximum number of retries to establish http connection to Argo CD server
--in-cluster Indicates Argo CD resides inside this cluster and should connect using the internal k8s hostname (kubernetes.default.svc)
--insecure Skip server certificate and domain verification
--label stringArray Set metadata labels (e.g. --label key=value)
--name string Overwrite the cluster name
--plaintext Disable TLS
--port-forward Connect to a random argocd-server port using port forwarding
--port-forward-namespace string Namespace name which should be used for port forwarding
--project string project of the cluster
--repo string Repository URL [GIT_REPO]
--server string Argo CD server address
--server-crt string Server certificate file
Expand Down
Loading

0 comments on commit f3823d3

Please sign in to comment.