You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for contributing to the Docker-Selenium project! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Inline config TLS for the Ingress resource is also considered as enable secure connection to the Ingress proxy.
For example, below is the config with using external TLS Secret for the Ingress resource and enable sub-chart NGINX Ingress Controller:
In case the Ingress resource is configured without hostname and tls, the incoming traffic access via global.K8S_PUBLIC_IP. When sub-chart ingress-nginx is enabled (deploy Ingress NGINX Controller together), the default TLS secret can also be assigned via ingress-nginx.controller.extraArgs.default-ssl-certificate.
For example (replace $RELEASENAME and $NAMESPACE with your values):
Possible Bug The variable SELENIUM_NAMESPACE is used in the command line argument for setting ingress.nginx.sslSecret but it is not defined or exported in the script or its environment. This might cause the script to fail or behave unexpectedly.
Code Improvement The method client_verify_cert uses environment variables directly which might make the code less flexible and harder to test. Consider passing these as parameters to the function or class.
Logic Error The logic for determining if seleniumGrid.ingress.secureConnection is true seems overly complex and might be prone to errors if not all conditions are properly met or understood.
Enclose variable expansions in double quotes to ensure correct parsing
It's recommended to use double quotes around variable expansions to prevent globbing and word splitting. This change ensures that the entire concatenated string is treated as a single argument, even if the variable values contain spaces or special characters.
Why: This suggestion addresses a best practice in shell scripting to prevent globbing and word splitting, which can lead to unexpected behavior. It ensures that the entire concatenated string is treated as a single argument, even if the variable values contain spaces or special characters.
10
Ensure robust default value handling in Helm template for ingress configuration
To ensure that the default value is correctly used when .secretName is not set, explicitly check for emptiness using the empty function. This change makes the template logic more explicit and robust.
Why: Explicitly checking for emptiness using the empty function makes the template logic more explicit and robust, ensuring that the default value is correctly used when .secretName is not set. This enhances the reliability of the configuration.
8
Error handling
Add error handling for the network request to improve robustness
To handle potential exceptions from the requests.get call, such as network issues or invalid URLs, wrap the request in a try-except block. This will improve the robustness of the testing script by allowing it to handle errors gracefully.
-response = requests.get(grid_url_status, verify=cert_path)+try:+ response = requests.get(grid_url_status, verify=cert_path)+except requests.exceptions.RequestException as e:+ print(f"Failed to connect to {grid_url_status}: {e}")
Apply this suggestion
Suggestion importance[1-10]: 9
Why: Adding error handling for the requests.get call is crucial for robustness, as it allows the script to handle potential network issues or invalid URLs gracefully. This improves the reliability of the testing script.
9
Maintainability
Improve readability and correctness of the ternary operation in the Helm template
To ensure that the ternary operator is correctly applied and readable, it's beneficial to use parentheses around the entire condition before applying the ternary operator. This makes the template more readable and less prone to errors if the logic becomes more complex.
Why: Using parentheses around the entire condition before applying the ternary operator enhances readability and reduces the risk of errors in complex logic. This is a good practice for maintainability.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Inline config TLS for the Ingress resource is also considered as enable secure connection to the Ingress proxy.
For example, below is the config with using external TLS Secret for the Ingress resource and enable sub-chart NGINX Ingress Controller:
In case the Ingress resource is configured without
hostname
andtls
, the incoming traffic access viaglobal.K8S_PUBLIC_IP
. When sub-chartingress-nginx
is enabled (deploy Ingress NGINX Controller together), the default TLS secret can also be assigned viaingress-nginx.controller.extraArgs.default-ssl-certificate
.For example (replace
$RELEASENAME
and$NAMESPACE
with your values):Types of changes
Checklist
PR Type
Enhancement, Documentation, Tests
Description
ingress.nginx.sslSecret
and refactoring Helm command settings.ssl
module and integrating certificate verification intest_grid_is_up
method.sslSecret
in ingress annotations.Changes walkthrough 📝
5 files
chart_test.sh
Enhance TLS and SSL configuration in Helm chart tests
tests/charts/make/chart_test.sh
ingress.nginx.sslSecret
when using external TLScertificates.
_helpers.tpl
Improve secure connection handling and annotations in Helm templates
charts/selenium-grid/templates/_helpers.tpl
sslSecret
in ingress annotations.ingress.tls
configurations.ingress.yaml
Update ingress template for TLS secret handling
charts/selenium-grid/templates/ingress.yaml
secretName
in ingress TLS configurations.jaeger-ingress.yaml
Update Jaeger ingress template for TLS secret handling
charts/selenium-grid/templates/jaeger-ingress.yaml
secretName
in Jaeger ingress TLSconfigurations.
values.yaml
Add SSL passthrough and secret settings in values file
charts/selenium-grid/values.yaml
sslPassthrough
andsslSecret
settings in ingress configuration.1 files
__init__.py
Add SSL certificate verification in smoke tests
tests/SmokeTests/init.py
ssl
module.client_verify_cert
method to verify certificates.test_grid_is_up
method.2 files
Makefile
Update Makefile for inline TLS configuration in chart tests
Makefile
simplex-minikube.yaml
Remove default SSL certificate setting in test values
tests/charts/refValues/simplex-minikube.yaml
1 files
README.md
Update documentation for TLS and SSL configurations
charts/selenium-grid/README.md
configurations.