Documentation
¶
Index ¶
- Constants
- type DownloadStatistic
- type ModuleDownloadResult
- type ModuleDownloader
- func (md *ModuleDownloader) DownloadByModuleVersion(ctx context.Context, moduleName, moduleVersion string) (*DownloadStatistic, error)
- func (md *ModuleDownloader) DownloadDevImageTag(moduleName, imageTag, checksum string) (string, *moduletypes.Definition, error)
- func (md *ModuleDownloader) DownloadMetadataFromReleaseChannel(ctx context.Context, moduleName, releaseChannel string) (*ModuleDownloadResult, error)
- func (md *ModuleDownloader) DownloadReleaseImageInfoByVersion(ctx context.Context, moduleName, moduleVersion string) (*ModuleDownloadResult, error)
- func (md *ModuleDownloader) GetDocumentationArchive(moduleName, moduleVersion string) (io.ReadCloser, error)
- func (md *ModuleDownloader) GetReleaseChannelChecksum(ctx context.Context, moduleName, releaseChannel string) (string, error)
- type ModuleReleaseMetadata
- type ReleaseImageInfo
Constants ¶
const (
DefaultDevVersion = "dev"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadStatistic ¶ added in v1.59.0
type ModuleDownloadResult ¶
type ModuleDownloadResult struct {
Checksum string
ModuleVersion string
ModuleDefinition *moduletypes.Definition
Changelog map[string]any
}
type ModuleDownloader ¶
type ModuleDownloader struct {
// contains filtered or unexported fields
}
func NewModuleDownloader ¶
func NewModuleDownloader(dc dependency.Container, downloadedModulesDir string, ms *v1alpha1.ModuleSource, logger *log.Logger, registryOptions []cr.Option) *ModuleDownloader
func (*ModuleDownloader) DownloadByModuleVersion ¶
func (md *ModuleDownloader) DownloadByModuleVersion(ctx context.Context, moduleName, moduleVersion string) (*DownloadStatistic, error)
func (*ModuleDownloader) DownloadDevImageTag ¶
func (md *ModuleDownloader) DownloadDevImageTag(moduleName, imageTag, checksum string) (string, *moduletypes.Definition, error)
DownloadDevImageTag downloads image tag and store it in the .../<moduleName>/dev fs path if checksum is equal to a module image digest - do nothing otherwise return new digest
func (*ModuleDownloader) DownloadMetadataFromReleaseChannel ¶
func (md *ModuleDownloader) DownloadMetadataFromReleaseChannel(ctx context.Context, moduleName, releaseChannel string) (*ModuleDownloadResult, error)
DownloadMetadataFromReleaseChannel downloads only module release image with metadata: version.json, checksum.json(soon) does not fetch and install the desired version on the module, only fetches its module definition
func (*ModuleDownloader) DownloadReleaseImageInfoByVersion ¶ added in v1.71.0
func (md *ModuleDownloader) DownloadReleaseImageInfoByVersion(ctx context.Context, moduleName, moduleVersion string) (*ModuleDownloadResult, error)
DownloadReleaseImageInfoByVersion downloads only module release image with metadata: version.json does not fetch and install the desired version on the module, only fetches its module definition
func (*ModuleDownloader) GetDocumentationArchive ¶ added in v1.58.0
func (md *ModuleDownloader) GetDocumentationArchive(moduleName, moduleVersion string) (io.ReadCloser, error)
func (*ModuleDownloader) GetReleaseChannelChecksum ¶ added in v1.76.18
func (md *ModuleDownloader) GetReleaseChannelChecksum(ctx context.Context, moduleName, releaseChannel string) (string, error)
GetReleaseChannelChecksum returns the digest of the module's release-channel image (registry path .../<moduleName>/release:<releaseChannel>). It reads only the manifest digest - via a cheap HEAD request when the registry supports it (see cr.Client.Digest), falling back to a GET otherwise - without pulling and extracting the image layers.
The returned value is the same digest that DownloadMetadataFromReleaseChannel stores as Checksum, so it can be compared against the checksum recorded in the ModuleSource status to detect whether the channel has moved before doing the full (expensive) metadata download.
type ModuleReleaseMetadata ¶ added in v1.65.0
type ModuleReleaseMetadata struct {
Version *semver.Version `json:"version"`
Changelog map[string]any `json:"-"`
ModuleDefinition *moduletypes.Definition `json:"module,omitempty"`
}
type ReleaseImageInfo ¶ added in v1.71.0
type ReleaseImageInfo struct {
Metadata *ModuleReleaseMetadata
Image crv1.Image
Digest crv1.Hash
}