Skip to content

Commit 70c1984

Browse files
authored
Patch memorystore samples (#1115)
* adding missing region tags * updating region tags * updating region tags * removing env (not required for Java, uses application.properties)
1 parent 2a5650c commit 70c1984

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

memorystore/redis/gke_deployment/visit-counter.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
14+
# [START memorystore_visitcounter_yaml]
1515
apiVersion: extensions/v1beta1
1616
kind: Deployment
1717
metadata:
@@ -28,12 +28,6 @@ spec:
2828
containers:
2929
- name: visit-counter
3030
image: "gcr.io/<PROJECT_ID>/visit-counter:v1"
31-
env:
32-
- name: REDISHOST
33-
valueFrom:
34-
configMapKeyRef:
35-
name: redishost
36-
key: REDISHOST
3731
ports:
3832
- name: http
3933
containerPort: 8080
@@ -50,3 +44,4 @@ spec:
5044
- port: 80
5145
targetPort: 8080
5246
protocol: TCP
47+
# [END memorystore_visitcounter_yaml]

memorystore/redis/src/main/java/com/example/redis/AppServletContextListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
// [START web_listener]
16+
// [START memorystore_web_listener]
1717

1818
package com.example.redis;
1919

@@ -70,4 +70,4 @@ public void contextInitialized(ServletContextEvent event) {
7070
}
7171
}
7272
}
73-
// [END web_listener]
73+
// [END memorystore_web_listener]

memorystore/redis/src/main/java/com/example/redis/VisitCounterServlet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
// [START visit_servlet]
16+
// [START memorystore_visit_servlet]
1717

1818
package com.example.redis;
1919

@@ -50,4 +50,4 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
5050
}
5151
}
5252
}
53-
// [END visit_servlet]
53+
// [END memorystore_visit_servlet]

memorystore/redis/src/main/resources/application.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
14+
# [START memorystore_app_properties]
1515
redis.host=REDIS_HOST_IP
1616
redis.port=6379
17+
# [END memorystore_app_properties]

0 commit comments

Comments
 (0)