Skip to content

Commit

Permalink
Fix formatting using fix.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybear327 committed Apr 2, 2024
1 parent f3dfcab commit 800fb44
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
keyBucket = []byte("key")
metaBucket = []byte("meta")

finishedCompactKeyName = []byte("finishedCompactRev")
finishedCompactKeyName = []byte("finishedCompactRev")
)

// KeySummary represents a kubernetes object stored in etcd.
Expand Down
10 changes: 5 additions & 5 deletions pkg/data/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,22 @@ func TestParseFilters(t *testing.T) {
{
name: "namespace-equals",
rawFilter: ".Value.metadata.namespace=default",
expected: []*FieldConstraint{&FieldConstraint{lhs: ".Value.metadata.namespace", op: Equals, rhs: "default"}},
expected: []*FieldConstraint{{lhs: ".Value.metadata.namespace", op: Equals, rhs: "default"}},
},
{
name: "2-filters",
rawFilter: ".Value.metadata.namespace=default,.Value.metadata.name=example",
expected: []*FieldConstraint{
&FieldConstraint{lhs: ".Value.metadata.namespace", op: Equals, rhs: "default"},
&FieldConstraint{lhs: ".Value.metadata.name", op: Equals, rhs: "example"},
{lhs: ".Value.metadata.namespace", op: Equals, rhs: "default"},
{lhs: ".Value.metadata.name", op: Equals, rhs: "example"},
},
},
{
name: "whitespace",
rawFilter: " .Value.metadata.namespace=default\t, .Value.metadata.name=example\n",
expected: []*FieldConstraint{
&FieldConstraint{lhs: ".Value.metadata.namespace", op: Equals, rhs: "default"},
&FieldConstraint{lhs: ".Value.metadata.name", op: Equals, rhs: "example"},
{lhs: ".Value.metadata.namespace", op: Equals, rhs: "default"},
{lhs: ".Value.metadata.name", op: Equals, rhs: "example"},
},
},
}
Expand Down
15 changes: 8 additions & 7 deletions pkg/encoding/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,18 @@ func init() {
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kuberentes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
//
//nolint:errcheck
func AddToScheme(scheme *runtime.Scheme) {
admissionv1beta1.AddToScheme(scheme)
Expand Down

0 comments on commit 800fb44

Please sign in to comment.