lib/kubernetes-deploy/kubernetes_resource/redis.rb in kubernetes-deploy-0.9.4 vs lib/kubernetes-deploy/kubernetes_resource/redis.rb in kubernetes-deploy-0.10.0
- old
+ new
@@ -54,11 +54,11 @@
service, _err, st = kubectl.run("get", "services", "redis-#{redis_resource_uuid}", "-o=json")
if st.success?
parsed = JSON.parse(service)
- if parsed.fetch("spec", {}).fetch("clusterIP", "") != ""
+ if parsed.dig("spec", "clusterIP").present?
return true
end
end
false
@@ -69,10 +69,10 @@
redis, _err, st = kubectl.run("get", "redises", @name, "-o=json")
if st.success?
parsed = JSON.parse(redis)
- @redis_resource_uuid = parsed.fetch("metadata", {}).fetch("uid", nil)
+ @redis_resource_uuid = parsed.dig("metadata", "uid")
end
end
end
end