@@ -23,7 +23,6 @@ import (
23
23
"strings"
24
24
25
25
"github.com/operator-framework/operator-sdk/internal/util/fileutil"
26
- "github.com/operator-framework/operator-sdk/pkg/scaffold"
27
26
28
27
log "github.com/sirupsen/logrus"
29
28
)
@@ -60,24 +59,23 @@ func GenerateCombinedNamespacedManifest() (*os.File, error) {
60
59
}
61
60
defer file .Close ()
62
61
63
- sa , err := ioutil .ReadFile (filepath .Join (scaffold . DeployDir , scaffold . ServiceAccountYamlFile ))
62
+ sa , err := ioutil .ReadFile (filepath .Join ("deploy" , "service_account.yaml" ))
64
63
if err != nil {
65
64
log .Warnf ("could not find the serviceaccount manifest: (%v)" , err )
66
65
}
67
- role , err := ioutil .ReadFile (filepath .Join (scaffold . DeployDir , scaffold . RoleYamlFile ))
66
+ role , err := ioutil .ReadFile (filepath .Join ("deploy" , "role.yaml" ))
68
67
if err != nil {
69
68
log .Warnf ("could not find role manifest: (%v)" , err )
70
69
}
71
- roleBinding , err := ioutil .ReadFile (filepath .Join (scaffold . DeployDir , scaffold . RoleBindingYamlFile ))
70
+ roleBinding , err := ioutil .ReadFile (filepath .Join ("deploy" , "role_binding.yaml" ))
72
71
if err != nil {
73
72
log .Warnf ("could not find role_binding manifest: (%v)" , err )
74
73
}
75
- operator , err := ioutil .ReadFile (filepath .Join (scaffold . DeployDir , scaffold . OperatorYamlFile ))
74
+ operator , err := ioutil .ReadFile (filepath .Join ("deploy" , "operator.yaml" ))
76
75
if err != nil {
77
76
return nil , fmt .Errorf ("could not find operator manifest: (%v)" , err )
78
77
}
79
- combined := []byte {}
80
- combined = CombineManifests (combined , sa , role , roleBinding , operator )
78
+ combined := CombineManifests ([]byte {}, sa , role , roleBinding , operator )
81
79
82
80
if err := file .Chmod (os .FileMode (fileutil .DefaultFileMode )); err != nil {
83
81
return nil , fmt .Errorf ("could not chown temporary namespaced manifest file: (%v)" , err )
@@ -100,16 +98,17 @@ func GenerateCombinedGlobalManifest() (*os.File, error) {
100
98
}
101
99
defer file .Close ()
102
100
103
- files , err := ioutil .ReadDir (scaffold .CrdsDir )
101
+ crdsDir := filepath .Join ("deploy" , "crds" )
102
+ files , err := ioutil .ReadDir (crdsDir )
104
103
if err != nil {
105
104
return nil , fmt .Errorf ("could not read deploy directory: (%v)" , err )
106
105
}
107
106
combined := []byte {}
108
107
for _ , file := range files {
109
108
if strings .HasSuffix (file .Name (), "crd.yaml" ) {
110
- fileBytes , err := ioutil .ReadFile (filepath .Join (scaffold . CrdsDir , file .Name ()))
109
+ fileBytes , err := ioutil .ReadFile (filepath .Join (crdsDir , file .Name ()))
111
110
if err != nil {
112
- return nil , fmt .Errorf ("could not read file %s: (%v)" , filepath .Join (scaffold . CrdsDir , file .Name ()), err )
111
+ return nil , fmt .Errorf ("could not read file %s: (%v)" , filepath .Join (crdsDir , file .Name ()), err )
113
112
}
114
113
combined = CombineManifests (combined , fileBytes )
115
114
}
0 commit comments