Skip to content

Commit

Permalink
Merge pull request #1275 from mrogers950/aggregator_roots
Browse files Browse the repository at this point in the history
pkg/asset/tls: self-sign aggregator-ca
  • Loading branch information
openshift-merge-robot authored Feb 26, 2019
2 parents e3d78d6 + 71441ef commit e9cb85a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions pkg/asset/tls/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// AggregatorCA is the asset that generates the aggregator-ca key/cert pair.
// [DEPRECATED]
type AggregatorCA struct {
SignedCertKey
SelfSignedCertKey
}

var _ asset.Asset = (*AggregatorCA)(nil)
Expand All @@ -19,24 +19,19 @@ var _ asset.Asset = (*AggregatorCA)(nil)
// the parent CA, and install config if it depends on the install config for
// DNS names, etc.
func (a *AggregatorCA) Dependencies() []asset.Asset {
return []asset.Asset{
&RootCA{},
}
return []asset.Asset{}
}

// Generate generates the cert/key pair based on its dependencies.
func (a *AggregatorCA) Generate(dependencies asset.Parents) error {
rootCA := &RootCA{}
dependencies.Get(rootCA)

cfg := &CertCfg{
Subject: pkix.Name{CommonName: "aggregator", OrganizationalUnit: []string{"bootkube"}},
KeyUsages: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
Validity: ValidityOneDay,
IsCA: true,
}

return a.SignedCertKey.Generate(cfg, rootCA, "aggregator-ca", DoNotAppendParent)
return a.SelfSignedCertKey.Generate(cfg, "aggregator-ca")
}

// Name returns the human-friendly name of the asset.
Expand Down

0 comments on commit e9cb85a

Please sign in to comment.