-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add replication reconciler for VerticaReplicator (#773)
This pull request modifies the Vertica replicator controller to invoke the replication command synchronously. Additionally, it introduces new status conditions within VerticaReplicator to monitor the controller's various states. --------- Co-authored-by: spilchen <mspilchen@opentext.com>
- Loading branch information
1 parent
c4d7e16
commit 3d1661a
Showing
31 changed files
with
1,173 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
(c) Copyright [2021-2024] Open Text. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package vrep | ||
|
||
import ( | ||
"context" | ||
|
||
vapi "github.com/vertica/vertica-kubernetes/api/v1" | ||
"github.com/vertica/vertica-kubernetes/api/v1beta1" | ||
verrors "github.com/vertica/vertica-kubernetes/pkg/errors" | ||
"github.com/vertica/vertica-kubernetes/pkg/names" | ||
"github.com/vertica/vertica-kubernetes/pkg/vk8s" | ||
ctrl "sigs.k8s.io/controller-runtime" | ||
) | ||
|
||
func fetchSourceAndTargetVDBs(ctx context.Context, | ||
vRec *VerticaReplicatorReconciler, | ||
vrep *v1beta1.VerticaReplicator) (vdbSource, vdbTarget *vapi.VerticaDB, res ctrl.Result, err error) { | ||
vdbSource = &vapi.VerticaDB{} | ||
vdbTarget = &vapi.VerticaDB{} | ||
nmSource := names.GenNamespacedName(vrep, vrep.Spec.Source.VerticaDB) | ||
nmTarget := names.GenNamespacedName(vrep, vrep.Spec.Target.VerticaDB) | ||
if res, err = vk8s.FetchVDB(ctx, vRec, vrep, nmSource, vdbSource); verrors.IsReconcileAborted(res, err) { | ||
return nil, nil, res, err | ||
} | ||
if res, err = vk8s.FetchVDB(ctx, vRec, vrep, nmTarget, vdbTarget); verrors.IsReconcileAborted(res, err) { | ||
return nil, nil, res, err | ||
} | ||
return vdbSource, vdbTarget, ctrl.Result{}, nil | ||
} |
Oops, something went wrong.