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

Fix build error #143

Merged
merged 1 commit into from
Feb 6, 2020
Merged
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
12 changes: 6 additions & 6 deletions controllers/application_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ var _ = Describe("Application Reconciler", func() {
})

It("should update the application status, as well as the components' ownerReference", func() {
application := &appv1beta1.Application {
application := &appv1beta1.Application{
ObjectMeta: metav1.ObjectMeta{
Name: "application-01",
Name: "application-01",
Namespace: metav1.NamespaceDefault,
Labels: labelSet1,
Labels: labelSet1,
},
Spec: appv1beta1.ApplicationSpec{
Selector: &metav1.LabelSelector{MatchLabels: labelSet1},
Expand Down Expand Up @@ -306,7 +306,7 @@ var _ = Describe("Application Reconciler", func() {
})

func fetchUpdatedDeployment(ctx context.Context, deployment *apps.Deployment) {
key := types.NamespacedName {
key := types.NamespacedName{
Name: deployment.Name,
Namespace: deployment.Namespace,
}
Expand All @@ -315,7 +315,7 @@ func fetchUpdatedDeployment(ctx context.Context, deployment *apps.Deployment) {
}

func fetchUpdatedService(ctx context.Context, service *core.Service) {
key := types.NamespacedName {
key := types.NamespacedName{
Name: service.Name,
Namespace: service.Namespace,
}
Expand All @@ -324,7 +324,7 @@ func fetchUpdatedService(ctx context.Context, service *core.Service) {
}

func waitForComponentsAddedToStatus(ctx context.Context, app *appv1beta1.Application, expectedNames ...string) {
key := types.NamespacedName {
key := types.NamespacedName{
Name: app.Name,
Namespace: app.Namespace,
}
Expand Down
26 changes: 8 additions & 18 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,14 @@ func main() {
}))

syncPeriod := 2 * time.Minute
if namespace == "" {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
Port: 9443,
SyncPeriod: &syncPeriod,
})
} else {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
Port: 9443,
SyncPeriod: &syncPeriod,
Namespace: namespace,
})
}
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
Port: 9443,
SyncPeriod: &syncPeriod,
Namespace: namespace,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
Expand Down