Skip to content
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

Updating endpoints only does not require previous snapshot #4403

Merged
merged 25 commits into from
Mar 12, 2021

Conversation

npolshakova
Copy link
Contributor

@npolshakova npolshakova commented Mar 9, 2021

Description

If there are user config errors that would normally prevent Gloo from starting up, we still need the control plane to be able to serve EDS updates even when the snapshot cache has been cleared. EDS updates should occur in all scenarios when the pod is running, regardless if there is a previous snapshot.

Context

Need to ensure Gloo pod starts and serves EDS regardless of config errors when the pod is bounced and snapshot cache is cleared. EDS updates should occur in all scenarios when the pod is running, even when the snapshot cache has been cleared (bouncing gloo pod, settings change, etc.)

#4345

Checklist:

  • I included a concise, user-facing changelog (for details, see https://github.com/solo-io/go-utils/tree/master/changelogutils) which references the issue that is resolved.
  • If I updated APIs (our protos) or helm values, I ran make install-go-tools generated-code to ensure there will be no code diff
  • I followed guidelines laid out in the Gloo Edge contribution guide
  • I opened a draft PR or added the work in progress label if my PR is not ready for review
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
    BOT NOTES:
    resolves Ensure Gloo pod starts and serves EDS regardless of config errors #4345

@github-actions github-actions bot added the keep pr updated signals bulldozer to keep pr up to date with base branch label Mar 9, 2021
@solo-changelog-bot
Copy link

Issues linked to changelog:
#4345

@npolshakova npolshakova marked this pull request as ready for review March 11, 2021 19:02

cancel()
})

It("updates Envoy endpoints even if proxy is rejected", func() {

By("create a deployment and a matching service")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to the BeforeEach. Now each test sets up the appDeployment and appService before the test, and then deletes it after.

@@ -337,8 +459,14 @@ func (t *mockTranslator) Translate(params plugins.Params, proxy *v1.Proxy) (envo
}
}
}
if t.currentSnapshot != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the code this part is in the syncer. why is it in mock translator here? should it be in level above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the test to be able to check the non NilSnapshot case. Otherwise syncEnvoy will use the NilSnapshot instead when it tests Sync (https://github.com/solo-io/gloo/blob/master/projects/gloo/pkg/syncer/envoy_translator_syncer.go#L125). When the mock translator has a snapshot set it will use that and we can verify only the endpoints/clusters were updated.

endpoints cache.Resources,
clusters cache.Resources,
) cache.Snapshot {
// TODO: Copy resources and downgrade, maybe maintain hash to not do it too many times
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue link for this? If so, can you include the link here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't right now but I can make one. I think I'll remove this comment and just keep the one in NewSnapshotFromResources so we don't have it in two spots.

},
},
}
_, err := upstreamClient.Write(upstream, clients.WriteOpts{Ctx: ctx, OverwriteExisting: true})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this err is unchecked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@soloio-bulldozer soloio-bulldozer bot merged commit c597716 into master Mar 12, 2021
@soloio-bulldozer soloio-bulldozer bot deleted the separate-eds-update branch March 12, 2021 19:34
npolshakova added a commit that referenced this pull request Mar 15, 2021
* Merge branch 'separate-eds-update' of github.com:solo-io/gloo into separate-eds-update
soloio-bulldozer bot pushed a commit that referenced this pull request Mar 17, 2021
* Updating endpoints only does not require previous snapshot (#4403)

* Merge branch 'separate-eds-update' of github.com:solo-io/gloo into separate-eds-update
* fix changelog
* correct dependency bump for solo-kit
* Merge refs/heads/v1.6.x into eds-missing-snapshot-fix-backport
* update solo-kit
* Merge branch 'eds-missing-snapshot-fix-backport' of github.com:solo-io/gloo into eds-missing-snapshot-fix-backport
* deleted dup file
* generate code
* bump k8s-utils
* enable ephemeral containers
* skipClusterCreation
* fix robustness test, remove k8s-utils bump
* fix robustness test
* port forward
* remove focus
* fix robustness test flake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep pr updated signals bulldozer to keep pr up to date with base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure Gloo pod starts and serves EDS regardless of config errors
3 participants