-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #627 from weaveworks/raw-client-testutils
Raw client testutils
- Loading branch information
Showing
5 changed files
with
201 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package defaultaddons_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
. "github.com/weaveworks/eksctl/pkg/addons/default" | ||
|
||
"github.com/weaveworks/eksctl/pkg/testutils" | ||
|
||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// TODO: test UpdateAWSNode | ||
|
||
var _ = Describe("default addons", func() { | ||
Describe("can load a set of resources and create a fake client", func() { | ||
It("can create the fake client and verify objects get loaded client", func() { | ||
clientSet, _ := testutils.NewFakeClientSetWithSamples("testdata/sample-1.10.json") | ||
|
||
nsl, err := clientSet.CoreV1().Namespaces().List(metav1.ListOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(nsl.Items).To(HaveLen(0)) | ||
|
||
dl, err := clientSet.AppsV1().Deployments(metav1.NamespaceAll).List(metav1.ListOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(dl.Items).To(HaveLen(1)) | ||
Expect(dl.Items[0].Spec.Template.Spec.Containers).To(HaveLen(3)) | ||
|
||
kubeProxy, err := clientSet.AppsV1().DaemonSets(metav1.NamespaceSystem).Get(KubeProxy, metav1.GetOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(kubeProxy).ToNot(BeNil()) | ||
Expect(kubeProxy.Spec.Template.Spec.Containers).To(HaveLen(1)) | ||
}) | ||
}) | ||
}) |
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 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