Skip to content

Commit

Permalink
Merge #383
Browse files Browse the repository at this point in the history
383: Tag Status field as omitempty r=mkmik a=mkmik

Checked that nobody depends on the Status field since we're technically breaking source backward compat
https://pkg.go.dev/github.com/bitnami-labs/sealed-secrets@v0.11.0/pkg/apis/sealed-secrets/v1alpha1?tab=doc#SealedSecretStatus

Co-authored-by: Marko Mikulicic <mkmik@vmware.com>
  • Loading branch information
bors[bot] and Marko Mikulicic authored Mar 27, 2020
2 parents 4c1a221 + 408a9c7 commit 1a1e4f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions cmd/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,12 @@ func (c *Controller) unseal(key string) (unsealErr error) {

func (c *Controller) updateSealedSecretStatus(ssecret *ssv1alpha1.SealedSecret, unsealError error) error {
ssecret = ssecret.DeepCopy()
st := &ssecret.Status
if ssecret.Status == nil {
ssecret.Status = &ssv1alpha1.SealedSecretStatus{}
}

st.ObservedGeneration = ssecret.ObjectMeta.Generation
updateSealedSecretsStatusConditions(st, unsealError)
ssecret.Status.ObservedGeneration = ssecret.ObjectMeta.Generation
updateSealedSecretsStatusConditions(ssecret.Status, unsealError)

_, err := c.ssclient.SealedSecrets(ssecret.GetObjectMeta().GetNamespace()).UpdateStatus(ssecret)
return err
Expand Down
7 changes: 4 additions & 3 deletions pkg/apis/sealed-secrets/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (

// SealedSecretManagedAnnotation is the name for the annotation for
// flaging the existing secrets be managed by SealedSecret controller.
SealedSecretManagedAnnotation = annoNs + "managed"
SealedSecretManagedAnnotation = annoNs + "managed"
)

// SecretTemplateSpec describes the structure a Secret should have
Expand Down Expand Up @@ -101,8 +101,9 @@ type SealedSecret struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec SealedSecretSpec `json:"spec"`
Status SealedSecretStatus `json:"status"`
Spec SealedSecretSpec `json:"spec"`
// +optional
Status *SealedSecretStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
6 changes: 5 additions & 1 deletion pkg/apis/sealed-secrets/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a1e4f3

Please sign in to comment.