Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Sloka <slokas@vmware.com>
  • Loading branch information
stevesloka committed May 11, 2021
1 parent 07a7f63 commit 041e9c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions cmd/contour/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"syscall"
"time"

"github.com/projectcontour/contour/internal/reconciler"
"github.com/projectcontour/contour/internal/controller"

envoy_server_v3 "github.com/envoyproxy/go-control-plane/pkg/server/v3"
contour_api_v1 "github.com/projectcontour/contour/apis/projectcontour/v1"
Expand Down Expand Up @@ -411,35 +411,31 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
// Only inform on GatewayAPI resources if Gateway API is found.
if ctx.Config.GatewayConfig != nil {
if clients.ResourcesExist(k8s.GatewayAPIResources()...) {
for _, r := range k8s.GatewayAPIResources() {
if err := informOnResource(clients, r, &dynamicHandler); err != nil {
log.WithError(err).WithField("resource", r).Fatal("failed to create informer")
}
}

// Setup a Manager
mgr, err := manager.New(controller_config.GetConfigOrDie(), manager.Options{})
if err != nil {
log.WithError(err).Fatal("unable to set up controller manager")
}

// Add the GatetwayAPI Scheme.
err = gatewayapi_v1alpha1.AddToScheme(mgr.GetScheme())
if err != nil {
log.WithError(err).Fatal("unable to add GatewayAPI to scheme.")
}

// Create and register the NewGatewayController controller with the manager.
if _, err := reconciler.NewGatewayController(mgr, &dynamicHandler, log.WithField("context", "gateway-controller")); err != nil {
if _, err := controller.NewGatewayController(mgr, &dynamicHandler, log.WithField("context", "gateway-controller")); err != nil {
log.WithError(err).Fatal("failed to create gateway-controller")
}

// Create and register the NewHTTPRouteController controller with the manager.
if _, err := reconciler.NewHTTPRouteController(mgr, &dynamicHandler, log.WithField("context", "httproute-controller")); err != nil {
if _, err := controller.NewHTTPRouteController(mgr, &dynamicHandler, log.WithField("context", "httproute-controller")); err != nil {
log.WithError(err).Fatal("failed to create httproute-controller")
}

// Create and register the NewTLSRouteController controller with the manager.
if _, err := reconciler.NewTLSRouteController(mgr, &dynamicHandler, log.WithField("context", "tlsroute-controller")); err != nil {
if _, err := controller.NewTLSRouteController(mgr, &dynamicHandler, log.WithField("context", "tlsroute-controller")); err != nil {
log.WithError(err).Fatal("failed to create tlsroute-controller")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package reconciler
package controller

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

package reconciler
package controller

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

package reconciler
package controller

import (
"context"
Expand Down

0 comments on commit 041e9c7

Please sign in to comment.