File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ func (cc ResourceConfiguratorChain) Configure(r *Resource) {
5252type BasePackages struct {
5353 APIVersion []string
5454 // Deprecated: Use ControllerMap instead.
55- Controller []string
55+ Controller []string
56+ // ControllerMap is a map from:
57+ // <API group name>/<resource name> to <provider package name>.
58+ // An example is "azure/resourcegroup: config", where "config" represents
59+ // the config package (provider family package).
5660 ControllerMap map [string ]string
5761}
5862
Original file line number Diff line number Diff line change @@ -207,7 +207,11 @@ func (r *PipelineRunner) Run(pc *config.Provider) []string { //nolint:gocyclo
207207 panic (errors .Wrapf (err , "cannot generate controller for resource %s" , name ))
208208 }
209209 controllerPkgMap [shortGroup ] = append (controllerPkgMap [shortGroup ], ctrlPkgPath )
210- controllerPkgMap [config .PackageNameMonolith ] = append (controllerPkgMap [config .PackageNameMonolith ], ctrlPkgPath )
210+ // if the controller is not already added as a base package controller
211+ // to the monolith provider.
212+ if len (pc .BasePackages .ControllerMap [strings .TrimPrefix (ctrlPkgPath , strings .TrimSuffix (r .ModulePathControllers , "/" )+ "/" )]) == 0 {
213+ controllerPkgMap [config .PackageNameMonolith ] = append (controllerPkgMap [config .PackageNameMonolith ], ctrlPkgPath )
214+ }
211215 if err := exampleGen .Generate (group , version , resources [name ]); err != nil {
212216 panic (errors .Wrapf (err , "cannot generate example manifest for resource %s" , name ))
213217 }
You can’t perform that action at this time.
0 commit comments