Skip to content

Commit

Permalink
move server runner's enable_dualstack to ServerDeploymentArgs (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
purnesh42H authored Sep 20, 2024
1 parent 37bd824 commit a752d2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions framework/test_app/runners/k8s/k8s_xds_server_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ServerDeploymentArgs:
enable_csm_observability: bool = False
csm_workload_name: str = ""
csm_canonical_service_name: str = ""
enable_dualstack: bool = False

def as_dict(self):
return {
Expand All @@ -47,6 +48,7 @@ def as_dict(self):
"enable_csm_observability": self.enable_csm_observability,
"csm_workload_name": self.csm_workload_name,
"csm_canonical_service_name": self.csm_canonical_service_name,
"enable_dualstack": self.enable_dualstack,
}


Expand Down Expand Up @@ -109,7 +111,6 @@ def __init__( # pylint: disable=too-many-locals
debug_use_port_forwarding: bool = False,
enable_workload_identity: bool = True,
deployment_args: Optional[ServerDeploymentArgs] = None,
enable_dualstack: bool = False,
):
super().__init__(
k8s_namespace,
Expand Down Expand Up @@ -145,7 +146,6 @@ def __init__( # pylint: disable=too-many-locals
self.td_bootstrap_image = td_bootstrap_image
self.network = network
self.xds_server_uri = xds_server_uri
self.enable_dualstack = enable_dualstack

# Workload identity settings:
if self.enable_workload_identity:
Expand Down Expand Up @@ -228,7 +228,7 @@ def run( # pylint: disable=arguments-differ,too-many-branches
app_label=self.app_label,
neg_name=self.gcp_neg_name,
test_port=test_port,
enable_dualstack=self.enable_dualstack,
enable_dualstack=self.deployment_args.enable_dualstack,
)
self._wait_service_neg_status_annotation(self.service_name, test_port)

Expand Down
2 changes: 0 additions & 2 deletions framework/xds_k8s_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,6 @@ def initKubernetesServerRunner(self, **kwargs) -> KubernetesServerRunner:
network=self.network,
debug_use_port_forwarding=self.debug_use_port_forwarding,
enable_workload_identity=self.enable_workload_identity,
enable_dualstack=self.enable_dualstack,
**kwargs,
)

Expand Down Expand Up @@ -1081,7 +1080,6 @@ def initKubernetesServerRunner(self, **kwargs) -> KubernetesServerRunner:
xds_server_uri=self.xds_server_uri,
deployment_template="server-secure.deployment.yaml",
debug_use_port_forwarding=self.debug_use_port_forwarding,
enable_dualstack=self.enable_dualstack,
**kwargs,
)

Expand Down
4 changes: 3 additions & 1 deletion tests/dualstack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

_SERVERS_APP_LABEL: Final[str] = "psm-interop-dualstack"

ServerDeploymentArgs = k8s_xds_server_runner.ServerDeploymentArgs


class DualStackTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
v4_server_runner: _KubernetesServerRunner = None
Expand Down Expand Up @@ -72,8 +74,8 @@ def setUp(self):
debug_use_port_forwarding=self.debug_use_port_forwarding,
reuse_namespace=True,
reuse_service=True,
enable_dualstack=True,
enable_workload_identity=self.enable_workload_identity,
deployment_args=ServerDeploymentArgs(enable_dualstack=True),
)

k8s_namespace = self.server_runner.k8s_namespace
Expand Down

0 comments on commit a752d2b

Please sign in to comment.