-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60dfb04
commit 646f938
Showing
84 changed files
with
867 additions
and
208 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,37 @@ | ||
package e2e | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/onsi/ginkgo/v2" | ||
"github.com/onsi/gomega" | ||
"k8s.io/client-go/kubernetes" | ||
) | ||
|
||
var _ = ginkgo.Describe("Kubernetes E2E Test with Multiple Users", func() { | ||
var aliceClient, bobClient *kubernetes.Clientset | ||
|
||
ginkgo.BeforeEach(func() { | ||
var err error | ||
// Load Alice's kubeconfig | ||
aliceClient, err = loadKubeConfig("alice") | ||
gomega.Expect(err).NotTo(gomega.HaveOccurred()) | ||
|
||
// Load Bob's kubeconfig | ||
bobClient, err = loadKubeConfig("bob") | ||
gomega.Expect(err).NotTo(gomega.HaveOccurred()) | ||
}) | ||
|
||
ginkgo.It("Should verify Alice and Bob's access", func() { | ||
// Example: Alice lists namespaces | ||
namespaces, err := aliceClient.CoreV1().Namespaces().List(context.TODO(), metav1.ListOptions{}) | ||
gomega.Expect(err).NotTo(gomega.HaveOccurred()) | ||
fmt.Println("Namespaces accessible by Alice:", namespaces) | ||
|
||
// Example: Bob lists namespaces | ||
namespaces, err = bobClient.CoreV1().Namespaces().List(context.TODO(), metav1.ListOptions{}) | ||
gomega.Expect(err).NotTo(gomega.HaveOccurred()) | ||
fmt.Println("Namespaces accessible by Bob:", namespaces) | ||
}) | ||
}) |
Oops, something went wrong.