-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
==========================================
+ Coverage 79.25% 79.58% +0.32%
==========================================
Files 5 5
Lines 188 191 +3
==========================================
+ Hits 149 152 +3
Misses 39 39
Continue to review full report at Codecov.
|
One problems. I hadn't found a way to modify the name inside the
|
Terraform state files are intended to represent already existing infrastructure, not as a replacement or alternative representation for Even if you did so, our Terraform provider doesn't support renaming instances. If you change its This doesn't have an easy solution, because we're using the Terraform provider just to run a bunch of cloud API calls sequentially and don't have granular resources nor Read/Update methods for any of them. 🙈 🙊 🙉 Deeply related to iterative/terraform-provider-iterative#175 (comment) |
@karajan1001 Modifying the instance attributes isn't really part of the requirement from the DVC side. Renaming the resource itself via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about setting a timeout exclusion for just this test?
tpi/terraform.py
Outdated
with self.make_tf(name) as tf: | ||
tf.cmd("state mv", f"{source}", f"{destination}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this some more, it's non-intuitive that most of the TPI functions depend on per-iterative-machine
workspace directories created in make_tf
(meaning that source
and destination
here should always be iterative-machine.<...>
names), it makes more sense for TPI to be generic, but that doesn't have to be handled in this PR
see: #15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment
1. Add a new rename method to TerraformBackend 2. Add a test for rename method
Co-authored-by: Casper da Costa-Luis <[email protected]>
Co-authored-by: Casper da Costa-Luis <[email protected]>
Co-authored-by: Casper da Costa-Luis <[email protected]>
Co-authored-by: Casper da Costa-Luis <[email protected]>
Timeout only act on state_mv Co-authored-by: Casper da Costa-Luis <[email protected]>
Co-authored-by: Casper da Costa-Luis <[email protected]>
928b606
to
19abda5
Compare
|
||
def state_mv(self, source, destination, **kwargs): | ||
"""Retain an existing remote object but track it as a | ||
different resource instance address. | ||
""" | ||
assert source and destination | ||
self.tf.cmd("state mv", source, destination) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll still need the wrapper for terraform state mv
in DVC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm apart from minor utility comment/query
/tag v2.1.0 b80ed24 |
fix #12