mirror of https://github.com/fluxcd/flux2.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
992 B
Go
33 lines
992 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCreateGitSecretNoArgs(t *testing.T) {
|
|
cmd := cmdTestCase{
|
|
args: "create secret git",
|
|
wantError: true,
|
|
goldenValue: "secret name is required",
|
|
}
|
|
cmd.runTestCmd(t)
|
|
}
|
|
|
|
func TestCreateGitBasicSecret(t *testing.T) {
|
|
cmd := cmdTestCase{
|
|
args: "create secret git podinfo-auth --url=https://github.com/stefanprodan/podinfo --username=my-username --password=my-password --namespace=my-namespace --export",
|
|
wantError: false,
|
|
goldenFile: "testdata/create/secret/git/secret-git-basic.yaml",
|
|
}
|
|
cmd.runTestCmd(t)
|
|
}
|
|
|
|
func TestCreateGitSSHPasswordSecret(t *testing.T) {
|
|
cmd := cmdTestCase{
|
|
args: "create secret git podinfo-auth --url=ssh://git@github.com/stefanprodan/podinfo --private-key-file=./testdata/create/secret/git/rsa-password.private --password=password --namespace=my-namespace --export",
|
|
wantError: false,
|
|
goldenFile: "testdata/create/secret/git/git-ssh-secret-password.yaml",
|
|
}
|
|
cmd.runTestCmd(t)
|
|
}
|