UNPKG

@soft-stech/fleet

Version:
582 lines (581 loc) 22.7 kB
import { IObjectMeta } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta"; import { Model, ModelData } from "@soft-stech/base"; /** * GitRepo describes a git repository that is watched by Fleet. * The resource contains the necessary information to deploy the repo, or parts * of it, to target clusters. */ export interface IGitRepo { /** * APIVersion defines the versioned schema of this representation of an object. * Servers should convert recognized schemas to the latest internal value, and * may reject unrecognized values. * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ "apiVersion": "fleet.cattle.io/v1alpha1"; /** * Kind is a string value representing the REST resource this object represents. * Servers may infer this from the endpoint the client submits requests to. * Cannot be updated. * In CamelCase. * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ "kind": "GitRepo"; "metadata"?: IObjectMeta; "spec"?: { /** * Branch The git branch to follow. */ "branch"?: string; /** * CABundle is a PEM encoded CA bundle which will be used to validate the repo's certificate. * @format byte */ "caBundle"?: string; /** * ClientSecretName is the name of the client secret to be used to connect to the repo * It is expected the secret be of type "kubernetes.io/basic-auth" or "kubernetes.io/ssh-auth". */ "clientSecretName"?: string; /** * CorrectDrift specifies how drift correction should work. */ "correctDrift"?: { /** * Enabled correct drift if true. */ "enabled"?: boolean; /** * Force helm rollback with --force option will be used if true. This will try to recreate all resources in the release. */ "force"?: boolean; /** * KeepFailHistory keeps track of failed rollbacks in the helm history. */ "keepFailHistory"?: boolean; }; /** * DeleteNamespace specifies if the namespace created must be deleted after deleting the GitRepo. */ "deleteNamespace"?: boolean; /** * Disables git polling. When enabled only webhooks will be used. */ "disablePolling"?: boolean; /** * Increment this number to force a redeployment of contents from Git. */ "forceSyncGeneration"?: number; /** * HelmRepoURLRegex Helm credentials will be used if the helm repo matches this regex * Credentials will always be used if this is empty or not provided. */ "helmRepoURLRegex"?: string; /** * HelmSecretName contains the auth secret for a private Helm repository. */ "helmSecretName"?: string; /** * HelmSecretNameForPaths contains the auth secret for private Helm repository for each path. */ "helmSecretNameForPaths"?: string; /** * Commit specifies how to commit to the git repo when a new image is scanned and written back to git repo. */ "imageScanCommit"?: { /** * AuthorEmail gives the email to provide when making a commit */ "authorEmail"?: string; /** * AuthorName gives the name to provide when making a commit */ "authorName"?: string; /** * MessageTemplate provides a template for the commit message, * into which will be interpolated the details of the change made. */ "messageTemplate"?: string; }; /** * ImageScanInterval is the interval of syncing scanned images and writing back to git repo. */ "imageScanInterval"?: string; /** * InsecureSkipTLSverify will use insecure HTTPS to clone the repo. */ "insecureSkipTLSVerify"?: boolean; /** * KeepResources specifies if the resources created must be kept after deleting the GitRepo. */ "keepResources"?: boolean; /** * OCIRegistry specifies the OCI registry related parameters */ "ociRegistry"?: { /** * AuthSecretName contains the auth secret where the OCI regristry credentials are stored. */ "authSecretName"?: string; /** * BasicHTTP uses HTTP connections to the OCI registry when enabled. */ "basicHTTP"?: boolean; /** * InsecureSkipTLS allows connections to OCI registry without certs when enabled. */ "insecureSkipTLS"?: boolean; /** * Reference of the OCI Registry */ "reference"?: string; }; /** * Paths is the directories relative to the git repo root that contain resources to be applied. * Path globbing is supported, for example ["charts/\*"] will match all folders as a subdirectory of charts/ * If empty, "/" is the default. */ "paths"?: Array<string>; /** * Paused, when true, causes changes in Git not to be propagated down to the clusters but instead to mark * resources as OutOfSync. */ "paused"?: boolean; /** * PollingInterval is how often to check git for new updates. */ "pollingInterval"?: string; /** * Repo is a URL to a git repo to clone and index. */ "repo"?: string; /** * Revision A specific commit or tag to operate on. */ "revision"?: string; /** * ServiceAccount used in the downstream cluster for deployment. */ "serviceAccount"?: string; /** * Ensure that all resources are created in this namespace * Any cluster scoped resource will be rejected if this is set * Additionally this namespace will be created on demand. */ "targetNamespace"?: string; /** * Targets is a list of targets this repo will deploy to. */ "targets"?: Array<{ /** * ClusterGroup is the name of a cluster group in the same namespace as the clusters. */ "clusterGroup"?: string; /** * ClusterGroupSelector is a label selector to select cluster groups. */ "clusterGroupSelector"?: { /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. */ "matchExpressions"?: Array<{ /** * key is the label key that the selector applies to. */ "key": string; /** * operator represents a key's relationship to a set of values. * Valid operators are In, NotIn, Exists and DoesNotExist. */ "operator": string; /** * values is an array of string values. If the operator is In or NotIn, * the values array must be non-empty. If the operator is Exists or DoesNotExist, * the values array must be empty. This array is replaced during a strategic * merge patch. */ "values"?: Array<string>; }>; /** * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels * map is equivalent to an element of matchExpressions, whose key field is "key", the * operator is "In", and the values array contains only "value". The requirements are ANDed. */ "matchLabels"?: Record<string, string>; }; /** * ClusterName is the name of a cluster. */ "clusterName"?: string; /** * ClusterSelector is a label selector to select clusters. */ "clusterSelector"?: { /** * matchExpressions is a list of label selector requirements. The requirements are ANDed. */ "matchExpressions"?: Array<{ /** * key is the label key that the selector applies to. */ "key": string; /** * operator represents a key's relationship to a set of values. * Valid operators are In, NotIn, Exists and DoesNotExist. */ "operator": string; /** * values is an array of string values. If the operator is In or NotIn, * the values array must be non-empty. If the operator is Exists or DoesNotExist, * the values array must be empty. This array is replaced during a strategic * merge patch. */ "values"?: Array<string>; }>; /** * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels * map is equivalent to an element of matchExpressions, whose key field is "key", the * operator is "In", and the values array contains only "value". The requirements are ANDed. */ "matchLabels"?: Record<string, string>; }; /** * Name is the name of this target. */ "name"?: string; }>; }; "status"?: { /** * Commit is the Git commit hash from the last git job run. */ "commit"?: string; /** * Conditions is a list of Wrangler conditions that describe the state * of the GitRepo. */ "conditions"?: Array<{ /** * Last time the condition transitioned from one status to another. */ "lastTransitionTime"?: string; /** * The last time this condition was updated. */ "lastUpdateTime"?: string; /** * Human-readable message indicating details about last transition */ "message"?: string; /** * The reason for the condition's last transition. */ "reason"?: string; /** * Status of the condition, one of True, False, Unknown. */ "status": string; /** * Type of cluster condition. */ "type": string; }>; /** * DesiredReadyClusters is the number of clusters that should be ready for bundles of this GitRepo. */ "desiredReadyClusters"?: number; /** * Display contains a human readable summary of the status. */ "display"?: { /** * Error is true if a message is present. */ "error"?: boolean; /** * Message contains the relevant message from the deployment conditions. */ "message"?: string; /** * ReadyBundleDeployments is a string in the form "%d/%d", that describes the * number of ready bundledeployments over the total number of bundledeployments. */ "readyBundleDeployments"?: string; /** * State is the state of the GitRepo, e.g. "GitUpdating" or the maximal * BundleState according to StateRank. */ "state"?: string; }; /** * GitJobStatus is the status of the last Git job run, e.g. "Current" if there was no error. */ "gitJobStatus"?: string; /** * LastPollingTime is the last time the polling check was triggered * @format date-time */ "lastPollingTriggered"?: string | null; /** * LastSyncedImageScanTime is the time of the last image scan. * @format date-time */ "lastSyncedImageScanTime"?: string | null; /** * ObservedGeneration is the current generation of the resource in the cluster. It is copied from k8s * metadata.Generation. The value is incremented for all changes, except for changes to .metadata or .status. */ "observedGeneration"?: number; /** * ReadyClusters is the lowest number of clusters that are ready over * all the bundles of this GitRepo. */ "readyClusters"?: number; /** * ResourceCounts contains the number of resources in each state over all bundles. */ "resourceCounts"?: { /** * DesiredReady is the number of resources that should be ready. */ "desiredReady"?: number; /** * Missing is the number of missing resources. */ "missing"?: number; /** * Modified is the number of resources that have been modified. */ "modified"?: number; /** * NotReady is the number of not ready resources. Resources are not * ready if they do not match any other state. */ "notReady"?: number; /** * Orphaned is the number of orphaned resources. */ "orphaned"?: number; /** * Ready is the number of ready resources. */ "ready"?: number; /** * Unknown is the number of resources in an unknown state. */ "unknown"?: number; /** * WaitApplied is the number of resources that are waiting to be applied. */ "waitApplied"?: number; }; /** * ResourceErrors is a sorted list of errors from the resources. */ "resourceErrors"?: Array<string>; /** * Resources contains metadata about the resources of each bundle. */ "resources"?: Array<{ /** * APIVersion is the API version of the resource. */ "apiVersion"?: string; /** * Error is true if any Error in the PerClusterState is true. */ "error"?: boolean; /** * ID is the name of the resource, e.g. "namespace1/my-config" or "backingimagemanagers.storage.io". */ "id"?: string; /** * IncompleteState is true if a bundle summary has 10 or more non-ready * resources or a non-ready resource has more 10 or more non-ready or * modified states. */ "incompleteState"?: boolean; /** * Kind is the k8s kind of the resource. */ "kind"?: string; /** * Message is the first message from the PerClusterStates. */ "message"?: string; /** * Name of the resource. */ "name"?: string; /** * Namespace of the resource. */ "namespace"?: string; /** * PerClusterState is a list of states for each cluster. Derived from the summaries non-ready resources. */ "perClusterState"?: Array<{ /** * ClusterID is the id of the cluster. */ "clusterId"?: string; /** * Error is true if the resource is in an error state, copied from the bundle's summary for non-ready resources. */ "error"?: boolean; /** * Message combines the messages from the bundle's summary. Messages are joined with the delimiter ';'. */ "message"?: string; /** * Patch for modified resources. */ "patch"?: {}; /** * State is the state of the resource. */ "state"?: string; /** * Transitioning is true if the resource is in a transitioning state, * copied from the bundle's summary for non-ready resources. */ "transitioning"?: boolean; }>; /** * State is the state of the resource, e.g. "Unknown", "WaitApplied", "ErrApplied" or "Ready". */ "state"?: string; /** * Transitioning is true if any Transitioning in the PerClusterState is true. */ "transitioning"?: boolean; /** * Type is the type of the resource, e.g. "apiextensions.k8s.io.customresourcedefinition" or "configmap". */ "type"?: string; }>; /** * Summary contains the number of bundle deployments in each state and a list of non-ready resources. */ "summary"?: { /** * DesiredReady is the number of bundle deployments that should be * ready. */ "desiredReady"?: number; /** * ErrApplied is the number of bundle deployments that have been synced * from the Fleet controller and the downstream cluster, but with some * errors when deploying the bundle. */ "errApplied"?: number; /** * Modified is the number of bundle deployments that have been deployed * and for which all resources are ready, but where some changes from the * Git repository have not yet been synced. */ "modified"?: number; /** * NonReadyClusters is a list of states, which is filled for a bundle * that is not ready. */ "nonReadyResources"?: Array<{ /** * State is the state of the resource, like e.g. "NotReady" or "ErrApplied". */ "bundleState"?: string; /** * Message contains information why the bundle is not ready. */ "message"?: string; /** * ModifiedStatus lists the state for each modified resource. */ "modifiedStatus"?: Array<{ "apiVersion"?: string; "delete"?: boolean; "kind"?: string; "missing"?: boolean; "name"?: string; "namespace"?: string; "patch"?: string; }>; /** * Name is the name of the resource. */ "name"?: string; /** * NonReadyStatus lists the state for each non-ready resource. */ "nonReadyStatus"?: Array<{ "apiVersion"?: string; "kind"?: string; "name"?: string; "namespace"?: string; "summary"?: { "error"?: boolean; "message"?: Array<string>; "state"?: string; "transitioning"?: boolean; }; /** * UID is a type that holds unique ID values, including UUIDs. Because we * don't ONLY use UUIDs, this is an alias to string. Being a type captures * intent and helps make sure that UIDs and names do not get conflated. */ "uid"?: string; }>; }>; /** * NotReady is the number of bundle deployments that have been deployed * where some resources are not ready. */ "notReady"?: number; /** * OutOfSync is the number of bundle deployments that have been synced * from Fleet controller, but not yet by the downstream agent. */ "outOfSync"?: number; /** * Pending is the number of bundle deployments that are being processed * by Fleet controller. */ "pending"?: number; /** * Ready is the number of bundle deployments that have been deployed * where all resources are ready. */ "ready"?: number; /** * WaitApplied is the number of bundle deployments that have been * synced from Fleet controller and downstream cluster, but are waiting * to be deployed. */ "waitApplied"?: number; }; /** * Update generation is the force update generation if spec.forceSyncGeneration is set */ "updateGeneration"?: number; /** * WebhookCommit is the latest Git commit hash received from a webhook */ "webhookCommit"?: string; }; } /** * GitRepo describes a git repository that is watched by Fleet. * The resource contains the necessary information to deploy the repo, or parts * of it, to target clusters. */ export declare class GitRepo extends Model<IGitRepo> implements IGitRepo { "apiVersion": IGitRepo["apiVersion"]; "kind": IGitRepo["kind"]; "metadata"?: IGitRepo["metadata"]; "spec"?: IGitRepo["spec"]; "status"?: IGitRepo["status"]; static apiVersion: IGitRepo["apiVersion"]; static kind: IGitRepo["kind"]; static is: import("@soft-stech/base").TypeMetaGuard<IGitRepo>; constructor(data?: ModelData<IGitRepo>); }