Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.8] Add cluster.cattle.io and rbac controllers, add missing import and sessions to the missing controllers #330

Open
wants to merge 1 commit into
base: release/v2.8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/codegen/generator/cleanup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ func main() {
}

func run() error {
if err := os.RemoveAll("./pkg/generated"); err != nil {
return err
}

if err := os.RemoveAll("../../clients/rancher/generated"); err != nil {
return err
}
Expand Down
31 changes: 28 additions & 3 deletions pkg/codegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/rancher/wrangler/v2/pkg/controller-gen/args"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"

capi "sigs.k8s.io/cluster-api/api/v1beta1"
)
Expand All @@ -44,9 +45,17 @@ func main() {
}

generatedControllerPaths := map[string]string{
"AppsControllerPath": "./pkg/generated/controllers/apps",
"CoreControllerPath": "./pkg/generated/controllers/core",
"ManagementControllerPath": "./pkg/generated/controllers/management.cattle.io",
"AppsControllerPath": "./pkg/generated/controllers/apps",
"CoreControllerPath": "./pkg/generated/controllers/core",
"RBACControllerPath": "./pkg/generated/controllers/rbac",
"ManagementControllerPath": "./pkg/generated/controllers/management.cattle.io",
"ClusterCattleControllerPath": "./pkg/generated/controllers/cluster.cattle.io",
"CatalogCattleControllerPath": "./pkg/generated/controllers/catalog.cattle.io",
"UpgradeCattleControllerPath": "./pkg/generated/controllers/upgrade.cattle.io",
"ProvisioningCattleControllerPath": "./pkg/generated/controllers/provisioning.cattle.io",
"FleetCattleControllerPath": "./pkg/generated/controllers/fleet.cattle.io",
"RKECattleControllerPath": "./pkg/generated/controllers/rke.cattle.io",
"ClusterXK8sControllerPath": "./pkg/generated/controllers/cluster.x-k8s.io",
}

controllergen.Run(args.Options{
Expand Down Expand Up @@ -79,6 +88,15 @@ func main() {
corev1.Pod{},
},
},
rbacv1.GroupName: {
Types: []interface{}{
rbacv1.Role{},
rbacv1.RoleBinding{},
rbacv1.ClusterRole{},
rbacv1.ClusterRoleBinding{},
},
OutputControllerPackageName: "rbac",
},
"management.cattle.io": {
PackageName: "management.cattle.io",
Types: []interface{}{
Expand All @@ -88,6 +106,13 @@ func main() {
managementv3.ClusterCatalog{},
},
},
"cluster.cattle.io": {
PackageName: "cluster.cattle.io",
Types: []interface{}{
// All structs with an embedded ObjectMeta field will be picked up
"./vendor/github.com/rancher/rancher/pkg/apis/cluster.cattle.io/v3",
},
},
"catalog.cattle.io": {
PackageName: "catalog.cattle.io",
Types: []interface{}{
Expand Down
6 changes: 3 additions & 3 deletions pkg/generated/controllers/catalog.cattle.io/factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pkg/generated/controllers/catalog.cattle.io/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/generated/controllers/catalog.cattle.io/v1/app.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions pkg/generated/controllers/catalog.cattle.io/v1/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions pkg/generated/controllers/cluster.cattle.io/factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions pkg/generated/controllers/cluster.cattle.io/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading