Skip to content

Commit

Permalink
fixing connector validation (#3461) (#3470)
Browse files Browse the repository at this point in the history
Signed-off-by: Dhrubo Saha <[email protected]>
(cherry picked from commit a6eaf08)

Co-authored-by: Dhrubo Saha <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and dhrubo-os authored Jan 30, 2025
1 parent 34a7fb6 commit 5b91647
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,19 @@ private void doRegister(MLRegisterModelInput registerModelInput, ActionListener<
mlFeatureEnabledSetting,
ActionListener.wrap(r -> {
if (Boolean.TRUE.equals(r)) {
createModelGroup(registerModelInput, listener);
if (registerModelInput.getModelInterface() == null) {
mlModelManager
.getConnector(
registerModelInput.getConnectorId(),
registerModelInput.getTenantId(),
ActionListener.wrap(connector -> {
updateRegisterModelInputModelInterfaceFieldsByConnector(registerModelInput, connector);
createModelGroup(registerModelInput, listener);
}, listener::onFailure)
);
} else {
createModelGroup(registerModelInput, listener);
}
} else {
listener
.onFailure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ public void getController(String modelId, ActionListener<MLController> listener)
* @param tenantId tenant id
* @param listener action listener
*/
private void getConnector(String connectorId, String tenantId, ActionListener<Connector> listener) {
public void getConnector(String connectorId, String tenantId, ActionListener<Connector> listener) {
GetDataObjectRequest getDataObjectRequest = GetDataObjectRequest
.builder()
.index(ML_CONNECTOR_INDEX)
Expand Down

0 comments on commit 5b91647

Please sign in to comment.