Check if observed_generation.present? - #990
Merged
Merged
Conversation
mvallati
force-pushed
the
es-generation
branch
2 times, most recently
from
October 24, 2025 16:59
111efcd to
7d18872
Compare
mvallati
force-pushed
the
es-generation
branch
from
October 24, 2025 17:09
7d18872 to
7b86b91
Compare
andriyredko
approved these changes
Oct 24, 2025
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish with this PR?
This PR checks if
observedGenerationis present before comparing it togeneration.While trying to deploy https://github.com/Shopify/infrastructure/pull/19701, I got the following error
After some investigation, I discovered this error is happening because elasticsearches deployed from the search control plane do not have a
observedGeneration.This hasn't been an issue until now, where we are trying to solve an edge case of someone potentially deleting their Elasticsearch resource from their manifest files after migrating to the search control plane, but before migrating their app to the infrastructure monorepo. We need to be able to deploy via production platform to re-establish the connection between their app and their elasticsearch resource. Currently, this will fail (as seen in my deploy) because the check for
current_generation != observed_generationwill always be true sinceobserved_generationwill benilinstead of a number. To resolve this, I have added an addition check at the beginning of theifstatement that checksobserved_generation.present?that will returnfalseif not present, which resolve the error I'm getting in my deploy.