Skip to content

Commit

Permalink
release version v2.0.0 (#124)
Browse files Browse the repository at this point in the history
* update dev docs

* Update docs/code_structure.md

Co-authored-by: serboctor <boctor.sarah@gmail.com>

* Add PolicyConfig CRD to make it possible to customize policy configuration per namespaces, applications or resources (#113)

* add policy config crd
* add unit tests to policy config crd
* add unit tests for policy crd
* add unit tests for policy sets
* fix agent template
* resolve remarks

Co-authored-by: Waleed Hammam <waleed.hamam@weave.works>

* add policy config documentations (#116)

* add policy config documentations

* update policy configuration documentation

* apply pr comments and add note about more policies

* Apply suggestions from code review

Co-authored-by: serboctor <boctor.sarah@gmail.com>

* apply pr comments

Co-authored-by: serboctor <boctor.sarah@gmail.com>

* Add mode field to policy set and add policy modes to its status (#117)

* refactor policy set

* update policy core version

* add unit test for policy controller

* add some comments

* unserve v2beta1

* fix remarks

* update docsting

* update policy core version (#119)

* fix terraform mode name (#120)

* remove policyset id field and make name field optional (#121)

* update agent docs (#122)

* update agent docs

* Apply suggestions from code review

Co-authored-by: serboctor <boctor.sarah@gmail.com>

* Apply suggestions from code review

Co-authored-by: serboctor <boctor.sarah@gmail.com>

* address remarks

* improve docs

* Apply suggestions from code review

Co-authored-by: serboctor <boctor.sarah@gmail.com>

Co-authored-by: serboctor <boctor.sarah@gmail.com>

* add policy modes to labels to support filtering (#123)

* add policy modes to labels to support filtering

* fix test

* set policy version v2beta1 served true (#125)

Co-authored-by: alichaddad <ali.chaddad@weave.works>
Co-authored-by: alichaddad <ali.chaddad@magalix.com>
Co-authored-by: serboctor <boctor.sarah@gmail.com>
Co-authored-by: Waleed Hammam <waleed.hamam@weave.works>
  • Loading branch information
5 people authored Nov 8, 2022
1 parent 2de8aad commit f56bed8
Show file tree
Hide file tree
Showing 47 changed files with 4,460 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
run: |
go test -v -cover -covermode=atomic -coverprofile=coverage.txt ./...
make test
bash <(curl -s https://codecov.io/bash) -F unit
- name: Build docker image
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
cd api && $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=../config/crd/bases
cp config/crd/bases/pac.weave.works_policies.yaml helm/crds
cp config/crd/bases/pac.weave.works_policysets.yaml helm/crds
cp config/crd/bases/pac.weave.works_policyconfigs.yaml helm/crds


.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand All @@ -71,7 +73,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -v ./... -coverprofile cover.out

##@ Build

Expand Down Expand Up @@ -127,12 +129,14 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
LOCALBIN = $(shell pwd)/bin
KUSTOMIZE = $(LOCALBIN)/kustomize
CONTROLLER_GEN = $(LOCALBIN)/controller-gen

.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0)

KUSTOMIZE = $(shell pwd)/bin/kustomize
.PHONY: kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)
Expand Down
42 changes: 39 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,47 @@ resources:
- api:
crdVersion: v1
namespaced: false
- api:
domain: weave.works
kind: Policy
path: api/v1
version: v1
- api:
crdVersion: v2beta1
namespaced: false
domain: weave.works
kind: Policy
path: github.com/weaveworks/policy-agent/api/v1
version: v1
path: api/v1
version: v2beta1
- api:
crdVersion: v2beta1
namespaced: false
domain: weave.works
kind: PolicySet
path: api/v1
version: v2beta1
- api:
crdVersion: v2beta2
namespaced: false
domain: weave.works
kind: Policy
path: api/v1
version: v2beta2
- api:
crdVersion: v2beta2
namespaced: false
domain: weave.works
kind: PolicySet
path: api/v1
version: v2beta2
- api:
crdVersion: v2beta2
namespaced: false
domain: weave.works
kind: PolicyConfig
path: api/v1
version: v2beta2
webhooks:
# defaulting: true
validation: true
webhookVersion: v1
version: "3"
30 changes: 30 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,49 @@ require (
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.28.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.23.4 // indirect
k8s.io/client-go v0.23.4 // indirect
k8s.io/component-base v0.23.4 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit f56bed8

Please sign in to comment.