
// This file was autogenerated by go-to-protobuf. Do not edit it manually!

syntax = "proto2";

package github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1;

import "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions/v1alpha1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";

// Package-wide variables from generator "generated".
option go_package = "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1";

// +k8s:openapi-gen=true
message AppCluster {
  // Specifies namespace in destination cluster (optional)
  // +optional
  optional string namespace = 1;

  // Specifies secret containing kubeconfig (required)
  // +optional
  optional AppClusterKubeconfigSecretRef kubeconfigSecretRef = 2;
}

// +k8s:openapi-gen=true
message AppClusterKubeconfigSecretRef {
  // Specifies secret name within app's namespace (required)
  // +optional
  optional string name = 1;

  // Specifies key that contains kubeconfig (optional)
  // +optional
  optional string key = 2;
}

// +k8s:openapi-gen=true
message AppDeploy {
  // Use kapp to deploy resources
  optional AppDeployKapp kapp = 1;
}

// +k8s:openapi-gen=true
message AppDeployKapp {
  // Override namespace for all resources (optional)
  optional string intoNs = 1;

  // Provide custom namespace override mapping (optional)
  repeated string mapNs = 2;

  // Pass through options to kapp deploy (optional)
  repeated string rawOptions = 3;

  // Configuration for inspect command (optional)
  // as of kapp-controller v0.31.0, inspect is disabled by default
  // add rawOptions or use an empty inspect config like `inspect: {}` to enable
  optional AppDeployKappInspect inspect = 4;

  // Configuration for delete command (optional)
  optional AppDeployKappDelete delete = 5;
}

// +k8s:openapi-gen=true
message AppDeployKappDelete {
  // Pass through options to kapp delete (optional)
  repeated string rawOptions = 1;
}

// +k8s:openapi-gen=true
message AppDeployKappInspect {
  // Pass through options to kapp inspect (optional)
  repeated string rawOptions = 1;
}

// +k8s:openapi-gen=true
message AppFetch {
  // Pulls content from within this resource; or other resources in the cluster
  optional AppFetchInline inline = 1;

  // Pulls content from Docker/OCI registry
  optional AppFetchImage image = 2;

  // Uses http library to fetch file
  optional AppFetchHTTP http = 3;

  // Uses git to clone repository
  optional AppFetchGit git = 4;

  // Uses helm fetch to fetch specified chart
  optional AppFetchHelmChart helmChart = 5;

  // Pulls imgpkg bundle from Docker/OCI registry (v0.17.0+)
  optional AppFetchImgpkgBundle imgpkgBundle = 6;

  // Relative path to place the fetched artifacts
  // +optional
  optional string path = 7;
}

// +k8s:openapi-gen=true
message AppFetchGit {
  // http or ssh urls are supported (required)
  optional string url = 1;

  // Branch, tag, commit; origin is the name of the remote (optional)
  // +optional
  optional string ref = 2;

  // Specifies a strategy to resolve to an explicit ref (optional; v0.24.0+)
  // +optional
  optional github.com.vmware_tanzu.carvel_vendir.pkg.vendir.versions.v1alpha1.VersionSelection refSelection = 6;

  // Secret with auth details. allowed keys: ssh-privatekey, ssh-knownhosts, username, password (optional)
  // (if ssh-knownhosts is not specified, git will not perform strict host checking)
  // +optional
  optional AppFetchLocalRef secretRef = 3;

  // Grab only portion of repository (optional)
  // +optional
  optional string subPath = 4;

  // Skip lfs download (optional)
  // +optional
  optional bool lfsSkipSmudge = 5;
}

// +k8s:openapi-gen=true
message AppFetchHTTP {
  // URL can point to one of following formats: text, tgz, zip
  // http and https url are supported;
  // plain file, tgz and tar types are supported (required)
  optional string url = 1;

  // Checksum to verify after download (optional)
  // +optional
  optional string sha256 = 2;

  // Secret to provide auth details (optional)
  // Secret may include one or more keys: username, password
  // +optional
  optional AppFetchLocalRef secretRef = 3;

  // Grab only portion of download (optional)
  // +optional
  optional string subPath = 4;
}

// +k8s:openapi-gen=true
message AppFetchHelmChart {
  // Example: stable/redis
  optional string name = 1;

  // +optional
  optional string version = 2;

  optional AppFetchHelmChartRepo repository = 3;
}

// +k8s:openapi-gen=true
message AppFetchHelmChartRepo {
  // Repository url;
  // scheme of oci:// will fetch experimental helm oci chart (v0.19.0+)
  // (required)
  optional string url = 1;

  // +optional
  optional AppFetchLocalRef secretRef = 2;
}

