Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
1effe0ca
Commit
1effe0ca
authored
Oct 12, 2018
by
Patrick Ohly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e framework: UniqueName
This is needed for tests which have to create entities that aren't namespaced, like ServiceAccounts.
parent
022c05c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
framework.go
test/e2e/framework/framework.go
+10
-0
No files found.
test/e2e/framework/framework.go
View file @
1effe0ca
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
"bufio"
"bufio"
"bytes"
"bytes"
"fmt"
"fmt"
"math/rand"
"os"
"os"
"strings"
"strings"
"sync"
"sync"
...
@@ -68,6 +69,11 @@ const (
...
@@ -68,6 +69,11 @@ const (
type
Framework
struct
{
type
Framework
struct
{
BaseName
string
BaseName
string
// Set together with creating the ClientSet and the namespace.
// Guaranteed to be unique in the cluster even when running the same
// test multiple times in parallel.
UniqueName
string
ClientSet
clientset
.
Interface
ClientSet
clientset
.
Interface
KubemarkExternalClusterClientSet
clientset
.
Interface
KubemarkExternalClusterClientSet
clientset
.
Interface
APIExtensionsClientSet
apiextensionsclient
.
Interface
APIExtensionsClientSet
apiextensionsclient
.
Interface
...
@@ -229,6 +235,10 @@ func (f *Framework) BeforeEach() {
...
@@ -229,6 +235,10 @@ func (f *Framework) BeforeEach() {
}
else
{
}
else
{
Logf
(
"Skipping waiting for service account"
)
Logf
(
"Skipping waiting for service account"
)
}
}
f
.
UniqueName
=
f
.
Namespace
.
GetName
()
}
else
{
// not guaranteed to be unique, but very likely
f
.
UniqueName
=
fmt
.
Sprintf
(
"%s-%08x"
,
f
.
BaseName
,
rand
.
Int31
())
}
}
if
TestContext
.
GatherKubeSystemResourceUsageData
!=
"false"
&&
TestContext
.
GatherKubeSystemResourceUsageData
!=
"none"
{
if
TestContext
.
GatherKubeSystemResourceUsageData
!=
"false"
&&
TestContext
.
GatherKubeSystemResourceUsageData
!=
"none"
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment