Skip to content

Commit bc7fd85

Browse files
authored
fix: updated virtual service status type
fix: updated virtual service status type
2 parents 6ae4db3 + 24a6034 commit bc7fd85

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

api/v1alpha1/virtualservice_methods.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (vs *VirtualService) SetValid(ctx context.Context, cl client.Client, msg Me
4343
}
4444

4545
vs.Status.Message = msg
46-
vs.Status.Valid = false
46+
vs.Status.Valid = true
4747

4848
return cl.Status().Update(ctx, vs.DeepCopy())
4949
}

api/v1alpha1/virtualservice_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type ResourceRef struct {
6161
// VirtualServiceStatus defines the observed state of VirtualService
6262
type VirtualServiceStatus struct {
6363
Message Message `json:"message,omitempty"`
64-
Valid bool `json:"valid,omitempty"`
64+
Valid bool `json:"valid"`
6565
UsedSecrets []ResourceRef `json:"usedSecrets,omitempty"`
6666

6767
LastAppliedHash *uint32 `json:"lastAppliedHash,omitempty"`
@@ -71,7 +71,7 @@ type VirtualServiceStatus struct {
7171
//+kubebuilder:subresource:status
7272
//+kubebuilder:resource:shortName=vs,categories=all
7373
//+kubebuilder:printcolumn:name="Valid",type="boolean",JSONPath=".status.valid"
74-
//+kubebuilder:printcolumn:name="Error",type="string",JSONPath=".status.error"
74+
//+kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.message"
7575

7676
// VirtualService is the Schema for the virtualservices API
7777
type VirtualService struct {

helm/charts/envoy-xds-controller/crds/envoy.kaasops.io_virtualservices.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ spec:
2222
- jsonPath: .status.valid
2323
name: Valid
2424
type: boolean
25-
- jsonPath: .status.error
26-
name: Error
25+
- jsonPath: .status.message
26+
name: Message
2727
type: string
2828
name: v1alpha1
2929
schema:
@@ -138,6 +138,8 @@ spec:
138138
type: array
139139
valid:
140140
type: boolean
141+
required:
142+
- valid
141143
type: object
142144
type: object
143145
served: true

0 commit comments

Comments
 (0)