Documentation ¶
Index ¶
- func FindKV(kvs []KeyValue, key string) string
- type Bom
- func (b *Bom) BuildImageOverrides(subComponentName string) ([]KeyValue, error)
- func (b *Bom) BuildImageStrings(subComponentName string) ([]KeyValue, []string, error)
- func (b *Bom) FindImage(subcomponentName, imageName string) (BomImage, error)
- func (b *Bom) GetComponent(componentName string) (*BomComponent, error)
- func (b *Bom) GetComponentVersion(componentName string) (string, error)
- func (b *Bom) GetImageNameList(subComponentName string) ([]string, error)
- func (b *Bom) GetRegistry() string
- func (b *Bom) GetSubcomponent(subComponentName string) (*BomSubComponent, error)
- func (b *Bom) GetSubcomponentImageCount(subComponentName string) int
- func (b *Bom) GetSubcomponentImages(subComponentName string) ([]BomImage, error)
- func (b *Bom) GetSupportedKubernetesVersion() []string
- func (b *Bom) GetVersion() string
- func (b *Bom) ResolveRegistry(sc *BomSubComponent, img BomImage) string
- func (b *Bom) ResolveRepo(sc *BomSubComponent, img BomImage) string
- type BomComponent
- type BomDoc
- type BomImage
- type BomSubComponent
- type KeyValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bom ¶
type Bom struct {
// contains filtered or unexported fields
}
Bom contains information related to the bill of materials along with structures to process it. The bom file is verrazzano-bom.json and it mainly has image information.
func NewBOMFromJSON ¶ added in v1.4.0
NewBOMFromJSON Create a new BOM instance from a JSON payload
func (*Bom) BuildImageOverrides ¶
BuildImageOverrides builds the image overrides array for the subComponent. Each override has an array of 1-n Helm Key:Value pairs
func (*Bom) BuildImageStrings ¶ added in v1.3.0
BuildImageStrings builds the image overrides array for the subComponent. Each override has an array of 1-n Helm Key:Value pairs Also return the set of fully constructed image names
func (*Bom) GetComponent ¶ added in v1.4.0
func (b *Bom) GetComponent(componentName string) (*BomComponent, error)
GetComponent gets the BOM component
func (*Bom) GetComponentVersion ¶ added in v1.5.0
func (*Bom) GetImageNameList ¶ added in v1.3.0
GetImageNameList build the image names and return a list of image names
func (*Bom) GetSubcomponent ¶
func (b *Bom) GetSubcomponent(subComponentName string) (*BomSubComponent, error)
GetSubcomponent gets the bom subcomponent
func (*Bom) GetSubcomponentImageCount ¶
GetSubcomponentImageCount returns the number of subcomponent images
func (*Bom) GetSubcomponentImages ¶
GetSubcomponentImages the imageBoms for a subcomponent
func (*Bom) GetSupportedKubernetesVersion ¶ added in v1.5.0
GetSupportedKubernetesVersion gets supported Kubernetes versions
func (*Bom) ResolveRegistry ¶
func (b *Bom) ResolveRegistry(sc *BomSubComponent, img BomImage) string
ResolveRegistry resolves the registry name using the ENV var if it exists.
func (*Bom) ResolveRepo ¶
func (b *Bom) ResolveRepo(sc *BomSubComponent, img BomImage) string
ResolveRepo resolves the repository name using the ENV var if it exists.
type BomComponent ¶
type BomComponent struct { // The name of the component, for example: Istio Name string `json:"name"` // Version of the component Version string `json:"version,omitempty"` // SubComponents is the array of subcomponents in the component SubComponents []BomSubComponent `json:"subcomponents"` }
BomComponent represents a high level component, such as Istio. Each component has one or more subcomponents.
type BomDoc ¶
type BomDoc struct { // Registry is the top level registry URI which contains the image repositories. // An example is ghcr.io Registry string `json:"registry"` // Version is the verrazzano version corresponding to the build Version string `json:"version"` // Components is the array of component boms Components []BomComponent `json:"components"` // SupportedKubernetesVersions is the array of supported Kubernetes versions SupportedKubernetesVersions []string `json:"supportedKubernetesVersions"` }
BomDoc contains product metadata for components installed by Verrazzano. Currently, this metadata only describes images and image repositories. This information is needed by the helm charts and used during install/upgrade.
type BomImage ¶
type BomImage struct { // ImageName specifies the name of the image tag, such as `nginx-ingress-controller` ImageName string `json:"image"` // ImageTag specifies the name of the image tag, such as `0.46.0-20210510134749-abc2d2088` ImageTag string `json:"tag"` // Registry is the image registry. It can be used to override the subcomponent registry Registry string `json:"registry,omitempty"` // Repository is the image repository. It can be used to override the subcomponent repository Repository string `json:"repository,omitempty"` // HelmRegistryKey is the helm template Key which identifies the registry for an image. An example is // `image.registry` in external-dns. The default is empty string. HelmRegistryKey string `json:"helmRegKey"` // HelmRepoKey is the helm template Key which stores the value of the repository for an image. HelmRepoKey string `json:"helmRepoKey"` // HelmImageKey is the helm template Key which identifies the base image name, without the registry or parent repo // parts of the path. For example, if the full image name is myreg.io/foo/bar/myimage:v1.0, the value of this key // will be "myimage". See the Istio proxyv2 entry in the BOM file for an example. HelmImageKey string `json:"helmImageKey"` // HelmTagKey is the helm template Key which stores the value of the image tag. For example, // if the full image name is myreg.io/foo/bar/myimage:v1.0, the value of this key will be "v1.0" HelmTagKey string `json:"helmTagKey"` // HelmFullImageKey is the helm path Key which identifies the image name without the registry or tag. For example, // if the full image name is myreg.io/foo/bar/myimage:v1.0, the value of this key will be // "foo/bar/myimage". HelmFullImageKey string `json:"helmFullImageKey"` // HelmRegistryAndRepoKey is a helm Key which stores the registry and repo parts of the image path. For example, // if the full image name is myreg.io/foo/bar/myimage:v1.0 the value of this key will be "myreg.io/foo/bar". // See `image.repository` in the external-dns component HelmRegistryAndRepoKey string `json:"helmRegistryAndRepoKey"` }
BomImage describes a single image used by one of the helm charts. This structure is needed to render the helm chart manifest, so the image fields are correctly populated in the resulting YAML. There is no helm standard which specifies the keys for image information used by a template, each product usually has a custom way to do this. The helm keys fields in this structure specify those custom keys.
type BomSubComponent ¶
type BomSubComponent struct { Name string `json:"name"` // Repository is the name of the repository within a registry. This is combined // with the registry Value to form the image URL prefix, for example: ghcr.io/verrazzano, // where ghci.io is the registry and Verrazzano is the repository name. Repository string `json:"repository"` // Override the registry within a subcomponent Registry string `json:"registry"` // Images is the array of images for this subcomponent Images []BomImage `json:"images"` }
BomSubComponent contains the bom information for a single helm chart. Istio is an example of a component with several subcomponents.