Skip to content

Commit

Permalink
connectivity: Move template utils from internal
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Falzoi <[email protected]>
  • Loading branch information
pippolo84 committed May 9, 2023
1 parent 6d3841d commit 9d451a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package utils
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

package template

import (
"bytes"
"text/template"
"html/template"
)

// RenderTemplate executes temp with data and returns the result
func RenderTemplate(temp string, data any) (string, error) {
// Render executes temp template with data and returns the result
func Render(temp string, data any) (string, error) {
tm, err := template.New("template").Parse(temp)
if err != nil {
return "", err
Expand Down
4 changes: 2 additions & 2 deletions connectivity/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/cilium/cilium-cli/connectivity/check"
"github.com/cilium/cilium-cli/connectivity/manifests/template"
"github.com/cilium/cilium-cli/connectivity/tests"
"github.com/cilium/cilium-cli/internal/utils"
)

var (
Expand Down Expand Up @@ -183,7 +183,7 @@ func Run(ctx context.Context, ct *check.ConnectivityTest, addExtraTests func(*ch
"clientEgressL7HTTPMatchheaderSecretYAML": clientEgressL7HTTPMatchheaderSecretYAML,
"echoIngressFromCIDRYAML": echoIngressFromCIDRYAML,
} {
val, err := utils.RenderTemplate(temp, ct.Params())
val, err := template.Render(temp, ct.Params())
if err != nil {
return err
}
Expand Down

0 comments on commit 9d451a5

Please sign in to comment.