Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apis/status/v1beta1/constrainttemplatepodstatus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type VAPGenerationStatus struct {

// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:subresource:status

// ConstraintTemplatePodStatus is the Schema for the constrainttemplatepodstatuses API.
type ConstraintTemplatePodStatus struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ spec:
type: object
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ spec:
type: object
served: true
storage: true
subresources:
status: {}
2 changes: 2 additions & 0 deletions deploy/gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2973,6 +2973,8 @@ spec:
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,5 @@ spec:
type: object
served: true
storage: true
subresources:
status: {}
2 changes: 2 additions & 0 deletions manifest_staging/deploy/gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3145,6 +3145,8 @@ spec:
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (r *ReconcileConstraintTemplate) Reconcile(ctx context.Context, request rec
createErr := &v1beta1.CreateCRDError{Code: ErrCreateCode, Message: err.Error()}
status.Status.Errors = append(status.Status.Errors, createErr)

if updateErr := r.Update(ctx, status); updateErr != nil {
if updateErr := r.Status().Update(ctx, status); updateErr != nil {
logger.Error(updateErr, "update status error")
return reconcile.Result{Requeue: true}, nil
}
Expand Down Expand Up @@ -454,7 +454,7 @@ func (r *ReconcileConstraintTemplate) reportErrorOnCTStatus(ctx context.Context,
Message: fmt.Sprintf("%s: %s", message, err),
}
status.Status.Errors = append(status.Status.Errors, createErr)
if err2 := r.Update(ctx, status); err2 != nil {
if err2 := r.Status().Update(ctx, status); err2 != nil {
return errorpkg.Wrap(err, fmt.Sprintf("Could not update status: %s", err2))
}
return err
Expand Down Expand Up @@ -522,7 +522,7 @@ func (r *ReconcileConstraintTemplate) handleUpdate(
if err != nil {
return reconcile.Result{}, err
}
if err := r.Update(ctx, status); err != nil {
if err := r.Status().Update(ctx, status); err != nil {
logger.Error(err, "update ct pod status error")
return reconcile.Result{Requeue: true}, nil
}
Expand Down
Loading