Created
May 6, 2019 03:01
-
-
Save aaron-prindle/94998f6b71250fdf984db101247e80bc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package master | |
| import ( | |
| "testing" | |
| auditregv1alpha1 "k8s.io/api/auditregistration/v1alpha1" | |
| "k8s.io/client-go/kubernetes" | |
| kubeapiservertesting "k8s.io/kubernetes/cmd/kube-apiserver/app/testing" | |
| "k8s.io/kubernetes/test/integration/framework" | |
| ) | |
| func TestFlowSchema(t *testing.T) { | |
| result := kubeapiservertesting.StartTestServerOrDie(t, nil, | |
| []string{ | |
| "--runtime-config", "auditregistration.k8s.io/v1alpha1=true", | |
| // "--runtime-config", "flowschema.k8s.io/v1alpha1=true", | |
| }, | |
| framework.SharedEtcd()) | |
| defer result.TearDownFn() | |
| kubeclient, err := kubernetes.NewForConfig(result.ClientConfig) | |
| if err != nil { | |
| t.Fatalf("Unexpected error: %v", err) | |
| } | |
| // url := "http://localhost:1234" | |
| example := &auditregv1alpha1.AuditSink{} | |
| example, err = kubeclient.AuditregistrationV1alpha1().AuditSinks().Create(example) | |
| expectNoError(t, err, "failed to create example") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment