Skip to content

Commit

Permalink
Feature: Group several manifest into one file
Browse files Browse the repository at this point in the history
- group manifests from several CNFs into one
  common_manifests.yaml file
- add functionality in cleanup.cr to remove this file
- depends on PR in helm library:
  cnf-testsuite/helm#4
  • Loading branch information
barmull committed Sep 9, 2024
1 parent c0f461e commit 3bb320c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tasks/cleanup.cr
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ task "samples_cleanup" do |_, args|
)
nil
end
# Remove common_manifest.yaml file
common_manifest_path = "cnfs/common_manifest.yaml"
if File.exists?(common_manifest_path)
File.delete(common_manifest_path)
Log.info { "#{common_manifest_path} file deleted successfully." }
end
end

desc "Cleans up the CNF Test Suite helper tools and containers"
Expand Down
18 changes: 18 additions & 0 deletions src/tasks/utils/cnf_manager.cr
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,24 @@ module CNFManager
#TODO call kubectl apply on file
KubectlClient::Apply.file(configmap_path)
# TODO when uninstalling, remove config map

#Generating manifest from installed CNF
generated_manifest = Helm.generate_manifest(release_name, deployment_namespace)

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (pod_network_corruption)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (zombie)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (pod_memory_hog)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (pod_io_stress)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (pod_delete)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (pod_network_latency)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (oran)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (pod_network_duplication)

undefined method 'generate_manifest' for Helm:Module

Check failure on line 887 in src/tasks/utils/cnf_manager.cr

View workflow job for this annotation

GitHub Actions / Chaos & Oran Tests (disk_fill)

undefined method 'generate_manifest' for Helm:Module
if generated_manifest.empty?
stdout_failure "The manifest was not generated."
exit 1
end
manifest_path = "cnfs/common_manifest.yaml"
if File.exists?(manifest_path)
File.open(manifest_path, "a") do |file|
file.puts generated_manifest
end
else
File.open(manifest_path, "w") do |file|
file.puts generated_manifest
end
end

ensure
#todo uninstall/reinstall clustertools because of tshark bug
end
Expand Down

0 comments on commit 3bb320c

Please sign in to comment.