This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve experience with .flux.yaml files #2565
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2opremio
approved these changes
Oct 30, 2019
squaremo
force-pushed
the
kustomize-ignore-unlinky-patches
branch
2 times, most recently
from
October 31, 2019 16:43
e36e0eb
to
8ca1303
Compare
squaremo
changed the title
Improve experience with patch files
Improve experience with .flux.yaml files
Oct 31, 2019
@2opremio I've moved this out of draft, and done more work to surface mistakes with config files; PTAnotherL when you have a sec. 🍎 |
2opremio
reviewed
Nov 1, 2019
@@ -22,6 +22,7 @@ require ( | |||
github.com/pkg/errors v0.8.1 | |||
github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 | |||
github.com/prometheus/client_golang v1.1.0 | |||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this come from? (just wondering)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, it keeps popping up whenever I run make
; so whichever version of go I have, it thinks it's a dependency.
2opremio
reviewed
Nov 1, 2019
2opremio
reviewed
Nov 1, 2019
2opremio
reviewed
Nov 1, 2019
Very minor stuff, otherwise LGTM! 💯 (+ an extra 🥇 for the dispatching refactoring!) |
- include more information like filenames - correct the implementation of resourceID so it uses the name of the resource
With respect to .flux.yaml files, two types control the generation and update of manifests in a repo: - ConfigFile, which is a directory subject to .flux.yaml; and - ConfigAware, which represents a set of directories, some of which have a ConfigFile, and some of which just have YAML files The dispatch of operations based on whether a config file has a PatchUpdated or CommandUpdated field more properly belongs among the ConfigFile methods, but hitherto has been somewhat scattered. This commit moves all the detail of how things are generated or updated into methods of ConfigFile, and just delegates to those from ConfigAware when there is a config file in effect. The methods to be delegated to are exported; helpers are not exported.
It's evidently easy to end up with no commands in a config file for updating manifests, either because you accidentally use `commandUpdated` with a `patchFile` field, or because the instructions were unclear, and so on. Instead of silently running nothing, then complaining that no files have changed, return an error if nothing got run. This way the person or system attempting the update will at least see the reason nothing happened.
squaremo
force-pushed
the
kustomize-ignore-unlinky-patches
branch
from
November 4, 2019 10:33
8ca1303
to
2fdaaa6
Compare
2opremio
pushed a commit
to 2opremio/flux
that referenced
this pull request
Nov 12, 2019
The problem was introduced at fluxcd#2565 Also, re-enable the manifest generation e2e test, which was disabled because of the bug fixed here.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resource
These two address a comment #2428 (comment) that fluxd should at least provide information about which file/resource is failing, when syncing goes wrong.
This addresses #2324 by making it more obvious what has failed (in that issue, the complaint can be interpreted as "nothing happened and I don't know why").