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
894cfac7
Commit
894cfac7
authored
Nov 16, 2014
by
Joe Beda
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2399 from brendandburns/guestbook
Update guestbook to fix given recent changes.
parents
ccc8bc82
c3888004
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
index.php
examples/guestbook/php-redis/index.php
+4
-4
run.sh
examples/guestbook/redis-slave/run.sh
+15
-1
guestbook.sh
hack/e2e-suite/guestbook.sh
+2
-2
No files found.
examples/guestbook/php-redis/index.php
View file @
894cfac7
...
...
@@ -12,20 +12,20 @@ if (isset($_GET['cmd']) === true) {
if
(
$_GET
[
'cmd'
]
==
'set'
)
{
$client
=
new
Predis\Client
([
'scheme'
=>
'tcp'
,
'host'
=>
getenv
(
'REDISMASTER_SERVICE_HOST'
)
?:
getenv
(
'SERVICE_HOST'
),
'port'
=>
getenv
(
'REDISMASTER_SERVICE_PORT'
),
'host'
=>
getenv
(
'REDIS
_
MASTER_SERVICE_HOST'
)
?:
getenv
(
'SERVICE_HOST'
),
'port'
=>
getenv
(
'REDIS
_
MASTER_SERVICE_PORT'
),
]);
$client
->
set
(
$_GET
[
'key'
],
$_GET
[
'value'
]);
print
(
'{"message": "Updated"}'
);
}
else
{
$read_port
=
getenv
(
'REDISMASTER_SERVICE_PORT'
);
$read_port
=
getenv
(
'REDIS
_
MASTER_SERVICE_PORT'
);
if
(
isset
(
$_ENV
[
'REDISSLAVE_SERVICE_PORT'
]))
{
$read_port
=
getenv
(
'REDISSLAVE_SERVICE_PORT'
);
}
$client
=
new
Predis\Client
([
'scheme'
=>
'tcp'
,
'host'
=>
getenv
(
'REDISMASTER_SERVICE_HOST'
)
?:
getenv
(
'SERVICE_HOST'
),
'host'
=>
getenv
(
'REDIS
_
MASTER_SERVICE_HOST'
)
?:
getenv
(
'SERVICE_HOST'
),
'port'
=>
$read_port
,
]);
...
...
examples/guestbook/redis-slave/run.sh
View file @
894cfac7
#!/bin/bash
redis-server
--slaveof
${
REDISMASTER_SERVICE_HOST
:-
$SERVICE_HOST
}
$REDISMASTER_SERVICE_PORT
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
redis-server
--slaveof
${
REDIS_MASTER_SERVICE_HOST
:-
$SERVICE_HOST
}
$REDIS_MASTER_SERVICE_PORT
hack/e2e-suite/guestbook.sh
View file @
894cfac7
...
...
@@ -42,8 +42,8 @@ $KUBECFG stop redisSlaveController
# Needed until issue #103 gets fixed
sleep
25
$KUBECFG
rm
redisSlaveController
$KUBECFG
delete services/redismaster
$KUBECFG
delete pods/redis-master
-2
$KUBECFG
delete services/redis
-
master
$KUBECFG
delete pods/redis-master
POD_LIST_2
=
$(
$KUBECFG
'-template={{range.items}}{{.id}} {{end}}'
list pods
)
echo
"Pods running after shutdown:
${
POD_LIST_2
}
"
...
...
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