-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into member-info-in-spc-status_capacity-manager…
…-part
- Loading branch information
Showing
5 changed files
with
36 additions
and
237 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
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
package nstemplatetier | ||
|
||
import ( | ||
"context" | ||
|
||
toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1" | ||
"github.com/codeready-toolchain/toolchain-common/pkg/test" | ||
|
||
"k8s.io/apimachinery/pkg/types" | ||
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
// Assertion an assertion helper for an NSTemplateTier | ||
type Assertion struct { | ||
tier *toolchainv1alpha1.NSTemplateTier //nolint:golint,unused | ||
client runtimeclient.Client | ||
namespacedName types.NamespacedName | ||
t test.T | ||
} | ||
|
||
func (a *Assertion) loadResource() error { //nolint:golint,unused | ||
tier := &toolchainv1alpha1.NSTemplateTier{} | ||
err := a.client.Get(context.TODO(), a.namespacedName, tier) | ||
a.tier = tier | ||
return err | ||
} | ||
|
||
// AssertThatNSTemplateTier helper func to begin with the assertions on an NSTemplateTier | ||
func AssertThatNSTemplateTier(t test.T, name string, client runtimeclient.Client) *Assertion { | ||
return &Assertion{ | ||
client: client, | ||
namespacedName: test.NamespacedName(test.HostOperatorNs, name), | ||
t: t, | ||
} | ||
} |
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