kcr_source_toolkit_fluxcd_io 3.20260112.151314

Kubernetes Custom Resource Bindings
Documentation
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/fluxcd/source-controller/source.toolkit.fluxcd.io/v1/gitrepositories.yaml
// kopium version: 0.22.5

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
}
use self::prelude::*;

/// GitRepositorySpec specifies the required configuration to produce an
/// Artifact for a Git repository.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "source.toolkit.fluxcd.io", version = "v1", kind = "GitRepository", plural = "gitrepositories")]
#[kube(namespaced)]
#[kube(status = "GitRepositoryStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct GitRepositorySpec {
    /// Ignore overrides the set of excluded patterns in the .sourceignore format
    /// (which is the same as .gitignore). If not provided, a default will be used,
    /// consult the documentation for your version to find out what those are.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ignore: Option<String>,
    /// Include specifies a list of GitRepository resources which Artifacts
    /// should be included in the Artifact produced for this GitRepository.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub include: Option<Vec<GitRepositoryInclude>>,
    /// Interval at which the GitRepository URL is checked for updates.
    /// This interval is approximate and may be subject to jitter to ensure
    /// efficient use of resources.
    pub interval: String,
    /// Provider used for authentication, can be 'azure', 'github', 'generic'.
    /// When not specified, defaults to 'generic'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub provider: Option<GitRepositoryProvider>,
    /// ProxySecretRef specifies the Secret containing the proxy configuration
    /// to use while communicating with the Git server.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "proxySecretRef")]
    pub proxy_secret_ref: Option<GitRepositoryProxySecretRef>,
    /// RecurseSubmodules enables the initialization of all submodules within
    /// the GitRepository as cloned from the URL, using their default settings.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "recurseSubmodules")]
    pub recurse_submodules: Option<bool>,
    /// Reference specifies the Git reference to resolve and monitor for
    /// changes, defaults to the 'master' branch.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ref")]
    pub r#ref: Option<GitRepositoryRef>,
    /// SecretRef specifies the Secret containing authentication credentials for
    /// the GitRepository.
    /// For HTTPS repositories the Secret must contain 'username' and 'password'
    /// fields for basic auth or 'bearerToken' field for token auth.
    /// For SSH repositories the Secret must contain 'identity'
    /// and 'known_hosts' fields.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<GitRepositorySecretRef>,
    /// ServiceAccountName is the name of the Kubernetes ServiceAccount used to
    /// authenticate to the GitRepository. This field is only supported for 'azure' provider.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccountName")]
    pub service_account_name: Option<String>,
    /// SparseCheckout specifies a list of directories to checkout when cloning
    /// the repository. If specified, only these directories are included in the
    /// Artifact produced for this GitRepository.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sparseCheckout")]
    pub sparse_checkout: Option<Vec<String>>,
    /// Suspend tells the controller to suspend the reconciliation of this
    /// GitRepository.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub suspend: Option<bool>,
    /// Timeout for Git operations like cloning, defaults to 60s.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
    /// URL specifies the Git repository URL, it can be an HTTP/S or SSH address.
    pub url: String,
    /// Verification specifies the configuration to verify the Git commit
    /// signature(s).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub verify: Option<GitRepositoryVerify>,
}

/// GitRepositoryInclude specifies a local reference to a GitRepository which
/// Artifact (sub-)contents must be included, and where they should be placed.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryInclude {
    /// FromPath specifies the path to copy contents from, defaults to the root
    /// of the Artifact.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fromPath")]
    pub from_path: Option<String>,
    /// GitRepositoryRef specifies the GitRepository which Artifact contents
    /// must be included.
    pub repository: GitRepositoryIncludeRepository,
    /// ToPath specifies the path to copy contents to, defaults to the name of
    /// the GitRepositoryRef.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "toPath")]
    pub to_path: Option<String>,
}

/// GitRepositoryRef specifies the GitRepository which Artifact contents
/// must be included.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryIncludeRepository {
    /// Name of the referent.
    pub name: String,
}

/// GitRepositorySpec specifies the required configuration to produce an
/// Artifact for a Git repository.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum GitRepositoryProvider {
    #[serde(rename = "generic")]
    Generic,
    #[serde(rename = "azure")]
    Azure,
    #[serde(rename = "github")]
    Github,
}

/// ProxySecretRef specifies the Secret containing the proxy configuration
/// to use while communicating with the Git server.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryProxySecretRef {
    /// Name of the referent.
    pub name: String,
}

/// Reference specifies the Git reference to resolve and monitor for
/// changes, defaults to the 'master' branch.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryRef {
    /// Branch to check out, defaults to 'master' if no other field is defined.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub branch: Option<String>,
    /// Commit SHA to check out, takes precedence over all reference fields.
    /// 
    /// This can be combined with Branch to shallow clone the branch, in which
    /// the commit is expected to exist.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub commit: Option<String>,
    /// Name of the reference to check out; takes precedence over Branch, Tag and SemVer.
    /// 
    /// It must be a valid Git reference: <https://git-scm.com/docs/git-check-ref-format#_description>
    /// Examples: "refs/heads/main", "refs/tags/v0.1.0", "refs/pull/420/head", "refs/merge-requests/1/head"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// SemVer tag expression to check out, takes precedence over Tag.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub semver: Option<String>,
    /// Tag to check out, takes precedence over Branch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tag: Option<String>,
}

/// SecretRef specifies the Secret containing authentication credentials for
/// the GitRepository.
/// For HTTPS repositories the Secret must contain 'username' and 'password'
/// fields for basic auth or 'bearerToken' field for token auth.
/// For SSH repositories the Secret must contain 'identity'
/// and 'known_hosts' fields.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositorySecretRef {
    /// Name of the referent.
    pub name: String,
}

