* Some fixes we did in server upstream to pkg
- reduce formatting calls where they are not necessary
- remove casts where they are not necessary
- switch to consts where possible.
* nit
* 1more
This augments the injection codegen with the capability to produce a duck.InformerFactory
attached to context for each type that we process.
Now a `duck.InformerFactory` for "Addressable" can be produced by "Get"ing it from the context.
This is triggered by placing `// +genduck` on the type that implements `duck.Implementable`.
Destination sits in a strange versioned directory without a group under APIs. Destination is in fact part of our duck type space, so it belongs under the `duck` group. This moves the definition (previously v1alpha1) to `v1` because it is referenced from source types that have been designated `v1`.
* Add Addressable type converters to v1 Addressable
v1alpha1 embeds v1beta1 which makes them easily convertible. However, we
cannot embed both v1beta1 and v1 into v1alpha1 easily. Updating to just
use v1 in v1alpha1 is breaking so this change implements converters
to enable moving between v1 and v1beta1/v1alpha1 without having to
implement the logic in every client needing to convert.
* Use apis.Convertible interface
The backbone of our Condition system is our "happy" condition and
the semantics governing how other subconditions influence that condition.
When looking towards Conversion, it is possible for the set of conditions
to vary between `v1alpha1` and `v1beta1`, but the "happy" condition should
remain consistent across versions.
The main changes:
1. Provide a `ConvertTo` helper for "converting" between `duckv1beta1.Status`
types in this "lowest common denominator" sense, where we just copy the
happy condition.
2. When `InitializeConditions()` (plural) is called, seed the initial state
of sub-conditions from the initial state of the "happy" condition, if True.
This change enables us to completely change the condition space across
versions, while maintaining the consistency of the happy condition.
A couple peripheral changes:
1. Add `context.Context` to the `apis.Convertible` interface.
2. Drop `InitializeCondition()` (singular) from the `ConditionsManager` interface (I don't see any usage outside of this file).
This moves the common Condition stuff to apis, and creates a v1beta1 form of Status that uses the Condition it defines (changing this in v1alpha1 is too breaking).
There aren't really any meaningful changes in this PR, mostly reorganization. Enumerating what I did:
1. Copied `condition_set*.go` to `apis/`,
1. Copied the `Condition` portions of `conditions_types.go` to `apis/`,
1. Copied the balance of `conditions_types.go` to `apis/duck/v1beta1/status_types.go`,
1. Changed the parts of the above to reference things in the appropriate new places,
1. Removed the reflection-based `ConditionsAccessor` stuff, implementing it instead on `duckv1beta1.Status`.
1. Incorporate: https://github.com/knative/pkg/pull/358