Skip to content

Commit

Permalink
Fixes a bug when running fix_serialization on Kubernetes ExternalName… (
Browse files Browse the repository at this point in the history
#161)

* Fixes a bug when running fix_serialization on Kubernetes ExternalName service definitions

* Simply check if ports array is defined
  • Loading branch information
Zac Petterd authored and fabianvf committed Mar 5, 2018
1 parent ed98094 commit 2a798cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openshift/helper/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def has_method(self, method_action):
return method is not None

def fix_serialization(self, obj):
if obj and obj.kind == "Service":
if obj and obj.kind == "Service" and obj.spec.ports:
for port in obj.spec.ports:
try:
port.target_port = int(port.target_port)
Expand Down

0 comments on commit 2a798cd

Please sign in to comment.