Skip to content

Redeploy router if mounted supergraph schema changes #2223

Merged
garypen merged 4 commits intoapollographql:devfrom
toneill818:dev
Dec 12, 2022
Merged

Redeploy router if mounted supergraph schema changes #2223
garypen merged 4 commits intoapollographql:devfrom
toneill818:dev

Conversation

@toneill818
Copy link
Contributor

Building off of @garypen's PR #2119, if the supergraphFile is set, add a label to the pods with a hash of its contents. This will force new pods to be spun up if the supergraphFile is changed so the new file will be loaded.

@bnjjj bnjjj requested a review from garypen December 7, 2022 14:45
Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

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

Great suggestion. I've requested a change to use annotation rather than label. Please update NEXT_CHANGELOG.md with an entry (it's a new FEATURE) to make sure you are correctly credited with the change in our release notes.

labels:
{{- include "router.selectorLabels" . | nindent 8 }}
{{- if .Values.supergraphFile }}
checksum/supergraph: {{ .Values.supergraphFile | sha256sum | trunc 63 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
checksum/supergraph: {{ .Values.supergraphFile | sha256sum | trunc 63 }}
checksum/supergraph-config-map: {{ .Values.supergraphFile | sha256sum | trunc 63 }}

One other thing: I usually see this done as an annotation rather than as a label. Could you make that change?

@garypen garypen changed the title Redeploy router if mounted supgergraph schema changes Redeploy router if mounted supergraph schema changes Dec 9, 2022
Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

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

Thanks very much for this submission.

@garypen garypen enabled auto-merge (squash) December 12, 2022 10:49
@garypen garypen merged commit 2521175 into apollographql:dev Dec 12, 2022
@BrynCooke BrynCooke added this to the v1.6.0 milestone Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants