Skip to content

Commit 99e0522

Browse files
feat: implement performance optimizations (#2045)
* feat: implement performance optimizations --------- Signed-off-by: Oliver Baehler <oliver@sudo-i.net>
1 parent 16bc219 commit 99e0522

86 files changed

Lines changed: 7123 additions & 457 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/v1beta2/capsuleconfiguration_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type CapsuleConfigurationStatus struct {
2121
// The total count is available via len(Tenants).
2222
// +listType=atomic
2323
// +optional
24-
Tenants []string `json:"tenants,omitempty"`
24+
Tenants []string `json:"tenants"`
2525
// ObservedGeneration is the most recent generation the controller has observed.
2626
// +optional
2727
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2020-2026 Project Capsule Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package v1beta2
5+
6+
import (
7+
"encoding/json"
8+
"testing"
9+
)
10+
11+
func TestCapsuleConfigurationStatusSerializesEmptyTenants(t *testing.T) {
12+
t.Parallel()
13+
14+
status := CapsuleConfigurationStatus{Tenants: make([]string, 0)}
15+
16+
data, err := json.Marshal(status)
17+
if err != nil {
18+
t.Fatalf("marshal status: %v", err)
19+
}
20+
if got, want := string(data), `{"tenants":[]}`; got != want {
21+
t.Fatalf("marshaled status = %s, want %s", got, want)
22+
}
23+
24+
var decoded CapsuleConfigurationStatus
25+
if err := json.Unmarshal(data, &decoded); err != nil {
26+
t.Fatalf("unmarshal status: %v", err)
27+
}
28+
if decoded.Tenants == nil {
29+
t.Fatal("tenants must remain initialized after a JSON round trip")
30+
}
31+
}

api/v1beta2/tenantresource_namespaced.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type TenantResourceStatus struct {
2626

2727
// +kubebuilder:object:root=true
2828
// +kubebuilder:subresource:status
29+
// +kubebuilder:resource:scope=Namespaced,shortName=tr
2930
// +kubebuilder:printcolumn:name="Items",type="integer",JSONPath=".status.size",description="The total amount of items being replicated"
3031
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="Reconcile Status for the tenant"
3132
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description="Reconcile Message for the tenant"

charts/capsule/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ The following Values have changed key or Value:
307307
| webhooks.hooks.ingresses.opts | object | `{}` | Capsule Hook Options |
308308
| webhooks.hooks.ingresses.reinvocationPolicy | string | `"Never"` | [ReinvocationPolicy](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#reinvocation-policy) |
309309
| webhooks.hooks.managed.enabled | bool | `true` | Enable the Hook |
310-
| webhooks.hooks.managed.failurePolicy | string | `"Ignore"` | [FailurePolicy](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#failure-policy) |
310+
| webhooks.hooks.managed.failurePolicy | string | `"Fail"` | [FailurePolicy](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#failure-policy) |
311311
| webhooks.hooks.managed.matchConditions | list | `[]` | [MatchConditions](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-matchpolicy) |
312312
| webhooks.hooks.managed.matchPolicy | string | `"Equivalent"` | [MatchPolicy](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-matchpolicy) |
313313
| webhooks.hooks.managed.namespaceSelector | object | `{}` | [NamespaceSelector](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-namespaceselector) |

charts/capsule/crds/capsule.clastix.io_tenantresources.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
kind: TenantResource
1212
listKind: TenantResourceList
1313
plural: tenantresources
14+
shortNames:
15+
- tr
1416
singular: tenantresource
1517
scope: Namespaced
1618
versions:

0 commit comments

Comments
 (0)