Documentation ¶
Index ¶
- Constants
- func GCENodeTest(opt *New)
- func KCCTest(opt *New)
- func LoadTest(opt *New)
- func NamespaceRepo(ns, name string) func(opt *New)
- func RootRepo(name string) func(opt *New)
- func SkipAutopilotCluster(opt *New)
- func SkipConfigSyncInstall(opt *New)
- func SkipNonLocalGitProvider(opt *New)
- func StressTest(opt *New)
- func Unstructured(opts *New)
- func WithCentralizedControl(opt *New)
- func WithDelegatedControl(opt *New)
- func WithInitialCommit(initialCommit Commit) func(opt *New)
- func WithReconcileTimeout(timeout time.Duration) func(opt *New)
- func WithoutReconcileTimeout(opt *New)
- type Commit
- type MultiRepo
- type New
- type Nomos
- type Opt
- type RepoControl
- type RepoOpts
- type TestType
Constants ¶
const ( // DelegatedControl indicates the central admin only declares the Namespace // in the Root Repo and delegates declaration of RepoSync to the app operator. DelegatedControl = "Delegated" // CentralControl indicates the central admin only declares the Namespace // in the Root Repo and delegates declaration of RepoSync to the app operator. CentralControl = "Central" )
Variables ¶
This section is empty.
Functions ¶
func GCENodeTest ¶
func GCENodeTest(opt *New)
GCENodeTest specifies the test is for verifying the gcenode auth type.
func NamespaceRepo ¶
NamespaceRepo tells the test case that a Namespace Repo should be configured that points at the provided Repository.
func RootRepo ¶
RootRepo tells the test case that a Root Repo should be configured that points at the provided Repository.
func SkipAutopilotCluster ¶
func SkipAutopilotCluster(opt *New)
SkipAutopilotCluster will skip the test on the autopilot cluster.
func SkipConfigSyncInstall ¶ added in v1.15.1
func SkipConfigSyncInstall(opt *New)
SkipConfigSyncInstall skip installation of Config Sync components in cluster
func SkipNonLocalGitProvider ¶
func SkipNonLocalGitProvider(opt *New)
SkipNonLocalGitProvider will skip the test with non-local GitProvider types
func Unstructured ¶
func Unstructured(opts *New)
Unstructured will set the option for unstructured repo.
func WithCentralizedControl ¶
func WithCentralizedControl(opt *New)
WithCentralizedControl will specify the Central Control Pattern.
func WithDelegatedControl ¶
func WithDelegatedControl(opt *New)
WithDelegatedControl will specify the Delegated Control Pattern.
func WithInitialCommit ¶
WithInitialCommit creates the initialCommit before the first sync
func WithReconcileTimeout ¶
WithReconcileTimeout tells the test case to override the default reconcile timeout on all RootSyncs and RepoSyncs by default.
func WithoutReconcileTimeout ¶ added in v1.16.0
func WithoutReconcileTimeout(opt *New)
WithoutReconcileTimeout tells the test case not to override the default reconcile timeout on all RootSyncs and RepoSyncs by default.
Types ¶
type Commit ¶
type Commit struct { // Message is the commit message Message string // Files is a map of file paths to Objects Files map[string]client.Object }
Commit represents a commit to be created on a git repository
type MultiRepo ¶
type MultiRepo struct { // NamespaceRepos is a set representing the Namespace repos to create. // // We don't support referencing the Root repository in this map; while we do // support this use case, it isn't special behavior that tests any unique code // paths. NamespaceRepos map[types.NamespacedName]RepoOpts // RootRepos is a set representing the Root repos to create. RootRepos map[string]RepoOpts // Control indicates options for configuring Namespace Repos. Control RepoControl // ReconcileTimeout sets spec.override.reconcileTimeout on each R*Sync // Default: 5m. ReconcileTimeout *time.Duration // SkipNonLocalGitProvider will skip the test if run with a GitProvider type other than local. SkipNonLocalGitProvider bool // RepoSyncPermissions will grant a list of PolicyRules to NS reconcilers RepoSyncPermissions []rbacv1.PolicyRule }
MultiRepo configures the NT for use with multi-repo tests. If NonRootRepos is non-empty, the test is assumed to be running in multi-repo mode.
type New ¶
type New struct { // Name is the name of the test. Overrides the one generated from the test // name. Name string // ClusterName is the name of the target cluster used by the test. ClusterName string // IsEphemeralCluster indicates whether the cluster will be destroyed. IsEphemeralCluster bool // TmpDir is the base temporary directory to use for the test. Overrides the // generated directory based on Name and the OS's main temporary directory. TmpDir string // RESTConfig is the config for creating a Client connection to a K8s cluster. RESTConfig *rest.Config // KubeconfigPath is the path to the kubeconfig file KubeconfigPath string // SkipConfigSyncInstall skips installation/cleanup of Config Sync SkipConfigSyncInstall bool // SkipAutopilot will skip the test if running on an Autopilot cluster. SkipAutopilot bool // InitialCommit commit to create before the initial sync InitialCommit *Commit // TestFeature is the feature that the test verifies TestFeature testing.Feature Nomos MultiRepo TestType }
New is the set of options for instantiating a new NT test.
type Nomos ¶
type Nomos struct { filesystem.SourceFormat // MultiRepo indicates that NT should setup and test multi-repo behavior // rather than mono-repo behavior. MultiRepo bool }
Nomos configures options for installing Nomos on the test cluster.
type Opt ¶
type Opt func(opt *New)
Opt is an option type for ntopts.New.
func RepoSyncPermissions ¶ added in v1.15.1
func RepoSyncPermissions(policy ...rbacv1.PolicyRule) Opt
RepoSyncPermissions specifies PolicyRule(s) to grant NS reconcilers
func RequireGKE ¶
RequireGKE requires the --test-cluster flag to be `gke` so that the test only runs on GKE clusters.
func RequireKind ¶ added in v1.15.1
RequireKind requires the --test-cluster flag to be `kind` so that the test only runs on kind clusters.
func RequireManual ¶
RequireManual requires the --manual flag is set. Otherwise it will skip the test. This avoids running tests (e.g stress tests) that aren't safe to run against a remote cluster automatically.
func WithRestConfig ¶ added in v1.15.1
WithRestConfig uses the provided rest.Config
type RepoControl ¶ added in v1.15.1
type RepoControl string
RepoControl indicates the type of control for Namespace repos.
type RepoOpts ¶
type RepoOpts struct{}
RepoOpts defines options for a Repository. Add options as-needed for tests.
type TestType ¶
type TestType struct { // LoadTest specifies the test is a load test. LoadTest bool // StressTest specifies the test is a stress test. StressTest bool // KCCTest specifies the test is for KCC resources. KCCTest bool // GCENodeTest specifies the test is for verifying the gcenode auth type. // It requires a GKE cluster with workload identity disabled. GCENodeTest bool }
TestType represents the test type.