Addresses issue #6596.

Removes ForTesting_ReferencesAllowBlankSelfLinks.
Fixes controller's persistentvolumes unit tests.
This commit is contained in:
Avesh Agarwal
2015-10-12 19:21:48 -04:00
parent 49b56d1788
commit 8e4a8b7260
7 changed files with 6 additions and 25 deletions

View File

@@ -32,10 +32,6 @@ var (
ErrNoSelfLink = errors.New("selfLink was empty, can't make reference")
)
// ForTesting_ReferencesAllowBlankSelfLinks can be set to true in tests to avoid
// "ErrNoSelfLink" errors.
var ForTesting_ReferencesAllowBlankSelfLinks = false
// GetReference returns an ObjectReference which refers to the given
// object, or an error if the object doesn't follow the conventions
// that would allow this.
@@ -68,11 +64,7 @@ func GetReference(obj runtime.Object) (*ObjectReference, error) {
if version == "" {
selfLink := meta.SelfLink()
if selfLink == "" {
if ForTesting_ReferencesAllowBlankSelfLinks {
version = "testing"
} else {
return nil, ErrNoSelfLink
}
return nil, ErrNoSelfLink
} else {
selfLinkUrl, err := url.Parse(selfLink)
if err != nil {