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

Remove unused results field from pr and tr specs #1425

Merged
merged 1 commit into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkg/apis/pipeline/v1alpha1/pipelineresource_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
"context"
"net/url"
"strconv"
"strings"

Expand Down Expand Up @@ -117,3 +118,14 @@ func AllowedStorageType(gotType string) bool {
}
return false
}

func validateURL(u, path string) *apis.FieldError {
if u == "" {
return nil
}
_, err := url.ParseRequestURI(u)
if err != nil {
return apis.ErrInvalidValue(u, path)
}
return nil
}
11 changes: 0 additions & 11 deletions pkg/apis/pipeline/v1alpha1/pipelinerun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ type PipelineRunSpec struct {
DeprecatedServiceAccounts []DeprecatedPipelineRunSpecServiceAccount `json:"serviceAccounts,omitempty"`
// +optional
ServiceAccountNames []PipelineRunSpecServiceAccountName `json:"serviceAccountNames,omitempty"`
// Deprecation Notice: The field Results will be removed in v0.8.0
// and should not be used. Plan to have this field removed before upgradring
// to v0.8.0.
// +optional
Results *Results `json:"results,omitempty"`
// Used for cancelling a pipelinerun (and maybe more later on)
// +optional
Status PipelineRunSpecStatus `json:"status,omitempty"`
Expand Down Expand Up @@ -113,12 +108,6 @@ type PipelineRef struct {
type PipelineRunStatus struct {
duckv1beta1.Status `json:",inline"`

// Deprecation Notice: The field Results will be removed in v0.8.0
// and should not be used. Plan to have this field removed before upgradring
// to v0.8.0.
// +optional
Results *Results `json:"results,omitempty"`

// StartTime is the time the PipelineRun is actually started.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`
Expand Down
7 changes: 0 additions & 7 deletions pkg/apis/pipeline/v1alpha1/pipelinerun_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ func (ps *PipelineRunSpec) Validate(ctx context.Context) *apis.FieldError {
}
}

// check for results
if ps.Results != nil {
if err := ps.Results.Validate(ctx, "spec.results"); err != nil {
return err
}
}

if ps.Timeout != nil {
// timeout should be a valid duration of at least 0.
if ps.Timeout.Duration < 0 {
Expand Down
4 changes: 0 additions & 4 deletions pkg/apis/pipeline/v1alpha1/pipelinerun_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ func TestPipelineRun_Validate(t *testing.T) {
PipelineRef: v1alpha1.PipelineRef{
Name: "prname",
},
Results: &v1alpha1.Results{
URL: "http://www.google.com",
Type: "gcs",
},
},
},
}, {
Expand Down
86 changes: 0 additions & 86 deletions pkg/apis/pipeline/v1alpha1/result_types.go

This file was deleted.

82 changes: 0 additions & 82 deletions pkg/apis/pipeline/v1alpha1/result_types_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions pkg/apis/pipeline/v1alpha1/taskrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ type TaskRunSpec struct {
Inputs TaskRunInputs `json:"inputs,omitempty"`
// +optional
Outputs TaskRunOutputs `json:"outputs,omitempty"`
// Deprecation Notice: The field Results will be removed in v0.8.0
// and should not be used. Plan to have this field removed before upgradring
// to v0.8.0.
// +optional
Results *Results `json:"results,omitempty"`
// +optional
ServiceAccountName string `json:"serviceAccountName"`
// DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.
Expand Down Expand Up @@ -105,12 +100,6 @@ var taskRunCondSet = apis.NewBatchConditionSet()
type TaskRunStatus struct {
duckv1beta1.Status `json:",inline"`

// Deprecation Notice: The field Results will be removed in v0.8.0
// and should not be used. Plan to have this field removed before upgradring
// to v0.8.0.
// +optional
Results *Results `json:"results,omitempty"`

// PodName is the name of the pod responsible for executing this task's steps.
PodName string `json:"podName"`

Expand Down
7 changes: 0 additions & 7 deletions pkg/apis/pipeline/v1alpha1/taskrun_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) *apis.FieldError {
return err
}

// check for results
if ts.Results != nil {
if err := ts.Results.Validate(ctx, "spec.results"); err != nil {
return err
}
}

if ts.Timeout != nil {
// timeout should be a valid duration of at least 0.
if ts.Timeout.Duration < 0 {
Expand Down
36 changes: 0 additions & 36 deletions pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ func addRetryHistory(tr *v1alpha1.TaskRun) {
func clearStatus(tr *v1alpha1.TaskRun) {
tr.Status.StartTime = nil
tr.Status.CompletionTime = nil
tr.Status.Results = nil
tr.Status.PodName = ""
}

Expand Down
Loading