util

package
v0.1.0-latest-stable Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DownloadingTaskMap sync.Map

Functions

func ApplyDOCAVersionFromISO

func ApplyDOCAVersionFromISO(bfs *provisioningv1.BlueFieldSoftware, isoPath string) error

ApplyDOCAVersionFromISO extracts DOCA version metadata from the OS ISO and writes it to BlueFieldSoftware status.

func ComponentDownloadFilename

func ComponentDownloadFilename(bfs *provisioningv1.BlueFieldSoftware, componentType ComponentType, specValue string) string

ComponentDownloadFilename returns the local filename for a component given the spec field value. For http(s) URLs it uses {namespace}-{name}-{URL basename} so different BlueFieldSoftware objects never collide under the shared components dir.

func ExtractDOCAVersionFromISO

func ExtractDOCAVersionFromISO(isoPath string) (formatted string, raw string, err error)

ExtractDOCAVersionFromISO derives the DOCA version for an OS ISO from its filename. The published bf4-os-doca-bundle images encode the version there (e.g. bf4-os-doca-bundle-3.3.0-341_...), so the version can be read without unpacking the image. It returns the formatted user-facing DOCA version plus the raw version.

func FilenameFromHTTPURL

func FilenameFromHTTPURL(rawURL string) string

FilenameFromHTTPURL returns the last path segment of rawURL when it is a valid http(s) URL with a usable filename. Otherwise it returns "".

func GenerateComponentTaskName

func GenerateComponentTaskName(bfs provisioningv1.BlueFieldSoftware, componentType ComponentType) string

func PldmComponentFilename

func PldmComponentFilename(bfs *provisioningv1.BlueFieldSoftware, psid, url string) string

PldmComponentFilename returns the on-disk filename for a per-PSID DPU PLDM bundle. The PSID is part of the name so bundles for different PSIDs (which may share a URL basename) never collide on shared bfb storage; an empty PSID collapses to {namespace}-{name}-{base}.

func PldmFwBundles

func PldmFwBundles(bfs *provisioningv1.BlueFieldSoftware) map[string]string

PldmFwBundles returns the spec DPU PLDM firmware bundles keyed by PSID (nil-safe). Empty URLs are dropped so callers never attempt an empty download.

func PldmTaskName

func PldmTaskName(bfs *provisioningv1.BlueFieldSoftware, psid string) string

PldmTaskName returns the download task name for the DPU PLDM bundle of a specific PSID, keeping per-PSID downloads of the same BlueFieldSoftware distinct. An empty PSID collapses to the plain bundle name (no trailing separator).

func SpecURLForComponent

func SpecURLForComponent(bfs *provisioningv1.BlueFieldSoftware, componentType ComponentType) string

SpecURLForComponent returns the spec value (typically a URL) for single-valued componentTypes. The DPU PLDM bundle is keyed per-PSID (see PldmFwBundles), so it is not single-valued and always returns "" here.

Types

type ComponentDownloadTask

type ComponentDownloadTask struct {
	TaskName      string
	URL           string
	FileName      string
	ComponentName string
	UID           types.UID
}

type ComponentType

type ComponentType string

ComponentType represents the type of component to download

const (
	ComponentTypeFwBundle         ComponentType = "fwbundle"
	ComponentTypePlatformFwBundle ComponentType = "platformpldmfwbundle"
	ComponentTypeOSISO            ComponentType = "osiso"
	ComponentTypeNicFw            ComponentType = "nicfw"
)

Jump to

Keyboard shortcuts

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