-
Notifications
You must be signed in to change notification settings - Fork 212
Add a new generator config to append an Age printcolumn
#84
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
Conversation
72e19ef
to
66d727c
Compare
Since All kubernetes resources have a `.metadata.creationTimestamp` field, we need a way to instruct the code generator to generate kubebuilder marker comments that will append the AGE field the `kubectl get` response. This patch extends `Resource.PrintConfig` to allow configuring the `ack-generate` to generate such marker comments.
66d727c
to
538402c
Compare
/unhold |
@@ -50,6 +50,9 @@ type {{ .CRD.Kind }}Status struct { | |||
{{- range $column := .CRD.AdditionalPrinterColumns }} | |||
// +kubebuilder:printcolumn:name="{{$column.Name}}",type={{$column.Type}},JSONPath=`{{$column.JSONPath}}` | |||
{{- end }} | |||
{{- if .CRD.PrintAgeColumn }} | |||
// +kubebuilder:printcolumn:name="Age",type="date",priority=0,JSONPath=".metadata.creationTimestamp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Priority 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also the default for all the builtin types (pods, services..)
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, jaypipes, RedbackThomson, vijtrip2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue: aws-controllers-k8s/community#822
Since All kubernetes resources have a
.metadata.creationTimestamp
field,we need a way to instruct the code generator to generate kubebuilder
marker comments that will append the AGE field the
kubectl get
response.
This patch extends
Resource.PrintConfig
to allow configuring theack-generate
to generate such marker comments.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.