@@ -637,6 +637,8 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
637637 return fmt .Errorf ("error constructing chart tree: %w" , err )
638638 }
639639
640+ notes := chartTree .Notes ()
641+
640642 var prevRelGeneralResources []* resrc.GeneralResource
641643 if prevReleaseFound {
642644 prevRelGeneralResources = prevRelease .GeneralResources ()
@@ -679,7 +681,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
679681 }
680682
681683 log .Default .Info (ctx , "Constructing new release" )
682- newRel , err := rls .NewRelease (releaseName , releaseNamespace .Name (), newRevision , chartTree .ReleaseValues (), chartTree .LegacyChart (), resProcessor .ReleasableHookResources (), resProcessor .ReleasableGeneralResources (), chartTree . Notes () , rls.ReleaseOptions {
684+ newRel , err := rls .NewRelease (releaseName , releaseNamespace .Name (), newRevision , chartTree .ReleaseValues (), chartTree .LegacyChart (), resProcessor .ReleasableHookResources (), resProcessor .ReleasableGeneralResources (), notes , rls.ReleaseOptions {
683685 FirstDeployed : firstDeployed ,
684686 Mapper : clientFactory .Mapper (),
685687 })
@@ -746,6 +748,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
746748 if useless , err := plan .Useless (); err != nil {
747749 return fmt .Errorf ("error checking if deploy plan will do nothing useful: %w" , err )
748750 } else if useless {
751+ printNotes (ctx , notes )
749752 log .Default .Info (ctx , color.Style {color .Bold , color .Green }.Render ("Skipped release" )+ " %q (namespace: %q): cluster resources already as desired" , releaseName , releaseNamespace .Name ())
750753 return nil
751754 }
@@ -842,7 +845,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
842845 nonCriticalErrs = append (nonCriticalErrs , noncriterrs ... )
843846
844847 if cmdData .AutoRollback && prevDeployedReleaseFound {
845- wcompops , wfailops , wcancops , criterrs , noncriterrs = runRollbackPlan (
848+ wcompops , wfailops , wcancops , notes , criterrs , noncriterrs = runRollbackPlan (
846849 ctx ,
847850 taskStore ,
848851 logStore ,
@@ -889,6 +892,10 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
889892 }
890893 }
891894
895+ if len (criticalErrs ) == 0 {
896+ printNotes (ctx , notes )
897+ }
898+
892899 if len (criticalErrs ) > 0 {
893900 return utls .Multierrorf ("failed release %q (namespace: %q)" , append (criticalErrs , nonCriticalErrs ... ), releaseName , releaseNamespace .Name ())
894901 } else if len (nonCriticalErrs ) > 0 {
@@ -1006,7 +1013,7 @@ func runRollbackPlan(
10061013 rollbackGraphPath string ,
10071014 networkParallelism int ,
10081015) (
1009- worthyCompletedOps , worthyFailedOps , worthyCanceledOps []opertn.Operation ,
1016+ worthyCompletedOps , worthyFailedOps , worthyCanceledOps []opertn.Operation , notes string ,
10101017 criticalErrs , nonCriticalErrs []error ,
10111018) {
10121019 log .Default .Info (ctx , "Processing rollback resources" )
@@ -1042,7 +1049,7 @@ func runRollbackPlan(
10421049 )
10431050
10441051 if err := resProcessor .Process (ctx ); err != nil {
1045- return nil , nil , nil , []error {fmt .Errorf ("error processing rollback resources: %w" , err )}, nonCriticalErrs
1052+ return nil , nil , nil , "" , []error {fmt .Errorf ("error processing rollback resources: %w" , err )}, nonCriticalErrs
10461053 }
10471054
10481055 rollbackRevision := failedRevision + 1
@@ -1063,7 +1070,7 @@ func runRollbackPlan(
10631070 },
10641071 )
10651072 if err != nil {
1066- return nil , nil , nil , []error {fmt .Errorf ("error constructing rollback release: %w" , err )}, nonCriticalErrs
1073+ return nil , nil , nil , "" , []error {fmt .Errorf ("error constructing rollback release: %w" , err )}, nonCriticalErrs
10671074 }
10681075
10691076 log .Default .Info (ctx , "Constructing rollback plan" )
@@ -1094,7 +1101,7 @@ func runRollbackPlan(
10941101
10951102 rollbackPlan , err := rollbackPlanBuilder .Build (ctx )
10961103 if err != nil {
1097- return nil , nil , nil , []error {fmt .Errorf ("error building rollback plan: %w" , err )}, nonCriticalErrs
1104+ return nil , nil , nil , "" , []error {fmt .Errorf ("error building rollback plan: %w" , err )}, nonCriticalErrs
10981105 }
10991106
11001107 if saveRollbackGraph {
@@ -1104,10 +1111,10 @@ func runRollbackPlan(
11041111 }
11051112
11061113 if useless , err := rollbackPlan .Useless (); err != nil {
1107- return nil , nil , nil , []error {fmt .Errorf ("error checking if rollback plan will do nothing useful: %w" , err )}, nonCriticalErrs
1114+ return nil , nil , nil , "" , []error {fmt .Errorf ("error checking if rollback plan will do nothing useful: %w" , err )}, nonCriticalErrs
11081115 } else if useless {
11091116 log .Default .Info (ctx , color.Style {color .Bold , color .Green }.Render ("Skipped rollback release" )+ " %q (namespace: %q): cluster resources already as desired" , releaseName , releaseNamespace .Name ())
1110- return nil , nil , nil , criticalErrs , nonCriticalErrs
1117+ return nil , nil , nil , "" , criticalErrs , nonCriticalErrs
11111118 }
11121119
11131120 log .Default .Info (ctx , "Executing rollback plan" )
@@ -1166,7 +1173,7 @@ func runRollbackPlan(
11661173 nonCriticalErrs = append (nonCriticalErrs , noncriterrs ... )
11671174 }
11681175
1169- return worthyCompletedOps , worthyFailedOps , worthyCanceledOps , criticalErrs , nonCriticalErrs
1176+ return worthyCompletedOps , worthyFailedOps , worthyCanceledOps , rollbackRel . Notes (), criticalErrs , nonCriticalErrs
11701177}
11711178
11721179func printTables (ctx context.Context , tablesBuilder * track.TablesBuilder ) {
@@ -1314,3 +1321,13 @@ func checkHelm3ReleaseExists(ctx context.Context, releaseName, namespace string,
13141321
13151322 return foundHelm3Release , nil
13161323}
1324+
1325+ func printNotes (ctx context.Context , notes string ) {
1326+ if notes == "" {
1327+ return
1328+ }
1329+
1330+ log .Default .InfoBlock (ctx , color.Style {color .Bold , color .Blue }.Render ("Release notes" )).Do (func () {
1331+ log .Default .Info (ctx , notes )
1332+ })
1333+ }
0 commit comments