Skip to content

Commit

Permalink
refactor: Setup function per api group
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Blatt (external expert on behalf of DB Netz) <[email protected]>
  • Loading branch information
MisterMX authored and threadproc committed Sep 1, 2023
1 parent 44e6e2d commit 3d08fef
Show file tree
Hide file tree
Showing 91 changed files with 2,175 additions and 387 deletions.
33 changes: 33 additions & 0 deletions pkg/controller/acm/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright 2023 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package acm

import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/crossplane/crossplane-runtime/pkg/controller"

"github.com/crossplane-contrib/provider-aws/pkg/utils/setup"
)

// Setup acm controllers.
func Setup(mgr ctrl.Manager, o controller.Options) error {
return setup.SetupControllers(
mgr, o,
SetupCertificate,
)
}
36 changes: 36 additions & 0 deletions pkg/controller/acmpca/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2023 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package acmpca

import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/crossplane/crossplane-runtime/pkg/controller"

"github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthority"
"github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthoritypermission"
"github.com/crossplane-contrib/provider-aws/pkg/utils/setup"
)

// Setup acm controllers.
func Setup(mgr ctrl.Manager, o controller.Options) error {
return setup.SetupControllers(
mgr, o,
certificateauthority.SetupCertificateAuthority,
certificateauthoritypermission.SetupCertificateAuthorityPermission,
)
}
38 changes: 38 additions & 0 deletions pkg/controller/apigateway/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Copyright 2023 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package apigateway

import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/crossplane/crossplane-runtime/pkg/controller"

"github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/method"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/resource"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/restapi"
"github.com/crossplane-contrib/provider-aws/pkg/utils/setup"
)

// Setup apigateway controllers.
func Setup(mgr ctrl.Manager, o controller.Options) error {
return setup.SetupControllers(
mgr, o,
method.SetupMethod,
resource.SetupResource,
restapi.SetupRestAPI,
)
}
56 changes: 56 additions & 0 deletions pkg/controller/apigatewayv2/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
Copyright 2023 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package apigatewayv2

import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/crossplane/crossplane-runtime/pkg/controller"

"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/api"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/apimapping"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/authorizer"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/deployment"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/domainname"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/integration"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/integrationresponse"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/model"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/route"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/routeresponse"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/stage"
"github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/vpclink"
"github.com/crossplane-contrib/provider-aws/pkg/utils/setup"
)

// Setup apigatewayv2 controllers.
func Setup(mgr ctrl.Manager, o controller.Options) error {
return setup.SetupControllers(
mgr, o,
api.SetupAPI,
apimapping.SetupAPIMapping,
authorizer.SetupAuthorizer,
deployment.SetupDeployment,
domainname.SetupDomainName,
integration.SetupIntegration,
integrationresponse.SetupIntegrationResponse,
model.SetupModel,
route.SetupRoute,
routeresponse.SetupRouteResponse,
stage.SetupStage,
vpclink.SetupVPCLink,
)
}
34 changes: 34 additions & 0 deletions pkg/controller/athena/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
Copyright 2023 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package athena

import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/crossplane/crossplane-runtime/pkg/controller"

"github.com/crossplane-contrib/provider-aws/pkg/controller/athena/workgroup"
"github.com/crossplane-contrib/provider-aws/pkg/utils/setup"
)

// Setup athena controllers.
func Setup(mgr ctrl.Manager, o controller.Options) error {
return setup.SetupControllers(
mgr, o,
workgroup.SetupWorkGroup,
)
}
34 changes: 34 additions & 0 deletions pkg/controller/autoscaling/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
Copyright 2023 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package autoscaling

import (
ctrl "sigs.k8s.io/controller-runtime"

"github.com/crossplane/crossplane-runtime/pkg/controller"

"github.com/crossplane-contrib/provider-aws/pkg/controller/autoscaling/autoscalinggroup"
"github.com/crossplane-contrib/provider-aws/pkg/utils/setup"
)

// Setup autoscaling controllers.
func Setup(mgr ctrl.Manager, o controller.Options) error {
return setup.SetupControllers(
mgr, o,
autoscalinggroup.SetupAutoScalingGroup,
)
}
Loading

0 comments on commit 3d08fef

Please sign in to comment.