flux: github.com/weaveworks/flux/pkg/cluster/kubernetes/testfiles Index | Files

package testfiles

import "github.com/weaveworks/flux/pkg/cluster/kubernetes/testfiles"

Index

Package Files

data.go

Variables

var EncryptedResourceMap = map[resource.ID]string{
    resource.MustParseID("<cluster>:deployment/helloworld"):   "helloworld-deploy.yaml",
    resource.MustParseID("<cluster>:deployment/multi-deploy"): "multi.yaml",
    resource.MustParseID("<cluster>:service/multi-service"):   "multi.yaml",
}
var Files = map[string]string{
    "garbage": "This should just be ignored, since it is not YAML",

    "helloworld-deploy.yaml": "" /* 528 byte string literal not displayed */,

    "semver-deploy.yaml": "" /* 465 byte string literal not displayed */,

    "locked-service-deploy.yaml": "" /* 429 byte string literal not displayed */,

    "test/test-service-deploy.yaml": "" /* 370 byte string literal not displayed */,

    "multi.yaml": "" /* 569 byte string literal not displayed */,

    "list.yaml": "" /* 628 byte string literal not displayed */,

    "init.yaml": "" /* 267 byte string literal not displayed */,

    "charts/nginx/Chart.yaml": "" /* 291 byte string literal not displayed */,

    "charts/nginx/values.yaml": "" /* 223 byte string literal not displayed */,

    "charts/nginx/templates/deployment.yaml": "" /* 788 byte string literal not displayed */,
}
var FilesForKustomize = map[string]string{
    ".flux.yaml": `version: 1
patchUpdated:
  generators:
  - command: kustomize build .
  patchFile: flux-patch.yaml
`,
    "base/kustomization.yaml": `resources:
- foo.yaml
`,
    "base/foo.yaml": `apiVersion: v1
kind: Namespace
metadata:
  name: foo
  annotations:
    key: value
`,
    "staging/kustomization.yaml": `bases:
- ../base/
patches:
- staging.yaml
`,
    "staging/staging.yaml": `apiVersion: v1
kind: Namespace
metadata:
  name: foo
  annotations:
    env: staging
`,
}
var FilesMultidoc = map[string]string{
    "namespaces.yaml": "" /* 176 byte string literal not displayed */,
}
var FilesUpdated = map[string]string{
    "helloworld-deploy.yaml": "" /* 525 byte string literal not displayed */,
}
var ResourceMap = map[resource.ID]string{
    resource.MustParseID("default:deployment/helloworld"):     "helloworld-deploy.yaml",
    resource.MustParseID("default:deployment/locked-service"): "locked-service-deploy.yaml",
    resource.MustParseID("default:deployment/test-service"):   "test/test-service-deploy.yaml",
    resource.MustParseID("default:deployment/multi-deploy"):   "multi.yaml",
    resource.MustParseID("default:service/multi-service"):     "multi.yaml",
    resource.MustParseID("default:deployment/list-deploy"):    "list.yaml",
    resource.MustParseID("default:service/list-service"):      "list.yaml",
    resource.MustParseID("default:deployment/semver"):         "semver-deploy.yaml",
    resource.MustParseID("default:daemonset/init"):            "init.yaml",
}

ResourceMap is the map of resource names to relative paths, which must correspond with `Files` below.

var SopsEncryptedFiles = map[string]string{
    "garbage":                "This should just be ignored, since it is not YAML",
    "helloworld-deploy.yaml": "" /* 3254 byte string literal not displayed */,

    "multi.yaml": "" /* 4574 byte string literal not displayed */,
}
var TestPrivateKey = "" /* 1042 byte string literal not displayed */

func TempDir Uses

func TempDir(t *testing.T) (string, func())

func WorkloadMap Uses

func WorkloadMap(dir string) map[resource.ID][]string

WorkloadMap ... given a base path, construct the map representing the services given in the test data. Must be kept in sync with `Files` below. TODO(michael): derive from ResourceMap, or similar.

func WriteSopsEncryptedTestFiles Uses

func WriteSopsEncryptedTestFiles(dir string) error

WriteSopsEncryptedTestFiles ... given a directory, create files in it, based on predetermined file content. These files are encrypted with sops using TestPrivateKey

func WriteTestFiles Uses

func WriteTestFiles(dir string, files map[string]string) error

WriteTestFiles ... given a directory, create files in it, based on predetermined file content

Package testfiles imports 6 packages (graph). Updated 2020-10-19. Refresh now. Tools for package owners.