From 5d037e3d0f420a0b7c1c66334164c0da078e058d Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Fri, 2 Dec 2022 08:29:25 -0500 Subject: [PATCH] Add Report resource --- .../v1alpha1/zz_generated.deepcopy.go | 318 +++++++++++++ .../v1alpha1/zz_generated.managed.go | 74 +++ .../v1alpha1/zz_generated.managedlist.go | 17 + .../v1alpha1/zz_generated.resolvers.go | 41 ++ .../v1alpha1/zz_generated_terraformed.go | 88 ++++ .../v1alpha1/zz_groupversion_info.go | 32 ++ apis/enterprise/v1alpha1/zz_report_types.go | 171 +++++++ apis/zz_register.go | 2 + config/external_name.go | 50 +- config/grafana/config.go | 51 +- config/groups.go | 3 + .../enterprise/report/zz_controller.go | 51 ++ internal/controller/zz_setup.go | 2 + ...erprise.grafana.crossplane.io_reports.yaml | 448 ++++++++++++++++++ 14 files changed, 1300 insertions(+), 48 deletions(-) create mode 100644 apis/enterprise/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/enterprise/v1alpha1/zz_generated.managed.go create mode 100644 apis/enterprise/v1alpha1/zz_generated.managedlist.go create mode 100644 apis/enterprise/v1alpha1/zz_generated.resolvers.go create mode 100755 apis/enterprise/v1alpha1/zz_generated_terraformed.go create mode 100755 apis/enterprise/v1alpha1/zz_groupversion_info.go create mode 100755 apis/enterprise/v1alpha1/zz_report_types.go create mode 100755 internal/controller/enterprise/report/zz_controller.go create mode 100644 package/crds/enterprise.grafana.crossplane.io_reports.yaml diff --git a/apis/enterprise/v1alpha1/zz_generated.deepcopy.go b/apis/enterprise/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..9b698b5 --- /dev/null +++ b/apis/enterprise/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,318 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Report) DeepCopyInto(out *Report) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Report. +func (in *Report) DeepCopy() *Report { + if in == nil { + return nil + } + out := new(Report) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Report) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReportList) DeepCopyInto(out *ReportList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Report, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportList. +func (in *ReportList) DeepCopy() *ReportList { + if in == nil { + return nil + } + out := new(ReportList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReportList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReportObservation) DeepCopyInto(out *ReportObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportObservation. +func (in *ReportObservation) DeepCopy() *ReportObservation { + if in == nil { + return nil + } + out := new(ReportObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReportParameters) DeepCopyInto(out *ReportParameters) { + *out = *in + if in.DashboardID != nil { + in, out := &in.DashboardID, &out.DashboardID + *out = new(string) + **out = **in + } + if in.DashboardRef != nil { + in, out := &in.DashboardRef, &out.DashboardRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DashboardSelector != nil { + in, out := &in.DashboardSelector, &out.DashboardSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.IncludeDashboardLink != nil { + in, out := &in.IncludeDashboardLink, &out.IncludeDashboardLink + *out = new(bool) + **out = **in + } + if in.IncludeTableCsv != nil { + in, out := &in.IncludeTableCsv, &out.IncludeTableCsv + *out = new(bool) + **out = **in + } + if in.Layout != nil { + in, out := &in.Layout, &out.Layout + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Orientation != nil { + in, out := &in.Orientation, &out.Orientation + *out = new(string) + **out = **in + } + if in.Recipients != nil { + in, out := &in.Recipients, &out.Recipients + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.Schedule != nil { + in, out := &in.Schedule, &out.Schedule + *out = make([]ScheduleParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TimeRange != nil { + in, out := &in.TimeRange, &out.TimeRange + *out = make([]TimeRangeParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportParameters. +func (in *ReportParameters) DeepCopy() *ReportParameters { + if in == nil { + return nil + } + out := new(ReportParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReportSpec) DeepCopyInto(out *ReportSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportSpec. +func (in *ReportSpec) DeepCopy() *ReportSpec { + if in == nil { + return nil + } + out := new(ReportSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReportStatus) DeepCopyInto(out *ReportStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReportStatus. +func (in *ReportStatus) DeepCopy() *ReportStatus { + if in == nil { + return nil + } + out := new(ReportStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduleObservation) DeepCopyInto(out *ScheduleObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleObservation. +func (in *ScheduleObservation) DeepCopy() *ScheduleObservation { + if in == nil { + return nil + } + out := new(ScheduleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduleParameters) DeepCopyInto(out *ScheduleParameters) { + *out = *in + if in.CustomInterval != nil { + in, out := &in.CustomInterval, &out.CustomInterval + *out = new(string) + **out = **in + } + if in.EndTime != nil { + in, out := &in.EndTime, &out.EndTime + *out = new(string) + **out = **in + } + if in.Frequency != nil { + in, out := &in.Frequency, &out.Frequency + *out = new(string) + **out = **in + } + if in.LastDayOfMonth != nil { + in, out := &in.LastDayOfMonth, &out.LastDayOfMonth + *out = new(bool) + **out = **in + } + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = new(string) + **out = **in + } + if in.WorkdaysOnly != nil { + in, out := &in.WorkdaysOnly, &out.WorkdaysOnly + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleParameters. +func (in *ScheduleParameters) DeepCopy() *ScheduleParameters { + if in == nil { + return nil + } + out := new(ScheduleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TimeRangeObservation) DeepCopyInto(out *TimeRangeObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeRangeObservation. +func (in *TimeRangeObservation) DeepCopy() *TimeRangeObservation { + if in == nil { + return nil + } + out := new(TimeRangeObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TimeRangeParameters) DeepCopyInto(out *TimeRangeParameters) { + *out = *in + if in.From != nil { + in, out := &in.From, &out.From + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeRangeParameters. +func (in *TimeRangeParameters) DeepCopy() *TimeRangeParameters { + if in == nil { + return nil + } + out := new(TimeRangeParameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/enterprise/v1alpha1/zz_generated.managed.go b/apis/enterprise/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..8ec27c6 --- /dev/null +++ b/apis/enterprise/v1alpha1/zz_generated.managed.go @@ -0,0 +1,74 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this Report. +func (mg *Report) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Report. +func (mg *Report) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetProviderConfigReference of this Report. +func (mg *Report) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Report. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Report) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Report. +func (mg *Report) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Report. +func (mg *Report) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Report. +func (mg *Report) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Report. +func (mg *Report) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetProviderConfigReference of this Report. +func (mg *Report) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Report. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Report) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Report. +func (mg *Report) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Report. +func (mg *Report) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/enterprise/v1alpha1/zz_generated.managedlist.go b/apis/enterprise/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..e45409c --- /dev/null +++ b/apis/enterprise/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,17 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this ReportList. +func (l *ReportList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/enterprise/v1alpha1/zz_generated.resolvers.go b/apis/enterprise/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..540ea42 --- /dev/null +++ b/apis/enterprise/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,41 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + v1alpha1 "github.com/grafana/crossplane-provider-grafana/apis/oss/v1alpha1" + grafana "github.com/grafana/crossplane-provider-grafana/config/grafana" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this Report. +func (mg *Report) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.DashboardID), + Extract: grafana.DashboardIDExtractor(), + Reference: mg.Spec.ForProvider.DashboardRef, + Selector: mg.Spec.ForProvider.DashboardSelector, + To: reference.To{ + List: &v1alpha1.DashboardList{}, + Managed: &v1alpha1.Dashboard{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.DashboardID") + } + mg.Spec.ForProvider.DashboardID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.DashboardRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/enterprise/v1alpha1/zz_generated_terraformed.go b/apis/enterprise/v1alpha1/zz_generated_terraformed.go new file mode 100755 index 0000000..c26f7f8 --- /dev/null +++ b/apis/enterprise/v1alpha1/zz_generated_terraformed.go @@ -0,0 +1,88 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/pkg/errors" + + "github.com/upbound/upjet/pkg/resource" + "github.com/upbound/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Report +func (mg *Report) GetTerraformResourceType() string { + return "grafana_report" +} + +// GetConnectionDetailsMapping for this Report +func (tr *Report) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Report +func (tr *Report) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Report +func (tr *Report) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Report +func (tr *Report) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Report +func (tr *Report) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Report +func (tr *Report) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Report using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Report) LateInitialize(attrs []byte) (bool, error) { + params := &ReportParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Report) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/enterprise/v1alpha1/zz_groupversion_info.go b/apis/enterprise/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..6c559b7 --- /dev/null +++ b/apis/enterprise/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=enterprise.grafana.crossplane.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "enterprise.grafana.crossplane.io" + CRDVersion = "v1alpha1" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/enterprise/v1alpha1/zz_report_types.go b/apis/enterprise/v1alpha1/zz_report_types.go new file mode 100755 index 0000000..30cbedc --- /dev/null +++ b/apis/enterprise/v1alpha1/zz_report_types.go @@ -0,0 +1,171 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ReportObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` +} + +type ReportParameters struct { + + // Dashboard to be sent in the report. + // +crossplane:generate:reference:type=github.com/grafana/crossplane-provider-grafana/apis/oss/v1alpha1.Dashboard + // +crossplane:generate:reference:extractor=github.com/grafana/crossplane-provider-grafana/config/grafana.DashboardIDExtractor() + // +crossplane:generate:reference:refFieldName=DashboardRef + // +crossplane:generate:reference:selectorFieldName=DashboardSelector + // +kubebuilder:validation:Optional + DashboardID *string `json:"dashboardId,omitempty" tf:"dashboard_id,omitempty"` + + // Reference to a Dashboard in oss to populate dashboardId. + // +kubebuilder:validation:Optional + DashboardRef *v1.Reference `json:"dashboardRef,omitempty" tf:"-"` + + // Selector for a Dashboard in oss to populate dashboardId. + // +kubebuilder:validation:Optional + DashboardSelector *v1.Selector `json:"dashboardSelector,omitempty" tf:"-"` + + // Whether to include a link to the dashboard in the report. Defaults to `true`. + // +kubebuilder:validation:Optional + IncludeDashboardLink *bool `json:"includeDashboardLink,omitempty" tf:"include_dashboard_link,omitempty"` + + // Whether to include a CSV file of table panel data. Defaults to `false`. + // +kubebuilder:validation:Optional + IncludeTableCsv *bool `json:"includeTableCsv,omitempty" tf:"include_table_csv,omitempty"` + + // Layout of the report. Allowed values: `simple`, `grid`. Defaults to `grid`. + // +kubebuilder:validation:Optional + Layout *string `json:"layout,omitempty" tf:"layout,omitempty"` + + // Message to be sent in the report. + // +kubebuilder:validation:Optional + Message *string `json:"message,omitempty" tf:"message,omitempty"` + + // Name of the report. + // +kubebuilder:validation:Required + Name *string `json:"name" tf:"name,omitempty"` + + // Orientation of the report. Allowed values: `landscape`, `portrait`. Defaults to `landscape`. + // +kubebuilder:validation:Optional + Orientation *string `json:"orientation,omitempty" tf:"orientation,omitempty"` + + // List of recipients of the report. + // +kubebuilder:validation:Required + Recipients []*string `json:"recipients" tf:"recipients,omitempty"` + + // Reply-to email address of the report. + // +kubebuilder:validation:Optional + ReplyTo *string `json:"replyTo,omitempty" tf:"reply_to,omitempty"` + + // Schedule of the report. + // +kubebuilder:validation:Required + Schedule []ScheduleParameters `json:"schedule" tf:"schedule,omitempty"` + + // Time range of the report. + // +kubebuilder:validation:Optional + TimeRange []TimeRangeParameters `json:"timeRange,omitempty" tf:"time_range,omitempty"` +} + +type ScheduleObservation struct { +} + +type ScheduleParameters struct { + + // Custom interval of the report. + // **Note:** This field is only available when frequency is set to `custom`. + // +kubebuilder:validation:Optional + CustomInterval *string `json:"customInterval,omitempty" tf:"custom_interval,omitempty"` + + // End time of the report. If empty, the report will be sent indefinitely (according to frequency). Note that times will be saved as UTC in Grafana. + // +kubebuilder:validation:Optional + EndTime *string `json:"endTime,omitempty" tf:"end_time,omitempty"` + + // Frequency of the report. Allowed values: `never`, `once`, `hourly`, `daily`, `weekly`, `monthly`, `custom`. + // +kubebuilder:validation:Required + Frequency *string `json:"frequency" tf:"frequency,omitempty"` + + // Send the report on the last day of the month Defaults to `false`. + // +kubebuilder:validation:Optional + LastDayOfMonth *bool `json:"lastDayOfMonth,omitempty" tf:"last_day_of_month,omitempty"` + + // Start time of the report. If empty, the start date will be set to the creation time. Note that times will be saved as UTC in Grafana. + // +kubebuilder:validation:Optional + StartTime *string `json:"startTime,omitempty" tf:"start_time,omitempty"` + + // Whether to send the report only on work days. Defaults to `false`. + // +kubebuilder:validation:Optional + WorkdaysOnly *bool `json:"workdaysOnly,omitempty" tf:"workdays_only,omitempty"` +} + +type TimeRangeObservation struct { +} + +type TimeRangeParameters struct { + + // Start of the time range. + // +kubebuilder:validation:Optional + From *string `json:"from,omitempty" tf:"from,omitempty"` + + // End of the time range. + // +kubebuilder:validation:Optional + To *string `json:"to,omitempty" tf:"to,omitempty"` +} + +// ReportSpec defines the desired state of Report +type ReportSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ReportParameters `json:"forProvider"` +} + +// ReportStatus defines the observed state of Report. +type ReportStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ReportObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Report is the Schema for the Reports API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,grafana} +type Report struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ReportSpec `json:"spec"` + Status ReportStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ReportList contains a list of Reports +type ReportList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Report `json:"items"` +} + +// Repository type metadata. +var ( + Report_Kind = "Report" + Report_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Report_Kind}.String() + Report_KindAPIVersion = Report_Kind + "." + CRDGroupVersion.String() + Report_GroupVersionKind = CRDGroupVersion.WithKind(Report_Kind) +) + +func init() { + SchemeBuilder.Register(&Report{}, &ReportList{}) +} diff --git a/apis/zz_register.go b/apis/zz_register.go index 3733382..fa5039b 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -12,6 +12,7 @@ import ( v1alpha1 "github.com/grafana/crossplane-provider-grafana/apis/alerting/v1alpha1" v1alpha1cloud "github.com/grafana/crossplane-provider-grafana/apis/cloud/v1alpha1" + v1alpha1enterprise "github.com/grafana/crossplane-provider-grafana/apis/enterprise/v1alpha1" v1alpha1oncall "github.com/grafana/crossplane-provider-grafana/apis/oncall/v1alpha1" v1alpha1oss "github.com/grafana/crossplane-provider-grafana/apis/oss/v1alpha1" v1alpha1sm "github.com/grafana/crossplane-provider-grafana/apis/sm/v1alpha1" @@ -24,6 +25,7 @@ func init() { AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1alpha1cloud.SchemeBuilder.AddToScheme, + v1alpha1enterprise.SchemeBuilder.AddToScheme, v1alpha1oncall.SchemeBuilder.AddToScheme, v1alpha1oss.SchemeBuilder.AddToScheme, v1alpha1sm.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index 935bad5..4450420 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -8,37 +8,33 @@ import "github.com/upbound/upjet/pkg/config" // ExternalNameConfigs contains all external name configurations for this // provider. -// Keep same structure as in groups.go var ExternalNameConfigs = map[string]config.ExternalName{ - "grafana_contact_point": config.IdentifierFromProvider, - "grafana_message_template": config.IdentifierFromProvider, - "grafana_mute_timing": config.IdentifierFromProvider, - "grafana_notification_policy": config.IdentifierFromProvider, - "grafana_rule_group": config.IdentifierFromProvider, - - "grafana_cloud_api_key": config.IdentifierFromProvider, - "grafana_cloud_stack": config.IdentifierFromProvider, - - "grafana_oncall_escalation": config.IdentifierFromProvider, - "grafana_oncall_escalation_chain": config.IdentifierFromProvider, - "grafana_oncall_integration": config.IdentifierFromProvider, - "grafana_oncall_on_call_shift": config.IdentifierFromProvider, - "grafana_oncall_outgoing_webhook": config.IdentifierFromProvider, - "grafana_oncall_route": config.IdentifierFromProvider, - "grafana_oncall_schedule": config.IdentifierFromProvider, - - "grafana_api_key": config.IdentifierFromProvider, - "grafana_data_source": config.IdentifierFromProvider, - "grafana_dashboard": config.IdentifierFromProvider, - "grafana_dashboard_permission": config.IdentifierFromProvider, - "grafana_folder": config.IdentifierFromProvider, - "grafana_folder_permission": config.IdentifierFromProvider, - "grafana_team": config.IdentifierFromProvider, - "grafana_user": config.IdentifierFromProvider, - + "grafana_api_key": config.IdentifierFromProvider, + "grafana_cloud_api_key": config.IdentifierFromProvider, + "grafana_cloud_stack": config.IdentifierFromProvider, + "grafana_contact_point": config.IdentifierFromProvider, + "grafana_dashboard_permission": config.IdentifierFromProvider, + "grafana_dashboard": config.IdentifierFromProvider, + "grafana_data_source": config.IdentifierFromProvider, + "grafana_folder_permission": config.IdentifierFromProvider, + "grafana_folder": config.IdentifierFromProvider, + "grafana_message_template": config.IdentifierFromProvider, + "grafana_mute_timing": config.IdentifierFromProvider, + "grafana_notification_policy": config.IdentifierFromProvider, + "grafana_oncall_escalation_chain": config.IdentifierFromProvider, + "grafana_oncall_escalation": config.IdentifierFromProvider, + "grafana_oncall_integration": config.IdentifierFromProvider, + "grafana_oncall_on_call_shift": config.IdentifierFromProvider, + "grafana_oncall_outgoing_webhook": config.IdentifierFromProvider, + "grafana_oncall_route": config.IdentifierFromProvider, + "grafana_oncall_schedule": config.IdentifierFromProvider, + "grafana_report": config.IdentifierFromProvider, + "grafana_rule_group": config.IdentifierFromProvider, "grafana_synthetic_monitoring_check": config.IdentifierFromProvider, "grafana_synthetic_monitoring_installation": config.IdentifierFromProvider, "grafana_synthetic_monitoring_probe": config.IdentifierFromProvider, + "grafana_team": config.IdentifierFromProvider, + "grafana_user": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/grafana/config.go b/config/grafana/config.go index 00117d6..f28aff9 100644 --- a/config/grafana/config.go +++ b/config/grafana/config.go @@ -19,22 +19,6 @@ const ( // Configure configures the grafana group func Configure(p *ujconfig.Provider) { - p.AddResourceConfigurator("grafana_notification_policy", func(r *ujconfig.Resource) { - r.References["contact_point"] = ujconfig.Reference{ - TerraformName: "grafana_contact_point", - RefFieldName: "ContactPointRef", - SelectorFieldName: "ContactPointSelector", - Extractor: SelfPackagePath + ".NameExtractor()", - } - }) - p.AddResourceConfigurator("grafana_rule_group", func(r *ujconfig.Resource) { - r.References["folder_uid"] = ujconfig.Reference{ - TerraformName: "grafana_folder", - RefFieldName: "FolderRef", - SelectorFieldName: "FolderSelector", - Extractor: SelfPackagePath + ".UIDExtractor()", - } - }) p.AddResourceConfigurator("grafana_api_key", func(r *ujconfig.Resource) { r.References["cloud_stack_slug"] = ujconfig.Reference{ TerraformName: "grafana_cloud_stack", @@ -77,6 +61,12 @@ func Configure(p *ujconfig.Provider) { Extractor: SelfPackagePath + ".DashboardIDExtractor()", } }) + p.AddResourceConfigurator("grafana_data_source", func(r *ujconfig.Resource) { + delete(r.TerraformResource.Schema, "basic_auth_password") // Deprecated + delete(r.TerraformResource.Schema, "password") // Deprecated + delete(r.TerraformResource.Schema, "json_data") // Deprecated + delete(r.TerraformResource.Schema, "secure_json_data") // Deprecated + }) p.AddResourceConfigurator("grafana_folder_permission", func(r *ujconfig.Resource) { r.References["folder_uid"] = ujconfig.Reference{ TerraformName: "grafana_folder", @@ -85,11 +75,30 @@ func Configure(p *ujconfig.Provider) { Extractor: SelfPackagePath + ".UIDExtractor()", } }) - p.AddResourceConfigurator("grafana_data_source", func(r *ujconfig.Resource) { - delete(r.TerraformResource.Schema, "basic_auth_password") // Deprecated - delete(r.TerraformResource.Schema, "password") // Deprecated - delete(r.TerraformResource.Schema, "json_data") // Deprecated - delete(r.TerraformResource.Schema, "secure_json_data") // Deprecated + p.AddResourceConfigurator("grafana_notification_policy", func(r *ujconfig.Resource) { + r.References["contact_point"] = ujconfig.Reference{ + TerraformName: "grafana_contact_point", + RefFieldName: "ContactPointRef", + SelectorFieldName: "ContactPointSelector", + Extractor: SelfPackagePath + ".NameExtractor()", + } + }) + p.AddResourceConfigurator("grafana_report", func(r *ujconfig.Resource) { + r.TerraformResource.Schema["dashboard_id"].Type = schema.TypeString // hack because it seems like upjet doesn't support number references + r.References["dashboard_id"] = ujconfig.Reference{ + TerraformName: "grafana_dashboard", + RefFieldName: "DashboardRef", + SelectorFieldName: "DashboardSelector", + Extractor: SelfPackagePath + ".DashboardIDExtractor()", + } + }) + p.AddResourceConfigurator("grafana_rule_group", func(r *ujconfig.Resource) { + r.References["folder_uid"] = ujconfig.Reference{ + TerraformName: "grafana_folder", + RefFieldName: "FolderRef", + SelectorFieldName: "FolderSelector", + Extractor: SelfPackagePath + ".UIDExtractor()", + } }) p.AddResourceConfigurator("grafana_team", func(r *ujconfig.Resource) { r.References["members"] = ujconfig.Reference{ diff --git a/config/groups.go b/config/groups.go index 780e697..7544037 100644 --- a/config/groups.go +++ b/config/groups.go @@ -58,6 +58,9 @@ var GroupMap = map[string]GroupKindCalculator{ "grafana_cloud_api_key": ReplaceGroupWords("cloud", 1), "grafana_cloud_stack": ReplaceGroupWords("cloud", 1), + // Enterprise + "grafana_report": ReplaceGroupWords("enterprise", 0), + // OnCall "grafana_oncall_escalation": ReplaceGroupWords("oncall", 1), "grafana_oncall_escalation_chain": ReplaceGroupWords("oncall", 1), diff --git a/internal/controller/enterprise/report/zz_controller.go b/internal/controller/enterprise/report/zz_controller.go new file mode 100755 index 0000000..38b572f --- /dev/null +++ b/internal/controller/enterprise/report/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package report + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/grafana/crossplane-provider-grafana/apis/enterprise/v1alpha1" +) + +// Setup adds a controller that reconciles Report managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Report_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha1.Report_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["grafana_report"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Report_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.Report{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 95efa0d..5232d21 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -16,6 +16,7 @@ import ( rulegroup "github.com/grafana/crossplane-provider-grafana/internal/controller/alerting/rulegroup" apikey "github.com/grafana/crossplane-provider-grafana/internal/controller/cloud/apikey" stack "github.com/grafana/crossplane-provider-grafana/internal/controller/cloud/stack" + report "github.com/grafana/crossplane-provider-grafana/internal/controller/enterprise/report" escalation "github.com/grafana/crossplane-provider-grafana/internal/controller/oncall/escalation" escalationchain "github.com/grafana/crossplane-provider-grafana/internal/controller/oncall/escalationchain" integration "github.com/grafana/crossplane-provider-grafana/internal/controller/oncall/integration" @@ -48,6 +49,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { rulegroup.Setup, apikey.Setup, stack.Setup, + report.Setup, escalation.Setup, escalationchain.Setup, integration.Setup, diff --git a/package/crds/enterprise.grafana.crossplane.io_reports.yaml b/package/crds/enterprise.grafana.crossplane.io_reports.yaml new file mode 100644 index 0000000..ba702a0 --- /dev/null +++ b/package/crds/enterprise.grafana.crossplane.io_reports.yaml @@ -0,0 +1,448 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: reports.enterprise.grafana.crossplane.io +spec: + group: enterprise.grafana.crossplane.io + names: + categories: + - crossplane + - managed + - grafana + kind: Report + listKind: ReportList + plural: reports + singular: report + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Report is the Schema for the Reports API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ReportSpec defines the desired state of Report + properties: + deletionPolicy: + default: Delete + description: DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + dashboardId: + description: Dashboard to be sent in the report. + type: string + dashboardRef: + description: Reference to a Dashboard in oss to populate dashboardId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + dashboardSelector: + description: Selector for a Dashboard in oss to populate dashboardId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + includeDashboardLink: + description: Whether to include a link to the dashboard in the + report. Defaults to `true`. + type: boolean + includeTableCsv: + description: Whether to include a CSV file of table panel data. + Defaults to `false`. + type: boolean + layout: + description: 'Layout of the report. Allowed values: `simple`, + `grid`. Defaults to `grid`.' + type: string + message: + description: Message to be sent in the report. + type: string + name: + description: Name of the report. + type: string + orientation: + description: 'Orientation of the report. Allowed values: `landscape`, + `portrait`. Defaults to `landscape`.' + type: string + recipients: + description: List of recipients of the report. + items: + type: string + type: array + replyTo: + description: Reply-to email address of the report. + type: string + schedule: + description: Schedule of the report. + items: + properties: + customInterval: + description: Custom interval of the report. **Note:** This + field is only available when frequency is set to `custom`. + type: string + endTime: + description: End time of the report. If empty, the report + will be sent indefinitely (according to frequency). Note + that times will be saved as UTC in Grafana. + type: string + frequency: + description: 'Frequency of the report. Allowed values: `never`, + `once`, `hourly`, `daily`, `weekly`, `monthly`, `custom`.' + type: string + lastDayOfMonth: + description: Send the report on the last day of the month + Defaults to `false`. + type: boolean + startTime: + description: Start time of the report. If empty, the start + date will be set to the creation time. Note that times + will be saved as UTC in Grafana. + type: string + workdaysOnly: + description: Whether to send the report only on work days. + Defaults to `false`. + type: boolean + required: + - frequency + type: object + type: array + timeRange: + description: Time range of the report. + items: + properties: + from: + description: Start of the time range. + type: string + to: + description: End of the time range. + type: string + type: object + type: array + required: + - name + - recipients + - schedule + type: object + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: ReportStatus defines the observed state of Report. + properties: + atProvider: + properties: + id: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: []