imagedigest

package
v0.26.7 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GostDigestAnnotationKey = "deckhouse.io/gost-digest"
)

Variables

This section is empty.

Functions

func AddGostAnnotation

func AddGostAnnotation(image v1.Image, digestHex string) v1.Image

AddGostAnnotation returns a new image with the GOST annotation added.

func AnnotateWithGostDigest

func AnnotateWithGostDigest(image v1.Image) (v1.Image, string, error)

AnnotateWithGostDigest calculates GOST digest and returns annotated image. Returns the annotated image and the calculated digest in hex format.

func CalculateGostHash

func CalculateGostHash(data []byte) []byte

CalculateGostHash computes GOST R 34.11-2012 (Streebog-256) from raw bytes.

func CalculateGostHashFromReader

func CalculateGostHashFromReader(r io.Reader) ([]byte, error)

CalculateGostHashFromReader computes GOST R 34.11-2012 hash from io.Reader.

func CalculateImageGostDigest

func CalculateImageGostDigest(image v1.Image) ([]byte, error)

CalculateImageGostDigest calculates GOST digest from an image's layers.

func ExtractSortedLayerDigests

func ExtractSortedLayerDigests(image v1.Image) ([]string, error)

ExtractSortedLayerDigests returns sorted layer digests from an image.

func PullAndCalculate

func PullAndCalculate(imageName string, opts ...crane.Option) ([]byte, error)

PullAndCalculate pulls image and calculates GOST digest.

func PullAnnotatePush

func PullAnnotatePush(imageName string, opts ...crane.Option) (string, error)

PullAnnotatePush pulls image, annotates with GOST digest, and pushes back. Returns the calculated digest in hex format.

func ReadGostAnnotation

func ReadGostAnnotation(image v1.Image) (string, bool, error)

ReadGostAnnotation reads the GOST digest annotation if present. Returns the digest value, whether it was found, and any error.

Types

type ImageInfo

type ImageInfo struct {
	Name         string
	Digest       string
	GostDigest   string   // May be empty if not annotated
	LayerDigests []string // Sorted
}

ImageInfo contains display information about an image (read-only DTO).

func GetImageInfo

func GetImageInfo(name string, image v1.Image) (*ImageInfo, error)

GetImageInfo extracts display information from an image.

type ValidationResult

type ValidationResult struct {
	StoredDigest     string // Digest read from image annotation
	CalculatedDigest string // Freshly calculated digest from layers
}

ValidationResult contains the result of GOST digest validation.

func PullAndValidate

func PullAndValidate(imageName string, opts ...crane.Option) (*ValidationResult, error)

PullAndValidate pulls image and validates its GOST digest.

func ValidateGostDigest

func ValidateGostDigest(image v1.Image) (*ValidationResult, error)

ValidateGostDigest verifies the stored annotation matches recalculated digest. Returns ValidationResult with both digests for comparison, and error if mismatch.

Directories

Path Synopsis
cmd
add

Jump to

Keyboard shortcuts

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