Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Structural schema (#38)
Browse files Browse the repository at this point in the history
* Schema and readme updates to structural

* Update README.md

* Update .travis.yml
  • Loading branch information
alewitt2 authored Jan 31, 2020
1 parent 8f473a8 commit fb72aa5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 31 deletions.
9 changes: 0 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ deploy:
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$
- provider: releases
file: /tmp/resource.yaml
skip_cleanup: true
draft: true
api_key:
secure: "${GITHUB_TOKEN}"
on:
tags: true
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+_[0-9]{3}$

# Deploy released builds
- provider: script
Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kubectl apply -f "https://github.com/razee-io/ManagedSet/releases/latest/downloa

```yaml
kind: ManagedSet
apiVersion: deploy.razee.io/v1alpha1
apiVersion: deploy.razee.io/v1alpha2
metadata:
name: <managed_set_name>
namespace: <namespace>
Expand Down Expand Up @@ -54,15 +54,27 @@ spec:
- containerPort: 80
```
### Required Fields
### Spec
- `.spec.resources`
- type: array
- items:
- type: object
- required: [kind, apiVersion, metadata]
**Path:** `.spec`

## Features
**Description:** `spec` is required and **must** include section `resources`,
where each resource is a Kubernetes object with `apiVersion`, `kind`, and `metadata`.

**Schema:**

```yaml
spec:
type: object
required: [resources]
properties:
resources:
type: array
items:
type: object
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true
```

### Managed Resource Labels

Expand Down
23 changes: 9 additions & 14 deletions kubernetes/ManagedSet/resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ items:
# list of versions supported by this CustomResourceDefinition
versions:
- name: v1alpha1
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
storage: false
- name: v1alpha2
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
Expand All @@ -96,6 +101,8 @@ items:
validation:
# openAPIV3Schema is the schema for validating custom objects.
openAPIV3Schema:
type: object
required: [spec]
properties:
spec:
type: object
Expand All @@ -105,17 +112,5 @@ items:
type: array
items:
type: object
required: [kind, apiVersion, metadata]
properties:
kind:
type: string
apiVersion:
type: string
metadata:
type: object
required: [name]
properties:
name:
type: string
namespace:
type: string
x-kubernetes-embedded-resource: true
x-kubernetes-preserve-unknown-fields: true

0 comments on commit fb72aa5

Please sign in to comment.