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

Remove ingress and node-services during reconcile #674

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
25 changes: 25 additions & 0 deletions controllers/solrcloud_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,21 @@ func (r *SolrCloudReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
}
}
}
} else {
janhoy marked this conversation as resolved.
Show resolved Hide resolved
// Need no individual services per onde, delete if found
for _, nodeName := range solrNodeNames {
serviceName := nodeName
foundService := &corev1.Service{}
err = r.Get(ctx, types.NamespacedName{Name: serviceName, Namespace: instance.Namespace}, foundService)
if err == nil {
err = r.Delete(ctx, foundService)
janhoy marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return requeueOrNot, err
}
} else if !errors.IsNotFound(err) {
return requeueOrNot, err
}
}
}

// Generate HeadlessService
Expand Down Expand Up @@ -347,6 +362,16 @@ func (r *SolrCloudReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
if err != nil {
return requeueOrNot, err
}
} else {
// If ingress exists, delete it
foundIngress := &netv1.Ingress{}
err = r.Get(ctx, types.NamespacedName{Name: instance.CommonIngressName(), Namespace: instance.GetNamespace()}, foundIngress)
if err == nil {
err = r.Delete(ctx, foundIngress)
if err != nil {
return requeueOrNot, err
}
}
}

var statefulSet *appsv1.StatefulSet
Expand Down
7 changes: 7 additions & 0 deletions helm/solr-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ annotations:
url: https://github.com/apache/solr-operator/issues/624
- name: Github PR
url: https://github.com/apache/solr-operator/pull/648
- kind: fixed
description: The operator will now delete ingress and per-node services when external ingress is disabled.
links:
- name: Github Issue
url: https://github.com/apache/solr-operator/issues/673
- name: Github PR
url: https://github.com/apache/solr-operator/pull/674
artifacthub.io/images: |
- name: solr-operator
image: apache/solr-operator:v0.9.0-prerelease
Expand Down
Loading