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

Config: Insert git sha when using configupdater #20527

Merged
merged 2 commits into from
Jan 21, 2021

Conversation

alvaroaleman
Copy link
Member

This change makes the configupdater always add a key named VERSION to
the configmap which contains the git sha that triggered said update.
The configloading in turn will pick it up if present. This allows
components to include the config version in their logs, which can be
useful for debugging.

The second commit shows the reason I started thinking about this, namely the fact that the statusreconciler log is near useless, it tells us what it did but not for what config version, which makes debugging issues impossible and forces us to guess (ref #20498 (comment))

This is technically a breaking change in that we now always include a key in the configmaps that we didn't include before (but won't override if it gets populated). This is fine for prow itself, as it only looks at all files in the context of job configs and there it ignores files that do not end with .yaml or .yml:

if filepath.Ext(path) != ".yaml" && filepath.Ext(path) != ".yml" {

If someone uses the configupdater for something other than the prow config and then looks at all files and expects all of them to have a certain format, that would break now. But this seems rather unlikely to me. WDYT @fejta ?

/assign @fejta

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow Issues or PRs related to prow area/prow/plugins Issues or PRs related to prow's plugins for the hook component area/prow/status-reconciler Issues or PRs related to reconciling status when jobs change labels Jan 20, 2021
@k8s-ci-robot k8s-ci-robot added the sig/testing Categorizes an issue or PR as relevant to SIG Testing. label Jan 20, 2021
@k8s-ci-robot k8s-ci-robot added the area/prow/config-bootstrapper Issues or PRs related to prow's config-bootstrapper utility label Jan 20, 2021
This change makes the configupdater always add a key named VERSION to
the configmap which contains the git sha that triggered said update.
The configloading in turn will pick it up if present. This allows
components to include the config version in their logs, which can be
useful for debugging.
Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

Seems safe to me. Could make it PROW-VERSION or something if this ends up breaking something.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 21, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, stevekuznetsov

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot merged commit 5a22a60 into kubernetes:master Jan 21, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Jan 21, 2021
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. area/prow/config-bootstrapper Issues or PRs related to prow's config-bootstrapper utility area/prow/plugins Issues or PRs related to prow's plugins for the hook component area/prow/status-reconciler Issues or PRs related to reconciling status when jobs change area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants