forked from TrueCloudLab/certificates
Add some TODOs for improvingin PKI initialization maintainability
This commit is contained in:
parent
8616d3160f
commit
317efa4568
2 changed files with 9 additions and 0 deletions
|
@ -86,6 +86,12 @@ func TestPKI_WriteHelmTemplate(t *testing.T) {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
o := tt.fields.casOptions
|
o := tt.fields.casOptions
|
||||||
opts := tt.fields.pkiOptions
|
opts := tt.fields.pkiOptions
|
||||||
|
// TODO(hs): invoking `New` doesn't perform all operations that are executed
|
||||||
|
// when `ca init --helm` is executed. The list of provisioners on the authority
|
||||||
|
// is not populated, for example, resulting in this test not being entirely
|
||||||
|
// realistic. Ideally this logic should be handled in one place and probably
|
||||||
|
// inside of the PKI initialization, but if that becomes messy, some more
|
||||||
|
// logic needs to be performed here to get the PKI instance in good shape.
|
||||||
p, err := New(o, opts...)
|
p, err := New(o, opts...)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
w := &bytes.Buffer{}
|
w := &bytes.Buffer{}
|
||||||
|
|
|
@ -307,6 +307,9 @@ type PKI struct {
|
||||||
|
|
||||||
// New creates a new PKI configuration.
|
// New creates a new PKI configuration.
|
||||||
func New(o apiv1.Options, opts ...Option) (*PKI, error) {
|
func New(o apiv1.Options, opts ...Option) (*PKI, error) {
|
||||||
|
// TODO(hs): invoking `New` with a context active will use values from
|
||||||
|
// that CA context while generating the context. Thay may or may not
|
||||||
|
// be fully expected and/or what we want. Check that.
|
||||||
currentCtx := step.Contexts().GetCurrent()
|
currentCtx := step.Contexts().GetCurrent()
|
||||||
caService, err := cas.New(context.Background(), o)
|
caService, err := cas.New(context.Background(), o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue