Skip to content

Commit

Permalink
fix: wrong field name on printcolumn (#32)
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony TREUILLIER <[email protected]>
  • Loading branch information
antrema authored Oct 17, 2024
1 parent c1cb618 commit 8c3672a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/rrset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type RRsetStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// +kubebuilder:printcolumn:name="Zone",type="string",JSONPath=".spec.zoneIdRef.name"
// +kubebuilder:printcolumn:name="Zone",type="string",JSONPath=".spec.zoneRef.name"
// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type"
// +kubebuilder:printcolumn:name="TTL",type="integer",JSONPath=".spec.ttl"
// +kubebuilder:printcolumn:name="Records",type="string",JSONPath=".spec.records"
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/dns.cav.enablers.ob_rrsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.zoneIdRef.name
- jsonPath: .spec.zoneRef.name
name: Zone
type: string
- jsonPath: .spec.type
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/rrset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var _ = Describe("RRset Controller", func() {
resourceTTL = uint32(300)
resourceType = "A"
resourceComment = "Just a comment"
zoneIdRef = zoneName
zoneRef = zoneName

testRecord1 = "127.0.0.1"
testRecord2 = "127.0.0.2"
Expand Down Expand Up @@ -108,7 +108,7 @@ var _ = Describe("RRset Controller", func() {
_, err = controllerutil.CreateOrUpdate(ctx, k8sClient, resource, func() error {
resource.Spec = dnsv1alpha1.RRsetSpec{
ZoneRef: dnsv1alpha1.ZoneRef{
Name: zoneIdRef,
Name: zoneRef,
},
Type: resourceType,
TTL: resourceTTL,
Expand Down Expand Up @@ -178,7 +178,7 @@ var _ = Describe("RRset Controller", func() {
Expect(getMockedTTL(resourceName, resourceType)).To(Equal(resourceTTL))
Expect(getMockedComment(resourceName, resourceType)).To(Equal(resourceComment))
Expect(createdResource.GetOwnerReferences()).NotTo(BeEmpty(), "RRset should have setOwnerReference")
Expect(createdResource.GetOwnerReferences()[0].Name).To(Equal(zoneIdRef), "RRset should have setOwnerReference to Zone")
Expect(createdResource.GetOwnerReferences()[0].Name).To(Equal(zoneRef), "RRset should have setOwnerReference to Zone")
Expect(createdResource.GetFinalizers()).To(ContainElement(FINALIZER_NAME), "RRset should contain the finalizer")
})
})
Expand Down

0 comments on commit 8c3672a

Please sign in to comment.