From 33c8204271f79cf79bea12221421e08627386616 Mon Sep 17 00:00:00 2001 From: Nitish Malhotra Date: Tue, 2 Feb 2021 13:33:06 -0800 Subject: [PATCH] chore: Update docker targets in Make and comment cleanup (#34) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra * chore: change branch name pattern to dev (#23) * Fix go.mod dependencies go.mod was failing to resolve dependencies Signed-off-by: Nitish Malhotra * Add additional tests for Argo.go functions Added more test and test cases Signed-off-by: Nitish Malhotra * Updated status field for application type Made Chartstatus inline so that we reference it under obj.status instead of obj.status.status which causes stutter Signed-off-by: Nitish Malhotra * Created registry Client and related methods - Modifications to rest of the code tree to support registry client Still a WIP Signed-off-by: Nitish Malhotra * New configurer and additional controller members Added new members to Application and ApplicationGroup controller objects Refactored the controller Config struct Signed-off-by: Nitish Malhotra * feat: Restructuring w/ major changes Bunch of changes to the controller and reconciler Updated configurer and config.yaml format Changes to application and applicationgroup CRD Status fields Signed-off-by: Nitish Malhotra * Update orkestra-core illustration (#30) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra * Update diagram and switch harbor for chartmuseum Update the orkestra-core diagram replacing harbor for chartmuseum Signed-off-by: Nitish Malhotra * feat: Implemented the Push functionlity Verfied manually that charts get uploaded to the staging directory Signed-off-by: Nitish Malhotra * bug: resolve merge errors Signed-off-by: Nitish Malhotra * feat: Modifications and enhanced argo logic - Multiple changes in argo object to support generation of valid workflow - Added overlays field to Applications CR as a workaround for https://github.com/kubernetes/kubernetes/issues/98683 - Helm chart for orkestra init. All dependency charts helm-operator, chartmuseum, argo added to chart dependencies. - Update main.go Signed-off-by: Nitish Malhotra * Fix lint and argo_test errors Signed-off-by: Nitish Malhotra * Docker target changes and TODO comment cleanup Signed-off-by: Nitish Malhotra Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> --- Dockerfile | 1 + Makefile | 2 +- pkg/configurer/configurer.go | 1 - pkg/registry/config.go | 3 +-- pkg/workflow/argo.go | 3 +-- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 74eb9d7..c109f9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ RUN go mod download # Copy the go source COPY main.go main.go COPY api/ api/ +COPY pkg/ pkg/ COPY controllers/ controllers/ # Build diff --git a/Makefile b/Makefile index 6ebe943..d6c0700 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Image URL to use all building/pushing image targets -IMG ?= controller:latest +IMG ?= azureorkestra/orkestra:latest # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:trivialVersions=true" diff --git a/pkg/configurer/configurer.go b/pkg/configurer/configurer.go index 96c289b..0c5d8dd 100644 --- a/pkg/configurer/configurer.go +++ b/pkg/configurer/configurer.go @@ -63,7 +63,6 @@ func NewConfigurer(cfgPath string) (*Configurer, error) { func setupRegistryRepos(registries map[string]*registry.Config) error { settings := cli.New() repoFile := settings.RepositoryConfig - // TODO (nitishm) : Do we need to do this? https://github.com/helm/helm/blob/v3.1.2/cmd/helm/repo_add.go#L83-L109 err := os.MkdirAll(filepath.Dir(repoFile), os.ModePerm) if err != nil && !os.IsExist(err) { return err diff --git a/pkg/registry/config.go b/pkg/registry/config.go index 4079bd6..2520293 100644 --- a/pkg/registry/config.go +++ b/pkg/registry/config.go @@ -12,12 +12,11 @@ type Config struct { KeyFile string `yaml:"keyFile" json:"key_file,omitempty"` InsecureSkipVerify bool `yaml:"insecureSkipVerify" json:"insecure_skip_verify,omitempty"` - // TODO (nitishm) : Add these fields to the config.yaml as and when use case arrives + // TODO (nitishm) : Add these fields to the config.yaml as and when the need arrives // See https://github.com/helm/helm/blob/v3.2.1/pkg/action/install.go#L106-L116 // Keyring string // --keyring // Verify bool // --verify // Version string // --version - // XXX (nitishm) : Is this required? Since it is not part of the repoAddOption in the helm go package AccessToken string `yaml:"accessToken" json:"access_token,omitempty"` } diff --git a/pkg/workflow/argo.go b/pkg/workflow/argo.go index 0fb02be..1b8c77e 100644 --- a/pkg/workflow/argo.go +++ b/pkg/workflow/argo.go @@ -299,8 +299,7 @@ func generateSubchartAndAppDAGTasks(app *v1alpha1.Application, repo, targetNS st return nil, fmt.Errorf("repo arg must be a valid non-empty string") } - // XXX (nitishm) - // Should this be set to nil if no subcharts are found?? + // XXX (nitishm) Should this be set to nil if no subcharts are found?? tasks := make([]v1alpha12.DAGTask, 0, len(app.Spec.Subcharts)+1) for _, sc := range app.Spec.Subcharts {