-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
core: Allow refresh of local state with no resources #7320
Conversation
@jen20 Is there anything I can do to move this along? |
@@ -64,8 +64,13 @@ func (s *CacheState) RefreshState() error { | |||
// Cache is newer than remote. Not a big deal, user can just | |||
// persist to get correct state. | |||
s.refreshResult = CacheRefreshLocalNewer | |||
case cached == nil && durable != nil: | |||
case !cached.HasResources() && durable != nil: |
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 should probably verify that cached is not nil here since the HasResources()
method accesses members.
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.
HasResources
returns false if the state is nil.
HI @dtolnay! Looks like we have a problem with the test applied to master:
One of us will pick this up next week unless you get a chance to do so beforehand. Thanks! |
I'm surprised it still merges cleanly after 2.5 months. I will let you folks take care of the test failure. I enabled the brand new "allow edits from maintainers" to make it easier. |
Never mind, it was simple enough I fixed it myself. |
|
I would love to +1 this (can it be merged soonish) - just needed this today and thought terraform would work this way when it clearly does not. |
@jen20 is there anything else I can do to help you merge this? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes #4154 and fixes #5410.
HasResources
is copied from @apparentlymart's work in #7026.