Comments (6)
The ones I've found are:
- "v1"
- "v1alpha1"
- "v1beta1"
- "constraints.gatekeeper.sh"
- "templates.gatekeeper.sh"
- "externaldata.gatekeeper.sh"
For the /api/
locations, the appropriate place is in a declaration like:
SchemeGroupVersion = schema.GroupVersion{Group: "externaldata.gatekeeper.sh", Version: "v1alpha1"}
In some cases, we define a constant but the code doesn't use it. For example "ProviderRequest" has a definition in constraint/pkg/externaldata/request.go
but it isn't referenced in the same file.
"data.lib" and "data.inventory" aren't repeated a bunch of times, but they're so important we should have them as constants so it's clear that their repetition in both "main.go" and "client.go" is meaningful and can't accidentally be broken.
That's everything I could find. There might be more (feel free to look if you want).
from frameworks.
goconst
is a great tool for discovering these. Don't worry about getting every instance - just the ones that make sense/are important to flow.
go get github.com/jgautheron/goconst/cmd/goconst
goconst -ignore "remote" ./pkg/... | sort
Anything in client/drivers/remote
is safe to ignore
from frameworks.
Also "data" since we define it as the root object users reference, so it pops up in a bunch of locations.
from frameworks.
Is this a blocker for sharding?
from frameworks.
Moving constants to pkg/apis seems reasonable
from frameworks.
Mostly done as parts of various PRs.
from frameworks.
Related Issues (20)
- [local.Driver] Copy Constraint matching library from gatekeeper to frameworks HOT 2
- [client.Client] Record matchers for constraints HOT 1
- [local.Driver] Move query violation binding logic to Go HOT 3
- [client] Add exported error for "key is not found in provider cache" HOT 1
- [client] clean constraints field in client HOT 1
- [client.Client] Move autoreject logic to Go HOT 1
- Make driver/handler cache operations atomic across Client HOT 1
- [bug] `external_data` http request doesn't set `Content-Type` header
- [client.Client] Create optional caching interface for Targets
- Ensure Driver properly handles multi-target deletes
- add dependabot HOT 1
- upgrade opa to 0.38.0 HOT 1
- No Need to Cache Constraint Status HOT 2
- Cannot upgrade opentelemetry until k8s.io/component-base upgrades HOT 1
- Multi-target ConstraintTemplate HOT 3
- Upgrade OPA to v0.40.0 HOT 4
- No longer know which resource is causing a violation HOT 1
- block template deployment if GK version is not compatible
- Result.Target is not populated
- update kubebuilder version to v3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frameworks.