Skip to content

Commit

Permalink
Merge pull request #1729 from miguelsorianod/multigroup-controller-ap…
Browse files Browse the repository at this point in the history
…igroup-package-names

⚠ Generate controllers with API Group name as package names in multi-group projects (only Go plugin v3)
  • Loading branch information
k8s-ci-robot committed Oct 21, 2020
2 parents 1c04fab + d461cb8 commit 8c42281
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ func (f *Controller) SetTemplateDefaults() error {
//nolint:lll
const controllerTemplate = `{{ .Boilerplate }}
{{if and .MultiGroup .Resource.Group }}
package {{ .Resource.GroupPackageName }}
{{else}}
package controllers
{{end}}
import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ func (f *SuiteTest) GetCodeFragments() file.CodeFragmentsMap {

const controllerSuiteTestTemplate = `{{ .Boilerplate }}
{{if and .MultiGroup .Resource.Group }}
package {{ .Resource.GroupPackageName }}
{{else}}
package controllers
{{end}}
import (
"path/filepath"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package crew

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package crew

import (
"path/filepath"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package foopolicy

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package foopolicy

import (
"path/filepath"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package seacreatures

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package seacreatures

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package seacreatures

import (
"path/filepath"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package ship

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package ship

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package ship

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers
package ship

import (
"path/filepath"
Expand Down

0 comments on commit 8c42281

Please sign in to comment.