Documentation ¶
Index ¶
- Constants
- func AnyMatch(toMatch []reference.Named, selectors []RefSelector) bool
- func FamiliarString(ref reference.Reference) string
- func ImageNamesEqual(a, b string) bool
- func IsEmptyRegistry(reg *v1alpha1.RegistryHosting) bool
- func MustParseNamed(s string) reference.Named
- func MustParseNamedTagged(s string) reference.NamedTagged
- func MustWithTag(name reference.Named, tag string) reference.NamedTagged
- func ParseNamed(s string) (reference.Named, error)
- func ParseNamedMulti(strs []string) ([]reference.Named, error)
- func ParseNamedTagged(s string) (reference.NamedTagged, error)
- func RegistryFromCluster(cluster *v1alpha1.Cluster) (*v1alpha1.RegistryHosting, error)
- func ReplaceRegistryForContainerRuntimeRef(rs RefSelector, reg *v1alpha1.RegistryHosting) (reference.Named, error)
- func ReplaceRegistryForLocalRef(rs RefSelector, reg *v1alpha1.RegistryHosting) (reference.Named, error)
- type ID
- type MatchType
- type Name
- type RefSelector
- func (s RefSelector) AsNamedOnly() reference.Named
- func (s RefSelector) Empty() bool
- func (s RefSelector) MatchExact() bool
- func (s RefSelector) Matches(toMatch reference.Named) bool
- func (s RefSelector) MatchesAny(toMatch []reference.Named) bool
- func (s RefSelector) RefFamiliarName() string
- func (s RefSelector) RefFamiliarString() string
- func (s RefSelector) RefName() string
- func (s RefSelector) RefsEqual(other RefSelector) bool
- func (s RefSelector) String() string
- func (s RefSelector) WithExactMatch() RefSelector
- func (s RefSelector) WithNameMatch() RefSelector
- type RefSet
- func (rs RefSet) AddTagSuffix(suffix string) (TaggedRefs, error)
- func (rs RefSet) ClusterRef() reference.Named
- func (rs RefSet) LocalRef() reference.Named
- func (rs RefSet) MustWithRegistry(reg *v1alpha1.RegistryHosting) RefSet
- func (rs RefSet) Registry() *v1alpha1.RegistryHosting
- func (rs RefSet) Validate() error
- func (rs RefSet) WithoutRegistry() RefSet
- type Runtime
- type TaggedRefs
Constants ¶
const IstioInitContainerName = Name("istio-init")
const IstioSidecarContainerName = Name("istio-proxy")
const LinkerdInitContainerName = Name("linkerd-init")
const LinkerdSidecarContainerName = Name("linkerd-proxy")
Variables ¶
This section is empty.
Functions ¶
func AnyMatch ¶ added in v0.10.14
func AnyMatch(toMatch []reference.Named, selectors []RefSelector) bool
func FamiliarString ¶ added in v0.10.19
func ImageNamesEqual ¶ added in v0.27.2
ImageNamesEqual returns true if the references correspond to the same named image.
If either reference is not a valid named image reference, false is returned.
For example: `reg.example.com/foo:abc` & `reg.example.com/foo:def` are equal because the named image is `reg.example.com/foo` in both cases.
func IsEmptyRegistry ¶ added in v0.29.0
func IsEmptyRegistry(reg *v1alpha1.RegistryHosting) bool
IsEmptyRegistry returns true if the object is nil or has no Host.
func MustParseNamed ¶
func MustParseNamedTagged ¶
func MustParseNamedTagged(s string) reference.NamedTagged
func MustWithTag ¶ added in v0.14.0
func MustWithTag(name reference.Named, tag string) reference.NamedTagged
func ParseNamedMulti ¶ added in v0.10.14
func ParseNamedTagged ¶
func ParseNamedTagged(s string) (reference.NamedTagged, error)
func RegistryFromCluster ¶ added in v0.27.1
func RegistryFromCluster(cluster *v1alpha1.Cluster) (*v1alpha1.RegistryHosting, error)
RegistryFromCluster determines the registry that should be used for pushing & pulling Tilt-built images.
If the v1alpha1.Cluster object is not in a healthy state, an error is returned.
If the v1alpha1.Cluster object is healthy and provides local registry metadata, that will be used.
Otherwise, if the v1alpha1.Cluster object is healthy and does not provide local registry metadata but a default registry for the cluster is defined (typically via `default_registry` in the Tiltfile), the default registry will be used.
As a fallback, an empty registry will be returned, which indicates that _no_ registry rewriting should occur and Tilt should push and pull images to the registry as specified by the configuration ref (e.g. what's passed in to `docker_build` or `custom_build`).
func ReplaceRegistryForContainerRuntimeRef ¶ added in v0.29.0
func ReplaceRegistryForContainerRuntimeRef(rs RefSelector, reg *v1alpha1.RegistryHosting) (reference.Named, error)
ReplaceRegistryForContainerRuntimeRef returns a new reference using the target local registry (as seen from the container runtime).
func ReplaceRegistryForLocalRef ¶ added in v0.29.0
func ReplaceRegistryForLocalRef(rs RefSelector, reg *v1alpha1.RegistryHosting) (reference.Named, error)
ReplaceRegistryForLocalRef returns a new reference using the target local registry (as seen from the user).
Types ¶
type RefSelector ¶ added in v0.7.11
type RefSelector struct {
// contains filtered or unexported fields
}
func MustParseSelector ¶ added in v0.7.11
func MustParseSelector(s string) RefSelector
func MustParseTaggedSelector ¶ added in v0.7.11
func MustParseTaggedSelector(s string) RefSelector
func NameSelector ¶ added in v0.7.11
func NameSelector(ref reference.Named) RefSelector
func NewRefSelector ¶ added in v0.7.11
func NewRefSelector(ref reference.Named) RefSelector
func SelectorFromImageMap ¶ added in v0.20.8
func SelectorFromImageMap(spec v1alpha1.ImageMapSpec) (RefSelector, error)
func (RefSelector) AsNamedOnly ¶ added in v0.7.11
func (s RefSelector) AsNamedOnly() reference.Named
AsNamedOnly returns the Ref as a Named, REMOVING THE TAG if one exists
func (RefSelector) Empty ¶ added in v0.7.11
func (s RefSelector) Empty() bool
func (RefSelector) MatchExact ¶ added in v0.20.8
func (s RefSelector) MatchExact() bool
func (RefSelector) Matches ¶ added in v0.7.11
func (s RefSelector) Matches(toMatch reference.Named) bool
func (RefSelector) MatchesAny ¶ added in v0.14.0
func (s RefSelector) MatchesAny(toMatch []reference.Named) bool
func (RefSelector) RefFamiliarName ¶ added in v0.7.11
func (s RefSelector) RefFamiliarName() string
func (RefSelector) RefFamiliarString ¶ added in v0.7.11
func (s RefSelector) RefFamiliarString() string
func (RefSelector) RefName ¶ added in v0.7.11
func (s RefSelector) RefName() string
func (RefSelector) RefsEqual ¶ added in v0.7.11
func (s RefSelector) RefsEqual(other RefSelector) bool
func (RefSelector) String ¶ added in v0.7.11
func (s RefSelector) String() string
func (RefSelector) WithExactMatch ¶ added in v0.7.11
func (s RefSelector) WithExactMatch() RefSelector
func (RefSelector) WithNameMatch ¶ added in v0.7.11
func (s RefSelector) WithNameMatch() RefSelector
type RefSet ¶ added in v0.14.0
type RefSet struct { // Ref as specified in Tiltfile; used to match a DockerBuild with // corresponding k8s YAML. May contain tags, etc. (Also used as // user-facing name for this image.) ConfigurationRef RefSelector // contains filtered or unexported fields }
RefSet describes the references for a given image:
- ConfigurationRef: ref as specified in the Tiltfile
- LocalRef(): ref as used outside of the cluster (for Docker etc.)
- ClusterRef(): ref as used inside the cluster (in k8s YAML etc.). Often equivalent to LocalRef, but in some cases they diverge: e.g. when using a local registry with KIND, the image localhost:1234/my-image (localRef) is referenced in the YAML as http://registry/my-image (clusterRef).
func MustSimpleRefSet ¶ added in v0.14.0
func MustSimpleRefSet(ref RefSelector) RefSet
func NewRefSet ¶ added in v0.14.0
func NewRefSet(confRef RefSelector, reg *v1alpha1.RegistryHosting) (RefSet, error)
func RefSetFromImageMap ¶ added in v0.27.2
func (RefSet) AddTagSuffix ¶ added in v0.17.2
func (rs RefSet) AddTagSuffix(suffix string) (TaggedRefs, error)
AddTagSuffix tags the references for build/deploy.
In most cases, we will use the tag given as-is.
If we're in the mode where we're pushing to a single image name (for ECR), we'll tag it with [escaped-original-name]-[suffix].
func (RefSet) ClusterRef ¶ added in v0.14.0
ClusterRef returns the ref by which this image will be pulled by the container runtime in the cluster.
For example, the registry host (that the user/Tilt *push* to) might be something like `localhost:1234/foo`, referring to an exposed port from the registry Docker container. However, when the container runtime (itself generally running within a Docker container), won't see it on localhost, and will instead use a reference like `registry:5000/foo`.
If HostFromContainerRuntime is not set on the registry for the RefSet, the Host will be used instead. This is common in cases where both the user and the container runtime refer to the registry in the same way.
Note that this is specific to the container runtime, which might have its own config for the host. The local registry specification allows an additional "ClusterFromClusterNetwork" value, which describes a generic way for access from within the cluster network (e.g. via cluster provided DNS). Within Tilt, this value is NOT used for business logic, so sometimes "cluster ref" is used to refer to the container runtime ref. The API types, however, include both values and are labeled accurately.
TODO(milas): Rename to ContainerRuntimeRef()
func (RefSet) LocalRef ¶ added in v0.14.0
LocalRef returns the ref by which this image is referenced from outside the cluster (e.g. by `docker build`, `docker push`, etc.)
func (RefSet) MustWithRegistry ¶ added in v0.14.0
func (rs RefSet) MustWithRegistry(reg *v1alpha1.RegistryHosting) RefSet
func (RefSet) Registry ¶ added in v0.17.5
func (rs RefSet) Registry() *v1alpha1.RegistryHosting
func (RefSet) WithoutRegistry ¶ added in v0.14.0
type Runtime ¶ added in v0.7.11
type Runtime string
A good way to manually test different container runtimes is with minikube. https://github.com/kubernetes/minikube/blob/master/docs/alternative_runtimes.md
func RuntimeFromVersionString ¶ added in v0.7.11
type TaggedRefs ¶ added in v0.14.0
type TaggedRefs struct { // LocalRef is the image name + tag as referenced from outside cluster // (e.g. by the user or Tilt when pushing images). LocalRef reference.NamedTagged // ClusterRef is the image name + tag as referenced from the // container runtime on the cluster. // // TODO(milas): Rename to ContainerRuntimeRef ClusterRef reference.NamedTagged }
TaggedRefs yielded by an image build