mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-17 05:01:47 +00:00
Merge pull request #5564 from fluxcd/backport-5563-to-release/v2.7.x
[release/v2.7.x] Fix `flux migrate -f` not considering kind comments
This commit is contained in:
commit
de92e95a50
4 changed files with 5 additions and 4 deletions
|
|
@ -623,7 +623,8 @@ func (f *FileSystemMigrator) detectFileUpgrades(file string) ([]APIUpgrade, erro
|
||||||
if idx == -1 {
|
if idx == -1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
kind := strings.TrimSpace(kindLine[idx+len(kindPrefix):])
|
kindValuePrefix := strings.TrimSpace(kindLine[idx+len(kindPrefix):])
|
||||||
|
kind := strings.Split(kindValuePrefix, " ")[0]
|
||||||
|
|
||||||
// Build GroupKind.
|
// Build GroupKind.
|
||||||
gk := schema.GroupKind{
|
gk := schema.GroupKind{
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ func TestFileSystemMigrator(t *testing.T) {
|
||||||
for _, wf := range tt.writtenFiles {
|
for _, wf := range tt.writtenFiles {
|
||||||
b, err := os.ReadFile(wf.goldenFile)
|
b, err := os.ReadFile(wf.goldenFile)
|
||||||
g.Expect(err).ToNot(HaveOccurred())
|
g.Expect(err).ToNot(HaveOccurred())
|
||||||
g.Expect(fileSystem.writtenFiles[wf.file]).To(Equal(b),
|
g.Expect(string(fileSystem.writtenFiles[wf.file])).To(Equal(string(b)),
|
||||||
"file %s does not match golden file %s", wf.file, wf.goldenFile)
|
"file %s does not match golden file %s", wf.file, wf.goldenFile)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ spec:
|
||||||
wait: true
|
wait: true
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- apiVersion: image.toolkit.fluxcd.io/v1 # update this from v1beta1
|
- apiVersion: image.toolkit.fluxcd.io/v1 # update this from v1beta1
|
||||||
kind: ImageRepository
|
kind: ImageRepository # there can be comments here too
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ spec:
|
||||||
wait: true
|
wait: true
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- apiVersion: image.toolkit.fluxcd.io/v1beta1 # update this from v1beta1
|
- apiVersion: image.toolkit.fluxcd.io/v1beta1 # update this from v1beta1
|
||||||
kind: ImageRepository
|
kind: ImageRepository # there can be comments here too
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue