Skip to content

Commit

Permalink
backport of commit acf7549
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancoleman committed Feb 15, 2023
1 parent dc2aa36 commit 9d41324
Show file tree
Hide file tree
Showing 3 changed files with 1,141 additions and 1,101 deletions.
16 changes: 16 additions & 0 deletions proto/pbconfigentry/config_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ func ConfigEntryToStructs(s *ConfigEntry) structs.ConfigEntry {
pbcommon.RaftIndexToStructs(s.RaftIndex, &target.RaftIndex)
pbcommon.EnterpriseMetaToStructs(s.EnterpriseMeta, &target.EnterpriseMeta)
return &target
case Kind_KindInlineCertificate:
var target structs.InlineCertificateConfigEntry
target.Name = s.Name

InlineCertificateToStructs(s.GetInlineCertificate(), &target)
pbcommon.RaftIndexToStructs(s.RaftIndex, &target.RaftIndex)
pbcommon.EnterpriseMetaToStructs(s.EnterpriseMeta, &target.EnterpriseMeta)
return &target
case Kind_KindServiceDefaults:
var target structs.ServiceConfigEntry
target.Name = s.Name
Expand Down Expand Up @@ -177,6 +185,14 @@ func ConfigEntryFromStructs(s structs.ConfigEntry) *ConfigEntry {
configEntry.Entry = &ConfigEntry_HTTPRoute{
HTTPRoute: &route,
}
case *structs.InlineCertificateConfigEntry:
var cert InlineCertificate
InlineCertificateFromStructs(v, &cert)

configEntry.Kind = Kind_KindInlineCertificate
configEntry.Entry = &ConfigEntry_InlineCertificate{
InlineCertificate: &cert,
}
default:
panic(fmt.Sprintf("unable to convert %T to proto", s))
}
Expand Down
Loading

0 comments on commit 9d41324

Please sign in to comment.