diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index db9dd36234979..b111458f15304 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -50,24 +50,6 @@ jobs: - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - - name: Setup cache for argocd-ui docker layer - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-single-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-single-buildx - - - name: Build cache for argocd-ui stage - uses: docker/build-push-action@v2 - with: - context: ./src/github.com/argoproj/argo-cd - target: argocd-ui - push: false - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'test-arm-image') - - name: Run non-container Snyk scans if: github.event_name == 'push' working-directory: ./src/github.com/argoproj/argo-cd @@ -88,7 +70,6 @@ jobs: fi echo "Building image for platforms: $IMAGE_PLATFORMS" docker buildx build --platform $IMAGE_PLATFORMS --push="${{ github.event_name == 'push' }}" \ - --cache-from "type=local,src=/tmp/.buildx-cache" \ -t ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} \ -t quay.io/argoproj/argocd:latest . working-directory: ./src/github.com/argoproj/argo-cd @@ -101,15 +82,6 @@ jobs: run: | snyk container test quay.io/argoproj/argocd:latest --org=argoproj --file=Dockerfile --severity-threshold=high - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Clean up build cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'test-arm-image') - # deploy - run: git clone "https://$TOKEN@github.com/argoproj/argoproj-deployments" if: github.event_name == 'push' diff --git a/reposerver/repository/repository_norace_test.go b/reposerver/repository/repository_norace_test.go deleted file mode 100644 index 96c09039b3fe5..0000000000000 --- a/reposerver/repository/repository_norace_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build !race -// +build !race - -package repository - -import ( - "os" - "path/filepath" - "sync" - "testing" - - "github.com/stretchr/testify/assert" - - argoappv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - "github.com/argoproj/argo-cd/v2/reposerver/apiclient" -) - -func TestHelmDependencyWithConcurrency(t *testing.T) { - - // !race: - // Un-synchronized use of a random source, will be fixed when this is merged: - // https://github.com/argoproj/argo-cd/issues/4728 - - cleanup := func() { - _ = os.Remove(filepath.Join("../../util/helm/testdata/dependency", helmDepUpMarkerFile)) - _ = os.RemoveAll(filepath.Join("../../util/helm/testdata/dependency", "charts")) - } - cleanup() - defer cleanup() - - helmRepo := argoappv1.Repository{Name: "bitnami", Type: "helm", Repo: "https://charts.bitnami.com/bitnami"} - var wg sync.WaitGroup - wg.Add(3) - for i := 0; i < 3; i++ { - go func() { - res, err := helmTemplate("../../util/helm/testdata/dependency", "../..", nil, &apiclient.ManifestRequest{ - ApplicationSource: &argoappv1.ApplicationSource{}, - Repos: []*argoappv1.Repository{&helmRepo}, - }, false) - - assert.NoError(t, err) - assert.NotNil(t, res) - wg.Done() - }() - } - wg.Wait() -} diff --git a/reposerver/repository/repository_test.go b/reposerver/repository/repository_test.go index cc1af272dca68..c38171c9e21a4 100644 --- a/reposerver/repository/repository_test.go +++ b/reposerver/repository/repository_test.go @@ -355,28 +355,6 @@ func TestGenerateJsonnetLibOutside(t *testing.T) { require.Contains(t, err.Error(), "value file '../../../testdata/jsonnet/vendor' resolved to outside repository root") } -func TestGenerateHelmChartWithDependencies(t *testing.T) { - service := newService("../..") - - cleanup := func() { - _ = os.Remove(filepath.Join("../../util/helm/testdata/dependency", helmDepUpMarkerFile)) - _ = os.RemoveAll(filepath.Join("../../util/helm/testdata/dependency", "charts")) - } - cleanup() - defer cleanup() - - helmRepo := argoappv1.Repository{Name: "bitnami", Type: "helm", Repo: "https://charts.bitnami.com/bitnami"} - q := apiclient.ManifestRequest{ - Repo: &argoappv1.Repository{}, - ApplicationSource: &argoappv1.ApplicationSource{ - Path: "./util/helm/testdata/dependency", - }, - Repos: []*argoappv1.Repository{&helmRepo}, - } - res1, err := service.GenerateManifest(context.Background(), &q) - assert.Nil(t, err) - assert.Len(t, res1.Manifests, 10) -} func TestManifestGenErrorCacheByNumRequests(t *testing.T) { // Returns the state of the manifest generation cache, by querying the cache for the previously set result @@ -1717,8 +1695,6 @@ func TestFindManifests_Exclude_NothingMatches(t *testing.T) { []string{"nginx-deployment", "nginx-deployment-sub"}, []string{objs[0].GetName(), objs[1].GetName()}) } - - func Test_findManifests(t *testing.T) { logCtx := log.WithField("test", "test") noRecurse := argoappv1.ApplicationSourceDirectory{Recurse: false} diff --git a/server/application/terminal.go b/server/application/terminal.go index 9758b2a586735..6cbbab81b0bd9 100644 --- a/server/application/terminal.go +++ b/server/application/terminal.go @@ -94,8 +94,8 @@ func (s *terminalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { podName := q.Get("pod") container := q.Get("container") - app := q.Get("app") - project := q.Get("project") + app := q.Get("appName") + project := q.Get("projectName") namespace := q.Get("namespace") if podName == "" || container == "" || app == "" || project == "" || namespace == "" { @@ -123,7 +123,7 @@ func (s *terminalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { http.Error(w, "Namespace name is not valid", http.StatusBadRequest) return } - shell := q.Get("shell") // No need to validate. Will only buse used if it's in the allow-list. + shell := q.Get("shell") // No need to validate. Will only buse used if it's in the allow-list. ctx := r.Context() diff --git a/util/helm/helm_test.go b/util/helm/helm_test.go index b373fbab7937d..400b1132cc4ff 100644 --- a/util/helm/helm_test.go +++ b/util/helm/helm_test.go @@ -1,8 +1,6 @@ package helm import ( - "fmt" - "os" "path/filepath" "testing" @@ -126,27 +124,6 @@ func TestHelmGetParamsValueFilesThatExist(t *testing.T) { assert.Equal(t, "3", slaveCountParam) } -func TestHelmDependencyBuild(t *testing.T) { - helmRepos := []HelmRepository{{Name: "bitnami", Repo: "https://charts.bitnami.com/bitnami"}} - chart := "dependency" - clean := func() { - _ = os.RemoveAll("./testdata/dependency/charts") - _ = os.RemoveAll("./testdata/dependency/Chart.lock") - } - clean() - defer clean() - h, err := NewHelmApp(fmt.Sprintf("./testdata/%s", chart), helmRepos, false, "", "", false) - assert.NoError(t, err) - err = h.Init() - assert.NoError(t, err) - _, err = h.Template(&TemplateOpts{Name: "wordpress"}) - assert.Error(t, err) - err = h.DependencyBuild() - assert.NoError(t, err) - _, err = h.Template(&TemplateOpts{Name: "wordpress"}) - assert.NoError(t, err) -} - func TestHelmTemplateReleaseNameOverwrite(t *testing.T) { h, err := NewHelmApp("./testdata/redis", nil, false, "", "", false) assert.NoError(t, err)