Skip to content

Commit 02332ad

Browse files
committed
fix: update YAML schema instructions for Kustomize Component files and FluxCD resources
1 parent e91ed41 commit 02332ad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/instructions/yaml-schemas.instructions.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@ These instructions should be applied when working with any YAML configuration fi
3939
```
4040
> **Note:** These files should always use `apiVersion: kustomize.config.k8s.io/v1beta1`
4141

42+
- **For Kustomize Component files**:
43+
```yaml
44+
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
45+
```
46+
> **Note:** These files should always use `apiVersion: kustomize.config.k8s.io/v1alpha1` and `kind: Component`
47+
4248
- **For FluxCD Kustomization resources** (Flux CRD, usually in ks.yaml files):
4349
```yaml
44-
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd/kustomize-controller/main/config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml
50+
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
4551
```
4652
> **Note:** These files should always use `apiVersion: kustomize.toolkit.fluxcd.io/v1`
4753

@@ -193,6 +199,7 @@ When working with schema-validated YAML files:
193199
| Pattern error | `should match pattern...` | Ensure formats match requirements, e.g., semantic versions like `1.2.3` |
194200
| Format error | `should match format "hostname"` | Ensure hostnames follow RFC 1123 format |
195201
| Array item error | `should have required property` | Ensure each array item has all required fields |
202+
| API version error | `kustomize build failed: accumulating resources...` | For Component files, ensure using `apiVersion: kustomize.config.k8s.io/v1alpha1` with `kind: Component` |
196203

197204
## Schema Validation Challenges and Solutions
198205

0 commit comments

Comments
 (0)