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
09dd0f18
Commit
09dd0f18
authored
Feb 26, 2016
by
Fabio Yeon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21639 from jayunit100/cassandra-example-fix
Fix broken cassandra test: Up to date containers + RC of 2 nodes with…
parents
7d0684e9
4c91cf20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
README.md
examples/cassandra/README.md
+3
-1
cassandra-controller.yaml
examples/cassandra/cassandra-controller.yaml
+3
-1
examples.go
test/e2e/examples.go
+11
-6
No files found.
examples/cassandra/README.md
View file @
09dd0f18
...
@@ -196,7 +196,9 @@ metadata:
...
@@ -196,7 +196,9 @@ metadata:
app
:
cassandra
app
:
cassandra
name
:
cassandra
name
:
cassandra
spec
:
spec
:
replicas
:
1
replicas
:
2
selector
:
app
:
cassandra
template
:
template
:
metadata
:
metadata
:
labels
:
labels
:
...
...
examples/cassandra/cassandra-controller.yaml
View file @
09dd0f18
...
@@ -5,7 +5,9 @@ metadata:
...
@@ -5,7 +5,9 @@ metadata:
app
:
cassandra
app
:
cassandra
name
:
cassandra
name
:
cassandra
spec
:
spec
:
replicas
:
1
replicas
:
2
selector
:
app
:
cassandra
template
:
template
:
metadata
:
metadata
:
labels
:
labels
:
...
...
test/e2e/examples.go
View file @
09dd0f18
...
@@ -210,31 +210,36 @@ var _ = Describe("[Feature:Example]", func() {
...
@@ -210,31 +210,36 @@ var _ = Describe("[Feature:Example]", func() {
controllerYaml
:=
mkpath
(
"cassandra-controller.yaml"
)
controllerYaml
:=
mkpath
(
"cassandra-controller.yaml"
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
By
(
"
starting
service and pod"
)
By
(
"
Starting the cassandra
service and pod"
)
runKubectlOrDie
(
"create"
,
"-f"
,
serviceYaml
,
nsFlag
)
runKubectlOrDie
(
"create"
,
"-f"
,
serviceYaml
,
nsFlag
)
runKubectlOrDie
(
"create"
,
"-f"
,
podYaml
,
nsFlag
)
runKubectlOrDie
(
"create"
,
"-f"
,
podYaml
,
nsFlag
)
Logf
(
"waiting for first cassandra pod"
)
err
:=
waitForPodRunningInNamespace
(
c
,
"cassandra"
,
ns
)
err
:=
waitForPodRunningInNamespace
(
c
,
"cassandra"
,
ns
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Logf
(
"waiting for thrift listener online"
)
_
,
err
=
lookForStringInLog
(
ns
,
"cassandra"
,
"cassandra"
,
"Listening for thrift clients"
,
serverStartTimeout
)
_
,
err
=
lookForStringInLog
(
ns
,
"cassandra"
,
"cassandra"
,
"Listening for thrift clients"
,
serverStartTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Logf
(
"wait for service"
)
err
=
waitForEndpoint
(
c
,
ns
,
"cassandra"
)
err
=
waitForEndpoint
(
c
,
ns
,
"cassandra"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
"create and scale rc"
)
// Create an RC with n nodes in it. Each node will then be verified.
By
(
"Creating a Cassandra RC"
)
runKubectlOrDie
(
"create"
,
"-f"
,
controllerYaml
,
nsFlag
)
runKubectlOrDie
(
"create"
,
"-f"
,
controllerYaml
,
nsFlag
)
err
=
ScaleRC
(
c
,
ns
,
"cassandra"
,
2
,
true
)
forEachPod
(
c
,
ns
,
"app"
,
"cassandra"
,
func
(
pod
api
.
Pod
)
{
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Logf
(
"Verifying pod %v "
,
pod
.
Name
)
forEachPod
(
c
,
ns
,
"name"
,
"cassandra"
,
func
(
pod
api
.
Pod
)
{
_
,
err
=
lookForStringInLog
(
ns
,
pod
.
Name
,
"cassandra"
,
"Listening for thrift clients"
,
serverStartTimeout
)
_
,
err
=
lookForStringInLog
(
ns
,
pod
.
Name
,
"cassandra"
,
"Listening for thrift clients"
,
serverStartTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
_
,
err
=
lookForStringInLog
(
ns
,
pod
.
Name
,
"cassandra"
,
"Handshaking version"
,
serverStartTimeout
)
_
,
err
=
lookForStringInLog
(
ns
,
pod
.
Name
,
"cassandra"
,
"Handshaking version"
,
serverStartTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
})
By
(
"Finding each node in the nodetool status lines"
)
output
:=
runKubectlOrDie
(
"exec"
,
"cassandra"
,
nsFlag
,
"--"
,
"nodetool"
,
"status"
)
output
:=
runKubectlOrDie
(
"exec"
,
"cassandra"
,
nsFlag
,
"--"
,
"nodetool"
,
"status"
)
forEachPod
(
c
,
ns
,
"
name
"
,
"cassandra"
,
func
(
pod
api
.
Pod
)
{
forEachPod
(
c
,
ns
,
"
app
"
,
"cassandra"
,
func
(
pod
api
.
Pod
)
{
if
!
strings
.
Contains
(
output
,
pod
.
Status
.
PodIP
)
{
if
!
strings
.
Contains
(
output
,
pod
.
Status
.
PodIP
)
{
Failf
(
"Pod ip %s not found in nodetool status"
,
pod
.
Status
.
PodIP
)
Failf
(
"Pod ip %s not found in nodetool status"
,
pod
.
Status
.
PodIP
)
}
}
...
...
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