-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating image inside the example doesn't cause container to restart #29
Comments
@morgante @aaron-lane this issue is no longer reproducible. Created container-vmf from simple example:
Noted the image
Updated the image with
Re-applied the template: it worked, output reflects changes (note image v2.0)
Double checked with
|
Double-checked again - the issue is still valid. Applied template:
Modified the image:
Re-applied template (note updated image):
Double-checked with
Double checked on the host itself:
The issue is still valid ! |
- Updated examples/simple_instance/main.tf with adding hashed image into instance_name - Updated examples/simple_instance/outputs.tf with adding hashed image into instance_name
- Updated examples/simple_instance/main.tf with adding hashed image into instance_name - Updated examples/simple_instance/outputs.tf with adding hashed image into instance_name
- Updated examples/simple_instance/main.tf with adding hashed image into instance_name - Updated examples/simple_instance/outputs.tf with adding hashed image into instance_name
- Updated examples/simple_instance/main.tf with adding hashed image into instance_name - Updated examples/simple_instance/outputs.tf with adding hashed image into instance_name
- Removed outdated doc_generator - Added missing helper scripts - Removed outdated docker linter - Fixed flake8 errors reported in terraform-google-modules#32 - Fixed broken simlinks(fixes terraform fmt terraform-google-modules#32) - Updated shared tfvars - Updated README files Migrate modules to 0.12 and make the rest of the code base 0.12-compatible terraform-google-modules#35 - Migrated modules to 0.12 syntax - Added variable types constraints - Updated README - Removed outdated check_docker make target - Added a temporary workgaround for terraform-google-modules#28 (skip not migrated files in `find_files`) Updating image inside the example doesn't cause container to restart terraform-google-modules#29 - Updated examples/simple_instance/main.tf with adding hashed image into instance_name - Updated examples/simple_instance/outputs.tf with adding hashed image into instance_name
- Removed outdated doc_generator - Added missing helper scripts - Removed outdated docker linter - Fixed flake8 errors reported in terraform-google-modules#32 - Fixed broken simlinks(fixes terraform fmt terraform-google-modules#32) - Updated shared tfvars - Updated README files Migrate modules to 0.12 and make the rest of the code base 0.12-compatible terraform-google-modules#35 - Migrated modules to 0.12 syntax - Added variable types constraints - Updated README - Removed outdated check_docker make target - Added a temporary workgaround for terraform-google-modules#28 (skip not migrated files in `find_files`) Updating image inside the example doesn't cause container to restart terraform-google-modules#29 - Updated examples/simple_instance/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/simple_instance/outputs.tf by reflecting the change above - Updated examples/instance_with_attached_disk/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/instance_with_attached_disk/outputs.tf by reflecting the change above
- Removed outdated doc_generator - Added missing helper scripts - Removed outdated docker linter - Fixed flake8 errors reported in terraform-google-modules#32 - Fixed broken simlinks(fixes terraform fmt terraform-google-modules#32) - Updated shared tfvars - Updated README files - Fixed trailing white-space from master Migrate modules to 0.12 and make the rest of the code base 0.12-compatible terraform-google-modules#35 - Migrated modules to 0.12 syntax - Added variable types constraints - Updated README - Removed outdated check_docker make target - Added a temporary workgaround for terraform-google-modules#28 (skip not migrated files in `find_files`) Updating image inside the example doesn't cause container to restart terraform-google-modules#29 - Updated examples/simple_instance/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/simple_instance/outputs.tf by reflecting the change above - Updated examples/instance_with_attached_disk/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/instance_with_attached_disk/outputs.tf by reflecting the change above
- Removed outdated doc_generator - Added missing helper scripts - Removed outdated docker linter - Fixed flake8 errors reported in terraform-google-modules#32 - Fixed broken simlinks(fixes terraform fmt terraform-google-modules#32) - Updated shared tfvars - Updated README files - Fixed trailing white-space from master Migrate modules to 0.12 and make the rest of the code base 0.12-compatible terraform-google-modules#35 - Migrated modules to 0.12 syntax - Added variable types constraints - Updated README - Removed outdated check_docker make target - Added a temporary workgaround for terraform-google-modules#28 (skip not migrated files in `find_files`) Updating image inside the example doesn't cause container to restart terraform-google-modules#29 - Updated examples/simple_instance/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/simple_instance/outputs.tf by reflecting the change above - Updated examples/instance_with_attached_disk/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/instance_with_attached_disk/outputs.tf by reflecting the change above
- Removed outdated doc_generator - Added missing helper scripts - Removed outdated docker linter - Fixed flake8 errors reported in terraform-google-modules#32 - Fixed broken simlinks(fixes terraform fmt terraform-google-modules#32) - Updated shared tfvars - Updated README files - Fixed trailing white-space from master - Adjusted .gitingore Migrate modules to 0.12 and make the rest of the code base 0.12-compatible terraform-google-modules#35 - Migrated modules to 0.12 syntax - Added variable types constraints - Updated README - Removed outdated check_docker make target - Added a temporary workgaround for terraform-google-modules#28 (skip not migrated files in `find_files`) Updating image inside the example doesn't cause container to restart terraform-google-modules#29 - Updated examples/simple_instance/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/simple_instance/outputs.tf by reflecting the change above - Updated examples/instance_with_attached_disk/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/instance_with_attached_disk/outputs.tf by reflecting the change above
- Removed outdated doc_generator - Added missing helper scripts - Removed outdated docker linter - Fixed flake8 errors reported in terraform-google-modules#32 - Fixed broken simlinks(fixes terraform fmt terraform-google-modules#32) - Updated shared tfvars - Updated README files - Fixed trailing white-space from master - Adjusted .gitingore Migrate modules to 0.12 and make the rest of the code base 0.12-compatible terraform-google-modules#35 - Migrated modules to 0.12 syntax - Added variable types constraints - Updated README - Removed outdated check_docker make target - Added a temporary workgaround for terraform-google-modules#28 (skip not migrated files in `find_files`) Updating image inside the example doesn't cause container to restart terraform-google-modules#29 - Updated examples/simple_instance/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/simple_instance/outputs.tf by reflecting the change above - Updated examples/instance_with_attached_disk/main.tf by introducing local.instance_name and adding substring of contianer image hash into instance_name - Updated examples/instance_with_attached_disk/outputs.tf by reflecting the change above
Hi guys, the issue still valid. Step for reproducing is the same
@ivankorn , issue still valid, please fix it ASAP @aaron-lane , please review changes more deeply |
Do you have your tests output? The issue was checked here as you can see it's not reproducible since then The image you referenced is not a proof of the fix, it's a proof of the bug, after that it was fixed with tests outputs of successful results in the PR not in the issue. cc: @aaron-lane @morgante |
@ivankorn, you absolutely right, but issue still valid, and you didn't fix their. And this issue not about your tests, your tests its your problem, but functionality of that module absolutely doesn't work as expected. Try reproduce this issue with the following steps you find above. If you can't reproduce it, please ping me and I'll provide all my logs. P.S. double checked and I can't find any word in a title / issue description about broken test you mention I am sure this issue about broken functionality |
I'm 100% sure it was passing(I posted link to output above), but what I didn't do is running the check a number of times to confirm subsequent passes..
I spoke to @kopachevsky who discussed that with you guys. |
yes, we work with the latest version of this module |
@ivankorn, any updates with fixing this bug ? |
I looked at the code @YermakovvD is reporting an issue with. He didn't include workaround for this container image in it and still uses
instead of
@YermakovvD is still concerned about workaround @morgante proposed earlier for the fix and he doesn't want whole VM to be re-created in order to update the container image. However the mentioned workaround merged with #31 still works. @YermakovvD, can you please confirm if I understood your concern correctly? Thanks |
I also have the same issue. Currently I'm solving it by running |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Facing this issue not only when image updates, but also when any image config (e.x. env) updates. |
Ran into this issue as well where anytime we update environment variables defined in the metadata, we have to restart the instance |
Can confirm that this issue is still there. Simply changing the container image reference doesn't actually make the change happen inside the VM. The Web Dashboard shows the new image being correctly assigned but when accessing the VM itself and checking, it still load the previous image. Only by using the workaround reported by @Ahmedn1 it seems to be fine but that's triggering a restart of the whole VM it seems while it would suffice if there was a docker refresh of sort. Is there anyone working on this? Can someone point to where to go looking to understand how to help? |
Yes this is still an issue. |
Any updates? |
I think we want to run |
This is still a problem, and a very annoying one. Having dynamic resource names means we can't just communicate between VMs using their name, because that will unexpectedly change with infra updates 🤦 |
This dirty workaround seems to work for me : locals {
envs = [{
name = "FOO"
value = "BAR"
}]
config_sha = sha1("${join("", local.envs.*.value)}-${local.image}")
image = "gcr.io/..."
zone = "..."
}
module "my_gce_container" {
source = "terraform-google-modules/container-vm/google"
# ...
container = {
image = local.image
env = local.envs
# ...
}
}
resource "google_compute_instance" "gce_instance" {
project = data.google_project.project.project_id
zone = local.zone
# ...
}
resource "null_resource" "gce_null_instance" {
triggers = {
config_sha = local.config_sha
}
provisioner "local-exec" {
command = "gcloud compute ssh --project=${data.google_project.project.project_id} --zone=${local.zone} ${google_compute_instance.gce_instance.name} --command 'sudo systemctl start konlet-startup'"
}
depends_on = [
google_compute_instance.gce_instance
]
} It should also work with |
+1 EDIT: One workaround I found is to manually run EDIT 2: A better workaround is to run
EDIT 3:
|
Another workaround described in https://cloud.google.com/blog/topics/developers-practitioners/force-terraform-resource-recreation is hashing the metadata content and putting the hash into a GCE field which forces its replacement (e.g. destroy and create), the This of course means a downtime, so may not work for everyone. |
I ended up using the It works well but create a new VM instance each time. It's not ideal but acceptable for my usecase. |
Changing the image name should cause a new container to be spun up.
Reproduction:
terraform apply
terraform apply
again - the new container should be started instead.The text was updated successfully, but these errors were encountered: