forked from cnti-testcatalog/testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: introduce new config format and parser
For supporting multiple deployments in one cnf and improving overall config usability and structure - new config format has to be introduced. Some existing parameters usage need to be changed for easier adaptation. This change does not replace the old config format. Refs: cnti-testcatalog#2121 Signed-off-by: Konstantin Yarovoy <[email protected]>
- Loading branch information
Konstantin Yarovoy
committed
Sep 5, 2024
1 parent
c0f461e
commit f1c5d67
Showing
61 changed files
with
315 additions
and
134 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
config_version: "v2" | ||
common: | ||
container_names: | ||
- name: coredns | ||
rolling_update_test_tag: "1.8.0" | ||
rolling_downgrade_test_tag: 1.6.7 | ||
rolling_version_change_test_tag: 1.8.0 | ||
rollback_from_tag: 1.8.0 | ||
|
||
deployments: | ||
helm_charts: | ||
- name: coredns | ||
helm_repo_name: stable | ||
helm_repo_url: https://cncf.gitlab.io/stable | ||
helm_chart_name: coredns | ||
# helm_dirs: | ||
# - name: envoy | ||
# helm_directory: ../example-cnfs/envoy/envoy | ||
# manifests: | ||
# - name: nginx | ||
# manifest_directory: manifests | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
release_name: envoy | ||
service_name: envoy | ||
helm_directory: envoy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
--- | ||
helm_directory: vpp | ||
release_name: vpp | ||
service_name: "" | ||
rolling_update_test_tag: latest | ||
allowlist_helm_chart_container_names: [nginx, calico-node, kube-proxy, nginx-proxy, node-cache, kube-multus] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
helm_directory: helm_chart | ||
release_name: nsm --set insecure=true | ||
service_name: nsm-admission-webhook-svc | ||
helm_repository: | ||
name: stable | ||
repo_url: https://cncf.gitlab.io/stable |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
helm_directory: nat-cnf | ||
release_name: cnf-nat | ||
service_name: | ||
allowlist_helm_chart_container_names: [node-cache, nginx, coredns, calico-node, kube-proxy, nginx-proxy, kube-multus] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: sidecar-container-demo | ||
service_name: | ||
helm_repository: | ||
name: stable | ||
repo_url: https://cncf.gitlab.io/stable |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: bad-helm-coredns-coredns | ||
service_name: bad-helm-coredns-coredns |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
release_name: coredns | ||
service_name: coredns-coredns | ||
helm_chart: stable/coredns |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns | ||
rolling_update_test_tag: 1.6.7 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns | ||
helm_repository: | ||
name: stable | ||
repo_url: https://cncf.gitlab.io/stable |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
helm_directory: chart | ||
helm_values: | ||
release_name: coredns | ||
service_name: coredns-coredns |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: envoy | ||
service_name: envoy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: bad-liveness | ||
service_name: bad-liveness-coredns |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns --set imageCredentials.registry=https://index.docker.io/v1/ --set imageCredentials.username=$PROTECTED_DOCKERHUB_USERNAME --set imageCredentials.password=$PROTECTED_DOCKERHUB_PASSWORD --set imageCredentials.email=$PROTECTED_DOCKERHUB_EMAIL --set image.repository=$PROTECTED_IMAGE_REPO | ||
service_name: coredns-coredns |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: envoy | ||
service_name: envoy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: envoy | ||
service_name: envoy |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: envoy | ||
service_name: envoy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ helm_directory: chart | |
git_clone_url: | ||
install_script: chart | ||
release_name: unifi | ||
service_name: unifi-controller |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
1 change: 0 additions & 1 deletion
1
sample-cnfs/sample_immutable_configmap_all_plus_env/cnf-testsuite.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
1 change: 0 additions & 1 deletion
1
sample-cnfs/sample_immutable_configmap_all_plus_env_but_fail/cnf-testsuite.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: coredns | ||
service_name: coredns-coredns |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ helm_directory: chart | |
git_clone_url: | ||
install_script: chart | ||
release_name: unifi | ||
service_name: unifi-controller |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: privileged-coredns | ||
service_name: privileged-coredns |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: postgresql | ||
release_name: postgresql | ||
service_name: postgresql |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
helm_directory: postgresql | ||
release_name: postgresql | ||
service_name: postgresql |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ helm_directory: postgresql | |
git_clone_url: | ||
install_script: chart | ||
release_name: postgresql | ||
service_name: postgresql |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ helm_directory: postgresql | |
git_clone_url: | ||
install_script: chart | ||
release_name: postgresql | ||
service_name: postgresql |
1 change: 0 additions & 1 deletion
1
sample-cnfs/sample_whitelisted_privileged_cnf/cnf-testsuite.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
helm_directory: chart | ||
release_name: privileged-coredns | ||
service_name: privileged-coredns-coredns | ||
allowlist_helm_chart_container_names: [coredns] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require "yaml" | ||
require "../utils.cr" | ||
require "./config_versions/config_v2.cr" | ||
|
||
module CNFInstall | ||
module Config | ||
|
||
class Config < ConfigV2::Config | ||
end | ||
|
||
def self.parse_cnf_config_from_file(path_to_config) | ||
yaml_content = File.read(path_to_config) | ||
config_dir = CNFManager.ensure_cnf_testsuite_dir(path_to_config) | ||
begin | ||
parse_cnf_config_from_yaml(yaml_content, config_dir) | ||
rescue exception | ||
stdout_failure "Error during parsing CNF config on #{path_to_config}" | ||
stdout_failure exception.message | ||
stdout_failure "Please check your config according to the config template." | ||
exit 1 | ||
end | ||
end | ||
|
||
def self.parse_cnf_config_from_yaml(yaml_content, config_dir) | ||
config = Config.from_yaml(yaml_content) | ||
|
||
config.dynamic.initialize_dynamic_properties(config, config_dir) | ||
|
||
config | ||
end | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
src/tasks/utils/cnf_installation/config_versions/config_base.cr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module CNFInstall | ||
module Config | ||
class ConfigBase | ||
include YAML::Serializable | ||
include YAML::Serializable::Strict | ||
end | ||
end | ||
end |
Oops, something went wrong.