Skip to content

Commit

Permalink
Do not return error in IsRevisionPinned
Browse files Browse the repository at this point in the history
  • Loading branch information
mgencur committed Nov 7, 2019
1 parent e853147 commit b0e7ea7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions test/v1/revision.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ func IsRevisionReady(r *v1.Revision) (bool, error) {

// IsRevisionPinned will check if the revision is pinned to a route.
func IsRevisionPinned(r *v1.Revision) (bool, error) {
if _, ok := r.Annotations[serving.RevisionLastPinnedAnnotationKey]; !ok {
return false, fmt.Errorf("Revision %s not pinned", r.Name)
}
return true, nil
_, pinned := r.Annotations[serving.RevisionLastPinnedAnnotationKey]
return pinned, nil
}

// IsRevisionAtExpectedGeneration returns a function that will check if the annotations
Expand Down
6 changes: 2 additions & 4 deletions test/v1alpha1/revision.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ func IsRevisionReady(r *v1alpha1.Revision) (bool, error) {

// IsRevisionPinned will check if the revision is pinned to a route.
func IsRevisionPinned(r *v1alpha1.Revision) (bool, error) {
if _, ok := r.Annotations[serving.RevisionLastPinnedAnnotationKey]; !ok {
return false, fmt.Errorf("Revision %s not pinned", r.Name)
}
return true, nil
_, pinned := r.Annotations[serving.RevisionLastPinnedAnnotationKey]
return pinned, nil
}

// IsRevisionAtExpectedGeneration returns a function that will check if the annotations
Expand Down
6 changes: 2 additions & 4 deletions test/v1beta1/revision.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ func IsRevisionReady(r *v1beta1.Revision) (bool, error) {

// IsRevisionPinned will check if the revision is pinned to a route.
func IsRevisionPinned(r *v1beta1.Revision) (bool, error) {
if _, ok := r.Annotations[serving.RevisionLastPinnedAnnotationKey]; !ok {
return false, fmt.Errorf("Revision %s not pinned", r.Name)
}
return true, nil
_, pinned := r.Annotations[serving.RevisionLastPinnedAnnotationKey]
return pinned, nil
}

// IsRevisionAtExpectedGeneration returns a function that will check if the annotations
Expand Down

0 comments on commit b0e7ea7

Please sign in to comment.