Skip to content

Check if observed_generation.present? - #990

Merged
mvallati merged 1 commit into
mainfrom
es-generation
Oct 24, 2025
Merged

Check if observed_generation.present?#990
mvallati merged 1 commit into
mainfrom
es-generation

Conversation

@mvallati

Copy link
Copy Markdown
Contributor

What are you trying to accomplish with this PR?
This PR checks if observedGeneration is present before comparing it to generation.

While trying to deploy https://github.com/Shopify/infrastructure/pull/19701, I got the following error

Elasticsearch/elasticsearch: TIMED OUT (timeout: 300s)
This resource's status could not be used to determine rollout success because it is not up-to-date
(.metadata.generation != .status.observedGeneration).

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_generation will always be true since observed_generation will be nil instead of a number. To resolve this, I have added an addition check at the beginning of the if statement that checks observed_generation.present? that will return false if not present, which resolve the error I'm getting in my deploy.

@mvallati
mvallati force-pushed the es-generation branch 2 times, most recently from 111efcd to 7d18872 Compare October 24, 2025 16:59
@mvallati
mvallati merged commit 6187227 into main Oct 24, 2025
383 of 385 checks passed
@alexgomez54 alexgomez54 mentioned this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants