rhctag

package
v1.5.54 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package rhctag implements types for working with versions as used in the Red Hat Container Catalog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Original string
	Major    int
	Minor    int
}

Version allows extracting the "major" and "minor" versions so that we don't compare container tags from different minor versions.

This is a workaround for another problem where not all minor releases of containers have a unique CPE.

For example, take "ocs4/rook-ceph-rhel8-operator": it shipped at least 2 minor releases into the same container repository. Both those major versions use the same CPE: "cpe:/a:redhat:openshift_container_storage:4". Here are 2 example tags which fixed CVE-2020-8565:

  • 4.7-140.49a6fcf.release_4.7
  • 4.8-167.9a9db5f.release_4.8

This type also handles container tags which have a 'v' prefix (e.g. "openshift4/ose-metering-hive").

  • v4.6.0-202112140546.p0.g8b9da97.assembly.stream
  • v4.7.0-202112140553.p0.g091bb99.assembly.stream

func Parse

func Parse(s string) (v Version, err error)

Parse attempts to extract a Red Hat container registry tag version string from the provided string.

func (*Version) Compare

func (v *Version) Compare(x *Version) int

Compare is a comparison for the provided [Version]s.

func (*Version) MinorStart

func (v *Version) MinorStart() (start Version)

MinorStart returns a Version which is lower than all others in the minor range major-minor series of the receiver.

func (*Version) Version

func (v *Version) Version(min bool) (c claircore.Version)

Version turns the reciever into a claircore.Version.

"Min" controls whether the returned version is the minimum within the minor series or the maximum.

type Versions

type Versions []Version

Versions implements sort.Interface.

func (Versions) Append

func (vs Versions) Append(v Version) Versions

func (Versions) First

func (vs Versions) First() (Version, error)

func (Versions) Len

func (vs Versions) Len() int

func (Versions) Less

func (vs Versions) Less(i, j int) bool

func (Versions) Swap

func (vs Versions) Swap(i, j int)

Jump to

Keyboard shortcuts

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