Documentation
¶
Overview ¶
Package offering reads an APIExport as a catalog card.
An offering has no object of its own: a producer publishes by annotating their APIExport, and the export's own permission claims are the claim surface a consumer accepts. This package is the single place that knows how to read that, so the operator (which grants `bind`) and the directory (which serves the catalog) cannot disagree about what is published or about what enabling would accept.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Claims ¶
func Claims(declared []apisv1alpha2.PermissionClaim) []marketplacev1alpha1.OfferingClaim
Claims projects an export's permission claims into the catalog's view of them. Nothing is validated, because there is nothing to validate against: the export declaring a claim is the claim existing.
func Published ¶
func Published(export *apisv1alpha2.APIExport) bool
Published reports whether an export opts into the catalog.
Only the exact string "true" publishes. An annotation present with any other value is not "sort of published": a typo should leave an export off the catalog rather than on it, because being on it is what grants `bind` to strangers.
func Revision ¶
func Revision(claims []marketplacev1alpha1.OfferingClaim) string
Revision is a digest of the claim surface: the same claims always give the same revision, and any change gives a different one.
This is what a consumer compares against the revision they accepted, to see whether the consent form moved under them. A digest rather than a counter because there is no object left to keep a counter on — and because a counter would restart at a different number every time a controller lost its memory of it, which is precisely when a consumer most wants the comparison to still mean something.
Types ¶
type Card ¶
type Card struct {
// DisplayName falls back to the export's own name.
DisplayName string
Description string
// IdentityHash is the export's identity, from its status. It is empty
// until kcp has reconciled the export, which is one of the two reasons
// an offering is not yet Ready.
IdentityHash string
// Claims is the export's permission claims, projected.
Claims []marketplacev1alpha1.OfferingClaim
// Revision is a digest of Claims.
Revision string
// DocsURL is the producer's documentation link, if any.
DocsURL string
// InstructionsRef names the ConfigMap holding the producer's "how to
// use this", in the export's own workspace. Empty means none.
InstructionsRef string
}
Card is one offering, as read off the APIExport that is it.
func From ¶
func From(export *apisv1alpha2.APIExport) Card
From reads the card off a published export.