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

Migrate the ConfigStore to use standard infrastructure. #150

Merged
merged 4 commits into from
Jul 22, 2021

Conversation

mattmoor
Copy link
Member

Knative has a ton of utilities for managing config storage, watching configmaps, and snapshotting those configmaps onto context during each reconciliation.

This is really just a first chunk, but migrates the bulk of the config package to support the standard interfaces, use the libraries for validation, and leverage the shared configmap watching libraries.

In a subsequent change, it would make the most sense to have the signer extract the config store from the context it is passed instead of having its own reference, but this change has grown overly large already.

/kind cleanup

cc @priyawadhwa @dlorenc

@tekton-robot tekton-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jul 21, 2021
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 21, 2021
Knative has a ton of utilities for managing config storage, watching configmaps, and snapshotting those configmaps onto context during each reconciliation.

This is really just a first chunk, but migrates the bulk of the config package to support the standard interfaces, use the libraries for validation, and leverage the shared configmap watching libraries.

In a subsequent change, it would make the most sense to have the signer extract the config store from the context it is passed instead of having its own reference, but this change has grown overly large already.

/kind cleanup
@mattmoor
Copy link
Member Author

Not sure what's going on here with go-license 😞

This changes the signer to access the config and the logger off of context instead of squirreling them away at construction.

For the configstore, this is about consistency.  The reconciliation framework snapshots configurations onto context at the beginning of reconciliation so that the configuration doesn't change in the middle of reconciliation.  By having the signer access the same config as the rest of the reconciler, we ensure that we don't get inconsistent views of the configuraton data.

For the logger, this is about tagging.  The reconciliation framework infuses the base logger with a variety of additional tagging, like the reconciliation key, which the current signer's logger doesn't have, so by switching to the logger that comes from the reconciliation context, we will get significantly richer log tagging from within the signer.
@mattmoor
Copy link
Member Author

I pushed the rest of the change here as a separate commit, but need to sort out the go-license things still, which I'll probably need some pointers on.

@mattmoor
Copy link
Member Author

Thanks to @dlorenc for spotting the missing newline in ./hack/tools.go 🤦

@mattmoor
Copy link
Member Author

I screwed something up, I added and removed the follow up commit here, and I want to clean that up.

@mattmoor
Copy link
Member Author

ok it should be fixed.

@mattmoor
Copy link
Member Author

Finally green 😅

@dlorenc
Copy link
Contributor

dlorenc commented Jul 22, 2021

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2021
@dlorenc
Copy link
Contributor

dlorenc commented Jul 22, 2021

/approve

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlorenc

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2021
@tekton-robot tekton-robot merged commit 6290255 into tektoncd:main Jul 22, 2021
@mattmoor mattmoor deleted the config-store branch July 22, 2021 15:03
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. 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.

3 participants