From 7b4e1e380f5025f37df5a274582a7a99fa9a44a0 Mon Sep 17 00:00:00 2001 From: Andy Lo-A-Foe Date: Sat, 6 Jul 2024 09:28:46 +0200 Subject: [PATCH] Upgrade upjet version --- .../v1alpha1/zz_generated.conversion_hubs.go | 13 +++ apis/cdr/v1alpha1/zz_groupversion_info.go | 4 - .../v1alpha1/zz_organization_terraformed.go | 4 - apis/cdr/v1alpha1/zz_organization_types.go | 9 +- .../v1alpha1/zz_subscription_terraformed.go | 4 - apis/cdr/v1alpha1/zz_subscription_types.go | 9 +- .../v1alpha1/zz_generated.conversion_hubs.go | 13 +++ apis/dbs/v1alpha1/zz_groupversion_info.go | 4 - .../v1alpha1/zz_sqssubscriber_terraformed.go | 4 - apis/dbs/v1alpha1/zz_sqssubscriber_types.go | 9 +- .../v1alpha1/zz_subscription_terraformed.go | 4 - apis/dbs/v1alpha1/zz_subscription_types.go | 9 +- .../v1alpha1/zz_generated.conversion_hubs.go | 19 ++++ apis/dicom/v1alpha1/zz_generated.deepcopy.go | 4 + apis/dicom/v1alpha1/zz_groupversion_info.go | 4 - .../v1alpha1/zz_notification_terraformed.go | 4 - apis/dicom/v1alpha1/zz_notification_types.go | 9 +- .../v1alpha1/zz_objectstore_terraformed.go | 6 +- apis/dicom/v1alpha1/zz_objectstore_types.go | 29 +++-- .../v1alpha1/zz_repository_terraformed.go | 4 - apis/dicom/v1alpha1/zz_repository_types.go | 9 +- .../v1alpha1/zz_storeconfig_terraformed.go | 4 - apis/dicom/v1alpha1/zz_storeconfig_types.go | 9 +- .../v1alpha1/zz_application_terraformed.go | 4 - apis/iam/v1alpha1/zz_application_types.go | 9 +- apis/iam/v1alpha1/zz_client_terraformed.go | 6 +- apis/iam/v1alpha1/zz_client_types.go | 13 +-- .../v1alpha1/zz_emailtemplate_terraformed.go | 4 - apis/iam/v1alpha1/zz_emailtemplate_types.go | 9 +- .../v1alpha1/zz_generated.conversion_hubs.go | 40 +++++++ apis/iam/v1alpha1/zz_generated.deepcopy.go | 11 ++ apis/iam/v1alpha1/zz_group_terraformed.go | 4 - apis/iam/v1alpha1/zz_group_types.go | 9 +- apis/iam/v1alpha1/zz_groupversion_info.go | 4 - .../v1alpha1/zz_organization_terraformed.go | 4 - apis/iam/v1alpha1/zz_organization_types.go | 9 +- .../v1alpha1/zz_passwordpolicy_terraformed.go | 4 - apis/iam/v1alpha1/zz_passwordpolicy_types.go | 9 +- .../v1alpha1/zz_proposition_terraformed.go | 4 - apis/iam/v1alpha1/zz_proposition_types.go | 9 +- apis/iam/v1alpha1/zz_role_terraformed.go | 4 - apis/iam/v1alpha1/zz_role_types.go | 9 +- .../zz_rolesharingpolicy_terraformed.go | 4 - .../v1alpha1/zz_rolesharingpolicy_types.go | 9 +- apis/iam/v1alpha1/zz_service_terraformed.go | 6 +- apis/iam/v1alpha1/zz_service_types.go | 14 +-- apis/iam/v1alpha1/zz_user_terraformed.go | 6 +- apis/iam/v1alpha1/zz_user_types.go | 18 ++-- apis/mdm/v1alpha1/zz_datatype_terraformed.go | 4 - apis/mdm/v1alpha1/zz_datatype_types.go | 9 +- .../v1alpha1/zz_generated.conversion_hubs.go | 13 +++ apis/mdm/v1alpha1/zz_groupversion_info.go | 4 - .../v1alpha1/zz_proposition_terraformed.go | 4 - apis/mdm/v1alpha1/zz_proposition_types.go | 9 +- apis/zz_register.go | 4 - config/provider.go | 2 +- examples-generated/cdr/organization.yaml | 16 --- examples-generated/cdr/subscription.yaml | 38 ------- examples-generated/dbs/sqssubscriber.yaml | 17 --- examples-generated/dicom/notification.yaml | 15 --- examples-generated/dicom/objectstore.yaml | 31 ------ examples-generated/dicom/repository.yaml | 17 --- examples-generated/dicom/storeconfig.yaml | 19 ---- examples-generated/iam/application.yaml | 15 --- examples-generated/iam/client.yaml | 36 ------- examples-generated/iam/emailtemplate.yaml | 24 ----- examples-generated/iam/group.yaml | 23 ---- examples-generated/iam/organization.yaml | 13 --- examples-generated/iam/passwordpolicy.yaml | 22 ---- examples-generated/iam/proposition.yaml | 15 --- examples-generated/iam/role.yaml | 24 ----- examples-generated/iam/rolesharingpolicy.yaml | 39 ------- examples-generated/iam/service.yaml | 21 ---- examples-generated/iam/user.yaml | 17 --- examples-generated/mdm/datatype.yaml | 19 ---- examples-generated/mdm/proposition.yaml | 15 --- go.mod | 5 +- .../cdr/organization/zz_controller.go | 43 ++++++-- .../cdr/subscription/zz_controller.go | 43 ++++++-- .../dbs/sqssubscriber/zz_controller.go | 43 ++++++-- .../dbs/subscription/zz_controller.go | 43 ++++++-- .../dicom/notification/zz_controller.go | 43 ++++++-- .../dicom/objectstore/zz_controller.go | 43 ++++++-- .../dicom/repository/zz_controller.go | 43 ++++++-- .../dicom/storeconfig/zz_controller.go | 43 ++++++-- .../iam/application/zz_controller.go | 43 ++++++-- .../controller/iam/client/zz_controller.go | 43 ++++++-- .../iam/emailtemplate/zz_controller.go | 43 ++++++-- .../controller/iam/group/zz_controller.go | 43 ++++++-- .../iam/organization/zz_controller.go | 43 ++++++-- .../iam/passwordpolicy/zz_controller.go | 43 ++++++-- .../iam/proposition/zz_controller.go | 43 ++++++-- internal/controller/iam/role/zz_controller.go | 43 ++++++-- .../iam/rolesharingpolicy/zz_controller.go | 43 ++++++-- .../controller/iam/service/zz_controller.go | 43 ++++++-- internal/controller/iam/user/zz_controller.go | 43 ++++++-- .../controller/mdm/datatype/zz_controller.go | 43 ++++++-- .../mdm/proposition/zz_controller.go | 43 ++++++-- internal/controller/zz_setup.go | 6 +- .../cdr.hsdp.crossplane.io_organizations.yaml | 20 +++- .../cdr.hsdp.crossplane.io_subscriptions.yaml | 20 +++- ...dbs.hsdp.crossplane.io_sqssubscribers.yaml | 20 +++- .../dbs.hsdp.crossplane.io_subscriptions.yaml | 20 +++- ...icom.hsdp.crossplane.io_notifications.yaml | 20 +++- ...dicom.hsdp.crossplane.io_objectstores.yaml | 102 ++++++++++++++++-- ...dicom.hsdp.crossplane.io_repositories.yaml | 20 +++- ...dicom.hsdp.crossplane.io_storeconfigs.yaml | 20 +++- .../hsdp.crossplane.io_providerconfigs.yaml | 7 ++ .../crds/hsdp.crossplane.io_storeconfigs.yaml | 7 ++ .../iam.hsdp.crossplane.io_applications.yaml | 20 +++- .../crds/iam.hsdp.crossplane.io_clients.yaml | 41 ++++++- ...iam.hsdp.crossplane.io_emailtemplates.yaml | 20 +++- .../crds/iam.hsdp.crossplane.io_groups.yaml | 20 +++- .../iam.hsdp.crossplane.io_organizations.yaml | 20 +++- ...m.hsdp.crossplane.io_passwordpolicies.yaml | 20 +++- .../iam.hsdp.crossplane.io_propositions.yaml | 20 +++- .../crds/iam.hsdp.crossplane.io_roles.yaml | 20 +++- ...sdp.crossplane.io_rolesharingpolicies.yaml | 20 +++- .../crds/iam.hsdp.crossplane.io_services.yaml | 40 ++++++- .../crds/iam.hsdp.crossplane.io_users.yaml | 44 +++++++- .../mdm.hsdp.crossplane.io_datatypes.yaml | 20 +++- .../mdm.hsdp.crossplane.io_propositions.yaml | 20 +++- 122 files changed, 1404 insertions(+), 985 deletions(-) create mode 100755 apis/cdr/v1alpha1/zz_generated.conversion_hubs.go create mode 100755 apis/dbs/v1alpha1/zz_generated.conversion_hubs.go create mode 100755 apis/dicom/v1alpha1/zz_generated.conversion_hubs.go create mode 100755 apis/iam/v1alpha1/zz_generated.conversion_hubs.go create mode 100755 apis/mdm/v1alpha1/zz_generated.conversion_hubs.go delete mode 100644 examples-generated/cdr/organization.yaml delete mode 100644 examples-generated/cdr/subscription.yaml delete mode 100644 examples-generated/dbs/sqssubscriber.yaml delete mode 100644 examples-generated/dicom/notification.yaml delete mode 100644 examples-generated/dicom/objectstore.yaml delete mode 100644 examples-generated/dicom/repository.yaml delete mode 100644 examples-generated/dicom/storeconfig.yaml delete mode 100644 examples-generated/iam/application.yaml delete mode 100644 examples-generated/iam/client.yaml delete mode 100644 examples-generated/iam/emailtemplate.yaml delete mode 100644 examples-generated/iam/group.yaml delete mode 100644 examples-generated/iam/organization.yaml delete mode 100644 examples-generated/iam/passwordpolicy.yaml delete mode 100644 examples-generated/iam/proposition.yaml delete mode 100644 examples-generated/iam/role.yaml delete mode 100644 examples-generated/iam/rolesharingpolicy.yaml delete mode 100644 examples-generated/iam/service.yaml delete mode 100644 examples-generated/iam/user.yaml delete mode 100644 examples-generated/mdm/datatype.yaml delete mode 100644 examples-generated/mdm/proposition.yaml diff --git a/apis/cdr/v1alpha1/zz_generated.conversion_hubs.go b/apis/cdr/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..5436fee --- /dev/null +++ b/apis/cdr/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,13 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Organization) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Subscription) Hub() {} diff --git a/apis/cdr/v1alpha1/zz_groupversion_info.go b/apis/cdr/v1alpha1/zz_groupversion_info.go index e204811..e36d44e 100755 --- a/apis/cdr/v1alpha1/zz_groupversion_info.go +++ b/apis/cdr/v1alpha1/zz_groupversion_info.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/cdr/v1alpha1/zz_organization_terraformed.go b/apis/cdr/v1alpha1/zz_organization_terraformed.go index 83d2bda..401a93c 100755 --- a/apis/cdr/v1alpha1/zz_organization_terraformed.go +++ b/apis/cdr/v1alpha1/zz_organization_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/cdr/v1alpha1/zz_organization_types.go b/apis/cdr/v1alpha1/zz_organization_types.go index b1a390b..33e2b2a 100755 --- a/apis/cdr/v1alpha1/zz_organization_types.go +++ b/apis/cdr/v1alpha1/zz_organization_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -133,13 +129,14 @@ type OrganizationStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Organization is the Schema for the Organizations API. Manages HSDP CDR Organizations -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Organization struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/cdr/v1alpha1/zz_subscription_terraformed.go b/apis/cdr/v1alpha1/zz_subscription_terraformed.go index 5c7db01..ffbd349 100755 --- a/apis/cdr/v1alpha1/zz_subscription_terraformed.go +++ b/apis/cdr/v1alpha1/zz_subscription_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/cdr/v1alpha1/zz_subscription_types.go b/apis/cdr/v1alpha1/zz_subscription_types.go index 3b0b932..a1fefe4 100755 --- a/apis/cdr/v1alpha1/zz_subscription_types.go +++ b/apis/cdr/v1alpha1/zz_subscription_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -139,13 +135,14 @@ type SubscriptionStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Subscription is the Schema for the Subscriptions API. Manages HSDP CDR Subscription resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Subscription struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/dbs/v1alpha1/zz_generated.conversion_hubs.go b/apis/dbs/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..2d6e8df --- /dev/null +++ b/apis/dbs/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,13 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *SqsSubscriber) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Subscription) Hub() {} diff --git a/apis/dbs/v1alpha1/zz_groupversion_info.go b/apis/dbs/v1alpha1/zz_groupversion_info.go index 4838676..d3fc124 100755 --- a/apis/dbs/v1alpha1/zz_groupversion_info.go +++ b/apis/dbs/v1alpha1/zz_groupversion_info.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/dbs/v1alpha1/zz_sqssubscriber_terraformed.go b/apis/dbs/v1alpha1/zz_sqssubscriber_terraformed.go index 195e9e3..3e89f83 100755 --- a/apis/dbs/v1alpha1/zz_sqssubscriber_terraformed.go +++ b/apis/dbs/v1alpha1/zz_sqssubscriber_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/dbs/v1alpha1/zz_sqssubscriber_types.go b/apis/dbs/v1alpha1/zz_sqssubscriber_types.go index 9488097..4e276b1 100755 --- a/apis/dbs/v1alpha1/zz_sqssubscriber_types.go +++ b/apis/dbs/v1alpha1/zz_sqssubscriber_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -132,13 +128,14 @@ type SqsSubscriberStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // SqsSubscriber is the Schema for the SqsSubscribers API. Manages Connect DBS SQS Subscriber configurations -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type SqsSubscriber struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/dbs/v1alpha1/zz_subscription_terraformed.go b/apis/dbs/v1alpha1/zz_subscription_terraformed.go index a3612c3..571b859 100755 --- a/apis/dbs/v1alpha1/zz_subscription_terraformed.go +++ b/apis/dbs/v1alpha1/zz_subscription_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/dbs/v1alpha1/zz_subscription_types.go b/apis/dbs/v1alpha1/zz_subscription_types.go index fdacf83..eecc498 100755 --- a/apis/dbs/v1alpha1/zz_subscription_types.go +++ b/apis/dbs/v1alpha1/zz_subscription_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -145,13 +141,14 @@ type SubscriptionStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Subscription is the Schema for the Subscriptions 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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Subscription struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/dicom/v1alpha1/zz_generated.conversion_hubs.go b/apis/dicom/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..ed5ebbd --- /dev/null +++ b/apis/dicom/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,19 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Notification) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *ObjectStore) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Repository) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *StoreConfig) Hub() {} diff --git a/apis/dicom/v1alpha1/zz_generated.deepcopy.go b/apis/dicom/v1alpha1/zz_generated.deepcopy.go index 86db0f3..a1bd92e 100644 --- a/apis/dicom/v1alpha1/zz_generated.deepcopy.go +++ b/apis/dicom/v1alpha1/zz_generated.deepcopy.go @@ -1016,6 +1016,7 @@ func (in *S3CredsAccessInitParameters) DeepCopyInto(out *S3CredsAccessInitParame *out = new(string) **out = **in } + out.ProductKeySecretRef = in.ProductKeySecretRef if in.ServiceAccount != nil { in, out := &in.ServiceAccount, &out.ServiceAccount *out = make([]ServiceAccountInitParameters, len(*in)) @@ -1123,6 +1124,7 @@ func (in *ServiceAccountInitParameters) DeepCopyInto(out *ServiceAccountInitPara *out = new(string) **out = **in } + out.PrivateKeySecretRef = in.PrivateKeySecretRef if in.ServiceID != nil { in, out := &in.ServiceID, &out.ServiceID *out = new(string) @@ -1219,6 +1221,7 @@ func (in *ServiceAccountParameters) DeepCopy() *ServiceAccountParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StaticAccessInitParameters) DeepCopyInto(out *StaticAccessInitParameters) { *out = *in + out.AccessKeySecretRef = in.AccessKeySecretRef if in.BucketName != nil { in, out := &in.BucketName, &out.BucketName *out = new(string) @@ -1229,6 +1232,7 @@ func (in *StaticAccessInitParameters) DeepCopyInto(out *StaticAccessInitParamete *out = new(string) **out = **in } + out.SecretKeySecretRef = in.SecretKeySecretRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StaticAccessInitParameters. diff --git a/apis/dicom/v1alpha1/zz_groupversion_info.go b/apis/dicom/v1alpha1/zz_groupversion_info.go index 0a1e410..10e3e08 100755 --- a/apis/dicom/v1alpha1/zz_groupversion_info.go +++ b/apis/dicom/v1alpha1/zz_groupversion_info.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/dicom/v1alpha1/zz_notification_terraformed.go b/apis/dicom/v1alpha1/zz_notification_terraformed.go index a0c41f4..bd6381b 100755 --- a/apis/dicom/v1alpha1/zz_notification_terraformed.go +++ b/apis/dicom/v1alpha1/zz_notification_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/dicom/v1alpha1/zz_notification_types.go b/apis/dicom/v1alpha1/zz_notification_types.go index 218b105..a431265 100755 --- a/apis/dicom/v1alpha1/zz_notification_types.go +++ b/apis/dicom/v1alpha1/zz_notification_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -119,13 +115,14 @@ type NotificationStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Notification is the Schema for the Notifications API. Manages HSDP DICOM Store notifications -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Notification struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/dicom/v1alpha1/zz_objectstore_terraformed.go b/apis/dicom/v1alpha1/zz_objectstore_terraformed.go index fd06b35..b5b2790 100755 --- a/apis/dicom/v1alpha1/zz_objectstore_terraformed.go +++ b/apis/dicom/v1alpha1/zz_objectstore_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -25,7 +21,7 @@ func (mg *ObjectStore) GetTerraformResourceType() string { // GetConnectionDetailsMapping for this ObjectStore func (tr *ObjectStore) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"s3creds_access[*].product_key": "spec.forProvider.s3credsAccess[*].productKeySecretRef", "s3creds_access[*].service_account[*].private_key": "spec.forProvider.s3credsAccess[*].serviceAccount[*].privateKeySecretRef", "static_access[*].access_key": "spec.forProvider.staticAccess[*].accessKeySecretRef", "static_access[*].secret_key": "spec.forProvider.staticAccess[*].secretKeySecretRef"} + return map[string]string{"s3creds_access[*].product_key": "s3credsAccess[*].productKeySecretRef", "s3creds_access[*].service_account[*].private_key": "s3credsAccess[*].serviceAccount[*].privateKeySecretRef", "static_access[*].access_key": "staticAccess[*].accessKeySecretRef", "static_access[*].secret_key": "staticAccess[*].secretKeySecretRef"} } // GetObservation of this ObjectStore diff --git a/apis/dicom/v1alpha1/zz_objectstore_types.go b/apis/dicom/v1alpha1/zz_objectstore_types.go index fe64bf1..10db91a 100755 --- a/apis/dicom/v1alpha1/zz_objectstore_types.go +++ b/apis/dicom/v1alpha1/zz_objectstore_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -125,6 +121,9 @@ type S3CredsAccessInitParameters struct { // The S3Creds folder path to use FolderPath *string `json:"folderPath,omitempty" tf:"folder_path,omitempty"` + // The S3Creds product key + ProductKeySecretRef v1.SecretKeySelector `json:"productKeySecretRef" tf:"-"` + // The IAM service account to use ServiceAccount []ServiceAccountInitParameters `json:"serviceAccount,omitempty" tf:"service_account,omitempty"` } @@ -159,7 +158,7 @@ type S3CredsAccessParameters struct { FolderPath *string `json:"folderPath" tf:"folder_path,omitempty"` // The S3Creds product key - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ProductKeySecretRef v1.SecretKeySelector `json:"productKeySecretRef" tf:"-"` // The IAM service account to use @@ -175,6 +174,9 @@ type ServiceAccountInitParameters struct { // Name of the service Name *string `json:"name,omitempty" tf:"name,omitempty"` + // The IAM service private key + PrivateKeySecretRef v1.SecretKeySelector `json:"privateKeySecretRef" tf:"-"` + // The IAM service id ServiceID *string `json:"serviceId,omitempty" tf:"service_id,omitempty"` @@ -208,7 +210,7 @@ type ServiceAccountParameters struct { Name *string `json:"name,omitempty" tf:"name,omitempty"` // The IAM service private key - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional PrivateKeySecretRef v1.SecretKeySelector `json:"privateKeySecretRef" tf:"-"` // The IAM service id @@ -222,11 +224,17 @@ type ServiceAccountParameters struct { type StaticAccessInitParameters struct { + // The S3 access key + AccessKeySecretRef v1.SecretKeySelector `json:"accessKeySecretRef" tf:"-"` + // The S3 bucket name BucketName *string `json:"bucketName,omitempty" tf:"bucket_name,omitempty"` // The S3 bucket endpoint Endpoint *string `json:"endpoint,omitempty" tf:"endpoint,omitempty"` + + // The S3 secret key + SecretKeySecretRef v1.SecretKeySelector `json:"secretKeySecretRef" tf:"-"` } type StaticAccessObservation struct { @@ -241,7 +249,7 @@ type StaticAccessObservation struct { type StaticAccessParameters struct { // The S3 access key - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional AccessKeySecretRef v1.SecretKeySelector `json:"accessKeySecretRef" tf:"-"` // The S3 bucket name @@ -253,7 +261,7 @@ type StaticAccessParameters struct { Endpoint *string `json:"endpoint" tf:"endpoint,omitempty"` // The S3 secret key - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional SecretKeySecretRef v1.SecretKeySelector `json:"secretKeySecretRef" tf:"-"` } @@ -281,13 +289,14 @@ type ObjectStoreStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // ObjectStore is the Schema for the ObjectStores API. Manages HSDP DICOM Object Stores -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type ObjectStore struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/dicom/v1alpha1/zz_repository_terraformed.go b/apis/dicom/v1alpha1/zz_repository_terraformed.go index aef709e..afcda4c 100755 --- a/apis/dicom/v1alpha1/zz_repository_terraformed.go +++ b/apis/dicom/v1alpha1/zz_repository_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/dicom/v1alpha1/zz_repository_types.go b/apis/dicom/v1alpha1/zz_repository_types.go index 9e22240..4aff69b 100755 --- a/apis/dicom/v1alpha1/zz_repository_types.go +++ b/apis/dicom/v1alpha1/zz_repository_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -164,13 +160,14 @@ type RepositoryStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Repository is the Schema for the Repositorys API. Manages HSDP DICOM Repository resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Repository struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/dicom/v1alpha1/zz_storeconfig_terraformed.go b/apis/dicom/v1alpha1/zz_storeconfig_terraformed.go index bb7f97d..ab1d948 100755 --- a/apis/dicom/v1alpha1/zz_storeconfig_terraformed.go +++ b/apis/dicom/v1alpha1/zz_storeconfig_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/dicom/v1alpha1/zz_storeconfig_types.go b/apis/dicom/v1alpha1/zz_storeconfig_types.go index 2a9f40f..834b92b 100755 --- a/apis/dicom/v1alpha1/zz_storeconfig_types.go +++ b/apis/dicom/v1alpha1/zz_storeconfig_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -172,13 +168,14 @@ type StoreConfigStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // StoreConfig is the Schema for the StoreConfigs API. Manages HSDP DICOM Store configurations -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type StoreConfig struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_application_terraformed.go b/apis/iam/v1alpha1/zz_application_terraformed.go index 6c65eb6..eb85321 100755 --- a/apis/iam/v1alpha1/zz_application_terraformed.go +++ b/apis/iam/v1alpha1/zz_application_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_application_types.go b/apis/iam/v1alpha1/zz_application_types.go index 931e9af..de7ec69 100755 --- a/apis/iam/v1alpha1/zz_application_types.go +++ b/apis/iam/v1alpha1/zz_application_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -147,13 +143,14 @@ type ApplicationStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Application is the Schema for the Applications API. Manages HSDP IAM Application resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Application struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_client_terraformed.go b/apis/iam/v1alpha1/zz_client_terraformed.go index 9137f2b..ed1d3f7 100755 --- a/apis/iam/v1alpha1/zz_client_terraformed.go +++ b/apis/iam/v1alpha1/zz_client_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -25,7 +21,7 @@ func (mg *Client) GetTerraformResourceType() string { // GetConnectionDetailsMapping for this Client func (tr *Client) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"password": "spec.forProvider.passwordSecretRef"} + return map[string]string{"password": "passwordSecretRef"} } // GetObservation of this Client diff --git a/apis/iam/v1alpha1/zz_client_types.go b/apis/iam/v1alpha1/zz_client_types.go index b629420..5a3510c 100755 --- a/apis/iam/v1alpha1/zz_client_types.go +++ b/apis/iam/v1alpha1/zz_client_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -66,6 +62,10 @@ type ClientInitParameters struct { // Name of the client. Name *string `json:"name,omitempty" tf:"name,omitempty"` + // The password to use (8-16 chars, at least one capital, number, special char) + // The password to use (8-16 chars, at least one capital, number, special char). + PasswordSecretRef v1.SecretKeySelector `json:"passwordSecretRef" tf:"-"` + // Array of valid RedirectionURIs for this client // List of valid RedirectionURIs for this client. // +listType=set @@ -276,13 +276,14 @@ type ClientStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Client is the Schema for the Clients API. Manages HSDP IAM Client resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Client struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_emailtemplate_terraformed.go b/apis/iam/v1alpha1/zz_emailtemplate_terraformed.go index 5c837db..a59085f 100755 --- a/apis/iam/v1alpha1/zz_emailtemplate_terraformed.go +++ b/apis/iam/v1alpha1/zz_emailtemplate_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_emailtemplate_types.go b/apis/iam/v1alpha1/zz_emailtemplate_types.go index 7a81fbf..a2900f6 100755 --- a/apis/iam/v1alpha1/zz_emailtemplate_types.go +++ b/apis/iam/v1alpha1/zz_emailtemplate_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -176,13 +172,14 @@ type EmailTemplateStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // EmailTemplate is the Schema for the EmailTemplates API. Manages HSDP IAM Email template resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type EmailTemplate struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_generated.conversion_hubs.go b/apis/iam/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..11e4caf --- /dev/null +++ b/apis/iam/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,40 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Application) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Client) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *EmailTemplate) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Group) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Organization) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *PasswordPolicy) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Proposition) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Role) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *RoleSharingPolicy) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Service) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *User) Hub() {} diff --git a/apis/iam/v1alpha1/zz_generated.deepcopy.go b/apis/iam/v1alpha1/zz_generated.deepcopy.go index 3fde868..e32f789 100644 --- a/apis/iam/v1alpha1/zz_generated.deepcopy.go +++ b/apis/iam/v1alpha1/zz_generated.deepcopy.go @@ -466,6 +466,7 @@ func (in *ClientInitParameters) DeepCopyInto(out *ClientInitParameters) { *out = new(string) **out = **in } + out.PasswordSecretRef = in.PasswordSecretRef if in.RedirectionUris != nil { in, out := &in.RedirectionUris, &out.RedirectionUris *out = make([]*string, len(*in)) @@ -3036,6 +3037,11 @@ func (in *ServiceInitParameters) DeepCopyInto(out *ServiceInitParameters) { *out = new(string) **out = **in } + if in.SelfManagedPrivateKeySecretRef != nil { + in, out := &in.SelfManagedPrivateKeySecretRef, &out.SelfManagedPrivateKeySecretRef + *out = new(v1.SecretKeySelector) + **out = **in + } if in.TokenValidity != nil { in, out := &in.TokenValidity, &out.TokenValidity *out = new(int64) @@ -3364,6 +3370,11 @@ func (in *UserInitParameters) DeepCopyInto(out *UserInitParameters) { *out = new(v1.Reference) (*in).DeepCopyInto(*out) } + if in.PasswordSecretRef != nil { + in, out := &in.PasswordSecretRef, &out.PasswordSecretRef + *out = new(v1.SecretKeySelector) + **out = **in + } if in.PreferredCommunicationChannel != nil { in, out := &in.PreferredCommunicationChannel, &out.PreferredCommunicationChannel *out = new(string) diff --git a/apis/iam/v1alpha1/zz_group_terraformed.go b/apis/iam/v1alpha1/zz_group_terraformed.go index bf267b6..16d0ac1 100755 --- a/apis/iam/v1alpha1/zz_group_terraformed.go +++ b/apis/iam/v1alpha1/zz_group_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_group_types.go b/apis/iam/v1alpha1/zz_group_types.go index 11aa7d3..e30576a 100755 --- a/apis/iam/v1alpha1/zz_group_types.go +++ b/apis/iam/v1alpha1/zz_group_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -252,13 +248,14 @@ type GroupStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Group is the Schema for the Groups API. Manages HSDP IAM Group resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Group struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_groupversion_info.go b/apis/iam/v1alpha1/zz_groupversion_info.go index fded38c..a0810d4 100755 --- a/apis/iam/v1alpha1/zz_groupversion_info.go +++ b/apis/iam/v1alpha1/zz_groupversion_info.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_organization_terraformed.go b/apis/iam/v1alpha1/zz_organization_terraformed.go index 780a5eb..046223f 100755 --- a/apis/iam/v1alpha1/zz_organization_terraformed.go +++ b/apis/iam/v1alpha1/zz_organization_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_organization_types.go b/apis/iam/v1alpha1/zz_organization_types.go index ee61497..926826c 100755 --- a/apis/iam/v1alpha1/zz_organization_types.go +++ b/apis/iam/v1alpha1/zz_organization_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -170,13 +166,14 @@ type OrganizationStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Organization is the Schema for the Organizations API. Manages HSDP IAM Organization resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Organization struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_passwordpolicy_terraformed.go b/apis/iam/v1alpha1/zz_passwordpolicy_terraformed.go index f90e219..babe230 100755 --- a/apis/iam/v1alpha1/zz_passwordpolicy_terraformed.go +++ b/apis/iam/v1alpha1/zz_passwordpolicy_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_passwordpolicy_types.go b/apis/iam/v1alpha1/zz_passwordpolicy_types.go index 6c03a03..e65b95f 100755 --- a/apis/iam/v1alpha1/zz_passwordpolicy_types.go +++ b/apis/iam/v1alpha1/zz_passwordpolicy_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -253,13 +249,14 @@ type PasswordPolicyStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // PasswordPolicy is the Schema for the PasswordPolicys API. Manages HSDP IAM Password policy resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type PasswordPolicy struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_proposition_terraformed.go b/apis/iam/v1alpha1/zz_proposition_terraformed.go index c37663e..cb8f3d0 100755 --- a/apis/iam/v1alpha1/zz_proposition_terraformed.go +++ b/apis/iam/v1alpha1/zz_proposition_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_proposition_types.go b/apis/iam/v1alpha1/zz_proposition_types.go index a68bd83..d74846a 100755 --- a/apis/iam/v1alpha1/zz_proposition_types.go +++ b/apis/iam/v1alpha1/zz_proposition_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -113,13 +109,14 @@ type PropositionStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Proposition is the Schema for the Propositions API. Manages HSDP IAM Proposition resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Proposition struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_role_terraformed.go b/apis/iam/v1alpha1/zz_role_terraformed.go index d750150..d8cb9d4 100755 --- a/apis/iam/v1alpha1/zz_role_terraformed.go +++ b/apis/iam/v1alpha1/zz_role_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_role_types.go b/apis/iam/v1alpha1/zz_role_types.go index c2c0b34..254547e 100755 --- a/apis/iam/v1alpha1/zz_role_types.go +++ b/apis/iam/v1alpha1/zz_role_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -141,13 +137,14 @@ type RoleStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Role is the Schema for the Roles API. Manages HSDP IAM Role resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Role struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_rolesharingpolicy_terraformed.go b/apis/iam/v1alpha1/zz_rolesharingpolicy_terraformed.go index ca1d5ca..dc09a8a 100755 --- a/apis/iam/v1alpha1/zz_rolesharingpolicy_terraformed.go +++ b/apis/iam/v1alpha1/zz_rolesharingpolicy_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/iam/v1alpha1/zz_rolesharingpolicy_types.go b/apis/iam/v1alpha1/zz_rolesharingpolicy_types.go index 1e6c43f..765126c 100755 --- a/apis/iam/v1alpha1/zz_rolesharingpolicy_types.go +++ b/apis/iam/v1alpha1/zz_rolesharingpolicy_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -142,13 +138,14 @@ type RoleSharingPolicyStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // RoleSharingPolicy is the Schema for the RoleSharingPolicys API. Manages HSDP IAM Role sharing policy resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type RoleSharingPolicy struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_service_terraformed.go b/apis/iam/v1alpha1/zz_service_terraformed.go index 3b2609f..a4d48db 100755 --- a/apis/iam/v1alpha1/zz_service_terraformed.go +++ b/apis/iam/v1alpha1/zz_service_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -25,7 +21,7 @@ func (mg *Service) GetTerraformResourceType() string { // GetConnectionDetailsMapping for this Service func (tr *Service) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"private_key": "status.atProvider.privateKey", "self_managed_private_key": "spec.forProvider.selfManagedPrivateKeySecretRef"} + return map[string]string{"private_key": "status.atProvider.privateKey", "self_managed_private_key": "selfManagedPrivateKeySecretRef"} } // GetObservation of this Service diff --git a/apis/iam/v1alpha1/zz_service_types.go b/apis/iam/v1alpha1/zz_service_types.go index dba89a0..db7a0d1 100755 --- a/apis/iam/v1alpha1/zz_service_types.go +++ b/apis/iam/v1alpha1/zz_service_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -55,6 +51,11 @@ type ServiceInitParameters struct { // Sets the certificate validity. When not specified, the certificate will have a validity of 5 years. SelfManagedExpiresOn *string `json:"selfManagedExpiresOn,omitempty" tf:"self_managed_expires_on,omitempty"` + // RSA private key in PEM format. When provided, overrides the generated certificate / private key combination of the + // IAM service. This gives you full control over the credentials. When not specified, a private key will be generated by IAM + // RSA private key in PEM format. When provided, overrides the generated certificate / private key combination of the IAM service. This gives you full control over the credentials. When not specified, a private key will be generated by IAM. + SelfManagedPrivateKeySecretRef *v1.SecretKeySelector `json:"selfManagedPrivateKeySecretRef,omitempty" tf:"-"` + // Integer. Access Token Lifetime (in seconds). Default: 1800 (30 minutes), Maximum: 2592000 (30 days) // Access Token Lifetime (in seconds). Default: 1800 (30 minutes), Maximum: 2592000 (30 days). TokenValidity *int64 `json:"tokenValidity,omitempty" tf:"token_validity,omitempty"` @@ -201,13 +202,14 @@ type ServiceStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Service is the Schema for the Services API. Manages HSDP IAM Service resources -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Service struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/iam/v1alpha1/zz_user_terraformed.go b/apis/iam/v1alpha1/zz_user_terraformed.go index 5657a8c..8a673e6 100755 --- a/apis/iam/v1alpha1/zz_user_terraformed.go +++ b/apis/iam/v1alpha1/zz_user_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -25,7 +21,7 @@ func (mg *User) GetTerraformResourceType() string { // GetConnectionDetailsMapping for this User func (tr *User) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"password": "spec.forProvider.passwordSecretRef"} + return map[string]string{"password": "passwordSecretRef"} } // GetObservation of this User diff --git a/apis/iam/v1alpha1/zz_user_types.go b/apis/iam/v1alpha1/zz_user_types.go index e2764b3..d323cdf 100755 --- a/apis/iam/v1alpha1/zz_user_types.go +++ b/apis/iam/v1alpha1/zz_user_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -52,6 +48,15 @@ type UserInitParameters struct { // +kubebuilder:validation:Optional OrganizationRef *v1.Reference `json:"organizationRef,omitempty" tf:"-"` + // When specified this will skip the email activation + // flow and immediately activate the IAM account. Very Important: you are responsible + // for sharing this password with the new IAM user through some channel of communication. + // No email will be triggered by the system. If unsure, do not set a password so the normal + // email activation flow is followed. Finally, any password value changes after user creation + // will have no effect on the users' actual password. + // When specified this will skip the email activation flow and immediately activate the IAM account. Very Important: you are responsible for sharing this password with the new IAM user through some channel of communication. No email will be triggered by the system. If unsure, do not set a password so the normal email activation flow is followed. Finally, any password value changes after user creation will have no effect on the users' actual password. + PasswordSecretRef *v1.SecretKeySelector `json:"passwordSecretRef,omitempty" tf:"-"` + // Preferred communication channel. // Email and SMS are supported channels. Email is the default channel if e-mail address is provided. // Values supported: [ email | sms ] @@ -207,13 +212,14 @@ type UserStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // User is the Schema for the Users API. Manages HSDP IAM Users -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type User struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/mdm/v1alpha1/zz_datatype_terraformed.go b/apis/mdm/v1alpha1/zz_datatype_terraformed.go index 6bc1c51..729119b 100755 --- a/apis/mdm/v1alpha1/zz_datatype_terraformed.go +++ b/apis/mdm/v1alpha1/zz_datatype_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/mdm/v1alpha1/zz_datatype_types.go b/apis/mdm/v1alpha1/zz_datatype_types.go index c7e2590..46d31ba 100755 --- a/apis/mdm/v1alpha1/zz_datatype_types.go +++ b/apis/mdm/v1alpha1/zz_datatype_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -121,13 +117,14 @@ type DataTypeStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // DataType is the Schema for the DataTypes API. Manages HSDP Connect MDM Data types -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type DataType struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/mdm/v1alpha1/zz_generated.conversion_hubs.go b/apis/mdm/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..63bdd7e --- /dev/null +++ b/apis/mdm/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,13 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *DataType) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Proposition) Hub() {} diff --git a/apis/mdm/v1alpha1/zz_groupversion_info.go b/apis/mdm/v1alpha1/zz_groupversion_info.go index 34f6d13..2e0df97 100755 --- a/apis/mdm/v1alpha1/zz_groupversion_info.go +++ b/apis/mdm/v1alpha1/zz_groupversion_info.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/mdm/v1alpha1/zz_proposition_terraformed.go b/apis/mdm/v1alpha1/zz_proposition_terraformed.go index b8249cc..937d4a6 100755 --- a/apis/mdm/v1alpha1/zz_proposition_terraformed.go +++ b/apis/mdm/v1alpha1/zz_proposition_terraformed.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/apis/mdm/v1alpha1/zz_proposition_types.go b/apis/mdm/v1alpha1/zz_proposition_types.go index cb5b3ec..0194990 100755 --- a/apis/mdm/v1alpha1/zz_proposition_types.go +++ b/apis/mdm/v1alpha1/zz_proposition_types.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -134,13 +130,14 @@ type PropositionStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Proposition is the Schema for the Propositions API. Manages HSDP Connect MDM Propositions -// +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="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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,hsdp} type Proposition struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/zz_register.go b/apis/zz_register.go index 2a47b5e..061adaf 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ diff --git a/config/provider.go b/config/provider.go index a7eab08..dd89fa7 100644 --- a/config/provider.go +++ b/config/provider.go @@ -34,7 +34,7 @@ func GetProvider() *ujconfig.Provider { pc := ujconfig.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, []byte(providerMetadata), ujconfig.WithShortName("hsdp"), ujconfig.WithRootGroup("hsdp.crossplane.io"), - ujconfig.WithNoForkIncludeList(ExternalNameConfigured()), + ujconfig.WithTerraformPluginSDKIncludeList(ExternalNameConfigured()), ujconfig.WithIncludeList([]string{}), ujconfig.WithFeaturesPackage("internal/features"), ujconfig.WithTerraformProvider(hsdp.Provider("v0.47.0")), diff --git a/examples-generated/cdr/organization.yaml b/examples-generated/cdr/organization.yaml deleted file mode 100644 index 190c34b..0000000 --- a/examples-generated/cdr/organization.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: cdr.hsdp.crossplane.io/v1alpha1 -kind: Organization -metadata: - annotations: - meta.upbound.io/example-id: cdr/v1alpha1/organization - labels: - testing.upbound.io/example-name: root_org - name: root-org -spec: - forProvider: - fhirStore: ${data.hsdp_cdr_fhir_store.sandbox.endpoint} - name: Root ORG - orgIdSelector: - matchLabels: - testing.upbound.io/example-name: example - version: r4 diff --git a/examples-generated/cdr/subscription.yaml b/examples-generated/cdr/subscription.yaml deleted file mode 100644 index 327dd47..0000000 --- a/examples-generated/cdr/subscription.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: cdr.hsdp.crossplane.io/v1alpha1 -kind: Subscription -metadata: - annotations: - meta.upbound.io/example-id: cdr/v1alpha1/subscription - labels: - testing.upbound.io/example-name: patient_changes - name: patient-changes -spec: - forProvider: - criteria: Patient - deleteEndpoint: https://webhook.myapp.io/patient_deleted - end: "2030-12-31T23:59:59Z" - endpoint: https://webhook.myapp.io/patient - fhirStore: ${hsdp_cdr_org.test.fhir_store} - headers: - - 'Authorization: Basic cm9uOnN3YW5zb24=' - reason: Notification for patient changes - version: r4 - ---- - -apiVersion: cdr.hsdp.crossplane.io/v1alpha1 -kind: Organization -metadata: - annotations: - meta.upbound.io/example-id: cdr/v1alpha1/subscription - labels: - testing.upbound.io/example-name: test - name: test -spec: - forProvider: - fhirStore: ${data.hsdp_cdr_fhir_store.sandbox.endpoint} - name: Hospital - orgIdSelector: - matchLabels: - testing.upbound.io/example-name: test - version: r4 diff --git a/examples-generated/dbs/sqssubscriber.yaml b/examples-generated/dbs/sqssubscriber.yaml deleted file mode 100644 index 7ad97f7..0000000 --- a/examples-generated/dbs/sqssubscriber.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: dbs.hsdp.crossplane.io/v1alpha1 -kind: SqsSubscriber -metadata: - annotations: - meta.upbound.io/example-id: dbs/v1alpha1/sqssubscriber - labels: - testing.upbound.io/example-name: my-subscriber - name: my-subscriber -spec: - forProvider: - deliveryDelaySeconds: 0 - description: My subscriber - messageRetentionPeriodSeconds: 0 - nameInfix: my-subscriber - queueType: Standard - receiveWaitTimeSeconds: 0 - serverSideEncryption: true diff --git a/examples-generated/dicom/notification.yaml b/examples-generated/dicom/notification.yaml deleted file mode 100644 index a0b8cfe..0000000 --- a/examples-generated/dicom/notification.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: dicom.hsdp.crossplane.io/v1alpha1 -kind: Notification -metadata: - annotations: - meta.upbound.io/example-id: dicom/v1alpha1/notification - labels: - testing.upbound.io/example-name: topic - name: topic -spec: - forProvider: - configUrl: ${hsdp_dicom_store_config.dicom.config_url} - defaultOrganizationIdSelector: - matchLabels: - testing.upbound.io/example-name: tenant1 - endpointUrl: ${var.notification_endpoint_url} diff --git a/examples-generated/dicom/objectstore.yaml b/examples-generated/dicom/objectstore.yaml deleted file mode 100644 index cc836f7..0000000 --- a/examples-generated/dicom/objectstore.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: dicom.hsdp.crossplane.io/v1alpha1 -kind: ObjectStore -metadata: - annotations: - meta.upbound.io/example-id: dicom/v1alpha1/objectstore - labels: - testing.upbound.io/example-name: store2 - name: store2 -spec: - forProvider: - configUrl: ${var.dicom_base_url} - description: Store 2 - organizationIdSelector: - matchLabels: - testing.upbound.io/example-name: example - s3credsAccess: - - bucketName: yyyy-yyyy-yyy-yyyy - endpoint: https://xxx.com - folderPath: /store1 - productKeySecretRef: - key: example-key - name: example-secret - namespace: upbound-system - serviceAccount: - - accessTokenEndpoint: ${data.hsdp_config.iam.url}/oauth2/access_token - privateKeySecretRef: - key: example-key - name: example-secret - namespace: upbound-system - serviceId: a@b.com - tokenEndpoint: ${data.hsdp_config.iam.url}/authorize/oauth2/token diff --git a/examples-generated/dicom/repository.yaml b/examples-generated/dicom/repository.yaml deleted file mode 100644 index 117c280..0000000 --- a/examples-generated/dicom/repository.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: dicom.hsdp.crossplane.io/v1alpha1 -kind: Repository -metadata: - annotations: - meta.upbound.io/example-id: dicom/v1alpha1/repository - labels: - testing.upbound.io/example-name: repo1 - name: repo1 -spec: - forProvider: - configUrl: ${hsdp_dicom_store_config.dicom.config_url} - notification: - - organizationId: ${hsdp_iam_org.tenant1.id} - objectStoreId: ${hsdp_dicom_object_store.store1.id} - organizationIdSelector: - matchLabels: - testing.upbound.io/example-name: root_org diff --git a/examples-generated/dicom/storeconfig.yaml b/examples-generated/dicom/storeconfig.yaml deleted file mode 100644 index 734f8d3..0000000 --- a/examples-generated/dicom/storeconfig.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: dicom.hsdp.crossplane.io/v1alpha1 -kind: StoreConfig -metadata: - annotations: - meta.upbound.io/example-id: dicom/v1alpha1/storeconfig - labels: - testing.upbound.io/example-name: dicom - name: dicom -spec: - forProvider: - cdrServiceAccount: - - privateKey: ${hsdp_iam_service.cdr.private_key} - serviceId: ${hsdp_iam_service.cdr.service_id} - configUrl: ${var.dicom_base_url} - fhirStore: - - mpiEndpoint: https://foo.bar/xxx - organizationIdSelector: - matchLabels: - testing.upbound.io/example-name: example diff --git a/examples-generated/iam/application.yaml b/examples-generated/iam/application.yaml deleted file mode 100644 index dbe9790..0000000 --- a/examples-generated/iam/application.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Application -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/application - labels: - testing.upbound.io/example-name: testapp - name: testapp -spec: - forProvider: - description: Test application - name: TESTAPP - propositionIdSelector: - matchLabels: - testing.upbound.io/example-name: testprop diff --git a/examples-generated/iam/client.yaml b/examples-generated/iam/client.yaml deleted file mode 100644 index bcb734d..0000000 --- a/examples-generated/iam/client.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Client -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/client - labels: - testing.upbound.io/example-name: testclient - name: testclient -spec: - forProvider: - applicationIdSelector: - matchLabels: - testing.upbound.io/example-name: testtapp - clientId: testclient - defaultScopes: - - cn - - introspect - description: Test client - globalReferenceId: some-ref-here - name: TESTCLIENT - passwordSecretRef: - key: attribute.result - name: example-password - namespace: upbound-system - redirectionUris: - - https://foo.bar/auth - - https://testapp.cloud.pcftest.com/auth - responseTypes: - - code - - code id_token - scopes: - - cn - - introspect - - email - - profile - type: Public diff --git a/examples-generated/iam/emailtemplate.yaml b/examples-generated/iam/emailtemplate.yaml deleted file mode 100644 index 4be4e54..0000000 --- a/examples-generated/iam/emailtemplate.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: EmailTemplate -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/emailtemplate - labels: - testing.upbound.io/example-name: password_changed - name: password-changed -spec: - forProvider: - format: HTML - managingOrganizationSelector: - matchLabels: - testing.upbound.io/example-name: hsdp_iam_org - message: | - Dear {{user.givenName}}, - - Your password was recently changed. If this was not initiated - by you please contact support immediately. - - Kind regards, - IAM Team - subject: Your IAM account password was changed - type: PASSWORD_CHANGED diff --git a/examples-generated/iam/group.yaml b/examples-generated/iam/group.yaml deleted file mode 100644 index e8a7e84..0000000 --- a/examples-generated/iam/group.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Group -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/group - labels: - testing.upbound.io/example-name: tdr_users - name: tdr-users -spec: - forProvider: - description: Group for TDR Users with Contract and Dataitem roles - devices: [] - managingOrganizationSelector: - matchLabels: - testing.upbound.io/example-name: devorg - name: TDR Users - roleRef: - - name: TDRALL - serviceRef: - - name: test - userRef: - - name: admin - - name: developer diff --git a/examples-generated/iam/organization.yaml b/examples-generated/iam/organization.yaml deleted file mode 100644 index 4a0c72f..0000000 --- a/examples-generated/iam/organization.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Organization -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/organization - labels: - testing.upbound.io/example-name: testorg - name: testorg -spec: - forProvider: - description: Test Organization - name: TestOrg - parentOrgId: ${hsdp_iam_org.myorg.id} diff --git a/examples-generated/iam/passwordpolicy.yaml b/examples-generated/iam/passwordpolicy.yaml deleted file mode 100644 index 68f62e8..0000000 --- a/examples-generated/iam/passwordpolicy.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: PasswordPolicy -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/passwordpolicy - labels: - testing.upbound.io/example-name: mypolicy - name: mypolicy -spec: - forProvider: - complexity: - - maxLength: 32 - minLength: 8 - minLowercase: 1 - minNumerics: 1 - minSpecialChars: 1 - minUppercase: 1 - expiryPeriodInDays: 180 - historyCount: 5 - managingOrganizationSelector: - matchLabels: - testing.upbound.io/example-name: hsdp_iam_org diff --git a/examples-generated/iam/proposition.yaml b/examples-generated/iam/proposition.yaml deleted file mode 100644 index 741b940..0000000 --- a/examples-generated/iam/proposition.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Proposition -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/proposition - labels: - testing.upbound.io/example-name: testprop - name: testprop -spec: - forProvider: - description: Test Proposition - name: TestProposition - organizationIdSelector: - matchLabels: - testing.upbound.io/example-name: devorg diff --git a/examples-generated/iam/role.yaml b/examples-generated/iam/role.yaml deleted file mode 100644 index 0e53e24..0000000 --- a/examples-generated/iam/role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Role -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/role - labels: - testing.upbound.io/example-name: TDRALL - name: tdrall -spec: - forProvider: - description: Role for TDR users with ALL access - managingOrganizationSelector: - matchLabels: - testing.upbound.io/example-name: testdev - name: TDRALL - permissions: - - DATAITEM.CREATEONBEHALF - - DATAITEM.READ - - DATAITEM.DELETEONBEHALF - - DATAITEM.DELETE - - CONTRACT.CREATE - - DATAITEM.READONBEHALF - - CONTRACT.READ - - DATAITEM.CREATE diff --git a/examples-generated/iam/rolesharingpolicy.yaml b/examples-generated/iam/rolesharingpolicy.yaml deleted file mode 100644 index 3bddd88..0000000 --- a/examples-generated/iam/rolesharingpolicy.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: RoleSharingPolicy -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/rolesharingpolicy - labels: - testing.upbound.io/example-name: policy - name: policy -spec: - forProvider: - purpose: Share SOME role with another organization - roleIdSelector: - matchLabels: - testing.upbound.io/example-name: shared - sharingPolicy: AllowChildren - targetOrganizationIdSelector: - matchLabels: - testing.upbound.io/example-name: another_org - ---- - -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Role -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/rolesharingpolicy - labels: - testing.upbound.io/example-name: shared - name: shared -spec: - forProvider: - description: A role we want to share across ORGs - managingOrganizationSelector: - matchLabels: - testing.upbound.io/example-name: my_org - name: SOME Role - permissions: - - PATIENT.READ - - PRACTITIONER.READ diff --git a/examples-generated/iam/service.yaml b/examples-generated/iam/service.yaml deleted file mode 100644 index 0b945ef..0000000 --- a/examples-generated/iam/service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: Service -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/service - labels: - testing.upbound.io/example-name: testservice - name: testservice -spec: - forProvider: - applicationIdSelector: - matchLabels: - testing.upbound.io/example-name: example - defaultScopes: - - openid - description: Test service - name: TESTSERVICE - scopes: - - openid - tokenValidity: 3600 - validity: 12 diff --git a/examples-generated/iam/user.yaml b/examples-generated/iam/user.yaml deleted file mode 100644 index b57e6ea..0000000 --- a/examples-generated/iam/user.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: iam.hsdp.crossplane.io/v1alpha1 -kind: User -metadata: - annotations: - meta.upbound.io/example-id: iam/v1alpha1/user - labels: - testing.upbound.io/example-name: developer - name: developer -spec: - forProvider: - email: developer@1e100.io - firstName: Devel - lastName: Oper - login: developer - organizationIdSelector: - matchLabels: - testing.upbound.io/example-name: testdev diff --git a/examples-generated/mdm/datatype.yaml b/examples-generated/mdm/datatype.yaml deleted file mode 100644 index 3b46478..0000000 --- a/examples-generated/mdm/datatype.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: mdm.hsdp.crossplane.io/v1alpha1 -kind: DataType -metadata: - annotations: - meta.upbound.io/example-id: mdm/v1alpha1/datatype - labels: - testing.upbound.io/example-name: some_type - name: some-type -spec: - forProvider: - description: A Terraform provisioned DataType - name: tf-some-data-type - propositionSelector: - matchLabels: - testing.upbound.io/example-name: hsdp_connect_mdm_proposition - tags: - - ONE - - TWO - - THREE diff --git a/examples-generated/mdm/proposition.yaml b/examples-generated/mdm/proposition.yaml deleted file mode 100644 index e519ad4..0000000 --- a/examples-generated/mdm/proposition.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: mdm.hsdp.crossplane.io/v1alpha1 -kind: Proposition -metadata: - annotations: - meta.upbound.io/example-id: mdm/v1alpha1/proposition - labels: - testing.upbound.io/example-name: app - name: app -spec: - forProvider: - description: Terraform managed proposition - name: moonshot - organizationSelector: - matchLabels: - testing.upbound.io/example-name: example diff --git a/go.mod b/go.mod index 6bed67c..85749df 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,8 @@ module github.com/philips-software/provider-hsdp -go 1.21 -toolchain go1.22.4 +go 1.22.0 + +toolchain go1.22.5 require ( dario.cat/mergo v1.0.0 diff --git a/internal/controller/cdr/organization/zz_controller.go b/internal/controller/cdr/organization/zz_controller.go index 695f14c..158e16a 100755 --- a/internal/controller/cdr/organization/zz_controller.go +++ b/internal/controller/cdr/organization/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/cdr/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Organization_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_cdr_org"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Organization_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_cdr_org"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Organization_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Organization + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Organization{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Organization") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.OrganizationList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.OrganizationList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Organization_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/cdr/subscription/zz_controller.go b/internal/controller/cdr/subscription/zz_controller.go index 447b2bb..d94f1e0 100755 --- a/internal/controller/cdr/subscription/zz_controller.go +++ b/internal/controller/cdr/subscription/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/cdr/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_cdr_subscription"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Subscription_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_cdr_subscription"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Subscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Subscription + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Subscription{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Subscription") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.SubscriptionList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.SubscriptionList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Subscription_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/dbs/sqssubscriber/zz_controller.go b/internal/controller/dbs/sqssubscriber/zz_controller.go index 4904573..24e9b42 100755 --- a/internal/controller/dbs/sqssubscriber/zz_controller.go +++ b/internal/controller/dbs/sqssubscriber/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/dbs/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.SqsSubscriber_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dbs_sqs_subscriber"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.SqsSubscriber_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dbs_sqs_subscriber"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.SqsSubscriber_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.SqsSubscriber + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.SqsSubscriber{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.SqsSubscriber") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.SqsSubscriberList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.SqsSubscriberList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.SqsSubscriber_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/dbs/subscription/zz_controller.go b/internal/controller/dbs/subscription/zz_controller.go index af304d4..548702d 100755 --- a/internal/controller/dbs/subscription/zz_controller.go +++ b/internal/controller/dbs/subscription/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/dbs/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dbs_topic_subscription"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Subscription_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dbs_topic_subscription"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Subscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Subscription + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Subscription{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Subscription") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.SubscriptionList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.SubscriptionList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Subscription_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/dicom/notification/zz_controller.go b/internal/controller/dicom/notification/zz_controller.go index 287885f..b2a3c44 100755 --- a/internal/controller/dicom/notification/zz_controller.go +++ b/internal/controller/dicom/notification/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/dicom/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Notification_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_notification"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Notification_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_notification"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Notification_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Notification + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Notification{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Notification") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.NotificationList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.NotificationList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Notification_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/dicom/objectstore/zz_controller.go b/internal/controller/dicom/objectstore/zz_controller.go index 1db4d6a..5f8725a 100755 --- a/internal/controller/dicom/objectstore/zz_controller.go +++ b/internal/controller/dicom/objectstore/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/dicom/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ObjectStore_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_object_store"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.ObjectStore_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_object_store"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.ObjectStore_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.ObjectStore + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.ObjectStore{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.ObjectStore") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.ObjectStoreList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.ObjectStoreList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ObjectStore_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/dicom/repository/zz_controller.go b/internal/controller/dicom/repository/zz_controller.go index 4fb31ac..0c5a9d2 100755 --- a/internal/controller/dicom/repository/zz_controller.go +++ b/internal/controller/dicom/repository/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/dicom/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Repository_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_repository"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Repository_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_repository"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Repository_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Repository + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Repository{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Repository") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.RepositoryList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.RepositoryList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Repository_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/dicom/storeconfig/zz_controller.go b/internal/controller/dicom/storeconfig/zz_controller.go index 6592672..43194dd 100755 --- a/internal/controller/dicom/storeconfig/zz_controller.go +++ b/internal/controller/dicom/storeconfig/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/dicom/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.StoreConfig_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_store_config"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.StoreConfig_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_dicom_store_config"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.StoreConfig_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.StoreConfig + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.StoreConfig{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.StoreConfig") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.StoreConfigList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.StoreConfigList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.StoreConfig_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/application/zz_controller.go b/internal/controller/iam/application/zz_controller.go index a86283d..4dea450 100755 --- a/internal/controller/iam/application/zz_controller.go +++ b/internal/controller/iam/application/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Application_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_application"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Application_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_application"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Application_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Application + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Application{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Application") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.ApplicationList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.ApplicationList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Application_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/client/zz_controller.go b/internal/controller/iam/client/zz_controller.go index baf34fa..16a5aae 100755 --- a/internal/controller/iam/client/zz_controller.go +++ b/internal/controller/iam/client/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Client_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_client"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Client_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_client"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Client_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Client + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Client{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Client") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.ClientList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.ClientList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Client_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/emailtemplate/zz_controller.go b/internal/controller/iam/emailtemplate/zz_controller.go index d621feb..13e905e 100755 --- a/internal/controller/iam/emailtemplate/zz_controller.go +++ b/internal/controller/iam/emailtemplate/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.EmailTemplate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_email_template"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.EmailTemplate_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_email_template"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.EmailTemplate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.EmailTemplate + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.EmailTemplate{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.EmailTemplate") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.EmailTemplateList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.EmailTemplateList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.EmailTemplate_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/group/zz_controller.go b/internal/controller/iam/group/zz_controller.go index 85a814e..ec64bc2 100755 --- a/internal/controller/iam/group/zz_controller.go +++ b/internal/controller/iam/group/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Group_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_group"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Group_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_group"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Group_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Group + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Group{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Group") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.GroupList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.GroupList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Group_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/organization/zz_controller.go b/internal/controller/iam/organization/zz_controller.go index d8c6172..a1b3b5a 100755 --- a/internal/controller/iam/organization/zz_controller.go +++ b/internal/controller/iam/organization/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Organization_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_org"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Organization_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_org"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Organization_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Organization + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Organization{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Organization") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.OrganizationList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.OrganizationList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Organization_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/passwordpolicy/zz_controller.go b/internal/controller/iam/passwordpolicy/zz_controller.go index 4c61646..8dbbb49 100755 --- a/internal/controller/iam/passwordpolicy/zz_controller.go +++ b/internal/controller/iam/passwordpolicy/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PasswordPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_password_policy"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.PasswordPolicy_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_password_policy"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.PasswordPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.PasswordPolicy + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.PasswordPolicy{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.PasswordPolicy") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PasswordPolicyList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PasswordPolicyList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PasswordPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/proposition/zz_controller.go b/internal/controller/iam/proposition/zz_controller.go index 37cd530..c153f18 100755 --- a/internal/controller/iam/proposition/zz_controller.go +++ b/internal/controller/iam/proposition/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Proposition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_proposition"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Proposition_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_proposition"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Proposition_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Proposition + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Proposition{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Proposition") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PropositionList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PropositionList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Proposition_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/role/zz_controller.go b/internal/controller/iam/role/zz_controller.go index c1a5c81..073648c 100755 --- a/internal/controller/iam/role/zz_controller.go +++ b/internal/controller/iam/role/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Role_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_role"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Role_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_role"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Role_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Role + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Role{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Role") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.RoleList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.RoleList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Role_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/rolesharingpolicy/zz_controller.go b/internal/controller/iam/rolesharingpolicy/zz_controller.go index fa8be35..78e281a 100755 --- a/internal/controller/iam/rolesharingpolicy/zz_controller.go +++ b/internal/controller/iam/rolesharingpolicy/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.RoleSharingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_role_sharing_policy"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.RoleSharingPolicy_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_role_sharing_policy"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.RoleSharingPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.RoleSharingPolicy + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.RoleSharingPolicy{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.RoleSharingPolicy") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.RoleSharingPolicyList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.RoleSharingPolicyList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.RoleSharingPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/service/zz_controller.go b/internal/controller/iam/service/zz_controller.go index 9d48381..878a068 100755 --- a/internal/controller/iam/service/zz_controller.go +++ b/internal/controller/iam/service/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_service"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Service_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_service"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Service_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Service + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Service{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Service") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.ServiceList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.ServiceList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Service_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/iam/user/zz_controller.go b/internal/controller/iam/user/zz_controller.go index b56b659..6fbd24d 100755 --- a/internal/controller/iam/user/zz_controller.go +++ b/internal/controller/iam/user/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/iam/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.User_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_user"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.User_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_iam_user"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.User_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.User + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.User{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.User") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.UserList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.UserList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.User_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/mdm/datatype/zz_controller.go b/internal/controller/mdm/datatype/zz_controller.go index dc1d099..7f4e57e 100755 --- a/internal/controller/mdm/datatype/zz_controller.go +++ b/internal/controller/mdm/datatype/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/mdm/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.DataType_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_connect_mdm_data_type"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.DataType_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_connect_mdm_data_type"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.DataType_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.DataType + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.DataType{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.DataType") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.DataTypeList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.DataTypeList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.DataType_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/mdm/proposition/zz_controller.go b/internal/controller/mdm/proposition/zz_controller.go index 5d1db7d..31e0321 100755 --- a/internal/controller/mdm/proposition/zz_controller.go +++ b/internal/controller/mdm/proposition/zz_controller.go @@ -1,7 +1,3 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - /* Copyright 2022 Upbound Inc. */ @@ -18,9 +14,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" v1alpha1 "github.com/philips-software/provider-hsdp/apis/mdm/v1alpha1" @@ -39,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Proposition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_connect_mdm_proposition"], - tjcontroller.WithNoForkAsyncLogger(o.Logger), - tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithNoForkAsyncCallbackProvider(ac), - tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Proposition_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["hsdp_connect_mdm_proposition"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Proposition_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), @@ -59,6 +57,29 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableBetaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Proposition + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Proposition{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Proposition") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PropositionList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PropositionList") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Proposition_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 6e930a9..fc8249f 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -1,6 +1,6 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 +/* +Copyright 2022 Upbound Inc. +*/ package controller diff --git a/package/crds/cdr.hsdp.crossplane.io_organizations.yaml b/package/crds/cdr.hsdp.crossplane.io_organizations.yaml index ba3e7f9..9ab38a6 100644 --- a/package/crds/cdr.hsdp.crossplane.io_organizations.yaml +++ b/package/crds/cdr.hsdp.crossplane.io_organizations.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -509,6 +509,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -532,6 +539,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/cdr.hsdp.crossplane.io_subscriptions.yaml b/package/crds/cdr.hsdp.crossplane.io_subscriptions.yaml index 091eb50..8342b33 100644 --- a/package/crds/cdr.hsdp.crossplane.io_subscriptions.yaml +++ b/package/crds/cdr.hsdp.crossplane.io_subscriptions.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -388,6 +388,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -411,6 +418,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/dbs.hsdp.crossplane.io_sqssubscribers.yaml b/package/crds/dbs.hsdp.crossplane.io_sqssubscribers.yaml index 2898de2..32fd5f9 100644 --- a/package/crds/dbs.hsdp.crossplane.io_sqssubscribers.yaml +++ b/package/crds/dbs.hsdp.crossplane.io_sqssubscribers.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -395,6 +395,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -418,6 +425,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/dbs.hsdp.crossplane.io_subscriptions.yaml b/package/crds/dbs.hsdp.crossplane.io_subscriptions.yaml index 8c71ca7..e7e480d 100644 --- a/package/crds/dbs.hsdp.crossplane.io_subscriptions.yaml +++ b/package/crds/dbs.hsdp.crossplane.io_subscriptions.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -625,6 +625,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -648,6 +655,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/dicom.hsdp.crossplane.io_notifications.yaml b/package/crds/dicom.hsdp.crossplane.io_notifications.yaml index 265d1e4..29bef87 100644 --- a/package/crds/dicom.hsdp.crossplane.io_notifications.yaml +++ b/package/crds/dicom.hsdp.crossplane.io_notifications.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -478,6 +478,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -501,6 +508,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/dicom.hsdp.crossplane.io_objectstores.yaml b/package/crds/dicom.hsdp.crossplane.io_objectstores.yaml index 9803aa7..e5c8e9d 100644 --- a/package/crds/dicom.hsdp.crossplane.io_objectstores.yaml +++ b/package/crds/dicom.hsdp.crossplane.io_objectstores.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -224,12 +224,8 @@ spec: tokenEndpoint: description: The IAM token endpoint type: string - required: - - privateKeySecretRef type: object type: array - required: - - productKeySecretRef type: object type: array staticAccess: @@ -276,9 +272,6 @@ spec: - name - namespace type: object - required: - - accessKeySecretRef - - secretKeySecretRef type: object type: array type: object @@ -396,6 +389,23 @@ spec: folderPath: description: The S3Creds folder path to use type: string + productKeySecretRef: + description: The S3Creds product key + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object serviceAccount: description: The IAM service account to use items: @@ -406,26 +416,84 @@ spec: name: description: Name of the service type: string + privateKeySecretRef: + description: The IAM service private key + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object serviceId: description: The IAM service id type: string tokenEndpoint: description: The IAM token endpoint type: string + required: + - privateKeySecretRef type: object type: array + required: + - productKeySecretRef type: object type: array staticAccess: description: Details of the CDR service account items: properties: + accessKeySecretRef: + description: The S3 access key + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object bucketName: description: The S3 bucket name type: string endpoint: description: The S3 bucket endpoint type: string + secretKeySecretRef: + description: The S3 secret key + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object + required: + - accessKeySecretRef + - secretKeySecretRef type: object type: array type: object @@ -687,6 +755,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -710,6 +785,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/dicom.hsdp.crossplane.io_repositories.yaml b/package/crds/dicom.hsdp.crossplane.io_repositories.yaml index bca8414..96ea957 100644 --- a/package/crds/dicom.hsdp.crossplane.io_repositories.yaml +++ b/package/crds/dicom.hsdp.crossplane.io_repositories.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -523,6 +523,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -546,6 +553,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/dicom.hsdp.crossplane.io_storeconfigs.yaml b/package/crds/dicom.hsdp.crossplane.io_storeconfigs.yaml index f9eb345..3ad2cd8 100644 --- a/package/crds/dicom.hsdp.crossplane.io_storeconfigs.yaml +++ b/package/crds/dicom.hsdp.crossplane.io_storeconfigs.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -526,6 +526,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -549,6 +556,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/hsdp.crossplane.io_providerconfigs.yaml b/package/crds/hsdp.crossplane.io_providerconfigs.yaml index 0a9bfb0..c2ae7d4 100644 --- a/package/crds/hsdp.crossplane.io_providerconfigs.yaml +++ b/package/crds/hsdp.crossplane.io_providerconfigs.yaml @@ -129,6 +129,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. diff --git a/package/crds/hsdp.crossplane.io_storeconfigs.yaml b/package/crds/hsdp.crossplane.io_storeconfigs.yaml index f324a3e..9f4ef6d 100644 --- a/package/crds/hsdp.crossplane.io_storeconfigs.yaml +++ b/package/crds/hsdp.crossplane.io_storeconfigs.yaml @@ -183,6 +183,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. diff --git a/package/crds/iam.hsdp.crossplane.io_applications.yaml b/package/crds/iam.hsdp.crossplane.io_applications.yaml index 743d3c4..7081b11 100644 --- a/package/crds/iam.hsdp.crossplane.io_applications.yaml +++ b/package/crds/iam.hsdp.crossplane.io_applications.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -521,6 +521,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -544,6 +551,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_clients.yaml b/package/crds/iam.hsdp.crossplane.io_clients.yaml index 4ea3c81..7859fc2 100644 --- a/package/crds/iam.hsdp.crossplane.io_clients.yaml +++ b/package/crds/iam.hsdp.crossplane.io_clients.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -389,6 +389,25 @@ spec: The name of the client Name of the client. type: string + passwordSecretRef: + description: |- + The password to use (8-16 chars, at least one capital, number, special char) + The password to use (8-16 chars, at least one capital, number, special char). + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object redirectionUris: description: |- Array of valid RedirectionURIs for this client @@ -424,6 +443,8 @@ spec: Either Public or Confidential The type of the client. Either 'Public' or 'Confidential'. type: string + required: + - passwordSecretRef type: object managementPolicies: default: @@ -747,6 +768,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -770,6 +798,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_emailtemplates.yaml b/package/crds/iam.hsdp.crossplane.io_emailtemplates.yaml index af2c708..5114047 100644 --- a/package/crds/iam.hsdp.crossplane.io_emailtemplates.yaml +++ b/package/crds/iam.hsdp.crossplane.io_emailtemplates.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -553,6 +553,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -576,6 +583,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_groups.yaml b/package/crds/iam.hsdp.crossplane.io_groups.yaml index 5bf1ecc..71c1fc8 100644 --- a/package/crds/iam.hsdp.crossplane.io_groups.yaml +++ b/package/crds/iam.hsdp.crossplane.io_groups.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -1054,6 +1054,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -1077,6 +1084,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_organizations.yaml b/package/crds/iam.hsdp.crossplane.io_organizations.yaml index 9c9c945..b097843 100644 --- a/package/crds/iam.hsdp.crossplane.io_organizations.yaml +++ b/package/crds/iam.hsdp.crossplane.io_organizations.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -419,6 +419,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -442,6 +449,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_passwordpolicies.yaml b/package/crds/iam.hsdp.crossplane.io_passwordpolicies.yaml index 6be83f2..995d636 100644 --- a/package/crds/iam.hsdp.crossplane.io_passwordpolicies.yaml +++ b/package/crds/iam.hsdp.crossplane.io_passwordpolicies.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -690,6 +690,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -713,6 +720,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_propositions.yaml b/package/crds/iam.hsdp.crossplane.io_propositions.yaml index ff69820..5c5b468 100644 --- a/package/crds/iam.hsdp.crossplane.io_propositions.yaml +++ b/package/crds/iam.hsdp.crossplane.io_propositions.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -479,6 +479,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -502,6 +509,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_roles.yaml b/package/crds/iam.hsdp.crossplane.io_roles.yaml index 77a31c4..75b9473 100644 --- a/package/crds/iam.hsdp.crossplane.io_roles.yaml +++ b/package/crds/iam.hsdp.crossplane.io_roles.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -520,6 +520,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -543,6 +550,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_rolesharingpolicies.yaml b/package/crds/iam.hsdp.crossplane.io_rolesharingpolicies.yaml index f88e62e..dae52b7 100644 --- a/package/crds/iam.hsdp.crossplane.io_rolesharingpolicies.yaml +++ b/package/crds/iam.hsdp.crossplane.io_rolesharingpolicies.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -636,6 +636,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -659,6 +666,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_services.yaml b/package/crds/iam.hsdp.crossplane.io_services.yaml index 3305803..0af81d9 100644 --- a/package/crds/iam.hsdp.crossplane.io_services.yaml +++ b/package/crds/iam.hsdp.crossplane.io_services.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -339,6 +339,26 @@ spec: Sets the certificate validity. When not specified, the certificate will have a validity of 5 years. Sets the certificate validity. When not specified, the certificate will have a validity of 5 years. type: string + selfManagedPrivateKeySecretRef: + description: |- + RSA private key in PEM format. When provided, overrides the generated certificate / private key combination of the + IAM service. This gives you full control over the credentials. When not specified, a private key will be generated by IAM + RSA private key in PEM format. When provided, overrides the generated certificate / private key combination of the IAM service. This gives you full control over the credentials. When not specified, a private key will be generated by IAM. + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object tokenValidity: description: |- Integer. Access Token Lifetime (in seconds). Default: 1800 (30 minutes), Maximum: 2592000 (30 days) @@ -624,6 +644,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -647,6 +674,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/iam.hsdp.crossplane.io_users.yaml b/package/crds/iam.hsdp.crossplane.io_users.yaml index 57e7da7..dae236f 100644 --- a/package/crds/iam.hsdp.crossplane.io_users.yaml +++ b/package/crds/iam.hsdp.crossplane.io_users.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -330,6 +330,30 @@ spec: required: - name type: object + passwordSecretRef: + description: |- + When specified this will skip the email activation + flow and immediately activate the IAM account. Very Important: you are responsible + for sharing this password with the new IAM user through some channel of communication. + No email will be triggered by the system. If unsure, do not set a password so the normal + email activation flow is followed. Finally, any password value changes after user creation + will have no effect on the users' actual password. + When specified this will skip the email activation flow and immediately activate the IAM account. Very Important: you are responsible for sharing this password with the new IAM user through some channel of communication. No email will be triggered by the system. If unsure, do not set a password so the normal email activation flow is followed. Finally, any password value changes after user creation will have no effect on the users' actual password. + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object preferredCommunicationChannel: description: |- Preferred communication channel. @@ -605,6 +629,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -628,6 +659,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/mdm.hsdp.crossplane.io_datatypes.yaml b/package/crds/mdm.hsdp.crossplane.io_datatypes.yaml index 821e33b..1e81b15 100644 --- a/package/crds/mdm.hsdp.crossplane.io_datatypes.yaml +++ b/package/crds/mdm.hsdp.crossplane.io_datatypes.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -486,6 +486,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -509,6 +516,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec diff --git a/package/crds/mdm.hsdp.crossplane.io_propositions.yaml b/package/crds/mdm.hsdp.crossplane.io_propositions.yaml index bc16e76..0425d2a 100644 --- a/package/crds/mdm.hsdp.crossplane.io_propositions.yaml +++ b/package/crds/mdm.hsdp.crossplane.io_propositions.yaml @@ -19,12 +19,12 @@ spec: 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: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string - jsonPath: .metadata.annotations.crossplane\.io/external-name name: EXTERNAL-NAME type: string @@ -499,6 +499,13 @@ spec: A Message containing details about this condition's last transition from one status to another, if any. type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer reason: description: A Reason for this condition's last transition from one status to another. @@ -522,6 +529,13 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer type: object required: - spec