mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
TemplateProcessor can add custom resource schemas to openapi
This commit is contained in:
10
kyaml/fn/framework/testdata/template-processor/patches/custom-resource/patch.template.yaml
vendored
Normal file
10
kyaml/fn/framework/testdata/template-processor/patches/custom-resource/patch.template.yaml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright 2021 The Kubernetes Authors.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
spec:
|
||||
targets:
|
||||
- app: B
|
||||
size: small
|
||||
- app: C
|
||||
type: Ruby
|
||||
size: large
|
||||
58
kyaml/fn/framework/testdata/template-processor/schemas/foo.json
vendored
Normal file
58
kyaml/fn/framework/testdata/template-processor/schemas/foo.json
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"definitions": {
|
||||
"com.example.v1.Foo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"description": "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",
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"description": "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",
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
|
||||
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
|
||||
},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"targets"
|
||||
],
|
||||
"properties": {
|
||||
"targets": {
|
||||
"type": "array",
|
||||
"x-kubernetes-patch-merge-key": "app",
|
||||
"x-kubernetes-patch-strategy": "merge",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"app"
|
||||
],
|
||||
"properties": {
|
||||
"app": {
|
||||
"type": "string"
|
||||
},
|
||||
"size": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-kubernetes-group-version-kind": [
|
||||
{
|
||||
"group": "example.com",
|
||||
"kind": "Foo",
|
||||
"version": "v1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
14
kyaml/fn/framework/testdata/template-processor/templates/custom-resource/foo.yaml
vendored
Normal file
14
kyaml/fn/framework/testdata/template-processor/templates/custom-resource/foo.yaml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# Copyright 2021 The Kubernetes Authors.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
apiVersion: example.com/v1
|
||||
kind: Foo
|
||||
metadata:
|
||||
name: example
|
||||
spec:
|
||||
targets:
|
||||
- app: A
|
||||
type: Go
|
||||
size: small
|
||||
- app: B
|
||||
type: Go
|
||||
Reference in New Issue
Block a user