Skip to content

Commit

Permalink
[operator] fix install wait v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody committed Dec 30, 2024
1 parent dfebc76 commit 30d9bd0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
27 changes: 12 additions & 15 deletions operator/pkg/install/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ func (i Installer) install(manifests []manifest.ManifestSet) error {
return err
}

disabledComponents := sets.New(slices.Map(
component.AllComponents,
func(cc component.Component) component.Name {
return cc.UserFacingName
},
)...)
dependencyWaitCh := dependenciesChs()
disabledComponents := sets.New(slices.Map(component.AllComponents, func(e component.Component) component.Name {
return e.UserFacingName
})...)
dependencyWaitCh := dependenciesChannels()
for _, mfs := range manifests {
c := mfs.Components
m := mfs.Manifests
Expand All @@ -68,6 +65,7 @@ func (i Installer) install(manifests []manifest.ManifestSet) error {
for _, ch := range componentDependencies[c] {
dependencyWaitCh[ch] <- struct{}{}
}

}()
}
for cc := range disabledComponents {
Expand Down Expand Up @@ -208,22 +206,21 @@ func (i Installer) prune(manifests []manifest.ManifestSet) error {
}

var componentDependencies = map[component.Name][]component.Name{
component.BaseComponentName: {},
component.AdminComponentName: {
component.BaseComponentName,
component.AdminComponentName: {},
component.BaseComponentName: {
component.AdminComponentName,
},
}

func dependenciesChs() map[component.Name]chan struct{} {
r := make(map[component.Name]chan struct{})
func dependenciesChannels() map[component.Name]chan struct{} {
ret := make(map[component.Name]chan struct{})
for _, parent := range componentDependencies {
for _, child := range parent {
r[child] = make(chan struct{}, 1)
ret[child] = make(chan struct{}, 1)
}
}
return r
return ret
}

func getOwnerLabels(dop values.Map, c string) map[string]string {
labels := make(map[string]string)

Expand Down
3 changes: 2 additions & 1 deletion operator/pkg/util/progress/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ func (i *Info) SetState(state InstallState) {
}
}

var testWriter *io.Writer

func createBar() *pb.ProgressBar {
var testWriter *io.Writer
bar := pb.New(0)
bar.Set(pb.Static, true)
if testWriter != nil {
Expand Down

0 comments on commit 30d9bd0

Please sign in to comment.