Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pipelines/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ defaults:
clustersService:
imageTag: abcdef
replicas: 3
certificates:
manage: Enabled
parentZone: example.com
childZone: child.example.com
vaultBaseUrl: myvault.azure.com
Expand Down
2 changes: 2 additions & 0 deletions pipelines/testdata/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ resourceGroups:
value: OneCertV2-PrivateCA
commonName:
value: hcp-mdsd.geneva.keyvault.aro-int.azure.com
manage:
configRef: certificates.manage
- name: rpRegistration
action: ResourceProviderRegistration
resourceProviderNamespaces:
Expand Down
27 changes: 18 additions & 9 deletions pipelines/types/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,23 @@ func (s *SetCertificateIssuerStep) RequiredInputs() []StepDependency {

const StepActionCreateCertificate = "CreateCertificate"

const (
CertificateManageEnabled = "Enabled"
CertificateManageDisabled = "Disabled"
)

type CreateCertificateStep struct {
StepMeta `json:",inline"`
VaultBaseUrl Value `json:"vaultBaseUrl,omitempty"`
CertificateName Value `json:"certificateName,omitempty"`
ContentType Value `json:"contentType,omitempty"`
SAN Value `json:"san,omitempty"`
Issuer Value `json:"issuer,omitempty"`
SecretKeyVault Value `json:"secretKeyVault,omitempty"`
SecretName Value `json:"secretName,omitempty"`
ApplicationId Value `json:"applicationId,omitempty"`
CommonName Value `json:"commonName,omitempty"`
VaultBaseUrl Value `json:"vaultBaseUrl,omitempty"`
CertificateName Value `json:"certificateName,omitempty"`
ContentType Value `json:"contentType,omitempty"`
SAN Value `json:"san,omitempty"`
Issuer Value `json:"issuer,omitempty"`
SecretKeyVault Value `json:"secretKeyVault,omitempty"`
SecretName Value `json:"secretName,omitempty"`
ApplicationId Value `json:"applicationId,omitempty"`
CommonName Value `json:"commonName,omitempty"`
Manage *Value `json:"manage,omitempty"`
}

func (s *CreateCertificateStep) Description() string {
Expand All @@ -252,6 +258,9 @@ func (s *CreateCertificateStep) RequiredInputs() []StepDependency {
deps = append(deps, val.Input.StepDependency)
}
}
if s.Manage != nil && s.Manage.Input != nil {
deps = append(deps, s.Manage.Input.StepDependency)
}
Comment thread
geoberle marked this conversation as resolved.
slices.SortFunc(deps, SortDependencies)
deps = slices.Compact(deps)
return deps
Expand Down
1 change: 1 addition & 0 deletions pipelines/types/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func TestRequiredInputs(t *testing.T) {
SecretName: Value{Input: &Input{StepDependency: StepDependency{ResourceGroup: "rg", Step: "step6"}}},
ApplicationId: Value{Input: &Input{StepDependency: StepDependency{ResourceGroup: "rg", Step: "step7"}}},
CommonName: Value{Input: &Input{StepDependency: StepDependency{ResourceGroup: "rg", Step: "step8"}}},
Manage: &Value{ConfigRef: "some.config.manage"},
Comment thread
geoberle marked this conversation as resolved.
},
expected: []StepDependency{
{ResourceGroup: "rg", Step: "step"},
Expand Down
3 changes: 3 additions & 0 deletions pipelines/types/pipeline.schema.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,9 @@
},
"commonName": {
"$ref": "#/definitions/value"
},
"manage": {
"$ref": "#/definitions/value"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ resourceGroups:
value: x-pem-file
issuer:
value: OneCertV2-PrivateCA
manage:
configRef: certificates.manage
name: cert
san:
value: hcp-mdsd.geneva.keyvault.aro-int.azure.com
Expand Down
Loading