-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added new tools such as oras and awscli, and script to check for…
… and delete packer cache (#24) * fix: added script to check for and delete packer cache * fix: added new tools such as oras and awscli, updated Terraform files * Apply suggestions from code review Co-authored-by: Karl Cardenas <[email protected]> * Update edge/vmware/clone_vm_template/delete-packer-cache.sh change error output destination * fix: added new tools such as oras and awscli, updated Terraform files… (#25) * fix: added new tools such as oras and awscli, updated Terraform files to include OCI registries * chore: updated the template and documentation * docs: minor update to the terraform.tfvars file * docs: minor update to the terraform.tfvars file --------- Co-authored-by: Karl Cardenas <[email protected]> --------- Co-authored-by: Lenny Chen <[email protected]> Co-authored-by: Karl Cardenas <[email protected]> Co-authored-by: caroldelwing <[email protected]>
- Loading branch information
1 parent
d36527f
commit d525fc6
Showing
11 changed files
with
177 additions
and
102 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
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,22 @@ | ||
#!/bin/bash | ||
|
||
source /edge/vmware/clone_vm_template/setenv.sh | ||
|
||
# Check if the packer cache exists | ||
CACHE_EXISTS=$(govc datastore.ls -ds=$vcenter_datastore /packer_cache 2>&1) | ||
|
||
if [ -z "$CACHE_EXISTS" ]; then | ||
echo "Existing packer cache not found. Nothing to delete." | ||
else | ||
# Cache exists, attempt to delete it | ||
govc datastore.rm -ds=$vcenter_datastore /packer_cache | ||
RESULT=$? | ||
if [ $RESULT -eq 0 ]; then | ||
echo "Deleted previous packer cache." | ||
exit 0 | ||
else | ||
echo "Failed to delete packer cache." | ||
exit 1 | ||
fi | ||
fi | ||
|
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
Oops, something went wrong.