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

Update readme #122

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,25 @@ test:
lint: bootstrap
golangci-lint run --max-same-issues 0

.PHONY: mocks
mocks: bootstrap
mockgen -source ./pkg/repository/repository.go -destination ./pkg/repository/mock/repository.go -package mock
mockgen -source ./pkg/listers/limitrange.go -destination ./pkg/listers/mock/limitrange.go -package mock
mockgen -source ./pkg/listers/node.go -destination ./pkg/listers/mock/node.go -package mock
mockgen -source ./pkg/listers/pod.go -destination ./pkg/listers/mock/pod.go -package mock
mockgen -source ./pkg/listers/radixregistration.go -destination ./pkg/listers/mock/radixregistration.go -package mock
mockgen -source ./pkg/listers/containerbulkdto.go -destination ./pkg/listers/mock/containerbulkdto.go -package mock
mockgen -source ./pkg/listers/nodebulkdto.go -destination ./pkg/listers/mock/nodebulkdto.go -package mock



HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;)
HAS_MOCKGEN := $(shell command -v mockgen;)

bootstrap:
ifndef HAS_GOLANGCI_LINT
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
endif
ifndef HAS_MOCKGEN
go install github.com/golang/mock/mockgen@v1.6.0
endif
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ sqlcmd -S ${SERVER_NAME}.database.windows.net -d ${DATABASE_NAME} -G --variables

## Deploy to cluster

Installation on cluster is handled by flux through [flux repo](https://github.com/equinor/radix-flux). Before being installed, it requires that there exist a namespace called `radix-cost-allocation`. In that namespace there must be a secret called `cost-db-secret` that contains the database password. This is handled through the setup script in [radix-platform](https://github.com/equinor/radix-platform)
Installation on cluster is handled by flux through [flux repo](https://github.com/equinor/radix-flux).

tag in git repository (in master branch) - matching to the version of Version in docs/docs.go
tag in git repository (in master branch) - matching to the version of Version in charts/Chart.yaml

## Developing

You need Go installed. Make sure `GOPATH` and `GOROOT` are properly set up.

Also needed:
You need:

- [`gomock`](https://github.com/golang/mock) (GO111MODULE=on go get github.com/golang/mock/mockgen@v1.5.0)

Expand All @@ -42,18 +40,8 @@ Want to contribute? Read our [contributing guidelines](./CONTRIBUTING.md)
We use gomock to generate mocks used in unit test.
You need to regenerate mocks if you make changes to any of the interface types used by the application; **Repository**

Repository:
```
$ mockgen -source ./pkg/repository/repository.go -destination ./pkg/repository/mock/repository.go -package mock
```
listers:
```
$ mockgen -source ./pkg/listers/limitrange.go -destination ./pkg/listers/mock/limitrange.go -package mock
$ mockgen -source ./pkg/listers/node.go -destination ./pkg/listers/mock/node.go -package mock
$ mockgen -source ./pkg/listers/pod.go -destination ./pkg/listers/mock/pod.go -package mock
$ mockgen -source ./pkg/listers/radixregistration.go -destination ./pkg/listers/mock/radixregistration.go -package mock
$ mockgen -source ./pkg/listers/containerbulkdto.go -destination ./pkg/listers/mock/containerbulkdto.go -package mock
$ mockgen -source ./pkg/listers/nodebulkdto.go -destination ./pkg/listers/mock/nodebulkdto.go -package mock
make mocks
```

## Update version
Expand Down