/// Verification specifies the configuration to verify the Git commit
/// signature(s).
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryVerify {
    /// Mode specifies which Git object(s) should be verified.
    /// 
    /// The variants "head" and "HEAD" both imply the same thing, i.e. verify
    /// the commit that the HEAD of the Git repository points to. The variant
    /// "head" solely exists to ensure backwards compatibility.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<GitRepositoryVerifyMode>,
    /// SecretRef specifies the Secret containing the public keys of trusted Git
    /// authors.
    #[serde(rename = "secretRef")]
    pub secret_ref: GitRepositoryVerifySecretRef,
}

/// Verification specifies the configuration to verify the Git commit
/// signature(s).
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum GitRepositoryVerifyMode {
    #[serde(rename = "head")]
    Head,
    #[serde(rename = "HEAD")]
    HeadX,
    Tag,
    #[serde(rename = "TagAndHEAD")]
    TagAndHead,
}

/// SecretRef specifies the Secret containing the public keys of trusted Git
/// authors.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryVerifySecretRef {
    /// Name of the referent.
    pub name: String,
}

/// GitRepositoryStatus records the observed state of a Git repository.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryStatus {
    /// Artifact represents the last successful GitRepository reconciliation.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub artifact: Option<GitRepositoryStatusArtifact>,
    /// Conditions holds the conditions for the GitRepository.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    /// IncludedArtifacts contains a list of the last successfully included
    /// Artifacts as instructed by GitRepositorySpec.Include.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "includedArtifacts")]
    pub included_artifacts: Option<Vec<GitRepositoryStatusIncludedArtifacts>>,
    /// LastHandledReconcileAt holds the value of the most recent
    /// reconcile request value, so a change of the annotation value
    /// can be detected.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastHandledReconcileAt")]
    pub last_handled_reconcile_at: Option<String>,
    /// ObservedGeneration is the last observed generation of the GitRepository
    /// object.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
    pub observed_generation: Option<i64>,
    /// ObservedIgnore is the observed exclusion patterns used for constructing
    /// the source artifact.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedIgnore")]
    pub observed_ignore: Option<String>,
    /// ObservedInclude is the observed list of GitRepository resources used to
    /// produce the current Artifact.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedInclude")]
    pub observed_include: Option<Vec<GitRepositoryStatusObservedInclude>>,
    /// ObservedRecurseSubmodules is the observed resource submodules
    /// configuration used to produce the current Artifact.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedRecurseSubmodules")]
    pub observed_recurse_submodules: Option<bool>,
    /// ObservedSparseCheckout is the observed list of directories used to
    /// produce the current Artifact.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedSparseCheckout")]
    pub observed_sparse_checkout: Option<Vec<String>>,
    /// SourceVerificationMode is the last used verification mode indicating
    /// which Git object(s) have been verified.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sourceVerificationMode")]
    pub source_verification_mode: Option<String>,
}

/// Artifact represents the last successful GitRepository reconciliation.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryStatusArtifact {
    /// Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
    pub digest: String,
    /// LastUpdateTime is the timestamp corresponding to the last update of the
    /// Artifact.
    #[serde(rename = "lastUpdateTime")]
    pub last_update_time: String,
    /// Metadata holds upstream information such as OCI annotations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<BTreeMap<String, String>>,
    /// Path is the relative file path of the Artifact. It can be used to locate
    /// the file in the root of the Artifact storage on the local file system of
    /// the controller managing the Source.
    pub path: String,
    /// Revision is a human-readable identifier traceable in the origin source
    /// system. It can be a Git commit SHA, Git tag, a Helm chart version, etc.
    pub revision: String,
    /// Size is the number of bytes in the file.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<i64>,
    /// URL is the HTTP address of the Artifact as exposed by the controller
    /// managing the Source. It can be used to retrieve the Artifact for
    /// consumption, e.g. by another controller applying the Artifact contents.
    pub url: String,
}

/// Artifact represents the output of a Source reconciliation.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryStatusIncludedArtifacts {
    /// Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
    pub digest: String,
    /// LastUpdateTime is the timestamp corresponding to the last update of the
    /// Artifact.
    #[serde(rename = "lastUpdateTime")]
    pub last_update_time: String,
    /// Metadata holds upstream information such as OCI annotations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<BTreeMap<String, String>>,
    /// Path is the relative file path of the Artifact. It can be used to locate
    /// the file in the root of the Artifact storage on the local file system of
    /// the controller managing the Source.
    pub path: String,
    /// Revision is a human-readable identifier traceable in the origin source
    /// system. It can be a Git commit SHA, Git tag, a Helm chart version, etc.
    pub revision: String,
    /// Size is the number of bytes in the file.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<i64>,
    /// URL is the HTTP address of the Artifact as exposed by the controller
    /// managing the Source. It can be used to retrieve the Artifact for
    /// consumption, e.g. by another controller applying the Artifact contents.
    pub url: String,
}

/// GitRepositoryInclude specifies a local reference to a GitRepository which
/// Artifact (sub-)contents must be included, and where they should be placed.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryStatusObservedInclude {
    /// FromPath specifies the path to copy contents from, defaults to the root
    /// of the Artifact.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fromPath")]
    pub from_path: Option<String>,
    /// GitRepositoryRef specifies the GitRepository which Artifact contents
    /// must be included.
    pub repository: GitRepositoryStatusObservedIncludeRepository,
    /// ToPath specifies the path to copy contents to, defaults to the name of
    /// the GitRepositoryRef.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "toPath")]
    pub to_path: Option<String>,
}

/// GitRepositoryRef specifies the GitRepository which Artifact contents
/// must be included.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct GitRepositoryStatusObservedIncludeRepository {
    /// Name of the referent.
    pub name: String,
}