diff --git a/api/v1beta1/grafana_types.go b/api/v1beta1/grafana_types.go index 8d4f2406b..9e7c03635 100644 --- a/api/v1beta1/grafana_types.go +++ b/api/v1beta1/grafana_types.go @@ -131,6 +131,8 @@ type GrafanaPreferences struct { // GrafanaStatus defines the observed state of Grafana type GrafanaStatus struct { + GrafanaCommonStatus `json:",inline"` + Stage OperatorStageName `json:"stage,omitempty"` StageStatus OperatorStageStatus `json:"stageStatus,omitempty"` LastMessage string `json:"lastMessage,omitempty"` diff --git a/api/v1beta1/grafanaalertrulegroup_types.go b/api/v1beta1/grafanaalertrulegroup_types.go index e37d73286..da052dee3 100644 --- a/api/v1beta1/grafanaalertrulegroup_types.go +++ b/api/v1beta1/grafanaalertrulegroup_types.go @@ -117,11 +117,6 @@ type AlertQuery struct { RelativeTimeRange *models.RelativeTimeRange `json:"relativeTimeRange,omitempty"` } -// GrafanaAlertRuleGroupStatus defines the observed state of GrafanaAlertRuleGroup -type GrafanaAlertRuleGroupStatus struct { - Conditions []metav1.Condition `json:"conditions"` -} - //+kubebuilder:object:root=true //+kubebuilder:subresource:status @@ -131,8 +126,8 @@ type GrafanaAlertRuleGroup struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec GrafanaAlertRuleGroupSpec `json:"spec,omitempty"` - Status GrafanaAlertRuleGroupStatus `json:"status,omitempty"` + Spec GrafanaAlertRuleGroupSpec `json:"spec,omitempty"` + Status GrafanaCommonStatus `json:"status,omitempty"` } // GroupName returns the name of alert rule group. diff --git a/api/v1beta1/grafanacontactpoint_types.go b/api/v1beta1/grafanacontactpoint_types.go index 74c6dfed9..c947b42ef 100644 --- a/api/v1beta1/grafanacontactpoint_types.go +++ b/api/v1beta1/grafanacontactpoint_types.go @@ -49,13 +49,6 @@ type GrafanaContactPointSpec struct { Type string `json:"type,omitempty"` } -// GrafanaContactPointStatus defines the observed state of GrafanaContactPoint -type GrafanaContactPointStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file - Conditions []metav1.Condition `json:"conditions"` -} - //+kubebuilder:object:root=true //+kubebuilder:subresource:status @@ -65,8 +58,8 @@ type GrafanaContactPoint struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec GrafanaContactPointSpec `json:"spec,omitempty"` - Status GrafanaContactPointStatus `json:"status,omitempty"` + Spec GrafanaContactPointSpec `json:"spec,omitempty"` + Status GrafanaCommonStatus `json:"status,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1beta1/grafanadashboard_types.go b/api/v1beta1/grafanadashboard_types.go index 21e14e78c..5a8a8466a 100644 --- a/api/v1beta1/grafanadashboard_types.go +++ b/api/v1beta1/grafanadashboard_types.go @@ -165,17 +165,15 @@ type GrafanaComDashboardReference struct { // GrafanaDashboardStatus defines the observed state of GrafanaDashboard type GrafanaDashboardStatus struct { + GrafanaCommonStatus `json:",inline"` + ContentCache []byte `json:"contentCache,omitempty"` ContentTimestamp metav1.Time `json:"contentTimestamp,omitempty"` ContentUrl string `json:"contentUrl,omitempty"` Hash string `json:"hash,omitempty"` // The dashboard instanceSelector can't find matching grafana instances - NoMatchingInstances bool `json:"NoMatchingInstances,omitempty"` - // Last time the dashboard was resynced - LastResync metav1.Time `json:"lastResync,omitempty"` - UID string `json:"uid,omitempty"` - - Conditions []metav1.Condition `json:"conditions,omitempty"` + NoMatchingInstances bool `json:"NoMatchingInstances,omitempty"` + UID string `json:"uid,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1beta1/grafanadatasource_types.go b/api/v1beta1/grafanadatasource_types.go index ebc2b48e5..eb285f2be 100644 --- a/api/v1beta1/grafanadatasource_types.go +++ b/api/v1beta1/grafanadatasource_types.go @@ -81,13 +81,13 @@ type GrafanaDatasourceSpec struct { // GrafanaDatasourceStatus defines the observed state of GrafanaDatasource type GrafanaDatasourceStatus struct { + GrafanaCommonStatus `json:",inline"` + Hash string `json:"hash,omitempty"` LastMessage string `json:"lastMessage,omitempty"` // The datasource instanceSelector can't find matching grafana instances - NoMatchingInstances bool `json:"NoMatchingInstances,omitempty"` - // Last time the datasource was resynced - LastResync metav1.Time `json:"lastResync,omitempty"` - UID string `json:"uid,omitempty"` + NoMatchingInstances bool `json:"NoMatchingInstances,omitempty"` + UID string `json:"uid,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1beta1/grafanafolder_types.go b/api/v1beta1/grafanafolder_types.go index b2d79b406..8f268730c 100644 --- a/api/v1beta1/grafanafolder_types.go +++ b/api/v1beta1/grafanafolder_types.go @@ -58,14 +58,11 @@ type GrafanaFolderSpec struct { // GrafanaFolderStatus defines the observed state of GrafanaFolder type GrafanaFolderStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file + GrafanaCommonStatus `json:",inline"` + Hash string `json:"hash,omitempty"` // The folder instanceSelector can't find matching grafana instances NoMatchingInstances bool `json:"NoMatchingInstances,omitempty"` - // Last time the folder was resynced - LastResync metav1.Time `json:"lastResync,omitempty"` - Conditions []metav1.Condition `json:"conditions,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1beta1/grafananotificationpolicy_types.go b/api/v1beta1/grafananotificationpolicy_types.go index 2a11ada30..447257c1b 100644 --- a/api/v1beta1/grafananotificationpolicy_types.go +++ b/api/v1beta1/grafananotificationpolicy_types.go @@ -126,11 +126,6 @@ func (r *Route) ToModelRoute() *models.Route { return out } -// GrafanaNotificationPolicyStatus defines the observed state of GrafanaNotificationPolicy -type GrafanaNotificationPolicyStatus struct { - Conditions []metav1.Condition `json:"conditions"` -} - //+kubebuilder:object:root=true //+kubebuilder:subresource:status @@ -140,8 +135,8 @@ type GrafanaNotificationPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec GrafanaNotificationPolicySpec `json:"spec,omitempty"` - Status GrafanaNotificationPolicyStatus `json:"status,omitempty"` + Spec GrafanaNotificationPolicySpec `json:"spec,omitempty"` + Status GrafanaCommonStatus `json:"status,omitempty"` } func (np *GrafanaNotificationPolicy) NamespacedResource() string { diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index d48d748da..acc146bae 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -503,28 +503,6 @@ func (in *GrafanaAlertRuleGroupSpec) DeepCopy() *GrafanaAlertRuleGroupSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GrafanaAlertRuleGroupStatus) DeepCopyInto(out *GrafanaAlertRuleGroupStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaAlertRuleGroupStatus. -func (in *GrafanaAlertRuleGroupStatus) DeepCopy() *GrafanaAlertRuleGroupStatus { - if in == nil { - return nil - } - out := new(GrafanaAlertRuleGroupStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaClient) DeepCopyInto(out *GrafanaClient) { *out = *in @@ -718,28 +696,6 @@ func (in *GrafanaContactPointSpec) DeepCopy() *GrafanaContactPointSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GrafanaContactPointStatus) DeepCopyInto(out *GrafanaContactPointStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaContactPointStatus. -func (in *GrafanaContactPointStatus) DeepCopy() *GrafanaContactPointStatus { - if in == nil { - return nil - } - out := new(GrafanaContactPointStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaDashboard) DeepCopyInto(out *GrafanaDashboard) { *out = *in @@ -924,20 +880,13 @@ func (in *GrafanaDashboardSpec) DeepCopy() *GrafanaDashboardSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaDashboardStatus) DeepCopyInto(out *GrafanaDashboardStatus) { *out = *in + in.GrafanaCommonStatus.DeepCopyInto(&out.GrafanaCommonStatus) if in.ContentCache != nil { in, out := &in.ContentCache, &out.ContentCache *out = make([]byte, len(*in)) copy(*out, *in) } in.ContentTimestamp.DeepCopyInto(&out.ContentTimestamp) - in.LastResync.DeepCopyInto(&out.LastResync) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaDashboardStatus. @@ -1135,7 +1084,7 @@ func (in *GrafanaDatasourceSpec) DeepCopy() *GrafanaDatasourceSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaDatasourceStatus) DeepCopyInto(out *GrafanaDatasourceStatus) { *out = *in - in.LastResync.DeepCopyInto(&out.LastResync) + in.GrafanaCommonStatus.DeepCopyInto(&out.GrafanaCommonStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaDatasourceStatus. @@ -1226,14 +1175,7 @@ func (in *GrafanaFolderSpec) DeepCopy() *GrafanaFolderSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaFolderStatus) DeepCopyInto(out *GrafanaFolderStatus) { *out = *in - in.LastResync.DeepCopyInto(&out.LastResync) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } + in.GrafanaCommonStatus.DeepCopyInto(&out.GrafanaCommonStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaFolderStatus. @@ -1363,28 +1305,6 @@ func (in *GrafanaNotificationPolicySpec) DeepCopy() *GrafanaNotificationPolicySp return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GrafanaNotificationPolicyStatus) DeepCopyInto(out *GrafanaNotificationPolicyStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaNotificationPolicyStatus. -func (in *GrafanaNotificationPolicyStatus) DeepCopy() *GrafanaNotificationPolicyStatus { - if in == nil { - return nil - } - out := new(GrafanaNotificationPolicyStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaPlugin) DeepCopyInto(out *GrafanaPlugin) { *out = *in @@ -1501,6 +1421,7 @@ func (in *GrafanaSpec) DeepCopy() *GrafanaSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaStatus) DeepCopyInto(out *GrafanaStatus) { *out = *in + in.GrafanaCommonStatus.DeepCopyInto(&out.GrafanaCommonStatus) if in.Dashboards != nil { in, out := &in.Dashboards, &out.Dashboards *out = make(NamespacedResourceList, len(*in))