2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-01-30 21:35:26 +00:00
|
|
|
package structs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/consul/api"
|
|
|
|
)
|
|
|
|
|
|
|
|
// EnvoyExtension has configuration for an extension that patches Envoy resources.
|
|
|
|
type EnvoyExtension struct {
|
2023-06-08 14:41:44 +00:00
|
|
|
Name string
|
|
|
|
Required bool
|
|
|
|
Arguments map[string]interface{} `bexpr:"-"`
|
|
|
|
ConsulVersion string
|
|
|
|
EnvoyVersion string
|
2023-01-30 21:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type EnvoyExtensions []EnvoyExtension
|
|
|
|
|
|
|
|
func (es EnvoyExtensions) ToAPI() []api.EnvoyExtension {
|
|
|
|
extensions := make([]api.EnvoyExtension, len(es))
|
|
|
|
for i, e := range es {
|
|
|
|
extensions[i] = api.EnvoyExtension{
|
2023-06-08 14:41:44 +00:00
|
|
|
Name: e.Name,
|
|
|
|
Required: e.Required,
|
|
|
|
Arguments: e.Arguments,
|
|
|
|
EnvoyVersion: e.EnvoyVersion,
|
|
|
|
ConsulVersion: e.ConsulVersion,
|
2023-01-30 21:35:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return extensions
|
|
|
|
}
|