// +k8s:openapi-gen=true
message AppFetchImage {
  // Docker image url; unqualified, tagged, or
  // digest references supported (required)
  // Example: username/app1-config:v0.1.0
  optional string url = 1;

  // Specifies a strategy to choose a tag (optional; v0.24.0+)
  // if specified, do not include a tag in url key
  // +optional
  optional github.com.vmware_tanzu.carvel_vendir.pkg.vendir.versions.v1alpha1.VersionSelection tagSelection = 4;

  // Secret may include one or more keys: username, password, token.
  // By default anonymous access is used for authentication.
  // +optional
  optional AppFetchLocalRef secretRef = 2;

  // Grab only portion of image (optional)
  // +optional
  optional string subPath = 3;
}

// +k8s:openapi-gen=true
message AppFetchImgpkgBundle {
  // Docker image url; unqualified, tagged, or
  // digest references supported (required)
  optional string image = 1;

  // Specifies a strategy to choose a tag (optional; v0.24.0+)
  // if specified, do not include a tag in url key
  // +optional
  optional github.com.vmware_tanzu.carvel_vendir.pkg.vendir.versions.v1alpha1.VersionSelection tagSelection = 3;

  // Secret may include one or more keys: username, password, token.
  // By default anonymous access is used for authentication.
  // +optional
  optional AppFetchLocalRef secretRef = 2;
}

// +k8s:openapi-gen=true
message AppFetchInline {
  // Specifies mapping of paths to their content;
  // not recommended for sensitive values as CR is not encrypted (optional)
  map<string, string> paths = 1;

  // Specifies content via secrets and config maps;
  // data values are recommended to be placed in secrets (optional)
  repeated AppFetchInlineSource pathsFrom = 2;
}

// +k8s:openapi-gen=true
message AppFetchInlineSource {
  optional AppFetchInlineSourceRef secretRef = 1;

  optional AppFetchInlineSourceRef configMapRef = 2;
}

// +k8s:openapi-gen=true
message AppFetchInlineSourceRef {
  // Specifies where to place files found in secret (optional)
  optional string directoryPath = 2;

  optional string name = 1;
}

// +k8s:openapi-gen=true
message AppFetchLocalRef {
  // Object is expected to be within same namespace
  optional string name = 1;
}

// +k8s:openapi-gen=true
message AppSpec {
  // Specifies that app should be deployed authenticated via
  // given service account, found in this namespace (optional; v0.6.0+)
  // +optional
  optional string serviceAccountName = 1;

  // Specifies that app should be deployed to destination cluster;
  // by default, cluster is same as where this resource resides (optional; v0.5.0+)
  // +optional
  optional AppCluster cluster = 2;

  // +optional
  repeated AppFetch fetch = 3;

  // +optional
  repeated AppTemplate template = 4;

  // +optional
  repeated AppDeploy deploy = 5;

  // Pauses _future_ reconciliation; does _not_ affect
  // currently running reconciliation (optional; default=false)
  // +optional
  optional bool paused = 6;

  // Cancels current and future reconciliations (optional; default=false)
  // +optional
  optional bool canceled = 7;

  // Specifies the length of time to wait, in time + unit
  // format, before reconciling. Always >= 30s. If value below
  // 30s is specified, 30s will be used. (optional; v0.9.0+; default=30s)
  // +optional
  optional k8s.io.apimachinery.pkg.apis.meta.v1.Duration syncPeriod = 8;

  // Deletion requests for the App will result in the App CR being
  // deleted, but its associated resources will not be deleted
  // (optional; default=false; v0.18.0+)
  // +optional
  optional bool noopDelete = 9;
}

// +k8s:openapi-gen=true
message AppTemplate {
  // Use ytt to template configuration
  optional AppTemplateYtt ytt = 1;

  // Use kbld to resolve image references to use digests
  optional AppTemplateKbld kbld = 2;

  // Use helm template command to render helm chart
  optional AppTemplateHelmTemplate helmTemplate = 3;

  optional AppTemplateKustomize kustomize = 4;

  optional AppTemplateJsonnet jsonnet = 5;

  // Use sops to decrypt *.sops.yml files (optional; v0.11.0+)
  optional AppTemplateSops sops = 6;

  optional AppTemplateCue cue = 7;
}

// +k8s:openapi-gen=true
message AppTemplateCue {
  // Explicit list of files/directories (optional)
  repeated string paths = 1;

  // Provide values (optional)
  repeated AppTemplateValuesSource valuesFrom = 2;

  // Cue expression for single path component, can be used to unify ValuesFrom into a given field (optional)
  optional string inputExpression = 3;

  // Cue expression to output, default will export all visible fields (optional)
  optional string outputExpression = 4;
}

