Skip to content

chore: Use client instead of APIReader + Add observedGeneration to status Conditions #193

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ mocks: install-mockery ## Build mocks
@echo -n "building mocks for sigs.k8s.io/controller-runtime/pkg/client ... "
@bin/mockery --quiet --name="(Object|Client|Status|Reader|SubResourceWriter)" --case=underscore --output=mocks/controller-runtime/pkg/client --dir="$(CONTROLLER_RUNTIME_DIR)/pkg/client"
@echo "ok."
@echo -n "building mocks for sigs.k8s.io/controller-runtime/pkg/cache ... "
@bin/mockery --quiet --name="(Cache)" --case=underscore --output=mocks/controller-runtime/pkg/cache --dir="$(CONTROLLER_RUNTIME_DIR)/pkg/cache"
@echo "ok."

help: ## Show this help.
@grep -F -h "##" $(MAKEFILE_LIST) | grep -F -v grep | sed -e 's/\\$$//' \
Expand Down
2 changes: 1 addition & 1 deletion apis/core/v1alpha1/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const (
// ACK service controller.
AnnotationReadOnly = AnnotationPrefix + "read-only"
// AnnotationAdoptionPolicy is an annotation whose value is the identifier for whether
// we will attempt adoption only (value = adopt-only) or attempt a create if resource
// we will attempt adoption only (value = adopt-only) or attempt a create if resource
// is not found (value adopt-or-create).
//
// NOTE (michaelhtm): Currently create-or-adopt is not supported
Expand Down
5 changes: 5 additions & 0 deletions apis/core/v1alpha1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ type Condition struct {
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// observedGeneration represents the .metadata.generation that the condition was set based upon.
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
// is 9, the condition is out of date with respect to the current state of the instance.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
Expand Down
231 changes: 231 additions & 0 deletions mocks/controller-runtime/pkg/cache/cache.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions mocks/controller-runtime/pkg/cache/new_cache_func.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading