* Add helper function to read port number from env var
* Add check for port == 0
* Add the unit test
* Update error message
Co-Authored-By: savitaashture <sashture@redhat.com>
* Panic when env var is set but invalid
* Rename the func to be PortFromEnv.
* Apply suggestions from code review on error message
Co-authored-by: Victor Agababov <vagababov@gmail.com>
* Join defers
Co-authored-by: savitaashture <sashture@redhat.com>
Co-authored-by: Victor Agababov <vagababov@gmail.com>
* do not record for empty metric config
* Revert "do not record for empty metric config"
This reverts commit 539a5e4dbb.
* delete
* log once
* remove space
* Library for writing interactive "shell script" in Go
Advance knative/test-infra#2063
Already used elsewhere
* address most comments
* Address more comments
* Functions common to HA tests
* Fix format errors
* More robust GetEndpoints function
* Do not use listOptions in getting endpoints
* re-use more existing code
* Fix format
* Rename GetLeader to WaitForNewLeader
* Fix fmt
* Simplify WaitForPodDeleted
* Remove span from WaitForChangedEndpoints
* Some nits in the genreconciler
- make sure we allocate proper amount of slice space
- `t:=t` is needed only if you're doing goroutines in the loop
- extract constants outside of the loops.
- reformat
* meh, I was wrong
* Implement the K8s lifecycle in webhook.
The webhook never properly implemented the Kubernetes SIGTERM/SIGKILL
lifecycle, and doesn't even really support readiness probes today. This
change enables folks to use a block like this on their webhook container:
```yaml
readinessProbe: &probe
periodSeconds: 1
httpGet:
scheme: HTTPS
port: 8443
httpHeaders:
- name: k-kubelet-probe
value: "webhook"
livenessProbe: *probe
```
With this, the webhook won't report as `Ready` until a probe has succeeded,
and when the SIGTERM is received, we will start failing probes for a grace
period (so our Endpoint drops) before shutting down the webhook's HTTP Server.
This was uncovered by running the webhook across 10 replicas in Serving with
the "Goose" (https://github.com/knative/pkg/pull/1316) enabled for the e2e
tests. The failure mode I saw was conversion webhook requests failing across
random tests.
This also moves the Serving probe-detection function into PKG.
* Increase the log level when we start to fail probes
* Wait for go routines to terminate on all paths.
* generate krshaped logic
* add logic to the tag
* Update injection/README.md
Co-authored-by: Matt Moore <mattmoor@vmware.com>
* move var to reconciler
Co-authored-by: Matt Moore <mattmoor@vmware.com>
* do not record for empty metric config
* Revert "do not record for empty metric config"
This reverts commit 539a5e4dbb.
* add a comment
* fix typo
* fix tests
* revert
* revert tests
* revert
* fix conflicts
* one more test file
- use more performant functions (mostly remove formatters were possible)
- move zap.Error() to the call site, rather than creating a new sugared logger with a key attached (not cheap)
- fix *w usages where the key was not provided.
* do not record for empty metric config
* Revert "do not record for empty metric config"
This reverts commit 539a5e4dbb.
* use metricstest package for test
* Add custom object encoders for the set of string and namespaced name
In future we might add more (endpoints is a really good candidate)
* switch NN logging
* usage
* nn without ns
* nit
* Split KResource into a file. Include an interface.
* Update apis/duck/v1/kresource_type.go
Co-authored-by: Matt Moore <mattmoor@vmware.com>
* type
* rename to KRShaped
* Create common logic for bumping obsgen
* fix typo
* remove interface cast
* missed a spot
* Update to use ObjectMetaAccessor
* switch alias to duckv1
* fix var names
* include a reason
* Switch to preprocess
* rename variable from new to resource
* Create a table style test
* missed a spot
* update deps
* fix nits
* fix gomod deps
* update with new KRshaped
* Update reconciler/reconcile_common_test.go
Co-authored-by: Victor Agababov <vagababov@gmail.com>
* Update reconciler/reconcile_common_test.go
Co-authored-by: Victor Agababov <vagababov@gmail.com>
* Update reconciler/reconcile_common_test.go
Co-authored-by: Matt Moore <mattmoor@vmware.com>
Co-authored-by: Matt Moore <mattmoor@vmware.com>
Co-authored-by: Victor Agababov <vagababov@gmail.com>
There was a comment on the PR I merged earlier.
To add cmp.diff to the tests,
but when I actually looked, the tests look pretty bleak,
so I beefed them up and used t rather log
* Split KResource into a file. Include an interface.
* Update apis/duck/v1/kresource_type.go
Co-authored-by: Matt Moore <mattmoor@vmware.com>
* type
* rename to KRShaped
Co-authored-by: Matt Moore <mattmoor@vmware.com>