<commit_before>package dtest

import (
	"fmt"
	"os"
	"time"

	"github.com/datawire/teleproxy/pkg/k8s"
	"github.com/datawire/teleproxy/pkg/kubeapply"
	"github.com/datawire/teleproxy/pkg/supervisor"
)

// K8sApply applies the supplied manifests to the cluster indicated by
// the supplied kubeconfig.
func K8sApply(files ...string) {
	if os.Getenv("DOCKER_REGISTRY") == "" {
		os.Setenv("DOCKER_REGISTRY", DockerRegistry())
	}
	kubeconfig := Kubeconfig()
	err := kubeapply.Kubeapply(k8s.NewKubeInfo(kubeconfig, "", ""), 120*time.Second, false, false, files...)
	if err != nil {
		fmt.Println()
		fmt.Println(err)
		fmt.Printf(`<commit_msg>Increase K8sApply timeout<commit_after>package dtest

import (
	"fmt"
	"os"
	"time"

	"github.com/datawire/teleproxy/pkg/k8s"
	"github.com/datawire/teleproxy/pkg/kubeapply"
	"github.com/datawire/teleproxy/pkg/supervisor"
)

// K8sApply applies the supplied manifests to the cluster indicated by
// the supplied kubeconfig.
func K8sApply(files ...string) {
	if os.Getenv("DOCKER_REGISTRY") == "" {
		os.Setenv("DOCKER_REGISTRY", DockerRegistry())
	}
	kubeconfig := Kubeconfig()
	err := kubeapply.Kubeapply(k8s.NewKubeInfo(kubeconfig, "", ""), 300*time.Second, false, false, files...)
	if err != nil {
		fmt.Println()
		fmt.Println(err)
		fmt.Printf(`
{'fraction_non_alphanumeric': 0.15707620528771385, 'fraction_numerical': 0.01166407465007776, 'mean_word_length': 4.620087336244541, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2319605', 'n_tokens_mistral': 518, 'n_tokens_neox': 494, 'n_words': 87}