external_repos

package
v0.0.0-...-0051d6e Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = "./pkg/external_repos/external_repos.json"
View Source
const RedHatGpgKeyFile = "redhat.gpg"
View Source
const RedHatReposFile = "redhat_repos.json"
View Source
const (
	RhCdnHost = "cdn.redhat.com"
)

Variables

This section is empty.

Functions

func GetBaseURLs

func GetBaseURLs(repos []ExternalRepository) []string

func IBUrlsFromDir

func IBUrlsFromDir(dirPath string) ([]string, error)

IBUrlsFromDir Import Repo Urls from image builder's git repo The dirPath should point to GITDIR/distributions/ which contains the repo directories. Each directory contains a json file with the same name as the directory itself: ./distributions/rhel-90/rhel-90.json

func Introspect

func Introspect(ctx context.Context, repo *dao.Repository, dao *dao.DaoRegistry) (int64, error, bool)

Introspect introspects a dao.Repository with the given Rpm inserting any needed RPMs and adding and removing associations to the repository Returns the number of new RPMs inserted system-wide and any error encountered

func IntrospectUrl

func IntrospectUrl(ctx context.Context, url string) (int64, error, error)

IntrospectUrl Fetch the metadata of a url and insert RPM data Returns the number of new RPMs inserted system-wide, any introspection errors, and any fatal errors

func IsRedHat

func IsRedHat(url string) bool

IsRedHat returns if the url is a 'cdn.redhat.com' url

func LoadCA

func LoadCA() ([]byte, error)

LoadCA Load the CA certificate from the embedded file at 'test_files/ca.pem' Return []byte with the content of the file and nil for error if the process finish with success, else it returns nil and the error is filled.

func RepoToRepoUpdate

func RepoToRepoUpdate(repo dao.Repository) dao.RepositoryUpdate

func SaveToFile

func SaveToFile(repoUrls []string) error

SaveToFile Saves a list of repo urls to the external file

func UpdateIntrospectionStatusMetadata

func UpdateIntrospectionStatusMetadata(repo dao.Repository, dao *dao.DaoRegistry, count int64, err error) error

UpdateIntrospectionStatusMetadata updates introspection timestamps, error, and status on repo. Use after calling Introspect().

Types

type ExternalRepository

type ExternalRepository struct {
	BaseUrl string `json:"base_url"`
}

func LoadFromFile

func LoadFromFile() ([]ExternalRepository, error)

LoadFromFile Loads repo urls from the external file

type ImageBuilderArch

type ImageBuilderArch struct {
	Repositories []ImageBuilderRepo `json:"repositories"`
	ImageTypes   []string           `json:"image_types"`
}

type ImageBuilderRepo

type ImageBuilderRepo struct {
	BaseUrl string `json:"baseurl"`
}

type ImageBuilderRepoJson

type ImageBuilderRepoJson struct {
	MainArch   ImageBuilderArch `json:"x86_64"`
	PlatformId string           `json:"module_platform_id"`
}

type RedHatRepo

type RedHatRepo struct {
	Url                 string `json:"url"`
	Name                string `json:"name"`
	Arch                string `json:"arch"`
	DistributionVersion string `json:"distribution_version"`
	Selector            string `json:"selector"`
	GpgKey              string `json:"gpg_key"`
	Label               string `json:"content_label"`
}

func (RedHatRepo) ToRepositoryRequest

func (rhr RedHatRepo) ToRepositoryRequest() api.RepositoryRequest

type RedHatRepoImporter

type RedHatRepoImporter struct {
	// contains filtered or unexported fields
}

func NewRedHatRepos

func NewRedHatRepos(daoReg *dao.DaoRegistry) RedHatRepoImporter

func (*RedHatRepoImporter) LoadAndSave

func (rhr *RedHatRepoImporter) LoadAndSave() error

Jump to

Keyboard shortcuts

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