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

Add support for local registry use to the local-dev tooling #894

Merged
merged 21 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ policy-tester
*.swp

gha-creds-*.json

# Kind cluster configuration produced by hack/local-dev.sh
kind.yaml
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ policy-controller:
policy-tester:
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ ./cmd/tester

## Build local-dev binary
.PHONY: local-dev
local-dev:
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/$@ ./cmd/local-dev

#####################
# lint / test section
#####################
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,24 @@ Then run it pointing to a YAML file containing a ClusterImagePolicy, and an imag

## Local Development

You can spin up a local [Kind](https://kind.sigs.k8s.io/) K8s cluster to test local changes to the policy controller using the ``
CLI tool. Build the tool with `make local-dev` and then run it with `./bin/local-dev setup --cluster-name=<my cluster name> --ko-docker-repo=<some-docker-repo>`.
You can spin up a local [Kind](https://kind.sigs.k8s.io/) K8s cluster to test local changes to the policy controller using the `./hack/local-dev.sh` script. It optionally accepts the following flags:
```
--cluster-name
--k8s-version
--registry-url
```

If no registry URL is provided, a local registry will be used.

You can clean up the cluster with `./bin/local-dev clean --cluster-name=<my cluster name>`.
### Cleaning Up

Clean up the Kind cluster with `kind delete cluster --name=<my cluster name>`

If the local registry was used, clean it up with:
```bash
docker stop registry.local
docker rm registry.local
```

You will need to have the following tools installed to use this:
- [Docker](https://docs.docker.com/get-docker/)
Expand Down
64 changes: 0 additions & 64 deletions cmd/local-dev/clean.go

This file was deleted.

20 changes: 0 additions & 20 deletions cmd/local-dev/main.go

This file was deleted.

36 changes: 0 additions & 36 deletions cmd/local-dev/root.go

This file was deleted.

127 changes: 0 additions & 127 deletions cmd/local-dev/setup.go

This file was deleted.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ require (
sigs.k8s.io/yaml v1.3.0
)

require github.com/spf13/cobra v1.7.0
require github.com/spf13/cobra v1.7.0 // indirect

require (
github.com/go-jose/go-jose/v3 v3.0.0
github.com/sigstore/sigstore/pkg/signature/kms/aws v1.7.1
github.com/sigstore/sigstore/pkg/signature/kms/azure v1.7.1
github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.7.1
github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.7.1
github.com/spf13/viper v1.16.0
)

require (
Expand Down Expand Up @@ -232,6 +231,7 @@ require (
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.16.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
Expand Down
Loading
Loading