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

Fix last updated time #466

Merged
merged 1 commit into from
Mar 25, 2021
Merged

Fix last updated time #466

merged 1 commit into from
Mar 25, 2021

Conversation

thisisnotashwin
Copy link
Contributor

Changes proposed in this PR:

  • Update the type of lastSynced time to allows a nil value to be set. Previously, the reconciler would fail to set it to null causing an error if the resource could not sync successfully. This now sets it to nil.

How I've tested this PR:
Helm install with imageK8S: ashwinvenkatesh/consul-k8s@sha256:eae7a1d7e3aab3cb2060ee3a882803f225d1cb676c9c8283f3ef7a01d2cde056

apply crd:

apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceSplitter
metadata:
  name: service-a
spec:
  splits:
    - weight: 90
      serviceSubset: v1
    - weight: 10
      serviceSubset: v2

Check controller logs. Previously an error message would show up:
invalid: status.lastSyncedTime: Invalid value: \"null\": status.lastSyncedTime in body must be of type string: \"null\""
It no longer does

How I expect reviewers to test this PR: code-review

Checklist:

  • Tests added
  • CHANGELOG entry added (HashiCorp engineers only, community PRs should not add a changelog entry)

@thisisnotashwin thisisnotashwin requested review from lkysow, a team and ndhanushkodi and removed request for a team March 25, 2021 17:20
Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

remember to rebase since this PR has the squashed commits

- Reconciling last synced time fails when the sync fails as it tries to
  set time to a null value. By updating the type of LastSyncedTime to a
pointer, it gets assined nil on failure, which can reconcile
successfully.
Copy link
Contributor

@ndhanushkodi ndhanushkodi left a comment

Choose a reason for hiding this comment

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

🎉 Nice!! Thanks for fixing this!!

@thisisnotashwin thisisnotashwin merged commit 3c5e456 into master Mar 25, 2021
@thisisnotashwin thisisnotashwin deleted the fix-last-updated-time branch March 25, 2021 19:28
ndhanushkodi pushed a commit to ndhanushkodi/consul-k8s that referenced this pull request Jul 9, 2021
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.

None yet

3 participants