Skip to content

Commit d1a9cb5

Browse files
authored
fix 'failed to find preflight specs' error (#361)
* fix the 'failed to find preflight specs' error to include the addon name * update embedded-cluster-utils
1 parent 5c13ddd commit d1a9cb5

File tree

6 files changed

+17
-2
lines changed

6 files changed

+17
-2
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/jedib0t/go-pretty v4.3.0+incompatible
1212
github.com/k0sproject/dig v0.2.0
1313
github.com/replicatedhq/embedded-cluster-operator v0.22.5
14-
github.com/replicatedhq/embedded-cluster-utils v0.0.0-20240214174642-c4acfad05b93
14+
github.com/replicatedhq/embedded-cluster-utils v0.0.0-20240214185439-68a1dfae58be
1515
github.com/replicatedhq/kotskinds v0.0.0-20230724164735-f83482cc9cfe
1616
github.com/replicatedhq/troubleshoot v0.83.0
1717
github.com/sirupsen/logrus v1.9.3

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ github.com/replicatedhq/embedded-cluster-operator v0.22.5 h1:7xW/dlNoJGoJykiJW7i
239239
github.com/replicatedhq/embedded-cluster-operator v0.22.5/go.mod h1:hBLJHrVuUW0X9444FJm+dQegfFDdmLAzIyDz6XhhSOc=
240240
github.com/replicatedhq/embedded-cluster-utils v0.0.0-20240214174642-c4acfad05b93 h1:IE1+6/Wn34nJ9ReOyQZXP8uwNB5YezZvs+JkgdUiYEI=
241241
github.com/replicatedhq/embedded-cluster-utils v0.0.0-20240214174642-c4acfad05b93/go.mod h1:4JmMC2CwMCLxq05GEW3XSPPVotqyamAF/omrbB3pH+c=
242+
github.com/replicatedhq/embedded-cluster-utils v0.0.0-20240214185439-68a1dfae58be h1:wuHmBUANuvCUeX4WmUVf7AWOlRTJMAmAR/GsYOY0Jdo=
243+
github.com/replicatedhq/embedded-cluster-utils v0.0.0-20240214185439-68a1dfae58be/go.mod h1:4JmMC2CwMCLxq05GEW3XSPPVotqyamAF/omrbB3pH+c=
242244
github.com/replicatedhq/kotskinds v0.0.0-20230724164735-f83482cc9cfe h1:3AJInd06UxzqHmgy8+24CPsT2tYSE0zToJZyuX9q+MA=
243245
github.com/replicatedhq/kotskinds v0.0.0-20230724164735-f83482cc9cfe/go.mod h1:QjhIUu3+OmHZ09u09j3FCoTt8F3BYtQglS+OLmftu9I=
244246
github.com/replicatedhq/troubleshoot v0.83.0 h1:rRG0sL+Ku9w8TJ5AH6kZb7yxeFQoODOaTAUs8yrkwJE=

pkg/addons/adminconsole/adminconsole.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ func (a *AdminConsole) Version() (map[string]string, error) {
102102
return map[string]string{"AdminConsole": "v" + Version}, nil
103103
}
104104

105+
func (a *AdminConsole) Name() string {
106+
return "AdminConsole"
107+
}
108+
105109
// GetProtectedFields returns the helm values that are not overwritten when upgrading
106110
func (a *AdminConsole) GetProtectedFields() map[string][]string {
107111
return map[string][]string{releaseName: protectedFields}

pkg/addons/applier.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
// AddOn is the interface that all addons must implement.
2626
type AddOn interface {
2727
Version() (map[string]string, error)
28+
Name() string
2829
HostPreflights() (*v1beta2.HostPreflightSpec, error)
2930
GenerateHelmConfig(onlyDefaults bool) ([]v1beta1.Chart, []v1beta1.Repository, error)
3031
Outro(context.Context, client.Client) error
@@ -111,7 +112,7 @@ func (a *Applier) HostPreflights() (*v1beta2.HostPreflightSpec, error) {
111112
for _, addon := range addons {
112113
hpf, err := addon.HostPreflights()
113114
if err != nil {
114-
return nil, fmt.Errorf("unable to get preflights for %s: %w", addon, err)
115+
return nil, fmt.Errorf("unable to get preflights for %s: %w", addon.Name(), err)
115116
} else if hpf == nil {
116117
continue
117118
}

pkg/addons/embeddedclusteroperator/embeddedclusteroperator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func (e *EmbeddedClusterOperator) Version() (map[string]string, error) {
5656
return map[string]string{"EmbeddedClusterOperator": "v" + Version}, nil
5757
}
5858

59+
func (a *EmbeddedClusterOperator) Name() string {
60+
return "EmbeddedClusterOperator"
61+
}
62+
5963
// HostPreflights returns the host preflight objects found inside the EmbeddedClusterOperator
6064
// Helm Chart, this is empty as there is no host preflight on there.
6165
func (e *EmbeddedClusterOperator) HostPreflights() (*v1beta2.HostPreflightSpec, error) {

pkg/addons/openebs/openebs.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ func (o *OpenEBS) Version() (map[string]string, error) {
4848
return map[string]string{"OpenEBS": "v" + Version}, nil
4949
}
5050

51+
func (a *OpenEBS) Name() string {
52+
return "OpenEBS"
53+
}
54+
5155
// HostPreflights returns the host preflight objects found inside the OpenEBS
5256
// Helm Chart, this is empty as there is no host preflight on there.
5357
func (o *OpenEBS) HostPreflights() (*v1beta2.HostPreflightSpec, error) {

0 commit comments

Comments
 (0)