Skip to content
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

Add CRDs printcolumns #353

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Add CRDs printcolumns #353

merged 2 commits into from
Dec 13, 2023

Conversation

grzpiotrowski
Copy link
Contributor

@grzpiotrowski grzpiotrowski commented Dec 4, 2023

This PR adds new columns with status and target refs information to kubectl get output with -o wide option.

Examples of the new output:

For RateLimitPolicy:

NAME       STATUS               TARGETREFKIND   TARGETREFNAME   AGE
toystore   HTTPRouteProtected   HTTPRoute       toystore        2d21h

For AuthPolicy:

NAME       STATUS                TARGETREFKIND   TARGETREFNAME   AGE
toystore   ReconciliationError   HTTPRoute       toystore        2d21h

For Kuadrant:

NAME       STATUS   AGE
kuadrant   Ready    2d21h

Verification

Verification trough one of the guides.

Closes #345

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Merging #353 (f56cac0) into main (5ab0be7) will decrease coverage by 0.22%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #353      +/-   ##
==========================================
- Coverage   65.19%   64.98%   -0.22%     
==========================================
  Files          35       35              
  Lines        3795     3795              
==========================================
- Hits         2474     2466       -8     
- Misses       1127     1133       +6     
- Partials      194      196       +2     
Flag Coverage Δ
integration 70.28% <ø> (-0.40%) ⬇️
unit 58.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
api/v1beta1 (u) ∅ <ø> (∅)
pkg/common (u) 76.92% <ø> (ø)
pkg/istio (u) 37.11% <ø> (ø)
pkg/log (u) 31.81% <ø> (ø)
pkg/reconcilers (u) 33.21% <ø> (ø)
pkg/rlptools (u) 56.46% <ø> (ø)
controllers (i) 70.28% <ø> (-0.40%) ⬇️
Files Coverage Δ
api/v1beta2/authpolicy_types.go 72.85% <ø> (ø)
api/v1beta2/ratelimitpolicy_types.go 17.85% <ø> (ø)

... and 3 files with indirect coverage changes

@eguzki
Copy link
Contributor

eguzki commented Dec 4, 2023

looking good!

@eguzki
Copy link
Contributor

eguzki commented Dec 4, 2023

We need to check this in openshift and see how it integrates.

@adam-cattermole
Copy link
Member

adam-cattermole commented Dec 6, 2023

Synced with @grzpiotrowski on a call and we had a look at OpenShift install - looks like we can still see all the fields with either a kubectl get or oc get. It doesn't look like it's displayed in the UI however if that was what was expected.

image

@grzpiotrowski grzpiotrowski marked this pull request as ready for review December 6, 2023 15:21
@grzpiotrowski grzpiotrowski requested a review from a team as a code owner December 6, 2023 15:21
@alexsnaps alexsnaps added this to the v0.6.0 milestone Dec 8, 2023
@@ -200,6 +200,10 @@ func (s *AuthPolicyStatus) Equals(other *AuthPolicyStatus, logger logr.Logger) b
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].reason`,description="AuthPolicy Status",priority=2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relies on the fact the we currently only set one condition per status stanza, which is fine for now.

Soon, it will have to differentiate Accepted and Enforced. E.g.:

// +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status`,description="AuthPolicy Accepted",priority=2
// +kubebuilder:printcolumn:name="Enforced",type=string,JSONPath=`.status.conditions[?(@.type=="Enforced")].status`,description="AuthPolicy Enforced",priority=2

See https://docs.kuadrant.io/architecture/rfcs/0004-policy-status.

@grzpiotrowski grzpiotrowski merged commit 0355953 into main Dec 13, 2023
22 checks passed
@eguzki eguzki deleted the enhance-crd-display branch December 13, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Improve Observability of Kuadrant resources in kubectl output
5 participants