Source Controller reference

This topic provides reference documentation for Source Controller.

ImageRepository [Deprecated]

---
apiVersion: source.apps.tanzu.vmware.com/v1alpha1
kind: ImageRepository
spec:
  image: registry.example/image/repository:tag
  # optional fields
  interval: 5m
  imagePullSecrets: []
  serviceAccountName: default

ImageRepository resolves source code defined in an Open Container Initiative (OCI) image repository, exposing the resulting source artifact at a URL defined by .status.artifact.url.

The interval determines how often to check tagged images for changes. Setting this value too high will result in delays in discovering new sources, while setting it too low may trigger a registry’s rate limits.

Repository credentials can be defined as image pull secrets. You can reference them either directly from the resources at .spec.imagePullSecrets or attach them to a service account referenced at .spec.serviceAccountName. The default service account name "default" is used if not otherwise specified. The default credential helpers for the registry are also used, for example, pulling from Google Container Registry (GCR) on a Google Kubernetes Engine (GKE) cluster.

MavenArtifact

---
apiVersion: source.apps.tanzu.vmware.com/v1alpha1
kind: MavenArtifact
metadata:
  name: mavenartifact-sample
spec:
  artifact:
    groupId: org.springframework.boot
    artifactId: spring-boot
    version: "2.7.0"
  repository:
    url: https://repo1.maven.org/maven2
  interval: 5m0s
  timeout: 1m0s

MavenArtifact resolves artifact from a Maven repository, exposing the resulting artifact at a URL defined by .status.artifact.url.

The interval determines how often to check artifact for changes. Setting this value too high results in delays in discovering new sources, while setting it too low may trigger a repository’s rate limits.

Repository credentials may be defined as secrets referenced from the resources at .spec.repository.secretRef. Secrets referenced by spec.repository.secretRef is parsed as follows:

---
apiVersion: v1
kind: Secret
metadata:
  name: auth-secret
type: Opaque
data:
  username: <BASE64>
  password: <BASE64>
  caFile:   <BASE64>   // PEM Encoded certificate data for Custom CA
  certFile: <BASE64>   // PEM-encoded client certificate
  keyFile:  <BASE64>   // Private Key

Maven supports a broad set of version syntax. Source Controller supports a strict subset of Maven’s version syntax in order to ensure compatibility and avoid user confusion. The subset of supported syntax may grow over time, but will never expand past the syntax defined directly by Maven. This behavior means that we can use mvn as a reference implementation for artifact resolution.

Version support implemented in the following order:

  1. Pinned version - an exact match of a version in2 maven-metadata.xml (versioning/versions/version).

  2. RELEASE - metaversion defined in maven-metadata.xml (versioning/release).

  3. *-SNAPSHOT - the newest artifact for a snapshot version.

  4. LATEST - metaversion defined in maven-metadata.xml (versioning/latest).

  5. Version ranges - https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html. Support is planned for a future release.

Note

Pinned versions should be immutable, all other versions are dynamic and can change at any time. The .spec.interval defines how frequently to check for updated artifacts.

check-circle-line exclamation-circle-line close-line
Scroll to top icon