Skip to content

Commit

Permalink
remove authArgs from probes cmd
Browse files Browse the repository at this point in the history
Signed-off-by: sayedppqq <[email protected]>
  • Loading branch information
sayedppqq committed Nov 12, 2024
1 parent 9d9ab0b commit 5ef370c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions apis/kubedb/v1/mongodb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,17 +919,13 @@ func (m *MongoDB) getCmdForProbes(mgVersion *v1alpha1.MongoDBVersion, isArbiter
}
}

var authArgs string
if len(isArbiter) == 0 { // not arbiter
authArgs = "--username=$MONGO_INITDB_ROOT_USERNAME --password=$MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase=admin"
}
return []string{
"bash",
"-c",
fmt.Sprintf(`set -x; if [[ $(%s admin --host=localhost %v %v --quiet --eval "db.adminCommand('ping').ok" ) -eq "1" ]]; then
fmt.Sprintf(`set -x; if [[ $(%s admin --host=localhost %v --quiet --eval "db.adminCommand('ping').ok" ) -eq "1" ]]; then
exit 0
fi
exit 1`, m.GetEntryCommand(mgVersion), sslArgs, authArgs),
exit 1`, m.GetEntryCommand(mgVersion), sslArgs),
}
}

Expand Down

0 comments on commit 5ef370c

Please sign in to comment.