Skip to content

Commit

Permalink
vsphere: parse ip as metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Oct 24, 2024
1 parent 5660275 commit f2c620c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kvirt/providers/kubevirt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,11 +748,11 @@ def info(self, name, vm=None, debug=False):
'harvesterhci.io/imageId' in spec['dataVolumeTemplates'][0]['metadata']['annotations']:
image = spec['dataVolumeTemplates'][0]['metadata']['annotations']['harvesterhci.io/imageId'].split('/')[1]
if annotations is not None:
profile = annotations['kcli/profile'] if 'kcli/profile' in annotations else 'N/A'
plan = annotations['kcli/plan'] if 'kcli/plan' in annotations else 'N/A'
ip = annotations['kcli/ip'] if 'kcli/ip' in annotations else None
kube = annotations['kcli/kube'] if 'kcli/kube' in annotations else None
kubetype = annotations['kcli/kubetype'] if 'kcli/kubetype' in annotations else None
profile = annotations.get('kcli/profile', 'N/A')
plan = annotations.get('kcli/plan', 'N/A')
ip = annotations.get('kcli/ip')
kube = annotations.ge('kcli/kube')
kubetype = annotations.get('kcli/kubetype')
if 'kcli/image' in annotations:
image = annotations['kcli/image']
host = None
Expand Down
2 changes: 2 additions & 0 deletions kvirt/providers/vsphere/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,8 @@ def info(self, name, output='plain', fields=[], values=False, vm=None, debug=Fal
yamlinfo['user'] = common.get_user(entry.value)
if entry.key == 'tags':
yamlinfo['tags'] = entry.value
if entry.key == 'ip':
yamlinfo['ip'] = entry.value
kubetype = yamlinfo.get('kubetype')
cluster_network = yamlinfo.get('cluster_network')
ips = []
Expand Down

0 comments on commit f2c620c

Please sign in to comment.