-
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.
KUBESAW-248: Drop NSTemplateTier.Status.Updates field (#1115)
* KUBESAW-248: Drop NSTemplateTier.Status.Updates field Signed-off-by: Feny Mehta <fbm3307@gmail.com> * go-lint Signed-off-by: Feny Mehta <fbm3307@gmail.com> * keeping the assert function for other PR Signed-off-by: Feny Mehta <fbm3307@gmail.com> * ignoring golint unused error for now Signed-off-by: Feny Mehta <fbm3307@gmail.com> --------- Signed-off-by: Feny Mehta <fbm3307@gmail.com> Co-authored-by: Francisc Munteanu <fmuntean@redhat.com>
- 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