1
0
mirror of synced 2026-02-06 19:05:55 +00:00

Merge pull request #3403 from somtochiama/fix-azure

Use proper file paths in Azure e2e tests
This commit is contained in:
Stefan Prodan
2022-12-14 11:11:41 +02:00
committed by GitHub
2 changed files with 8 additions and 8 deletions

View File

@@ -283,7 +283,7 @@ func TestAzureDevOpsCloning(t *testing.T) {
name: foobar name: foobar
namespace: %s namespace: %s
`, tt.name) `, tt.name)
name := fmt.Sprintf("./cloning-test/%s/configmap.yaml", tt.name) name := fmt.Sprintf("cloning-test/%s/configmap.yaml", tt.name)
files[name] = strings.NewReader(manifest) files[name] = strings.NewReader(manifest)
} }
@@ -554,7 +554,7 @@ stringData:
require.NoError(t, err) require.NoError(t, err)
files := make(map[string]io.Reader) files := make(map[string]io.Reader)
files["./key-vault-sops/secret.enc.yaml"] = r files["key-vault-sops/secret.enc.yaml"] = r
err = commitAndPushAll(repo, files, name) err = commitAndPushAll(repo, files, name)
require.NoError(t, err) require.NoError(t, err)

View File

@@ -129,7 +129,7 @@ func installFlux(ctx context.Context, kubeClient client.Client, kubeconfigPath,
//// Install Flux and push files to git repository //// Install Flux and push files to git repository
repo, _, err := getRepository(repoUrl, defaultBranch, true, azdoPat) repo, _, err := getRepository(repoUrl, defaultBranch, true, azdoPat)
if err != nil { if err != nil {
return err return fmt.Errorf("error cloning repositoriy: %w", err)
} }
kustomizeYaml := ` kustomizeYaml := `
@@ -168,19 +168,19 @@ patchesStrategicMerge:
` `
files := make(map[string]io.Reader) files := make(map[string]io.Reader)
files["./clusters/e2e/flux-system/kustomization.yaml"] = strings.NewReader(kustomizeYaml) files["clusters/e2e/flux-system/kustomization.yaml"] = strings.NewReader(kustomizeYaml)
files["./clusters/e2e/flux-system/gotk-components.yaml"] = strings.NewReader("") files["clusters/e2e/flux-system/gotk-components.yaml"] = strings.NewReader("")
files["./clusters/e2e/flux-system/gotk-sync.yaml"] = strings.NewReader("") files["clusters/e2e/flux-system/gotk-sync.yaml"] = strings.NewReader("")
err = commitAndPushAll(repo, files, defaultBranch) err = commitAndPushAll(repo, files, defaultBranch)
if err != nil { if err != nil {
return err return fmt.Errorf("error commiting and pushing manifests: %w", err)
} }
bootstrapCmd := fmt.Sprintf("flux bootstrap git --url=%s --password=%s --kubeconfig=%s"+ bootstrapCmd := fmt.Sprintf("flux bootstrap git --url=%s --password=%s --kubeconfig=%s"+
" --token-auth --path=clusters/e2e --components-extra image-reflector-controller,image-automation-controller", " --token-auth --path=clusters/e2e --components-extra image-reflector-controller,image-automation-controller",
repoUrl, azdoPat, kubeconfigPath) repoUrl, azdoPat, kubeconfigPath)
if err := runCommand(context.Background(), 10*time.Minute, "./", bootstrapCmd); err != nil { if err := runCommand(context.Background(), 10*time.Minute, "./", bootstrapCmd); err != nil {
return err return fmt.Errorf("error running bootstrap: %w", err)
} }
return nil return nil