Skip to content

Commit

Permalink
Rename CAPool to CaPool.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraino committed Jun 8, 2021
1 parent 9db68db commit 529eb4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cas/apiv1/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Options struct {
// certificate authority.
Project string `json:"-"`
Location string `json:"-"`
CAPool string `json:"-"`
CaPool string `json:"-"`
}

// CertificateIssuer contains the properties used to use the StepCAS certificate
Expand Down
9 changes: 5 additions & 4 deletions cas/cloudcas/cloudcas.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ func New(ctx context.Context, opts apiv1.Options) (*CloudCAS, error) {
return nil, errors.New("cloudCAS 'project' cannot be empty")
case opts.Location == "":
return nil, errors.New("cloudCAS 'location' cannot be empty")
case opts.CAPool == "":
case opts.CaPool == "":
return nil, errors.New("cloudCAS 'caPool' cannot be empty")
}

} else {
if opts.CertificateAuthority == "" {
return nil, errors.New("cloudCAS 'certificateAuthority' cannot be empty")
Expand All @@ -118,8 +119,8 @@ func New(ctx context.Context, opts apiv1.Options) (*CloudCAS, error) {
if opts.Location == "" {
opts.Location = parts[3]
}
if opts.CAPool == "" {
opts.CAPool = parts[5]
if opts.CaPool == "" {
opts.CaPool = parts[5]
}
}
}
Expand All @@ -134,7 +135,7 @@ func New(ctx context.Context, opts apiv1.Options) (*CloudCAS, error) {
certificateAuthority: opts.CertificateAuthority,
project: opts.Project,
location: opts.Location,
caPool: opts.CAPool,
caPool: opts.CaPool,
}, nil
}

Expand Down
4 changes: 2 additions & 2 deletions cas/cloudcas/cloudcas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func TestNew(t *testing.T) {
caPool: testCaPool,
}, false},
{"ok creator", args{context.Background(), apiv1.Options{
IsCreator: true, Project: testProject, Location: testLocation, CAPool: testCaPool,
IsCreator: true, Project: testProject, Location: testLocation, CaPool: testCaPool,
}}, &CloudCAS{
client: &testClient{},
project: testProject,
Expand All @@ -311,7 +311,7 @@ func TestNew(t *testing.T) {
IsCreator: true, Project: testProject, Location: "",
}}, nil, true},
{"fail caPool", args{context.Background(), apiv1.Options{
IsCreator: true, Project: testProject, Location: testLocation, CAPool: "",
IsCreator: true, Project: testProject, Location: testLocation, CaPool: "",
}}, nil, true},
}
for _, tt := range tests {
Expand Down

0 comments on commit 529eb4b

Please sign in to comment.