Documentation
¶
Index ¶
- Constants
- func AddGostAnnotation(image v1.Image, digestHex string) v1.Image
- func AnnotateWithGostDigest(image v1.Image) (v1.Image, string, error)
- func CalculateGostHash(data []byte) []byte
- func CalculateGostHashFromReader(r io.Reader) ([]byte, error)
- func CalculateImageGostDigest(image v1.Image) ([]byte, error)
- func ExtractSortedLayerDigests(image v1.Image) ([]string, error)
- func PullAndCalculate(imageName string, opts ...crane.Option) ([]byte, error)
- func PullAnnotatePush(imageName string, opts ...crane.Option) (string, error)
- func ReadGostAnnotation(image v1.Image) (string, bool, error)
- type ImageInfo
- type ValidationResult
Constants ¶
const (
GostDigestAnnotationKey = "deckhouse.io/gost-digest"
)
Variables ¶
This section is empty.
Functions ¶
func AddGostAnnotation ¶
AddGostAnnotation returns a new image with the GOST annotation added.
func AnnotateWithGostDigest ¶
AnnotateWithGostDigest calculates GOST digest and returns annotated image. Returns the annotated image and the calculated digest in hex format.
func CalculateGostHash ¶
CalculateGostHash computes GOST R 34.11-2012 (Streebog-256) from raw bytes.
func CalculateGostHashFromReader ¶
CalculateGostHashFromReader computes GOST R 34.11-2012 hash from io.Reader.
func CalculateImageGostDigest ¶
CalculateImageGostDigest calculates GOST digest from an image's layers.
func ExtractSortedLayerDigests ¶
ExtractSortedLayerDigests returns sorted layer digests from an image.
func PullAndCalculate ¶
PullAndCalculate pulls image and calculates GOST digest.
func PullAnnotatePush ¶
PullAnnotatePush pulls image, annotates with GOST digest, and pushes back. Returns the calculated digest in hex format.
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).
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.