Skip to content

Add Version Checker datagatherer#200

Merged
charlieegan3 merged 21 commits intomasterfrom
version-checker-dg
Nov 4, 2020
Merged

Add Version Checker datagatherer#200
charlieegan3 merged 21 commits intomasterfrom
version-checker-dg

Conversation

@charlieegan3
Copy link
Contributor

@charlieegan3 charlieegan3 commented Nov 2, 2020

This creates a datagatherer based on version checker. The new datagatherer wraps the dynamic client and version-checker. It returns a list of pods and the results of their image check from version checker.

Fixes https://github.com/jetstack/preflight-platform/issues/608

@jetstack-bot
Copy link
Contributor

@charlieegan3: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jetstack-bot jetstack-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 2, 2020
@jetstack-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@jetstack-bot jetstack-bot added dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 2, 2020
@jetstack-bot jetstack-bot requested a review from wwwil November 2, 2020 18:16
@jetstack-bot jetstack-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 2, 2020
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 2, 2020
This creates a datagatherer based on version checker

There is still work to load the config correctly from files

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Nov 3, 2020
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
@charlieegan3 charlieegan3 marked this pull request as ready for review November 3, 2020 15:36
@jetstack-bot jetstack-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 3, 2020
@charlieegan3 charlieegan3 changed the title Example version checker dg Version Checker datagatherer Nov 3, 2020
@charlieegan3 charlieegan3 changed the title Version Checker datagatherer Add Version Checker datagatherer Nov 3, 2020
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Copy link

@JoshVanL JoshVanL left a comment

Choose a reason for hiding this comment

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

Made a couple comments, hope they make sense 😄

/assign @charlieegan3

Comment on lines 173 to 233
expectedResultsJSON := fmt.Sprintf(`[
{
"pod": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "example-6d94489854-zpzhr",
"namespace": "example",
"selfLink": "/api/v1/namespaces/example/pods/example-6d94489854-zpzhr",
"uid": "efff9dae-28ca-42c3-be70-970731c44f67",
"resourceVersion": "32023849",
"creationTimestamp": null,
"labels": {
"app": "example"
},
"ownerReferences": [
{
"apiVersion": "apps/v1",
"kind": "ReplicaSet",
"name": "example-6d94489854",
"uid": "bb6c0f31-0e28-4c28-a81d-91b8d7bfed33",
"controller": true,
"blockOwnerDeletion": true
}
]
},
"spec": {
"containers": [
{
"name": "example",
"image": "%s/jetstack/example:v1.0.0",
"command": [
"sh",
"-c"
],
"resources": {}
}
]
},
"status": {
"containerStatuses": [
{
"name": "example",
"state": {},
"lastState": {},
"ready": false,
"restartCount": 0,
"image": "",
"imageID": "is set"
}
]
}
},
"result": {
"CurrentVersion": "v1.0.0",
"LatestVersion": "v1.0.1",
"IsLatest": false,
"ImageURL": "%s/jetstack/example"
}
}
]`, parsedURL.Host, parsedURL.Host)
Copy link

Choose a reason for hiding this comment

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

Maybe push the json to a const at the bottom of the file so it doesn't interrupt the flow of the code?

Copy link
Contributor Author

@charlieegan3 charlieegan3 Nov 3, 2020

Choose a reason for hiding this comment

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

Call me mad, but I like this 😂

I'm going to leave this comment open in case others agree with you.

As per comments

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
As per feedback

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
As per feedback

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
This is needed to make the config loading from a global config file work

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
As per style feedback

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
In case files are leftover after a failed test run

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
As per feedback

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
As per feedback

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Also shows if container is init or not. This makes the volume of data less to send to the backend

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
This is in order to improve vc log output

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
As per feedback

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
@tfadeyi
Copy link
Contributor

tfadeyi commented Nov 4, 2020

lgtm to me 👍

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
@j-fuentes j-fuentes removed the request for review from wwwil November 4, 2020 12:12
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: charlieegan3, j-fuentes

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:
  • OWNERS [charlieegan3,j-fuentes]

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

@charlieegan3 charlieegan3 merged commit 12636ec into master Nov 4, 2020
@charlieegan3 charlieegan3 deleted the version-checker-dg branch November 4, 2020 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants