components/contour: Define newComponent to create struct
This commit is a internal API change and doesn't have any user facing
changes. This commit adds a function newComponent to create and return
a component struct which is consistent with other components in
lokoctl.
@@ -16,7 +16,7 @@ import (
const name = "contour"
func init() {
- components.Register(name, &component{})
+ components.Register(name, newComponent())
}
type component struct {
@@ -25,6 +25,10 @@ type component struct {
// TODO: add num of replicas when using install_mode "deployment"
}
+func newComponent() *component {
+ return &component{}
+}
+
func (c *component) LoadConfig(configBody *hcl.Body, evalContext *hcl.EvalContext) hcl.Diagnostics {
if configBody == nil {
return hcl.Diagnostics{
