-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The main addition is `.Kubectl`, which seems to be slower than using the client directly, but can be more ergonomic for development. This requires a kubeconfig, but one can be generated from the REST config, only requiring small changes to the main "constructor" function for a toolkit. Signed-off-by: Justin Kulikauskas <[email protected]>
- Loading branch information
1 parent
8ae5669
commit b299115
Showing
9 changed files
with
215 additions
and
77 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright Contributors to the Open Cluster Management project | ||
|
||
package basic | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Additional Toolkit tests", func() { | ||
It("Config methods should override values, but preserve the original toolkit", func() { | ||
newTK := tk. | ||
WithEPoll("50ms"). | ||
WithETimeout("3s"). | ||
WithCPoll("500ms"). | ||
WithCTimeout("2s") | ||
|
||
Expect(newTK.EventuallyPoll).To(Equal("50ms")) | ||
Expect(newTK.EventuallyTimeout).To(Equal("3s")) | ||
Expect(newTK.ConsistentlyPoll).To(Equal("500ms")) | ||
Expect(newTK.ConsistentlyTimeout).To(Equal("2s")) | ||
|
||
Expect(tk.EventuallyPoll).To(Equal("100ms")) | ||
Expect(tk.EventuallyTimeout).To(Equal("1s")) | ||
Expect(tk.ConsistentlyPoll).To(Equal("100ms")) | ||
Expect(tk.ConsistentlyTimeout).To(Equal("1s")) | ||
}) | ||
|
||
It("Kubectl should return error outputs", func() { | ||
output, err := tk.Kubectl("get", "node", "nonexist") | ||
Expect(output).To(BeEmpty()) | ||
Expect(err).To(HaveOccurred()) | ||
Expect(err.Error()).To(ContainSubstring("not found")) | ||
}) | ||
}) |
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
Oops, something went wrong.