Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Use new unit test fixture for pilot control tests#292

Merged
jetstack-bot merged 1 commit intojetstack:masterfrom
wallrj:simpler-pilot-control
Mar 27, 2018
Merged

Use new unit test fixture for pilot control tests#292
jetstack-bot merged 1 commit intojetstack:masterfrom
wallrj:simpler-pilot-control

Conversation

@wallrj
Copy link
Contributor

@wallrj wallrj commented Mar 20, 2018

  • Removes the Pilot Update code. Instead we (for now) only create missing pilots.
  • Later the pilot creation and deletion will be done by the ScaleOut and ScaleIn actions.
  • Also makes the pilot control gracefully handle the situation where the pilot list doesn't yet have latest pilots and pilot creation therefore results in an AlreadyExists error.

Release note:

NONE

_, err = client.Update(desiredPilot)
_, err = client.Create(desiredPilot)
if k8sErrors.IsAlreadyExists(err) {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

I worry returning nil here just because a pilot with that same name already exists could cause problems. Similar to my comments in #291, I think we should return an error here and let the next invocation of the loop take the correct action (once the lister is consistent)

t.Log(updatedLabels)
t.Error("custom labels were altered")
}
"no error if pilot not yet listed": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be an error IMO (we have retry logic to handle cache inconsistencies)

if updatedLabels["foo"] != "bar" {
t.Log(updatedLabels)
t.Error("custom labels were altered")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this no longer necessary?

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've removed the update code so no longer necessary.

* Removes the Pilot Update code. Instead we (for now) only create missing pilots.
* Later the pilot creation and deletion will be done by the ScaleOut and ScaleIn actions.
* Add some documentation explaining why Pilot resources are created and how they are named.
@wallrj wallrj force-pushed the simpler-pilot-control branch from ad1dc7a to 1571422 Compare March 27, 2018 16:45
@munnerz
Copy link
Contributor

munnerz commented Mar 27, 2018

/lgtm
/approve

@jetstack-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: munnerz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@munnerz munnerz added this to the v0.1 milestone Mar 27, 2018
@jetstack-bot jetstack-bot merged commit 13d9bd1 into jetstack:master Mar 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants