diff --git a/components/automate-deployment/pkg/server/server.go b/components/automate-deployment/pkg/server/server.go index 9c8e0a703f2..3a9dc977c24 100644 --- a/components/automate-deployment/pkg/server/server.go +++ b/components/automate-deployment/pkg/server/server.go @@ -1193,49 +1193,55 @@ func (s *server) isCompatibleForConverge(v1, v2 string) bool { // the configured channel. If neither are available, an error is // returned. func (s *server) nextManifest() (*manifest.A2, error) { - if s.shouldFetchManifest() { - ctx := context.Background() - currentVersion := s.deployment.CurrentReleaseManifest.Version() - _, _, nextVersion, err := s.releaseManifestProvider.GetCompatibleVersion(ctx, s.deployment.Channel(), currentVersion) + if !s.shouldFetchManifest() { + return s.deployment.CurrentReleaseManifest, nil + } + + ctx := context.Background() + var nextManifestVersion string + var err error + + if s.deployment.CurrentReleaseManifest == nil { + nextManifest, err := s.releaseManifestProvider.GetCurrentManifest(context.Background(), s.deployment.Channel()) if err != nil { logrus.WithError(err).Error("Could not fetch manifest") if s.deployment.CurrentReleaseManifest == nil { return nil, errors.New("Release manifest not available") } - - // Continue with last manifest even in the - // case of an error because we still want to - // converge + // Continue with last manifest even in the case of an error because we still want to converge logrus.Info("Continuing converge with last known manifest") return s.deployment.CurrentReleaseManifest, nil } + return nextManifest, nil + } - // Never use an older manifest. If the user has - // explicitly upgraded to a manifest that is newer - // than what is the channel, we keep using our current - // manifest until the channel catches up. - if s.deployment.CurrentReleaseManifest != nil && s.isCompatibleForConverge(s.deployment.CurrentReleaseManifest.Version(), nextVersion) { - m, err := s.releaseManifestProvider.GetManifest(ctx, nextVersion) - if err != nil { - logrus.WithError(err).Error("Could not fetch manifest") - if s.deployment.CurrentReleaseManifest == nil { - return nil, errors.New("Release manifest not available") - } + currentVersion := s.deployment.CurrentReleaseManifest.Version() + _, _, nextManifestVersion, err = s.releaseManifestProvider.GetCompatibleVersion(ctx, s.deployment.Channel(), currentVersion) - // Continue with last manifest even in the - // case of an error because we still want to - // converge - logrus.Info("Continuing converge with last known manifest") - return s.deployment.CurrentReleaseManifest, nil + if err != nil { + logrus.WithError(err).Error("Could not fetch next manifest version") + + // Continue with last manifest even in the case of an error because we still want to converge + logrus.Info("Continuing converge with last known manifest") + return s.deployment.CurrentReleaseManifest, nil + } + // Never use an older manifest. If the user has explicitly upgraded to a manifest that is newer + // than what is the channel, we keep using our current manifest until the channel catches up. + if s.isCompatibleForConverge(s.deployment.CurrentReleaseManifest.Version(), nextManifestVersion) { + m, err := s.releaseManifestProvider.GetManifest(ctx, nextManifestVersion) + if err != nil { + logrus.WithError(err).Error("Could not fetch manifest") + if s.deployment.CurrentReleaseManifest == nil { + return nil, errors.New("Release manifest not available") } - return m, nil + // Continue with last manifest even in the case of an error because we still want to converge + logrus.Info("Continuing converge with last known manifest") + return s.deployment.CurrentReleaseManifest, nil } - - logrus.Infof("The next available version %s in channel %q requires a manual upgrade with --major flag from the current version %s. Thus, ignoring auto-upgrade", - s.deployment.Channel(), - nextVersion, - s.deployment.CurrentReleaseManifest.Version()) + return m, nil } + logrus.Infof("The next available version %s in channel %q requires a manual upgrade with --major flag from the current version %s. Thus, ignoring auto-upgrade", + s.deployment.Channel(), nextManifestVersion, s.deployment.CurrentReleaseManifest.Version()) return s.deployment.CurrentReleaseManifest, nil } diff --git a/components/automate-ui/src/app/ui.component.ts b/components/automate-ui/src/app/ui.component.ts index 893b62c9dec..781e4428b43 100644 --- a/components/automate-ui/src/app/ui.component.ts +++ b/components/automate-ui/src/app/ui.component.ts @@ -87,7 +87,8 @@ export class UIComponent implements OnInit, AfterViewChecked { localStorage.setItem('manual-upgrade-banner', this.booleanToString(true)); this.showBanner = true; } else { - this.showBanner = this.stringToBoolean(bannerStorage); + // this.showBanner = this.stringToBoolean(bannerStorage); + this.showBanner = this.stringToBoolean('false'); } this.store.dispatch(new CreateNotification({ type: Type.error,