Add inline-certificate as possible payload of config-entry wrapper (#16254)

Co-authored-by: Andrew Stucki <3577250+andrewstucki@users.noreply.github.com>
This commit is contained in:
Nathan Coleman 2023-02-15 11:06:44 -05:00 committed by GitHub
parent fd61605ffb
commit dd0ca4825c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1149 additions and 1109 deletions

View File

@ -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
@ -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))
}

File diff suppressed because it is too large Load Diff

View File

@ -37,6 +37,7 @@ message ConfigEntry {
BoundAPIGateway BoundAPIGateway = 11;
TCPRoute TCPRoute = 12;
HTTPRoute HTTPRoute = 13;
InlineCertificate InlineCertificate = 14;
}
}