Skip to content

Commit cb243e2

Browse files
ikethecoderTravis Raines
ikethecoder
authored and
Travis Raines
committed
feat: support cert by reference for absent certificates
From #269 Fix #268
1 parent 0ebd7d5 commit cb243e2

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

file/builder.go

-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ type stateBuilder struct {
1717

1818
selectTags []string
1919
intermediate *state.KongState
20-
certIDs map[string]bool
2120

2221
err error
2322
}
@@ -45,7 +44,6 @@ func (b *stateBuilder) build() (*utils.KongRawState, error) {
4544
if err != nil {
4645
return nil, err
4746
}
48-
b.certIDs = map[string]bool{}
4947

5048
// build
5149
b.certificates()
@@ -105,8 +103,6 @@ func (b *stateBuilder) certificates() {
105103
b.err = err
106104
return
107105
}
108-
109-
b.certIDs[*c.ID] = true
110106
}
111107
}
112108

@@ -430,14 +426,6 @@ func (b *stateBuilder) services() {
430426
utils.MustMergeTags(&s.Service, b.selectTags)
431427
b.defaulter.MustSet(&s.Service)
432428

433-
if s.ClientCertificate != nil && !utils.Empty(s.ClientCertificate.ID) {
434-
if _, ok := b.certIDs[*s.ClientCertificate.ID]; !ok {
435-
b.err = errors.Errorf("client certificate not found: %v",
436-
*s.ClientCertificate.ID)
437-
return
438-
}
439-
}
440-
441429
b.rawState.Services = append(b.rawState.Services, &s.Service)
442430
err := b.intermediate.Services.Add(state.Service{Service: s.Service})
443431
if err != nil {

0 commit comments

Comments
 (0)