-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Allow device adoption #188
Conversation
internal/provider/resource_device.go
Outdated
Description: "Specifies whether this resource should tell the controller to \"forget\" the device on destroy.", | ||
Type: schema.TypeBool, | ||
Optional: true, | ||
Default: false, |
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.
I think we may want to default this to true
? If I happened to do something like rename my resource I wouldn't want the controller to delete this without me being very explicit you know. Perhaps the user one should have also defaulted that way? I don't know, what are your thoughts?
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.
Renaming the resource is a good point, but in general that is a destructive operation that requires care. Like if I am managing an EC2 instance or RDS database then without a state mv
that would involve destroying and recreating my infrastructure.
The end result should be the same either way, it's just that there will be a few seconds (minutes?) where the device is no longer adopted. I'm not sure if the device would retain its settings or not though, hmm. If it does then it's probably fine. If it doesn't then yeah that's not a great idea.
In any case I suspect that deletion is rare and this forget on delete functionality isn't very important. I mainly added it for the acceptance tests. I am fine either way really.
1353704
to
066362e
Compare
066362e
to
4eb9fa4
Compare
Tests should be fixed by #190 |
fccdfc1
to
ec0b88d
Compare
Needs a bit more work. It looks harmless, but I see some warnings/errors in the controller logs:
|
Those sanitize logs are interesting though, I wonder if we could incorporate that output somehow in to the acc tests themselves. |
c2d8ba9
to
6556faf
Compare
6556faf
to
66e36df
Compare
* Allow device adoption * Handling disappearing device * Allocate test devices dynamically * Increase `NotFoundChecks` * Demo devices don't seem to have sequential MACs * Change default for `forget_on_destroy` * Minor
Allow for devices to be adopted on creation and forgotten on destruction. As these could be destructive operations I have made them both opt-in with
allow_adopt
andforget_on_destroy
.One issue that I haven't fixed is that the acceptance tests fail with
TEST_COUNT=2
(or any number larger than one). The reason for this is that after forgetting a device it seems to disappear completely for about 30 seconds before it reappears. I wanted to think about this problem a bit more and will submit a follow-up PR to fix it.