Documentation
¶
Index ¶
- Variables
- func Delete(serveOpts Config, args []string) error
- func FetchChartDetailFromOciUrl(chartTarballURL string, userAgent string, authz string, netClient *http.Client) (map[string]string, error)
- func GetUserAgent(version, userAgentComment string) string
- func InvalidateCache(serveOpts Config, args []string) error
- func Sync(serveOpts Config, version string, args []string) error
- type ChartCatalog
- type Config
- type HelmRepo
- func (r *HelmRepo) AppRepository() *models.AppRepositoryInternal
- func (r *HelmRepo) Charts(ctx context.Context, fetchLatestOnly bool, chartResults chan pullChartResult) ([]string, error)
- func (r *HelmRepo) Checksum(ctx context.Context) (string, error)
- func (r *HelmRepo) FetchFiles(cv models.ChartVersion, userAgent string, passCredentials bool) (map[string]string, error)
- func (r *HelmRepo) Filters() *apprepov1alpha1.FilterRuleSpec
- type OCILayer
- type OCIManifest
- type OCIRegistry
- func (r *OCIRegistry) AppRepository() *models.AppRepositoryInternal
- func (r *OCIRegistry) Charts(ctx context.Context, fetchLatestOnly bool, chartResults chan pullChartResult) ([]string, error)
- func (r *OCIRegistry) Checksum(ctx context.Context) (string, error)
- func (r *OCIRegistry) FetchFiles(cv models.ChartVersion, userAgent string, passCredentials bool) (map[string]string, error)
- func (r *OCIRegistry) Filters() *apprepov1alpha1.FilterRuleSpec
- type OciAPIClient
- func (o *OciAPIClient) Catalog(ctx context.Context, userAgent string) ([]string, error)
- func (o *OciAPIClient) CatalogAvailable(ctx context.Context, userAgent string) (bool, error)
- func (o *OciAPIClient) IsHelmChart(appName, tag, userAgent string) (bool, error)
- func (o *OciAPIClient) TagList(appName string, userAgent string) (*TagList, error)
- type TagList
- type VACCatalog
Constants ¶
This section is empty.
Variables ¶
var ErrMultipleRows = fmt.Errorf("more than one row returned in query result")
Functions ¶
func FetchChartDetailFromOciUrl ¶
func FetchChartDetailFromOciUrl(chartTarballURL string, userAgent string, authz string, netClient *http.Client) (map[string]string, error)
Fetches helm chart details from an OCI url
func GetUserAgent ¶
Returns the user agent to be used during calls to the chart repositories Examples: asset-syncer/devel asset-syncer/1.0 asset-syncer/1.0 (foo v1.0-beta4) More info here https://github.com/vmware-tanzu/kubeapps/issues/767#issuecomment-436835938
func InvalidateCache ¶
Types ¶
type ChartCatalog ¶
type ChartCatalog interface {
Checksum(ctx context.Context) (string, error)
AppRepository() *models.AppRepositoryInternal
Charts(ctx context.Context, fetchLatestOnly bool, charts chan pullChartResult) ([]string, error)
FetchFiles(cv models.ChartVersion, userAgent string, passCredentials bool) (map[string]string, error)
Filters() *apprepov1alpha1.FilterRuleSpec
}
ChartCatalog defines the methods to retrieve information from the given repository
type Config ¶
type Config struct {
DatabaseURL string
DatabaseName string
DatabaseUser string
DatabasePassword string
Debug bool
Namespace string
OciRepositories []string
TlsInsecureSkipVerify bool
FilterRules string
PassCredentials bool
UserAgent string
UserAgentComment string
GlobalPackagingNamespace string
KubeappsNamespace string
AuthorizationHeader string
DockerConfigJson string
OCICatalogURL string
}
type HelmRepo ¶
type HelmRepo struct {
*models.AppRepositoryInternal
// contains filtered or unexported fields
}
HelmRepo implements the ChartCatalog interface for chartmuseum-like repositories
func (*HelmRepo) AppRepository ¶
func (r *HelmRepo) AppRepository() *models.AppRepositoryInternal
AppRepository returns the repo information
func (*HelmRepo) Charts ¶
func (r *HelmRepo) Charts(ctx context.Context, fetchLatestOnly bool, chartResults chan pullChartResult) ([]string, error)
Charts retrieve the list of charts exposed in the repo
func (*HelmRepo) FetchFiles ¶
func (r *HelmRepo) FetchFiles(cv models.ChartVersion, userAgent string, passCredentials bool) (map[string]string, error)
FetchFiles retrieves the important files of a chart and version from the repo
func (*HelmRepo) Filters ¶
func (r *HelmRepo) Filters() *apprepov1alpha1.FilterRuleSpec
type OCILayer ¶
type OCILayer struct {
MediaType string `json:"mediaType"`
Digest string `json:"digest"`
Size int `json:"size"`
}
OCILayer represents a single OCI layer
type OCIManifest ¶
type OCIManifest struct {
Schema int `json:"schema"`
Config OCILayer `json:"config"`
Layers []OCILayer `json:"layers"`
}
OCIManifest representation
type OCIRegistry ¶
type OCIRegistry struct {
*models.AppRepositoryInternal
// contains filtered or unexported fields
}
OCIRegistry implements the Repo interface for OCI repositories
func (*OCIRegistry) AppRepository ¶
func (r *OCIRegistry) AppRepository() *models.AppRepositoryInternal
AppRepository returns the repo information
func (*OCIRegistry) Charts ¶
func (r *OCIRegistry) Charts(ctx context.Context, fetchLatestOnly bool, chartResults chan pullChartResult) ([]string, error)
Charts retrieve the list of actual charts needing syncing in the repo.
func (*OCIRegistry) Checksum ¶
func (r *OCIRegistry) Checksum(ctx context.Context) (string, error)
Checksum returns a random sha256 so that the OCI sync will always be performed. This is because we check each app individually whether it has any versions that need syncing.
func (*OCIRegistry) FetchFiles ¶
func (r *OCIRegistry) FetchFiles(cv models.ChartVersion, userAgent string, passCredentials bool) (map[string]string, error)
FetchFiles do nothing for the OCI case since they have been already fetched in the Charts() method
func (*OCIRegistry) Filters ¶
func (r *OCIRegistry) Filters() *apprepov1alpha1.FilterRuleSpec
type OciAPIClient ¶
type OciAPIClient struct {
RegistryNamespaceUrl *url.URL
// The HttpClient is used for all http requests to the OCI Distribution
// spec API.
HttpClient *http.Client
// The GrpcClient is used when querying our OCI Catalog service, which
// aims to work around some of the shortfalls of the OCI Distribution spec
// API
GrpcClient ocicatalog.OCICatalogServiceClient
AuthorizationHeader string
}
OciAPIClient enables basic interactions with an OCI registry using (for now) a combination of the gRPC OCI catalog service and the http distribution spec API.
func (*OciAPIClient) Catalog ¶
Catalog returns the list of repositories in the (namespaced) registry when discoverable.
func (*OciAPIClient) CatalogAvailable ¶
CatalogAvailable returns whether Kubeapps can return a catalog for this OCI repository.
Currently this checks only for a VMware Application Catalog index as documented at: https://docs.vmware.com/en/VMware-Application-Catalog/services/main/GUID-using-consume-metadata.html#method-2-obtain-metadata-from-the-oci-registry-10 although examples have "chart-index" rather than "index" as the artifact name.
func (*OciAPIClient) IsHelmChart ¶
func (o *OciAPIClient) IsHelmChart(appName, tag, userAgent string) (bool, error)
type TagList ¶
TagList represents a list of tags as specified at https://github.com/opencontainers/distribution-spec/blob/main/spec.md#content-discovery
type VACCatalog ¶
type VACCatalog struct {
APIVersion string `json:"apiVersion"`
Entries map[string]any `json:"entries"`
}
VACCatalog representation