# Overlay

Overlay will parse the layered overlay and generates `ClusterConfig` from configs declared in [tidb-configuration](https://github.com/tidbcloud/tidb-configuration) in both `cloud.pingcap.com/v1` and `ops.tidbcloud.com/v1alpha1` api version. See [Overview](#overview) to understand the layered overlay structure.

## Overview

```
// overlay process the layered configuration file tree the file tree assumed to be the following format
//  .
// ├── tenants
// │   └── tenant-1270613000524402688
// │       ├── clusters
// │       │   └── cluster-1270613313241
// │       │       ├── tikv.toml      # cluster config overlays, optional
// │       │       └── meta.yaml      # cluster’s meta, optional
// │       ├── tikv.toml              # tenant config overlays, optional
// │       └── meta.yaml              # tenant’s default meta, optional
// ├── versions                       # must include all supported versions, required
// │   └── v4.0.9                     # base config of v4.0.9, required
// │       ├── base
// │       │   ├── backup.yaml
// │       │   ├── restore.yaml
// │       │   ├── pd.toml
// │       │   ├── tidb.toml
// │       │   ├── tiflash.toml
// │       │   ├── tikv.toml
// │       │   └── meta.yaml
// │       └── instances               # instance overlays, optional
// │           ├── aws.m5.2xlarge
// │           │   └── tikv.toml       # tuning for instance type `aws.m5.2xlarge`
// │           └── gcp.n2-standard-8
// │               └── tikv.toml       # tuning for instance type `gcp.n2-standard-8`
// └── meta.yaml                       # Global default meta, required
```

## Diff

Diff Command provides the ability to check the difference between two `ClusterConfig` directories. It's helpful in CI pipeline check to see what changes a new PR will make.
