-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Shash Reddy <[email protected]>
- Loading branch information
1 parent
ef113e1
commit 5d61fc2
Showing
9 changed files
with
399 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
// GitSource is an endpoint from which to get data which is required | ||
// by a Build/Task for context (e.g. a repo from which to build an image). | ||
type GitSource struct { | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
URL string `json:"url"` | ||
Branch string `json:"branch"` | ||
Commit string `json:"commit,omitempty"` | ||
ServiceAccount string `json:"serviceAccount,omitempty"` | ||
} | ||
|
||
func (s GitSource) getName() string { | ||
return s.Name | ||
} | ||
|
||
func (s GitSource) getType() string { | ||
return "git" | ||
} | ||
|
||
func (s GitSource) getVersion() string { | ||
return s.Commit | ||
} | ||
|
||
func (s GitSource) getParams() []Param { | ||
var result []Param | ||
return result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
// ImageSource defines an endpoint where artifacts can be stored, such as images. | ||
type ImageSource struct { | ||
Name string `json:"name"` | ||
// TODO: maybe an enum, with values like 'registry', GCS bucket | ||
Type string `json:"type"` | ||
URL string `json:"url"` | ||
Sha string `json:"sha"` | ||
} | ||
|
||
func (s ImageSource) getName() string { | ||
return s.Name | ||
} | ||
|
||
func (s ImageSource) getType() string { | ||
return "image" | ||
} | ||
|
||
func (s ImageSource) getVersion() string { | ||
return s.Sha | ||
} | ||
|
||
func (s ImageSource) getParams() []Param { | ||
var result []Param | ||
return result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// SourceVersionSpec defines the desired state of SourceVersion | ||
type SourceVersionSpec struct { | ||
SourceRef SourceRef `json:"sourceRef"` | ||
Version string `json:"string"` | ||
} | ||
|
||
// SourceVersionStatus defines the observed state of TaskRun | ||
type SourceVersionStatus struct { | ||
} | ||
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// SourceVersion is the Schema for the sourceversion API | ||
// +k8s:openapi-gen=true | ||
type SourceVersion struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec SourceVersionSpec `json:"spec,omitempty"` | ||
Status SourceVersionStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// SourceVersionList contains a list of SourceVersion | ||
type SourceVersionList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []SourceVersion `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&SourceVersion{}, &SourceVersionList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.