Files
+7
Kanika RanaGitHubAlexandre Gaudreaultdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Pasha KostohryspashaRegina VoloshinShubham Singhshubham singh mahargithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>CIJosh Sorefargoproj-renovate[bot] <161757507+argoproj-renovate[bot]@users.noreply.github.com>Jakub RudnikIllia OleksiukAya HosniNitish Kumar
7e0f8b86ac test(e2e): configurable tmp dir locally (#25780) (#26339)
Signed-off-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: reggie-k <[email protected]>
Signed-off-by: shubham singh mahar <[email protected]>
Signed-off-by: CI <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: renovate[bot] <renovate[bot]@users.noreply.github.com>
Signed-off-by: Jakub Rudnik <[email protected]>
Signed-off-by: ioleksiuk <[email protected]>
Signed-off-by: Illia Oleksiuk <[email protected]>
Signed-off-by: Aya <[email protected]>
Co-authored-by: Alexandre Gaudreault <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pasha Kostohrys <[email protected]>
Co-authored-by: pasha <[email protected]>
Co-authored-by: Regina Voloshin <[email protected]>
Co-authored-by: Shubham Singh <[email protected]>
Co-authored-by: shubham singh mahar <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CI <[email protected]>
Co-authored-by: Josh Soref <[email protected]>
Co-authored-by: argoproj-renovate[bot] <161757507+argoproj-renovate[bot]@users.noreply.github.com>
Co-authored-by: Jakub Rudnik <[email protected]>
Co-authored-by: Illia Oleksiuk <[email protected]>
Co-authored-by: Aya Hosni <[email protected]>
Co-authored-by: Nitish Kumar <[email protected]>
2026-02-11 12:05:24 +02:00

43 lines
1.2 KiB
Go

package gpgkeys
import (
"fmt"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
"github.com/argoproj/argo-cd/v3/util/errors"
)
// Add GPG public key via API and create appropriate file where the ConfigMap mount would de it as well
func AddGPGPublicKey(t *testing.T) {
t.Helper()
keyPath, err := filepath.Abs("../fixture/gpg/" + fixture.GpgGoodKeyID)
require.NoError(t, err)
args := []string{"gpg", "add", "--from", keyPath}
errors.NewHandler(t).FailOnErr(fixture.RunCli(args...))
if fixture.IsLocal() {
keyData, err := os.ReadFile(keyPath)
require.NoError(t, err)
err = os.WriteFile(fmt.Sprintf("%s/app/config/gpg/source/%s", fixture.TmpDir(), fixture.GpgGoodKeyID), keyData, 0o644)
require.NoError(t, err)
} else {
fixture.RestartRepoServer(t)
}
}
func DeleteGPGPublicKey(t *testing.T) {
t.Helper()
args := []string{"gpg", "rm", fixture.GpgGoodKeyID}
errors.NewHandler(t).FailOnErr(fixture.RunCli(args...))
if fixture.IsLocal() {
require.NoError(t, os.Remove(fmt.Sprintf("%s/app/config/gpg/source/%s", fixture.TmpDir(), fixture.GpgGoodKeyID)))
} else {
fixture.RestartRepoServer(t)
}
}