Documentation
¶
Index ¶
- Constants
- func PrepareOciServer(t *testing.T, ociRepo *api.Repo)
- func PushFileToOCI(t *testing.T, filepath string, ref string)
- type Repo
- func (r *Repo) Fetch(chartName string, version string) (string, error)
- func (r *Repo) GetChartDetails(name string, version string) (*types.ChartDetails, error)
- func (r *Repo) Has(chartName string, version string) (bool, error)
- func (r *Repo) List() ([]string, error)
- func (r *Repo) ListChartVersions(chartName string) ([]string, error)
- func (r *Repo) Reload() error
- func (r *Repo) Upload(file string, metadata *chart.Metadata) error
- type RepoTester
- func (rt *RepoTester) GetChart(_ http.ResponseWriter, _ *http.Request, _ string)
- func (rt *RepoTester) GetChartPackage(w http.ResponseWriter, r *http.Request, name, digest string)
- func (rt *RepoTester) GetIndex(_ http.ResponseWriter, _ *http.Request)
- func (rt *RepoTester) GetTagManifest(w http.ResponseWriter, r *http.Request, name, version string)
- func (rt *RepoTester) GetTagsList(w http.ResponseWriter, r *http.Request, name string)
- func (rt *RepoTester) GetURL() string
- func (rt *RepoTester) HeadManifest200(w http.ResponseWriter)
- func (rt *RepoTester) HeadManifest404(w http.ResponseWriter)
- func (rt *RepoTester) PostChart(_ http.ResponseWriter, _ *http.Request)
- func (rt *RepoTester) ReplyPing(w http.ResponseWriter)
- func (rt *RepoTester) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Tags
Constants ¶
const ( // HelmChartConfigMediaType is the reserved media type for the Helm chart manifest config HelmChartConfigMediaType = "application/vnd.cncf.helm.config.v1+json" // HelmChartContentLayerMediaType is the reserved media type for Helm chart package content HelmChartContentLayerMediaType = "application/vnd.cncf.helm.chart.content.v1.tar+gzip" // HelmChartContentLayerMediaTypeDeprecated is the (deprecated) reserved media type for Helm // chart package content HelmChartContentLayerMediaTypeDeprecated = "application/tar+gzip" // ImageManifestMediaType is the reserved media type for OCI manifests ImageManifestMediaType = "application/vnd.oci.image.manifest.v1+json" )
Variables ¶
This section is empty.
Functions ¶
func PrepareOciServer ¶
Starts an OCI compliant server (docker-registry) so our push command based on oras cli works out-of-the-box. This way we don't have to mimic all the low-level HTTP requests made by oras.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo allows to operate a chart repository.
func NewRaw ¶
func NewRaw(u *url.URL, user string, pass string, c cache.Cacher, insecure bool, entries map[string][]string, resolver remotes.Resolver) (*Repo, error)
NewRaw creates a Repo object.
func PrepareHttpServer ¶
Creates an HTTP server that knows how to reply to all OCI related request except PUSH one.
func (*Repo) GetChartDetails ¶
GetChartDetails returns the details of a chart
func (*Repo) ListChartVersions ¶
ListChartVersions lists all versions of a chart
type RepoTester ¶
type RepoTester struct {
// contains filtered or unexported fields
}
RepoTester allows to unit test each repo implementation
func NewTester ¶
func NewTester(t *testing.T, repo *api.Repo) *RepoTester
NewTester creates fake HTTP server to handle requests and return a RepoTester object with useful info for testing
func (*RepoTester) GetChart ¶
func (rt *RepoTester) GetChart(_ http.ResponseWriter, _ *http.Request, _ string)
GetChart returns the chart info from the index
func (*RepoTester) GetChartPackage ¶
func (rt *RepoTester) GetChartPackage(w http.ResponseWriter, r *http.Request, name, digest string)
GetChartPackage returns a packaged helm chart
func (*RepoTester) GetIndex ¶
func (rt *RepoTester) GetIndex(_ http.ResponseWriter, _ *http.Request)
GetIndex returns an index file
func (*RepoTester) GetTagManifest ¶
func (rt *RepoTester) GetTagManifest(w http.ResponseWriter, r *http.Request, name, version string)
GetTagManifest returns the oci manifest of a specific tag
func (*RepoTester) GetTagsList ¶
func (rt *RepoTester) GetTagsList(w http.ResponseWriter, r *http.Request, name string)
GetTagsList returns the list of available tags for the specified asset
func (*RepoTester) GetURL ¶
func (rt *RepoTester) GetURL() string
GetURL returns the URL of the server
func (*RepoTester) HeadManifest200 ¶
func (rt *RepoTester) HeadManifest200(w http.ResponseWriter)
HeadManifest200 return if a manifests exists or not
func (*RepoTester) HeadManifest404 ¶
func (rt *RepoTester) HeadManifest404(w http.ResponseWriter)
HeadManifest404 return if a manifests exists or not
func (*RepoTester) PostChart ¶
func (rt *RepoTester) PostChart(_ http.ResponseWriter, _ *http.Request)
PostChart push a packaged chart
func (*RepoTester) ReplyPing ¶
func (rt *RepoTester) ReplyPing(w http.ResponseWriter)
ReplyPing reply to a ping operation done by remote.Head to guess some connection parameters https://github.com/google/go-containerregistry/blob/main/pkg/v1/remote/transport/transport.go#L51
func (*RepoTester) ServeHTTP ¶
func (rt *RepoTester) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http Handler type