Documentation ¶
Index ¶
- Constants
- func GCENodeTest(opt *New)
- func KCCTest(opt *New)
- func NamespaceRepo(ns, name string) func(opt *New)
- func RequireHelmProvider(opt *New)
- func RequireLocalGitProvider(opt *New)
- func RequireLocalHelmProvider(opt *New)
- func RequireLocalOCIProvider(opt *New)
- func RequireOCIProvider(opt *New)
- func RootRepo(name string) func(opt *New)
- func SkipAutopilotCluster(opt *New)
- func SkipConfigSyncInstall(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 RequireHelmProvider ¶ added in v1.18.0
func RequireHelmProvider(opt *New)
RequireHelmProvider will enable Helm repo client login and logout
func RequireLocalGitProvider ¶ added in v1.18.0
func RequireLocalGitProvider(opt *New)
RequireLocalGitProvider will skip the test with non-local GitProvider types
func RequireLocalHelmProvider ¶ added in v1.18.0
func RequireLocalHelmProvider(opt *New)
RequireLocalHelmProvider will skip the test with non-local HelmProvider types. RequireLocalHelmProvider implies RequireHelmProvider.
func RequireLocalOCIProvider ¶ added in v1.18.0
func RequireLocalOCIProvider(opt *New)
RequireLocalOCIProvider will skip the test with non-local OCIProvider types. RequireLocalOCIProvider implies RequireOCIProvider.
func RequireOCIProvider ¶ added in v1.18.0
func RequireOCIProvider(opt *New)
RequireOCIProvider will enable OCI repo client login and logout
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 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 // RequireOCIProvider will enable GitProvider Login & Logout. RequireOCIProvider bool // RequireHelmProvider will enable HelmProvider Login & Logout. RequireHelmProvider bool // RequireLocalGitProvider will skip the test if run with a GitProvider type other than local. RequireLocalGitProvider bool // RequireLocalOCIProvider will skip the test if run with a OCIProvider type other than local. RequireLocalOCIProvider bool // RequireLocalHelmProvider will skip the test if run with a HelmProvider type other than local. RequireLocalHelmProvider 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.
func (*New) EvaluateSkipOptions ¶ added in v1.18.0
EvaluateSkipOptions compares the flags for this specific test case against the runtime options that were provided to the test suite. The test may be skipped based on the below set of rules.
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 RequireCloudSourceRepository ¶ added in v1.18.0
RequireCloudSourceRepository requires the --git-provider flag to be set to csr
func RequireGKE ¶
RequireGKE requires the --test-cluster flag to be `gke` so that the test only runs on GKE clusters.
func RequireHelmArtifactRegistry ¶ added in v1.18.0
RequireHelmArtifactRegistry requires the --helm-provider flag to be set to `gar`. RequireHelmArtifactRegistry implies RequireHelmProvider.
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 RequireOCIArtifactRegistry ¶ added in v1.18.0
RequireOCIArtifactRegistry requires the --oci-provider flag to be set to `gar`. RequireOCIArtifactRegistry implies RequireOCIProvider.
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 { // 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.