moduleprepare

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

Package moduleprepare materializes Terraform modules for a later offline scan.

Index

Constants

View Source
const (
	DefaultMaxDepth          = 16
	DefaultResolutionTimeout = 15 * time.Minute
	DefaultFetchTimeout      = resolver.DefaultFetchTimeout
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RepositoryRoot string
	// ArtifactDir is published atomically and must not already exist.
	ArtifactDir    string
	DiscoveryPaths []string
	// Resolver replaces the standard resolver chain when set.
	Resolver resolver.Resolver
	// AdditionalResolvers run before the standard network resolvers.
	AdditionalResolvers []resolver.Resolver
	HostAllowlist       []string
	CacheDir            string
	MaxCacheBytes       int64
	// MaxDepth caps remote-module traversal depth. nil uses DefaultMaxDepth; explicit zero disables traversal.
	MaxDepth          *int
	FetchTimeout      time.Duration
	ResolutionTimeout time.Duration
	ResourceLimits    resolver.ResourceLimits
	TotalParseBytes   int64
	FS                vfs.FS
	// LinkPackages hard-links resolved package files outside RepositoryRoot into
	// the artifact instead of copying them, falling back to copies across
	// filesystems. Linked files share their inode with the resolver's copy,
	// whose permissions are narrowed to the artifact's, so enable it only when
	// nothing rewrites resolved packages in place afterwards, as in a throwaway
	// scan environment.
	LinkPackages bool
}

type Result

type Result struct {
	ManifestPath string
	Modules      []resolver.ManifestModule
	Stats        []modulegraph.ModuleStat
	Failures     []modulegraph.ResolutionFailure
	BudgetEvents []modulegraph.BudgetEvent
	TimedOut     bool
}

func Prepare

func Prepare(ctx context.Context, config *Config) (Result, error)

Prepare resolves a staged repository's module graph into an offline scan artifact.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL