Skip to content

Commit 03f70bb

Browse files
committed
Revert "Add sandbox option to VerticaScrutinize, to run using sandbox hosts instead of main cluster (#1183)"
This reverts commit d9f59a7.
1 parent cb8efdc commit 03f70bb

16 files changed

+2
-331
lines changed

api/v1beta1/verticascrutinize_types.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ type VerticaScrutinizeSpec struct {
8383
// +operator-sdk:csv:customresourcedefinitions:type=spec
8484
// A list of labels that will be added to the scrutinize pod.
8585
Labels map[string]string `json:"labels,omitempty"`
86-
87-
// +operator-sdk:csv:customresourcedefinitions:type=spec
88-
// Set scrutinize to run using the hosts of a single sandbox
89-
// If this is omitted, it will run using the main cluster
90-
Sandbox string `json:"sandbox,omitempty"`
9186
}
9287

9388
// VerticaScrutinizeStatus defines the observed state of VerticaScrutinize

pkg/controllers/vscr/scrutinizepod_reconciler.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,14 @@ func (s *ScrutinizePodReconciler) Reconcile(ctx context.Context, _ *ctrl.Request
9595
// to the vcluster scrutinize CLI
9696
func (s *ScrutinizePodReconciler) collectInfoFromVdb(ctx context.Context) (ctrl.Result, error) {
9797
finder := iter.MakeSubclusterFinder(s.VRec.Client, s.Vdb)
98-
99-
cluster := v1.MainCluster
100-
if s.Vscr.Spec.Sandbox != "" {
101-
cluster = s.Vscr.Spec.Sandbox
102-
}
103-
104-
pods, err := finder.FindPods(ctx, iter.FindExisting, cluster)
98+
pods, err := finder.FindPods(ctx, iter.FindExisting, v1.MainCluster)
10599
if err != nil {
106100
return ctrl.Result{}, err
107101
}
108102

109103
hosts := s.getHostList(pods.Items)
110104
if len(hosts) == 0 {
111-
s.Log.Info("could not find any pod with NMA running, requeue reconciliation", "Cluster", cluster)
105+
s.Log.Info("could not find any pod with NMA running, requeue reconciliation")
112106
return ctrl.Result{Requeue: true}, nil
113107
}
114108
s.ScrArgs = &ScrutinizeCmdArgs{}

pkg/controllers/vscr/scrutinizepod_reconciler_test.go

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -160,55 +160,4 @@ var _ = Describe("scrutinizepod_reconciler", func() {
160160
Expect(args).Should(ContainElement(ContainSubstring("--log-age-oldest-time")))
161161
Expect(args).Should(ContainElement(ContainSubstring("--log-age-newest-time")))
162162
})
163-
164-
It("should create scrutinize pod for sandbox", func() {
165-
vdb := v1.MakeVDBForScrutinize()
166-
167-
const scName = "sc1"
168-
const sbName = "sb1"
169-
170-
vdb.Spec.Subclusters = append(vdb.Spec.Subclusters, v1.Subcluster{
171-
Name: scName,
172-
Size: 3,
173-
})
174-
vdb.Spec.Sandboxes = []v1.Sandbox{
175-
{Name: sbName, Subclusters: []v1.SandboxSubcluster{{Name: scName}}},
176-
}
177-
178-
test.CreateVDB(ctx, k8sClient, vdb)
179-
defer test.DeleteVDB(ctx, k8sClient, vdb)
180-
181-
vdb.Status.Sandboxes = []v1.SandboxStatus{
182-
{Name: sbName, Subclusters: []string{scName}},
183-
}
184-
185-
test.CreatePods(ctx, k8sClient, vdb, test.AllPodsRunning)
186-
defer test.DeletePods(ctx, k8sClient, vdb)
187-
188-
sc := &vdb.Spec.Subclusters[1]
189-
cntStatuses := []corev1.ContainerStatus{
190-
{Name: names.NMAContainer, Ready: true},
191-
}
192-
test.SetPodContainerStatus(ctx, k8sClient, names.GenPodName(vdb, sc, 0), cntStatuses)
193-
194-
vscr := v1beta1.MakeVscr()
195-
vscr.Spec.Sandbox = sbName
196-
v1beta1_test.CreateVSCR(ctx, k8sClient, vscr)
197-
defer v1beta1_test.DeleteVSCR(ctx, k8sClient, vscr)
198-
cond := v1.MakeCondition(v1beta1.ScrutinizeReady, metav1.ConditionTrue, "")
199-
meta.SetStatusCondition(&vscr.Status.Conditions, *cond)
200-
201-
r := MakeScrutinizePodReconciler(vscrRec, vscr, logger)
202-
res, err := r.Reconcile(ctx, &ctrl.Request{})
203-
defer v1beta1_test.DeleteScrutinizePod(ctx, k8sClient, vscr)
204-
Expect(err).Should(Succeed())
205-
Expect(res).Should(Equal(ctrl.Result{}))
206-
207-
pod := &corev1.Pod{}
208-
Expect(k8sClient.Get(ctx, vscr.ExtractNamespacedName(), pod)).Should(Succeed())
209-
Expect(vscr.Status.PodName).Should(Equal(pod.Name))
210-
Expect(vscr.Status.PodUID).Should(Equal(pod.UID))
211-
checkStatusConditionAndStateAfterReconcile(ctx, vscr, v1beta1.ScrutinizePodCreated, metav1.ConditionTrue,
212-
"PodCreated", "PodCreated")
213-
})
214163
})

pkg/controllers/vscr/vdbverify_reconciler.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ func (s *VDBVerifyReconciler) Reconcile(ctx context.Context, _ *ctrl.Request) (c
6969
return ctrl.Result{}, s.updateStateAndScrutinizeReadyCondition(ctx, metav1.ConditionFalse, events.VerticaDBNotFound,
7070
fmt.Sprintf("NotReady:%s", events.VerticaDBNotFound))
7171
}
72-
73-
// If sandbox is defined and sandbox does not exist, we want to exit early
74-
sandbox := s.Vscr.Spec.Sandbox
75-
if sandbox != "" && s.Vdb.GetSandboxStatus(sandbox) == nil {
76-
s.VRec.Eventf(s.Vscr, corev1.EventTypeWarning, events.SandboxNotFound,
77-
"Sandbox '%s' was not found in the Vertica DB", sandbox)
78-
return ctrl.Result{}, s.updateStateAndScrutinizeReadyCondition(ctx, metav1.ConditionFalse, events.SandboxNotFound,
79-
fmt.Sprintf("NotReady:%s", events.SandboxNotFound))
80-
}
81-
8272
return ctrl.Result{}, s.checkVersionAndDeploymentType(ctx)
8373
}
8474

pkg/controllers/vscr/verticascrutinize_controller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ func (r *VerticaScrutinizeReconciler) logScrutinizeNotReadyMsg(log logr.Logger,
225225
msg = fmt.Sprintf("The server version could not be found in the VerticaDB %s", vdbName)
226226
case events.VclusterOpsScrutinizeNotSupported:
227227
msg = "The server version does not have scrutinize support through vclusterOps"
228-
case events.SandboxNotFound:
229-
msg = "Sandbox could not be found"
230228
default:
231229
msg = "The server version does not support vclusterOps scrutinize reading db password from secret"
232230
}

pkg/events/event.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ const (
142142
VclusterOpsScrutinizeNotSupported = "VclusterOpsScrutinizeNotSupported"
143143
VclusterOpsScrutinizeSucceeded = "VclusterOpsScrutinizeSucceeded"
144144
VclusterOpsScrutinizeFailed = "VclusterOpsScrutinizeFailed"
145-
SandboxNotFound = "SandboxNotFound"
146145
)
147146

148147
// Constants for VerticaReplicator reconciler

tests/e2e-leg-10/sandbox-on-create/40-create-vscr.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/e2e-leg-10/sandbox-on-create/41-assert.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

tests/e2e-leg-10/sandbox-on-create/41-verify-pod-created.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/e2e-leg-10/sandbox-on-create/42-assert.yaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)