mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-20 06:31:47 +00:00
Adapt tree command to HelmRelease v2beta2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
437a943677
commit
afcf12194d
1 changed files with 5 additions and 16 deletions
|
|
@ -208,27 +208,16 @@ func getHelmReleaseInventory(ctx context.Context, objectKey client.ObjectKey, ku
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
storageNamespace := hr.GetNamespace()
|
storageNamespace := hr.Status.StorageNamespace
|
||||||
if hr.Spec.StorageNamespace != "" {
|
latest := hr.Status.History.Latest()
|
||||||
storageNamespace = hr.Spec.StorageNamespace
|
if len(storageNamespace) == 0 || latest == nil {
|
||||||
}
|
// Skip release if it has no current
|
||||||
|
|
||||||
storageName := hr.GetName()
|
|
||||||
if hr.Spec.ReleaseName != "" {
|
|
||||||
storageName = hr.Spec.ReleaseName
|
|
||||||
} else if hr.Spec.TargetNamespace != "" {
|
|
||||||
storageName = strings.Join([]string{hr.Spec.TargetNamespace, hr.Name}, "-")
|
|
||||||
}
|
|
||||||
|
|
||||||
storageVersion := hr.Status.LastReleaseRevision
|
|
||||||
// skip release if it failed to install
|
|
||||||
if storageVersion < 1 {
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
storageKey := client.ObjectKey{
|
storageKey := client.ObjectKey{
|
||||||
Namespace: storageNamespace,
|
Namespace: storageNamespace,
|
||||||
Name: fmt.Sprintf("sh.helm.release.v1.%s.v%v", storageName, storageVersion),
|
Name: fmt.Sprintf("sh.helm.release.v1.%s.v%v", latest.Name, latest.Version),
|
||||||
}
|
}
|
||||||
|
|
||||||
storageSecret := &corev1.Secret{}
|
storageSecret := &corev1.Secret{}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue