Merge pull request 'Accept the credential form none in a provisioner's plan, so design 47's release delivers (issue 774)' (#483) from fix/774-none-form into main
Reviewed-on: #483
This commit was merged in pull request #483.
This commit is contained in:
@@ -127,9 +127,10 @@ var (
|
|||||||
// begin.
|
// begin.
|
||||||
var PlacementKinds = []string{"dir", "access", "port", "seat", "machine", "backup"}
|
var PlacementKinds = []string{"dir", "access", "port", "seat", "machine", "backup"}
|
||||||
|
|
||||||
// credentialForms are the forms a provider's offer may declare for its credential (issue 768).
|
// credentialForms are the forms a provider's offer may declare for its credential (issue 768); "none" is an offer with
|
||||||
|
// no credential, which the release's catalogue states on every such offer (issue 774).
|
||||||
var credentialForms = []string{catalogue.CredentialFormShared, catalogue.CredentialFormPair,
|
var credentialForms = []string{catalogue.CredentialFormShared, catalogue.CredentialFormPair,
|
||||||
catalogue.CredentialFormIssued, catalogue.CredentialFormGiven}
|
catalogue.CredentialFormIssued, catalogue.CredentialFormGiven, catalogue.CredentialFormNone}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
digestShape = regexp.MustCompile(`^sha256:[0-9a-f]{64}$`)
|
digestShape = regexp.MustCompile(`^sha256:[0-9a-f]{64}$`)
|
||||||
|
|||||||
@@ -316,14 +316,16 @@ func TestAPlanNamesTheCredentialFormOfEachProvidersOffer(t *testing.T) {
|
|||||||
p := aPlan()
|
p := aPlan()
|
||||||
p.Provisions = []ProvisionedCredential{
|
p.Provisions = []ProvisionedCredential{
|
||||||
{Provision: "postgres-database", Provider: "novox", ProviderModule: "postgres", CredentialForm: "pair"},
|
{Provision: "postgres-database", Provider: "novox", ProviderModule: "postgres", CredentialForm: "pair"},
|
||||||
{Provision: "sonarr-api", Provider: "ace", ProviderModule: "sonarr", CredentialForm: "shared"}}
|
{Provision: "sonarr-api", Provider: "ace", ProviderModule: "sonarr", CredentialForm: "shared"},
|
||||||
|
{Provision: "artifact-store", Provider: "novox", ProviderModule: "distribution", CredentialForm: "none"}}
|
||||||
values, err := AssignmentValues(assigned, map[string]Provisioning{"g14.dunst": p})
|
values, err := AssignmentValues(assigned, map[string]Provisioning{"g14.dunst": p})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if want := `{"provision":"postgres-database","provider":"novox","provider-module":"postgres",` +
|
if want := `{"provision":"postgres-database","provider":"novox","provider-module":"postgres",` +
|
||||||
`"credential-form":"pair"},{"provision":"sonarr-api","provider":"ace","provider-module":"sonarr",` +
|
`"credential-form":"pair"},{"provision":"sonarr-api","provider":"ace","provider-module":"sonarr",` +
|
||||||
`"credential-form":"shared"}`; !strings.Contains(string(values["g14.dunst"]), want) {
|
`"credential-form":"shared"},{"provision":"artifact-store","provider":"novox","provider-module":"distribution",` +
|
||||||
|
`"credential-form":"none"}`; !strings.Contains(string(values["g14.dunst"]), want) {
|
||||||
t.Errorf("the plan's value is %s, want it to carry %s", values["g14.dunst"], want)
|
t.Errorf("the plan's value is %s, want it to carry %s", values["g14.dunst"], want)
|
||||||
}
|
}
|
||||||
bad := aPlan()
|
bad := aPlan()
|
||||||
|
|||||||
Reference in New Issue
Block a user