// +k8s:openapi-gen=true
message AppTemplateHelmTemplate {
  // Set name explicitly, default is App CR's name (optional; v0.13.0+)
  optional string name = 1;

  // Set namespace explicitly, default is App CR's namespace (optional; v0.13.0+)
  optional string namespace = 2;

  // Path to chart (optional; v0.13.0+)
  optional string path = 3;

  // One or more secrets, config maps, paths that provide values (optional)
  repeated AppTemplateValuesSource valuesFrom = 4;

  // Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster.
  // Can be manually overridden to a value instead.
  optional Version kubernetesVersion = 5;

  // Optional: Use kubernetes group/versions resources available in the live cluster
  optional KubernetesAPIs kubernetesAPIs = 6;
}

// TODO implement jsonnet
// +k8s:openapi-gen=true
message AppTemplateJsonnet {
}

// +k8s:openapi-gen=true
message AppTemplateKbld {
  repeated string paths = 1;
}

// TODO implement kustomize
// +k8s:openapi-gen=true
message AppTemplateKustomize {
}

// +k8s:openapi-gen=true
message AppTemplateSops {
  // Use PGP to decrypt files (required)
  optional AppTemplateSopsPGP pgp = 1;

  // Lists paths to decrypt explicitly (optional; v0.13.0+)
  repeated string paths = 2;

  optional AppTemplateSopsAge age = 3;
}

// +k8s:openapi-gen=true
message AppTemplateSopsAge {
  // Secret with private armored PGP private keys (required)
  optional AppTemplateSopsPrivateKeysSecretRef privateKeysSecretRef = 1;
}

// +k8s:openapi-gen=true
message AppTemplateSopsPGP {
  // Secret with private armored PGP private keys (required)
  optional AppTemplateSopsPrivateKeysSecretRef privateKeysSecretRef = 1;
}

// +k8s:openapi-gen=true
message AppTemplateSopsPrivateKeysSecretRef {
  optional string name = 1;
}

// +k8s:openapi-gen=true
message AppTemplateValuesDownwardAPI {
  repeated AppTemplateValuesDownwardAPIItem items = 1;
}

// +k8s:openapi-gen=true
message AppTemplateValuesDownwardAPIItem {
  optional string name = 1;

  // Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.
  optional string fieldPath = 2;

  // Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster.
  // Can be manually supplied instead.
  optional Version kubernetesVersion = 3;

  // Optional: Get running KappController version, defaults (empty) to retrieving the current running version..
  // Can be manually supplied instead.
  optional Version kappControllerVersion = 4;

  // Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster.
  // Can be manually supplied instead, e.g ["group/version", "group2/version2"]
  optional KubernetesAPIs kubernetesAPIs = 5;
}

// +k8s:openapi-gen=true
message AppTemplateValuesSource {
  optional AppTemplateValuesSourceRef secretRef = 1;

  optional AppTemplateValuesSourceRef configMapRef = 2;

  optional string path = 3;

  optional AppTemplateValuesDownwardAPI downwardAPI = 4;
}

// +k8s:openapi-gen=true
message AppTemplateValuesSourceRef {
  optional string name = 1;
}

// +k8s:openapi-gen=true
message AppTemplateYtt {
  // Ignores comments that ytt doesn't recognize
  // (optional; default=false)
  optional bool ignoreUnknownComments = 1;

  // Forces strict mode https://github.com/k14s/ytt/blob/develop/docs/strict.md
  // (optional; default=false)
  optional bool strict = 2;

  // Specify additional files, including data values (optional)
  optional AppFetchInline inline = 3;

  // Lists paths to provide to ytt explicitly (optional)
  repeated string paths = 4;

  // Control metadata about input files passed to ytt (optional; v0.18.0+)
  // see https://carvel.dev/ytt/docs/latest/file-marks/ for more details
  repeated string fileMarks = 5;

  // Provide values via ytt's --data-values-file (optional; v0.19.0-alpha.9)
  repeated AppTemplateValuesSource valuesFrom = 6;
}

// +k8s:openapi-gen=true
message Condition {
  optional string type = 1;

  optional string status = 2;

  // Unique, this should be a short, machine understandable string that gives the reason
  // for condition's last transition. If it reports "ResizeStarted" that means the underlying
  // persistent volume is being resized.
  // +optional
  optional string reason = 3;

  // Human-readable message indicating details about last transition.
  // +optional
  optional string message = 4;
}

message GenericStatus {
  // Populated based on metadata.generation when controller
  // observes a change to the resource; if this value is
  // out of data, other status fields do not reflect latest state
  // +optional
  optional int64 observedGeneration = 1;

  // +optional
  repeated Condition conditions = 2;

  // +optional
  optional string friendlyDescription = 3;

  // +optional
  optional string usefulErrorMessage = 4;
}

// +k8s:openapi-gen=true
message KubernetesAPIs {
  repeated string groupVersions = 1;
}

// +k8s:openapi-gen=true
message Version {
  optional string version = 1;
}

