mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
+7![github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>](/assets/img/avatar_default.png)





![dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>](/assets/img/avatar_default.png)



Kanika Rana
GitHub
Alexandre Gaudreault
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Pasha Kostohrys
pasha
Regina Voloshin
Shubham Singh
shubham singh mahar
github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
CI
Josh Soref
argoproj-renovate[bot] <161757507+argoproj-renovate[bot]@users.noreply.github.com>
Jakub Rudnik
Illia Oleksiuk
Aya Hosni
Nitish Kumar
7e0f8b86ac
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]>
43 lines
1.2 KiB
Go
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)
|
|
}
|
|
}
|