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

mongo/mongo.go:78:3: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields #67

Open
sadath-12 opened this issue Mar 20, 2023 · 1 comment

Comments

@sadath-12
Copy link

Run command "make run" to start the operator run into issue that looks similar to this

// /home/sadath/go/bin/controller-gen rbac:roleName=mongodb-operator-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
// /home/sadath/go/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
// go fmt ./...
// go vet ./...
// # mongodb-operator/mongo
// mongo/mongo.go:77:3: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields
// mongo/mongo.go:77:35: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields
// 
// mongo/mongo.go:104:58: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields
// make: *** [Makefile:86: vet] Error 1

Solution to fix this issue is to add Key and Value for running db command for user and role
for Example

change this

{"createUser", monitoringUser}, { "pwd",  params.Password}

To

{Key: "createUser", Value: monitoringUser}, {Key: "pwd", Value: params.Password}
@sadath-12
Copy link
Author

Added pr #68

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

No branches or pull requests

1 participant