package mapper import ( "time" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/intstr" "edge-infra.dev/pkg/edge/api/graph/model" ) // Namespace for flux components changes and is used in a number of components // Update here accordingly to update all instances of flux namespace within project const ( HelmReleaseNamespace = "flux-system" TimeFormat = "2006-01-02 15:04:05" testSecret = "test-secret" workloadLabel = "workload.edge.ncr.com" testOrganization = "orgname" organization = "test-org" // is namespace storeClusterName = "test-store" SecretManagerSecretLabel = "secret-mamager.edge.ncr.com" HelmReleaseTimeout = 15 apiVersion = "clusterregistry.k8s.io/v1alpha1" AddNamespaceKind = "AddNamespace" AddHelmRepoKind = "AddHelmRepository" AddExternalSecretKind = "AddExternalSecret" //nolint not credentials TenantPrefix = "tenant-" DeleteResourceKind = "DeleteResource" AddClusterKind = "AddCluster" kubeconfig = ` apiVersion: v1 clusters: - k3sTask: certificate-authority-data: will-be-redacted server: https://localhost name: k8s contexts: - context: k3sTask: k8s user: test name: k8s current-context: k8s kind: Config preferences: {} users: - name: test user: password: will-be-redacted username: test-name ` sMock = ` apiVersion: v1 kind: Secret data: clientCert: "" clientKey: "" clusterCA: %s endpoint: https://localhost password: "" username: default-agent namespace: test-namespace metadata: namespace: test-namespace name: test ` //nolint test configValues = ` { "global": { "deploymentMode": "store", "gcloud": { "serviceAccount": { "enabled": true, "secret": "ewog-testing" } } } }` ) var ( SAName = "bff-sa" SANamespace = "edge-system" EdgeNamespace = "edge-system" Region = "region-infra" helmRepository = "test-helm-repository" helmChart = "test-helm-chart" name = "test-name" version = "test-version" namespace = "test-namespace" projectID = "test" privateKey = "fawef2234" privateKeyID = "werwerwe" clientEmail = "test123@acc.com" tokenURI = "23423423" httpPort = intstr.FromInt(8000) conditionTime = time.Now() startedPointer = Started testPodlist = GetTestWorkloadPodList(conditionTime, startedPointer) testDeployment = GetTestWorkloadDeployment(httpPort) testStatefulSet = GetTestWorkloadStatefulSet(httpPort) testDaemonSet = GetTestWorkloadDaemonSet(httpPort) badServiceAccount = []byte(`{"project_id":wef323!}`) fakeServiceAccountSecret = []byte(`{"type":"servAcc", "project_id":"test", "private_key_id":"werwerwe", "private_key":"fawef2234", "client_email":"test123@acc.com", "token_uri":"23423423"}`) unstruct = map[string]interface{}{ "testkey": "testval1", "testkey2": struct { source string test float64 }{"test4", 1.75}, "bool": true, } unstructarr = &unstructured.UnstructuredList{Items: []unstructured.Unstructured{ { Object: unstruct, }, { Object: unstruct, }, }} testValsSuccess = []*model.KeyValues{ { Key: "helmUrl", Value: "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYA", }, } )