Fix gitopsset not updating when gitrepo is nested inside matrix#82
Fix gitopsset not updating when gitrepo is nested inside matrix#82
Conversation
|
bc4ed45 to
2996469
Compare
|
|
||
| imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2" | ||
| "github.com/fluxcd/pkg/runtime/testenv" | ||
| v1 "github.com/fluxcd/source-controller/api/v1" |
There was a problem hiding this comment.
How about importing this as sourcev1 which follows the pattern?
There was a problem hiding this comment.
When using sourcev1, it shows this error 🤔
cannot use &(sourcev1.Artifact literal) (value of type *"github.com/fluxcd/source-controller/api/v1beta2".Artifact) as *"github.com/fluxcd/source-controller/api/v1".Artifact value in struct literalcompilerIncompatibleAssign
There was a problem hiding this comment.
I get a different error...
--- FAIL: TestReconcilingUpdatingImagePolicy_in_matrix (10.03s)
gitopsset_controller_test.go:403:
Timed out after 10.001s.
Expected
<bool>: false
to be true
--- FAIL: TestGitOpsSetUpdateOnGitRepoChange (0.01s)
gitopsset_controller_test.go:427: GitRepository.source.toolkit.fluxcd.io "my-git-repo" is invalid: status.artifact.lastUpdateTime: Required value
Looks like you need to populate that field?
There was a problem hiding this comment.
I've had a further look at this.
There are three problems, getGitRepoStatusUpdate doesn't set the LastUpdateTime on the Artifact, you can set it to time.Now() without any issues.
Also, it's setting the Digest to be an invalid error, if you look at the error message:
gitopsset_controller_test.go:429: GitRepository.source.toolkit.fluxcd.io "my-git-repo" is invalid: status.artifact.digest: Invalid value: "f0a57ec1cdebda91cf00d89dfa298c6ac27791e7fdb0329990478061755eaca8": status.artifact.digest in body should match '^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$'
You can see that it needs to begin with some sort of string + ":" + another string.
Looking at an example GitRepository I have in cluster...I can see...
digest: sha256:1c88565146a95dda6aa8ed198271816c3f609288ea5abd2a8628fc9a763e2a53
So, that first string looks like the Hash algorithm?
The code is looking for files.tar.gz in the testdata/archive directory, I can see a files.tar.gz.sum so I think you just forgot to add the file?
There was a problem hiding this comment.
Thank you Kevin for the information! 🙂 I will fix the issues now 👍
a7559fb to
c186ec9
Compare
It indexes gitrepos that are in matrix generator and dedups the list before returning it.
c186ec9 to
4e8dbdc
Compare
PR to fix repository changes aren't detected by indexing gitrepos that are in matrix generator and dedups the list before returning it.