bootstrap: support legacy revision while polling
Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
|
||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
|
||||
"github.com/fluxcd/flux2/pkg/manifestgen/install"
|
||||
"github.com/fluxcd/flux2/pkg/manifestgen/sourcesecret"
|
||||
@@ -190,7 +191,7 @@ func kustomizationReconciled(ctx context.Context, kube client.Client, objKey cli
|
||||
}
|
||||
|
||||
// Confirm the given revision has been attempted by the controller
|
||||
if kustomization.Status.LastAttemptedRevision != expectRevision {
|
||||
if sourcev1.TransformLegacyRevision(kustomization.Status.LastAttemptedRevision) != expectRevision {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ func (b *PlainGitBootstrapper) ReportKustomizationHealth(ctx context.Context, op
|
||||
|
||||
b.logger.Waitingf("waiting for Kustomization %q to be reconciled", objKey.String())
|
||||
|
||||
expectRevision := fmt.Sprintf("%s/%s", options.Branch, head)
|
||||
expectRevision := fmt.Sprintf("%s@%s", options.Branch, git.Hash(head).Digest())
|
||||
var k kustomizev1.Kustomization
|
||||
if err := wait.PollImmediate(pollInterval, timeout, kustomizationReconciled(
|
||||
ctx, b.kube, objKey, &k, expectRevision),
|
||||
|
||||
Reference in New Issue
Block a user