From 70c1984f03b502c81861966fa9b12a0c8aaee974 Mon Sep 17 00:00:00 2001 From: Jisha Abubaker Date: Wed, 30 May 2018 09:43:14 -0700 Subject: [PATCH] Patch memorystore samples (#1115) * adding missing region tags * updating region tags * updating region tags * removing env (not required for Java, uses application.properties) --- memorystore/redis/gke_deployment/visit-counter.yaml | 9 ++------- .../com/example/redis/AppServletContextListener.java | 4 ++-- .../main/java/com/example/redis/VisitCounterServlet.java | 4 ++-- .../redis/src/main/resources/application.properties | 3 ++- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/memorystore/redis/gke_deployment/visit-counter.yaml b/memorystore/redis/gke_deployment/visit-counter.yaml index a1fa7516158..803c1a95b66 100644 --- a/memorystore/redis/gke_deployment/visit-counter.yaml +++ b/memorystore/redis/gke_deployment/visit-counter.yaml @@ -11,7 +11,7 @@ # 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. - +# [START memorystore_visitcounter_yaml] apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -28,12 +28,6 @@ spec: containers: - name: visit-counter image: "gcr.io//visit-counter:v1" - env: - - name: REDISHOST - valueFrom: - configMapKeyRef: - name: redishost - key: REDISHOST ports: - name: http containerPort: 8080 @@ -50,3 +44,4 @@ spec: - port: 80 targetPort: 8080 protocol: TCP +# [END memorystore_visitcounter_yaml] diff --git a/memorystore/redis/src/main/java/com/example/redis/AppServletContextListener.java b/memorystore/redis/src/main/java/com/example/redis/AppServletContextListener.java index 513ff8c331f..c0c407bf559 100644 --- a/memorystore/redis/src/main/java/com/example/redis/AppServletContextListener.java +++ b/memorystore/redis/src/main/java/com/example/redis/AppServletContextListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [START web_listener] +// [START memorystore_web_listener] package com.example.redis; @@ -70,4 +70,4 @@ public void contextInitialized(ServletContextEvent event) { } } } -// [END web_listener] +// [END memorystore_web_listener] diff --git a/memorystore/redis/src/main/java/com/example/redis/VisitCounterServlet.java b/memorystore/redis/src/main/java/com/example/redis/VisitCounterServlet.java index 5f66e69ad3b..199d1a18166 100644 --- a/memorystore/redis/src/main/java/com/example/redis/VisitCounterServlet.java +++ b/memorystore/redis/src/main/java/com/example/redis/VisitCounterServlet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [START visit_servlet] +// [START memorystore_visit_servlet] package com.example.redis; @@ -50,4 +50,4 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc } } } -// [END visit_servlet] +// [END memorystore_visit_servlet] diff --git a/memorystore/redis/src/main/resources/application.properties b/memorystore/redis/src/main/resources/application.properties index fc1a1a3ef54..37bd1040cda 100644 --- a/memorystore/redis/src/main/resources/application.properties +++ b/memorystore/redis/src/main/resources/application.properties @@ -11,6 +11,7 @@ # 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. - +# [START memorystore_app_properties] redis.host=REDIS_HOST_IP redis.port=6379 +# [END memorystore_app_properties]