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

issue-590, ingestNodes for OpenSearch in API v2 #610

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

OleksiienkoMykyta
Copy link
Collaborator

No description provided.

@OleksiienkoMykyta OleksiienkoMykyta force-pushed the issue-590-ingestNodes-for-OpenSearch-in-API-v2 branch 2 times, most recently from 5f4281f to 1f52059 Compare November 6, 2023 08:16
@@ -55,7 +55,8 @@ type OpenSearchSpec struct {
BundledUseOnly bool `json:"bundledUseOnly,omitempty"`
UserRefs []*UserReference `json:"userRefs,omitempty"`
//+kubuilder:validation:MaxItems:=1
ResizeSettings []*ResizeSettings `json:"resizeSettings,omitempty"`
ResizeSettings []*ResizeSettings `json:"resizeSettings,omitempty"`
OpenSearchIngestNode []*OpenSearchIngestNode `json:"ingestNodes,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenSearchIngestNode -> OpenSearchIngestNodes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@OleksiienkoMykyta OleksiienkoMykyta force-pushed the issue-590-ingestNodes-for-OpenSearch-in-API-v2 branch from 1f52059 to c41c745 Compare November 7, 2023 11:22
@OleksiienkoMykyta OleksiienkoMykyta force-pushed the issue-590-ingestNodes-for-OpenSearch-in-API-v2 branch from c41c745 to 29ccb49 Compare November 7, 2023 12:06
@@ -56,6 +56,8 @@ type OpenSearchSpec struct {
UserRefs []*UserReference `json:"userRefs,omitempty"`
//+kubuilder:validation:MaxItems:=1
ResizeSettings []*ResizeSettings `json:"resizeSettings,omitempty"`
//+kubuilder:validation:MaxItems:=1
OpenSearchIngestNodes []*OpenSearchIngestNodes `json:"ingestNodes,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[]*OpenSearchIngestNodes -> []*OpenSearchIngestNode

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has multiple nodes, so I use plural form

Comment on lines 187 to 191
l.Info("The node has been successfully reloaded",
"Node ID", nrs.Status.NodeInProgress.ID,
"Node ID", nodeReloadStatus.NodeID,
)
r.EventRecorder.Eventf(nrs, models.Normal, models.UpdatedEvent,
"Node %s has been successfully reloaded", nrs.Status.NodeInProgress.ID,
"Node %s has been successfully reloaded", nodeReloadStatus.NodeID,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these changes please

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with "nrs.Status"

@@ -211,6 +219,17 @@ func (oss *OpenSearchSpec) dataNodesToInstAPI() (iDataNodes []*models.OpenSearch
return
}

func (oss *OpenSearchSpec) ingestNodesToInstAPI() (iIngestNodes []*models.OpenSearchIngestNodes) {
for _, ingestNodes := range oss.OpenSearchIngestNodes {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ingestNodes -> ingestNode

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -56,6 +56,8 @@ type OpenSearchSpec struct {
UserRefs []*UserReference `json:"userRefs,omitempty"`
//+kubuilder:validation:MaxItems:=1
ResizeSettings []*ResizeSettings `json:"resizeSettings,omitempty"`
//+kubuilder:validation:MaxItems:=1
OpenSearchIngestNodes []*OpenSearchIngestNodes `json:"ingestNodes,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenSearch- prefix in field name is unnecessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

AlertingPlugin bool `json:"alertingPlugin"`
ResizeSettings []*ResizeSettings `json:"resizeSettings,omitempty"`
Description string `json:"description,omitempty"`
OpenSearchIngestNodes []*OpenSearchIngestNodes `json:"ingestNodes,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenSearch prefix is not necessary because it's obvious that they are nodes of OpenSearch cluster

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Collaborator

@worryg0d worryg0d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@OleksiienkoMykyta OleksiienkoMykyta force-pushed the issue-590-ingestNodes-for-OpenSearch-in-API-v2 branch from 29ccb49 to 3bcec33 Compare November 8, 2023 09:01
@ribaraka ribaraka merged commit 1a20736 into main Nov 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants