Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry tool: support --- separator between documents in Registry YAML files #1108

Open
timburks opened this issue Mar 20, 2023 · 2 comments
Labels
question Further information is requested

Comments

@timburks
Copy link
Contributor

timburks commented Mar 20, 2023

Kubernetes YAML allows multiple documents to be concatenated in a single file, separated by a line with three dashes.

https://stackoverflow.com/questions/50788277/why-3-dashes-hyphen-in-yaml-file

This might be useful for Registry YAML. For example, we might group all the patch versions of a Kubernetes minor version into a single file:

apiVersion: apigeeregistry/v1
kind: Version
metadata:
  parent: apis/kubernetes
  name: v1.26.3
data:
  displayName: v1.26.3
  specs:
  - metadata:
      name: openapi
    data:
      filename: swagger.json
      mimeType: application/x.openapi+gzip;version=2.0
      sourceURI: https://raw.githubusercontent.com/kubernetes/kubernetes/v1.26.3/api/openapi-spec/swagger.json
---
apiVersion: apigeeregistry/v1
kind: Version
metadata:
  parent: apis/kubernetes
  name: v1.26.2
data:
  displayName: v1.26.2
  specs:
  - metadata:
      name: openapi
    data:
      filename: swagger.json
      mimeType: application/x.openapi+gzip;version=2.0
      sourceURI: https://raw.githubusercontent.com/kubernetes/kubernetes/v1.26.2/api/openapi-spec/swagger.json
---
apiVersion: apigeeregistry/v1
kind: Version
metadata:
  parent: apis/kubernetes
  name: v1.26.1
data:
  displayName: v1.26.1
  specs:
  - metadata:
      name: openapi
    data:
      filename: swagger.json
      mimeType: application/x.openapi+gzip;version=2.0
      sourceURI: https://raw.githubusercontent.com/kubernetes/kubernetes/v1.26.1/api/openapi-spec/swagger.json
---
apiVersion: apigeeregistry/v1
kind: Version
metadata:
  parent: apis/kubernetes
  name: v1.26.0
data:
  displayName: v1.26.0
  specs:
  - metadata:
      name: openapi
    data:
      filename: swagger.json
      mimeType: application/x.openapi+gzip;version=2.0
      sourceURI: https://raw.githubusercontent.com/kubernetes/kubernetes/v1.26.0/api/openapi-spec/swagger.json
@timburks
Copy link
Contributor Author

We already support this, which is produced by registry get and read by registry apply:

apiVersion: apigeeregistry/v1
items:
  - apiVersion: apigeeregistry/v1
    kind: Version
    metadata:
      name: v1.10.0
      parent: apis/kubernetes
      labels:
        updated: "2023-03-19"
    data:
      displayName: v1.10.0
      state: production
  - apiVersion: apigeeregistry/v1
    kind: Version
    metadata:
      name: v1.10.13
      parent: apis/kubernetes
      labels:
        updated: "2023-03-19"
    data:
      displayName: v1.10.13
      state: production
  - apiVersion: apigeeregistry/v1
    kind: Version
    metadata:
      name: v1.11.0
      parent: apis/kubernetes
      labels:
        updated: "2023-03-19"
    data:
      displayName: v1.11.0
      state: production

@timburks timburks added the question Further information is requested label Mar 20, 2023
@theganyo
Copy link
Member

Multiple docs are easily supported. We used multi-doc CRD format for our standard configuration in envoy adapter, see: https://github.com/apigee/apigee-remote-service-envoy/blob/main/server/config.go#L172.

@timburks timburks moved this to Todo in Apigee API Registry Apr 5, 2023
@timburks timburks moved this from Todo to Backlog in Apigee API Registry Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: Backlog
Development

No branches or pull requests

2 participants