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

not checking reachability if internal #20

Merged
merged 1 commit into from
May 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
1 change: 1 addition & 0 deletions api/v1beta1/loadbalancer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type LoadbalancerStatus struct {

type BackendStatus struct {
Phase BackendPhase `json:"phase"`
Internal bool `json:"internal"`
Endpoint BackendEndpoint `json:"endpoint"`
Listeners []BackendListener `json:"listeners"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ spec:
- DNS
- IP
type: object
internal:
type: boolean
listeners:
items:
properties:
Expand All @@ -302,6 +304,7 @@ spec:
type: string
required:
- endpoint
- internal
- listeners
- phase
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ spec:
- DNS
- IP
type: object
internal:
type: boolean
listeners:
items:
properties:
Expand All @@ -328,6 +330,7 @@ spec:
type: string
required:
- endpoint
- internal
- listeners
- phase
type: object
Expand Down Expand Up @@ -355,6 +358,8 @@ spec:
- DNS
- IP
type: object
internal:
type: boolean
listeners:
items:
properties:
Expand All @@ -371,6 +376,7 @@ spec:
type: string
required:
- endpoint
- internal
- listeners
- phase
type: object
Expand Down
8 changes: 5 additions & 3 deletions controllers/awsbackend_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ func (r *AWSBackendReconciler) ReconcileVerify(ctx context.Context, backend load
return ctrl.Result{Requeue: true}, err
}
backend.Status = status
reached, err := backend.ReachableAll()
if err != nil || !reached {
return ctrl.Result{Requeue: true}, err
if backend.Status.Internal != true {
reached, err := backend.ReachableAll()
if err != nil || !reached {
return ctrl.Result{Requeue: true}, err
}
}
backend.Status.Phase = loadbalancerv1beta1.BackendPhaseReady
return ctrl.Result{}, r.Update(ctx, &backend)
Expand Down
1 change: 1 addition & 0 deletions pkg/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (t TerraformClient) GetStatus() (v1beta1.BackendStatus, error) {
status := t.awsBackend.Status.DeepCopy()
status.Endpoint = endpoint
status.Listeners = listeners
status.Internal = t.awsBackend.Spec.Internal
return *status, nil
}

Expand Down