Skip to content

Commit

Permalink
Added new config type WorkloadGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
hhovsepy committed May 20, 2021
1 parent e0b9d72 commit f4b46d1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions kiali_qe/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,7 @@ def _get_item_validation(self, element):
return get_validation(_valid, _not_valid, _warning)

def _get_details_validation(self):
wait_to_spinner_disappear(self.browser)
_not_valid = len(self.browser.elements(
parent=self.DETAILS_ROOT,
locator='.//*[contains(@class, "ace_error")]')) > 0
Expand Down
1 change: 1 addition & 0 deletions kiali_qe/components/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class IstioConfigObjectType(StringEnum):
SIDECAR = ('Sidecar')
VIRTUAL_SERVICE = ('VirtualService')
WORKLOAD_ENTRY = ('WorkloadEntry')
WORKLOAD_GROUP = ('WorkloadGroup')


class IstioConfigValidationType(StringEnum):
Expand Down
16 changes: 16 additions & 0 deletions kiali_qe/rest/kiali_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'VirtualService': 'virtualservices',
'ServiceEntry': 'serviceentries',
'WorkloadEntry': 'workloadentries',
'WorkloadGroup': 'workloadgroups',
'Gateway': 'gateways',
'Handler': 'handler',
'EnvoyFilter': 'envoyfilters',
Expand Down Expand Up @@ -336,6 +337,17 @@ def istio_config_list(self, namespaces=[], config_names=[], params=None):
'workloadentries',
_policy['metadata']['name'])))

# update workloadGroups
if len(_data['workloadGroups']) > 0:
for _policy in _data['workloadGroups']:
items.append(IstioConfig(
name=_policy['metadata']['name'],
namespace=_namespace,
object_type=OBJECT_TYPE.WORKLOAD_GROUP.text,
validation=self.get_istio_config_validation(_namespace,
'workloadgroups',
_policy['metadata']['name'])))

# update sidecars
if len(_data['sidecars']) > 0:
for _policy in _data['sidecars']:
Expand Down Expand Up @@ -406,6 +418,10 @@ def istio_config_details(self, namespace, object_type, object_name):
if _data['workloadEntry']:
config_data = _data['workloadEntry']

# get workloadGroup
if _data['workloadGroup']:
config_data = _data['workloadGroup']

# get PeerAuthentication
if _data['peerAuthentication']:
config_data = _data['peerAuthentication']
Expand Down
5 changes: 5 additions & 0 deletions kiali_qe/rest/openshift_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
'DestinationRule': '_destinationrule',
'ServiceEntry': '_serviceentry',
'WorkloadEntry': '_workloadentry',
'WorkloadGroup': '_workloadgroup',
'EnvoyFilter': '_envoyfilter',
'PeerAuthentication': '_peerauthentication',
'RequestAuthentication': '_requestauthentication',
Expand Down Expand Up @@ -143,6 +144,10 @@ def _serviceentry(self):
def _workloadentry(self):
return self._istio_config(kind='WorkloadEntry', api_version='v1alpha3')

@property
def _workloadgroup(self):
return self._istio_config(kind='WorkloadGroup', api_version='v1alpha3')

@property
def _kubernetes(self):
return self._istio_config(kind='kubernetes', api_version='v1alpha2')
Expand Down

0 comments on commit f4b46d1

Please sign in to comment.