-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Only have one set of examples and test that they are valid #109
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2018 The Knative Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# smoke_test.sh will attempt to deploy all of the example CRDs to whatever | ||
# is the current kubectl cluster context. | ||
# It will not wait for any Runs to complete and instead will destroy the CRDs | ||
# immediately after creation, so at the moment this pretty much just makes | ||
# sure the structure is valid (and this might even have weird side effects..). | ||
|
||
set -o xtrace | ||
set -o errexit | ||
set -o pipefail | ||
|
||
kubectl apply -f examples/ | ||
kubectl apply -f examples/pipelines | ||
kubectl apply -f examples/invocations | ||
|
||
sleep 5 | ||
|
||
kubectl delete -f examples/invocations | ||
kubectl delete -f examples/pipelines | ||
kubectl delete -f examples/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one advantage of using IDE, it adds new line :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i wonder if i need to turn an extension on or something 🤔 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,16 @@ type PipelineResourceSpec struct { | |
Params []Param `json:"params"` | ||
} | ||
|
||
// TaskResource defines an input or output Resource declared as a requirement | ||
// by a Task. The Name field will be used to refer to these Resources within | ||
// the Task definition, and when provided as an Input, the Name will be the | ||
// path to the volume mounted containing this Resource as an input (e.g. | ||
// an input Resource named `workspace` will be mounted at `/workspace`). | ||
type TaskResource struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! |
||
Name string `json:"name"` | ||
Type PipelineResourceType `json:"type"` | ||
} | ||
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,27 +69,14 @@ type Task struct { | |
// Inputs are the requirements that a task needs to run a Build. | ||
type Inputs struct { | ||
// +optional | ||
Sources []Source `json:"resources,omitempty"` | ||
Resources []TaskResource `json:"resources,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! |
||
// +optional | ||
Params []Param `json:"params,omitempty"` | ||
// TODO(#68) a cluster and/or deployment should be a type of Resource | ||
// +optional | ||
Clusters []Cluster `json:"clusters,omitempty"` | ||
} | ||
|
||
// Source is data which is required by a Build/Task for context | ||
// (e.g. a repo from which to build an image). The name of the input will be | ||
// used as the name of the volume containing this context which will be mounted | ||
// into the container executed by the Build/Task, e.g. a Source with the | ||
// name "workspace" would be mounted into "/workspace". | ||
// | ||
// TODO(#62): Something is wrong here, this should be a reference to a resource, | ||
// could just be that the names and comments are out of date. | ||
type Source struct { | ||
// name of the source should match the name of the SourceBinding in the pipeline | ||
Name string `json:"name"` | ||
Type PipelineResourceType `json:"type"` | ||
} | ||
|
||
// Param defines arbitrary parameters needed by a task beyond typed inputs | ||
// such as resources. | ||
type Param struct { | ||
|
@@ -103,7 +90,7 @@ type Outputs struct { | |
// +optional | ||
Results []TestResult `json:"results,omitempty"` | ||
// +optional | ||
Sources []Source `json:"resources,omitempty"` | ||
Resources []TaskResource `json:"resources,omitempty"` | ||
} | ||
|
||
// TestResult allows a task to specify the location where test logs | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use
ko
here ? (like on some otherknative
projects ?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vdemeester we could but I'm not sure we need to since there's nothing to build - even
ko
under the hood I think still calls out tokubectl
(i think?) - but maybe there are some other benefits I'm missing?