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

[feature]: Support inheritance for GenericAdditionalPrinterColumn #806

Open
jhested opened this issue Aug 28, 2024 · 0 comments
Open

[feature]: Support inheritance for GenericAdditionalPrinterColumn #806

jhested opened this issue Aug 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jhested
Copy link

jhested commented Aug 28, 2024

Is your feature request related to a problem? Please describe.

No response

Describe the solution you would like

In KubeOps 7 it was possible to use inheritance for GenericAdditionalPrinterColumnAttributes, which made it very simple to predefine as set of standard columns such as 'Ready' or 'Reason.

In kubeops 9 this is no longer supported so now we have to define it on each entity again and again.

KubeOps 7

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class ReadyPrinterColumnAttribute : GenericAdditionalPrinterColumnAttribute
{
    public ReadyPrinterColumnAttribute()
        : base(".status.conditions[?(@.type==\"Ready\")].status", "Ready", "string")
    {
    }
}

[KubernetesEntity(Group = "activedirectory", ApiVersion = "v1alpha1", Kind = "Group", PluralName = "groups")]
[ReadyPrinterColumn, ReasonPrinterColumn, AgePrinterColumn]
public partial class V1GroupEntity : CustomKubernetesEntity<V1GroupEntitySpec, V1GroupEntityStatus>
{
}

[KubernetesEntity(Group = "serviceaccount", ApiVersion = "v1alpha1", Kind = "Group", PluralName = "groups")]
[ReadyPrinterColumn, ReasonPrinterColumn, AgePrinterColumn]
public partial class V1ServiceAccount : CustomKubernetesEntity<V1GroupEntitySpec, V1GroupEntityStatus>
{
}

KubeOps 9

[KubernetesEntity(Group = "activedirectory", ApiVersion = "v1alpha1", Kind = "Group", PluralName = "groups")]
[GenericAdditionalPrinterColumn(".status.conditions[?(@.type==\"Ready\")].status", "Ready", "string")]
[GenericAdditionalPrinterColumn(".metadata.creationTimestamp", "Age", "date")]
[GenericAdditionalPrinterColumn(".status.conditions[?(@.type==\"Ready\")].reason", "Reason", "string")]
public partial class V1GroupEntity : CustomKubernetesEntity<V1GroupEntitySpec, V1GroupEntityStatus>
{
}

[KubernetesEntity(Group = "serviceaccount", ApiVersion = "v1alpha1", Kind = "Group", PluralName = "groups")]
[GenericAdditionalPrinterColumn(".status.conditions[?(@.type==\"Ready\")].status", "Ready", "string")]
[GenericAdditionalPrinterColumn(".metadata.creationTimestamp", "Age", "date")]
[GenericAdditionalPrinterColumn(".status.conditions[?(@.type==\"Ready\")].reason", "Reason", "string")]
public partial class V1ServiceAccount : CustomKubernetesEntity<V1GroupEntitySpec, V1GroupEntityStatus>
{
}

Additional Context

No response

@jhested jhested added the enhancement New feature or request label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant