Skip to content

Commit

Permalink
Add values for types in resources
Browse files Browse the repository at this point in the history
Added values for the following types, which would be the initial types
we would want to implement and support (could expand to support more in
the future):
- `SourceType`
- `ArtifactType`
- `ResultTargetType`
- `PipelineTriggerType` and `TaskTriggerType`
- `ParamType` (just strings for now?)

Since in #39 @pivotal-nader-ziada and @shashwathi are combining Sources
and Artifacts into one concept, we'll likely combine `SourceType` and
`ArtifactType` into one type as well.

While doing this noticed and cleaned up a couple things:
- Don't need to specify lists of result stores, just one
  for each type (test, log, runs). Also these are identical
  except for their usage, so we can use a common type for all of them
- Turns out pipeline run specs were not defined!
- Updated DEVELOPMENT.md re. how to regenerate generated code
  (such as `zz_generated.deepcopy.go`)

Fixes #18
  • Loading branch information
bobcatfish committed Sep 17, 2018
1 parent fddb0fa commit 16912c0
Show file tree
Hide file tree
Showing 15 changed files with 330 additions and 246 deletions.
10 changes: 10 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ This repo uses [`dep`](https://golang.github.io/dep/docs/daily-dep.html) for dep
* `dep ensure` should be a no-op
* Add a dep with `dep ensure -add $MY_DEP`

### Changing types

When updating types, you should regenerate any generated code with:

```bash
make generate
```

Then test this by [installing and running](#installing-and-running).

### Installing and running

The skeleton for this project was generated using [kubebuilder](https://book.kubebuilder.io/quick_start.html),
Expand Down
78 changes: 36 additions & 42 deletions config/crds/pipeline_v1beta1_pipelineparams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,50 +40,44 @@ spec:
results:
properties:
logs:
items:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
type: array
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
runs:
items:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
type: array
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
tests:
items:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
type: array
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
required:
- runs
- logs
Expand Down
32 changes: 32 additions & 0 deletions config/crds/pipeline_v1beta1_pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,38 @@ spec:
metadata:
type: object
spec:
properties:
pipelineParamsRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
pipelineRef:
properties:
apiVersion:
type: string
name:
type: string
required:
- name
type: object
triggerRef:
properties:
name:
type: string
type:
type: string
required:
- type
type: object
required:
- pipelineRef
- pipelineParamsRef
- triggerRef
type: object
status:
properties:
Expand Down
78 changes: 36 additions & 42 deletions config/crds/pipeline_v1beta1_taskrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,50 +97,44 @@ spec:
results:
properties:
logs:
items:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
type: array
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
runs:
items:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
type: array
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
tests:
items:
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
type: array
properties:
name:
type: string
type:
type: string
url:
type: string
required:
- name
- type
- url
type: object
required:
- runs
- logs
Expand Down
6 changes: 3 additions & 3 deletions config/samples/pipeline_v1beta1_pipelineparams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ spec:
url: 'gcr.io/wizzbang-staging'
results:
runs:
- name: 'runsBucket'
name: 'runsBucket'
type: 'gcs'
url: 'gcs://somebucket/results/runs'
token: 'todo'
logs:
- name: 'logBucket'
name: 'logBucket'
type: 'gcs'
url: 'gcs://somebucket/results/logs'
token: 'todo'
tests:
- name: 'testBucket'
name: 'testBucket'
type: 'gcs'
url: 'gcs://somebucket/results/tests'
token: 'todo'
Expand Down
5 changes: 2 additions & 3 deletions config/samples/pipeline_v1beta1_pipelinerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ spec:
name: wizzbang-pipeline
pipelineParamsRef:
name: wizzbang-pipeline-params
trigger:
triggerRef:
type: manual
triggerRef:
type: manual
status:
taskRuns:
- taskRef:
Expand Down
6 changes: 3 additions & 3 deletions config/samples/pipeline_v1beta1_taskrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ spec:
storeKey: registry # registy is the name of the ArtifactStore
results:
runs:
- name: 'runsBucket'
name: 'runsBucket'
type: 'gcs'
url: 'gcs://somebucket/results/runs'
logs:
- name: 'logBucket'
name: 'logBucket'
type: 'gcs'
url: 'gcs://somebucket/results/logs'
tests:
- name: 'testBucket'
name: 'testBucket'
type: 'gcs'
url: 'gcs://somebucket/results/tests'
status:
Expand Down
5 changes: 2 additions & 3 deletions examples/invocations/kritis-pipeline-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ spec:
name: kritis-pipeline
pipelineParamsRef:
name: pipelineparams-sample
trigger:
triggerRef:
type: manual
triggerRef:
type: manual
status:
taskRuns:
- taskRef:
Expand Down
6 changes: 3 additions & 3 deletions examples/invocations/run-kritis-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ spec:
value: 'test'
results:
runs:
- name: 'runsBucket'
name: 'runsBucket'
type: 'gcs'
url: 'gcs://somebucket/results/runs'
logs:
- name: 'logBucket'
name: 'logBucket'
type: 'gcs'
url: 'gcs://somebucket/results/logs'
tests:
- name: 'testBucket'
name: 'testBucket'
type: 'gcs'
url: 'gcs://somebucket/results/tests'
status:
Expand Down
6 changes: 3 additions & 3 deletions examples/pipelineparams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ spec:
endpoint: 'https://staging.gke.corp.com'
results:
runs:
- name: 'runsBucket'
name: 'runsBucket'
type: 'gcs'
url: 'gcs://somebucket/results/runs'
token: 'todo'
logs:
- name: 'logBucket'
name: 'logBucket'
type: 'gcs'
url: 'gcs://somebucket/results/logs'
token: 'todo'
tests:
- name: 'testBucket'
name: 'testBucket'
type: 'gcs'
url: 'gcs://somebucket/results/tests'
token: 'todo'
Loading

0 comments on commit 16912c0

Please sign in to comment.