diff --git a/v2/api/alertsmanagement/v1api20210401/smart_detector_alert_rule_types_gen.go b/v2/api/alertsmanagement/v1api20210401/smart_detector_alert_rule_types_gen.go index b9da3d702dc..410036fe0cd 100644 --- a/v2/api/alertsmanagement/v1api20210401/smart_detector_alert_rule_types_gen.go +++ b/v2/api/alertsmanagement/v1api20210401/smart_detector_alert_rule_types_gen.go @@ -174,6 +174,10 @@ func (rule *SmartDetectorAlertRule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (rule *SmartDetectorAlertRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/alertsmanagement/v1api20210401/storage/smart_detector_alert_rule_types_gen.go b/v2/api/alertsmanagement/v1api20210401/storage/smart_detector_alert_rule_types_gen.go index d9fe81ba1a1..13c4ac7a90f 100644 --- a/v2/api/alertsmanagement/v1api20210401/storage/smart_detector_alert_rule_types_gen.go +++ b/v2/api/alertsmanagement/v1api20210401/storage/smart_detector_alert_rule_types_gen.go @@ -116,6 +116,10 @@ func (rule *SmartDetectorAlertRule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (rule *SmartDetectorAlertRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/alertsmanagement/v1api20230301/prometheus_rule_group_types_gen.go b/v2/api/alertsmanagement/v1api20230301/prometheus_rule_group_types_gen.go index 9ef8d18b1bc..de9300bae1c 100644 --- a/v2/api/alertsmanagement/v1api20230301/prometheus_rule_group_types_gen.go +++ b/v2/api/alertsmanagement/v1api20230301/prometheus_rule_group_types_gen.go @@ -173,6 +173,10 @@ func (group *PrometheusRuleGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *PrometheusRuleGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/alertsmanagement/v1api20230301/storage/prometheus_rule_group_types_gen.go b/v2/api/alertsmanagement/v1api20230301/storage/prometheus_rule_group_types_gen.go index baef6f5d6f1..a78c44a7181 100644 --- a/v2/api/alertsmanagement/v1api20230301/storage/prometheus_rule_group_types_gen.go +++ b/v2/api/alertsmanagement/v1api20230301/storage/prometheus_rule_group_types_gen.go @@ -115,6 +115,10 @@ func (group *PrometheusRuleGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *PrometheusRuleGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/apimanagement/v1api20220801/api_types_gen.go b/v2/api/apimanagement/v1api20220801/api_types_gen.go index bfd662534c1..a275877b799 100644 --- a/v2/api/apimanagement/v1api20220801/api_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/api_types_gen.go @@ -172,6 +172,10 @@ func (api *Api) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (api *Api) Owner() *genruntime.ResourceReference { + if api.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(api.Spec) return api.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/api_version_set_types_gen.go b/v2/api/apimanagement/v1api20220801/api_version_set_types_gen.go index 576a5a57925..6d7ef627588 100644 --- a/v2/api/apimanagement/v1api20220801/api_version_set_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/api_version_set_types_gen.go @@ -174,6 +174,10 @@ func (versionSet *ApiVersionSet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (versionSet *ApiVersionSet) Owner() *genruntime.ResourceReference { + if versionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(versionSet.Spec) return versionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/authorization_provider_types_gen.go b/v2/api/apimanagement/v1api20220801/authorization_provider_types_gen.go index 54cfcb76d29..cc180000a81 100644 --- a/v2/api/apimanagement/v1api20220801/authorization_provider_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/authorization_provider_types_gen.go @@ -173,6 +173,10 @@ func (provider *AuthorizationProvider) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (provider *AuthorizationProvider) Owner() *genruntime.ResourceReference { + if provider.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(provider.Spec) return provider.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/authorization_providers_authorization_types_gen.go b/v2/api/apimanagement/v1api20220801/authorization_providers_authorization_types_gen.go index 1837a013aa9..7f591a0e7d6 100644 --- a/v2/api/apimanagement/v1api20220801/authorization_providers_authorization_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/authorization_providers_authorization_types_gen.go @@ -175,6 +175,10 @@ func (authorization *AuthorizationProvidersAuthorization) NewEmptyStatus() genru // Owner returns the ResourceReference of the owner func (authorization *AuthorizationProvidersAuthorization) Owner() *genruntime.ResourceReference { + if authorization.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(authorization.Spec) return authorization.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/authorization_providers_authorizations_access_policy_types_gen.go b/v2/api/apimanagement/v1api20220801/authorization_providers_authorizations_access_policy_types_gen.go index 11d64b731a6..af138926453 100644 --- a/v2/api/apimanagement/v1api20220801/authorization_providers_authorizations_access_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/authorization_providers_authorizations_access_policy_types_gen.go @@ -175,6 +175,10 @@ func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) NewEmptyStatus() // Owner returns the ResourceReference of the owner func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/backend_types_gen.go b/v2/api/apimanagement/v1api20220801/backend_types_gen.go index c938366cf36..b0acd46cba5 100644 --- a/v2/api/apimanagement/v1api20220801/backend_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/backend_types_gen.go @@ -174,6 +174,10 @@ func (backend *Backend) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (backend *Backend) Owner() *genruntime.ResourceReference { + if backend.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(backend.Spec) return backend.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/named_value_types_gen.go b/v2/api/apimanagement/v1api20220801/named_value_types_gen.go index 55c54fbb8c5..aafb7f658eb 100644 --- a/v2/api/apimanagement/v1api20220801/named_value_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/named_value_types_gen.go @@ -174,6 +174,10 @@ func (value *NamedValue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (value *NamedValue) Owner() *genruntime.ResourceReference { + if value.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(value.Spec) return value.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/policy_fragment_types_gen.go b/v2/api/apimanagement/v1api20220801/policy_fragment_types_gen.go index e6d37762563..330b4e6e8f8 100644 --- a/v2/api/apimanagement/v1api20220801/policy_fragment_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/policy_fragment_types_gen.go @@ -174,6 +174,10 @@ func (fragment *PolicyFragment) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (fragment *PolicyFragment) Owner() *genruntime.ResourceReference { + if fragment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(fragment.Spec) return fragment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/policy_types_gen.go b/v2/api/apimanagement/v1api20220801/policy_types_gen.go index a5e3bd3f728..e9f067fdaf5 100644 --- a/v2/api/apimanagement/v1api20220801/policy_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/policy_types_gen.go @@ -167,6 +167,10 @@ func (policy *Policy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *Policy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/product_api_types_gen.go b/v2/api/apimanagement/v1api20220801/product_api_types_gen.go index 00769bd7615..a0f4e110b9a 100644 --- a/v2/api/apimanagement/v1api20220801/product_api_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/product_api_types_gen.go @@ -173,6 +173,10 @@ func (productApi *ProductApi) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (productApi *ProductApi) Owner() *genruntime.ResourceReference { + if productApi.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(productApi.Spec) return productApi.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/product_policy_types_gen.go b/v2/api/apimanagement/v1api20220801/product_policy_types_gen.go index 6747ecf8e74..a7df3b0e9fe 100644 --- a/v2/api/apimanagement/v1api20220801/product_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/product_policy_types_gen.go @@ -167,6 +167,10 @@ func (policy *ProductPolicy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *ProductPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/product_types_gen.go b/v2/api/apimanagement/v1api20220801/product_types_gen.go index fd9280d2a2a..8f7235b9e4c 100644 --- a/v2/api/apimanagement/v1api20220801/product_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/product_types_gen.go @@ -174,6 +174,10 @@ func (product *Product) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (product *Product) Owner() *genruntime.ResourceReference { + if product.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(product.Spec) return product.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/service_types_gen.go b/v2/api/apimanagement/v1api20220801/service_types_gen.go index 909c24af1c4..6c8a694a795 100644 --- a/v2/api/apimanagement/v1api20220801/service_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/service_types_gen.go @@ -173,6 +173,10 @@ func (service *Service) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (service *Service) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/api_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/api_types_gen.go index e3f4041788d..86677004c7c 100644 --- a/v2/api/apimanagement/v1api20220801/storage/api_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/api_types_gen.go @@ -114,6 +114,10 @@ func (api *Api) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (api *Api) Owner() *genruntime.ResourceReference { + if api.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(api.Spec) return api.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/api_version_set_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/api_version_set_types_gen.go index 5c117e6dfa5..9bf6280cdc8 100644 --- a/v2/api/apimanagement/v1api20220801/storage/api_version_set_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/api_version_set_types_gen.go @@ -116,6 +116,10 @@ func (versionSet *ApiVersionSet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (versionSet *ApiVersionSet) Owner() *genruntime.ResourceReference { + if versionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(versionSet.Spec) return versionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/authorization_provider_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/authorization_provider_types_gen.go index a5f1876d9ef..ad43166cfe1 100644 --- a/v2/api/apimanagement/v1api20220801/storage/authorization_provider_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/authorization_provider_types_gen.go @@ -115,6 +115,10 @@ func (provider *AuthorizationProvider) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (provider *AuthorizationProvider) Owner() *genruntime.ResourceReference { + if provider.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(provider.Spec) return provider.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorization_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorization_types_gen.go index 2bb1ba6432d..afd60fd7f8f 100644 --- a/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorization_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorization_types_gen.go @@ -115,6 +115,10 @@ func (authorization *AuthorizationProvidersAuthorization) NewEmptyStatus() genru // Owner returns the ResourceReference of the owner func (authorization *AuthorizationProvidersAuthorization) Owner() *genruntime.ResourceReference { + if authorization.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(authorization.Spec) return authorization.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorizations_access_policy_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorizations_access_policy_types_gen.go index 0c4a08d9916..63ff2e92b35 100644 --- a/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorizations_access_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/authorization_providers_authorizations_access_policy_types_gen.go @@ -115,6 +115,10 @@ func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) NewEmptyStatus() // Owner returns the ResourceReference of the owner func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/backend_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/backend_types_gen.go index ce97cb246e3..9141499bf77 100644 --- a/v2/api/apimanagement/v1api20220801/storage/backend_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/backend_types_gen.go @@ -116,6 +116,10 @@ func (backend *Backend) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (backend *Backend) Owner() *genruntime.ResourceReference { + if backend.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(backend.Spec) return backend.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/named_value_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/named_value_types_gen.go index 284d444da77..ff50ec71159 100644 --- a/v2/api/apimanagement/v1api20220801/storage/named_value_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/named_value_types_gen.go @@ -116,6 +116,10 @@ func (value *NamedValue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (value *NamedValue) Owner() *genruntime.ResourceReference { + if value.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(value.Spec) return value.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/policy_fragment_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/policy_fragment_types_gen.go index 97097a0be27..c7453d2721b 100644 --- a/v2/api/apimanagement/v1api20220801/storage/policy_fragment_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/policy_fragment_types_gen.go @@ -116,6 +116,10 @@ func (fragment *PolicyFragment) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (fragment *PolicyFragment) Owner() *genruntime.ResourceReference { + if fragment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(fragment.Spec) return fragment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/policy_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/policy_types_gen.go index 5c2c344ad7c..22e011dc0e2 100644 --- a/v2/api/apimanagement/v1api20220801/storage/policy_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/policy_types_gen.go @@ -116,6 +116,10 @@ func (policy *Policy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *Policy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/product_api_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/product_api_types_gen.go index f603785d606..c364b3bea15 100644 --- a/v2/api/apimanagement/v1api20220801/storage/product_api_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/product_api_types_gen.go @@ -115,6 +115,10 @@ func (productApi *ProductApi) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (productApi *ProductApi) Owner() *genruntime.ResourceReference { + if productApi.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(productApi.Spec) return productApi.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/product_policy_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/product_policy_types_gen.go index 4bd9dd91ef2..bbab10ec023 100644 --- a/v2/api/apimanagement/v1api20220801/storage/product_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/product_policy_types_gen.go @@ -116,6 +116,10 @@ func (policy *ProductPolicy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *ProductPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/product_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/product_types_gen.go index cd74c33105b..cd366ea59fc 100644 --- a/v2/api/apimanagement/v1api20220801/storage/product_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/product_types_gen.go @@ -116,6 +116,10 @@ func (product *Product) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (product *Product) Owner() *genruntime.ResourceReference { + if product.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(product.Spec) return product.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/service_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/service_types_gen.go index fa852efaa90..7f4e5b2c44c 100644 --- a/v2/api/apimanagement/v1api20220801/storage/service_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/service_types_gen.go @@ -115,6 +115,10 @@ func (service *Service) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (service *Service) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/storage/subscription_types_gen.go b/v2/api/apimanagement/v1api20220801/storage/subscription_types_gen.go index 01bf4558fdb..3d72d38d256 100644 --- a/v2/api/apimanagement/v1api20220801/storage/subscription_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/storage/subscription_types_gen.go @@ -116,6 +116,10 @@ func (subscription *Subscription) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (subscription *Subscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20220801/subscription_types_gen.go b/v2/api/apimanagement/v1api20220801/subscription_types_gen.go index e1038f423d7..5c7d9c2d1a5 100644 --- a/v2/api/apimanagement/v1api20220801/subscription_types_gen.go +++ b/v2/api/apimanagement/v1api20220801/subscription_types_gen.go @@ -174,6 +174,10 @@ func (subscription *Subscription) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (subscription *Subscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/api_types_gen.go b/v2/api/apimanagement/v1api20230501preview/api_types_gen.go index 6babc99c00e..10fc032baa0 100644 --- a/v2/api/apimanagement/v1api20230501preview/api_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/api_types_gen.go @@ -175,6 +175,10 @@ func (api *Api) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (api *Api) Owner() *genruntime.ResourceReference { + if api.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(api.Spec) return api.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/api_version_set_types_gen.go b/v2/api/apimanagement/v1api20230501preview/api_version_set_types_gen.go index 73592701135..0e26b7a4f63 100644 --- a/v2/api/apimanagement/v1api20230501preview/api_version_set_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/api_version_set_types_gen.go @@ -177,6 +177,10 @@ func (versionSet *ApiVersionSet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (versionSet *ApiVersionSet) Owner() *genruntime.ResourceReference { + if versionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(versionSet.Spec) return versionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/authorization_provider_types_gen.go b/v2/api/apimanagement/v1api20230501preview/authorization_provider_types_gen.go index 55aeeac33e7..f4dd88bafc2 100644 --- a/v2/api/apimanagement/v1api20230501preview/authorization_provider_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/authorization_provider_types_gen.go @@ -176,6 +176,10 @@ func (provider *AuthorizationProvider) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (provider *AuthorizationProvider) Owner() *genruntime.ResourceReference { + if provider.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(provider.Spec) return provider.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorization_types_gen.go b/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorization_types_gen.go index ce209c8fe46..3636daa3616 100644 --- a/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorization_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorization_types_gen.go @@ -178,6 +178,10 @@ func (authorization *AuthorizationProvidersAuthorization) NewEmptyStatus() genru // Owner returns the ResourceReference of the owner func (authorization *AuthorizationProvidersAuthorization) Owner() *genruntime.ResourceReference { + if authorization.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(authorization.Spec) return authorization.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorizations_access_policy_types_gen.go b/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorizations_access_policy_types_gen.go index 1dddf148376..a320e79b0c2 100644 --- a/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorizations_access_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/authorization_providers_authorizations_access_policy_types_gen.go @@ -178,6 +178,10 @@ func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) NewEmptyStatus() // Owner returns the ResourceReference of the owner func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/backend_types_gen.go b/v2/api/apimanagement/v1api20230501preview/backend_types_gen.go index fb09fda1014..9e54480db04 100644 --- a/v2/api/apimanagement/v1api20230501preview/backend_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/backend_types_gen.go @@ -177,6 +177,10 @@ func (backend *Backend) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (backend *Backend) Owner() *genruntime.ResourceReference { + if backend.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(backend.Spec) return backend.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/named_value_types_gen.go b/v2/api/apimanagement/v1api20230501preview/named_value_types_gen.go index 176f1e12427..48d800a1941 100644 --- a/v2/api/apimanagement/v1api20230501preview/named_value_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/named_value_types_gen.go @@ -177,6 +177,10 @@ func (value *NamedValue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (value *NamedValue) Owner() *genruntime.ResourceReference { + if value.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(value.Spec) return value.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/policy_fragment_types_gen.go b/v2/api/apimanagement/v1api20230501preview/policy_fragment_types_gen.go index 07218960f04..4f2c044cac5 100644 --- a/v2/api/apimanagement/v1api20230501preview/policy_fragment_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/policy_fragment_types_gen.go @@ -177,6 +177,10 @@ func (fragment *PolicyFragment) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (fragment *PolicyFragment) Owner() *genruntime.ResourceReference { + if fragment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(fragment.Spec) return fragment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/policy_types_gen.go b/v2/api/apimanagement/v1api20230501preview/policy_types_gen.go index 55b84db8db7..c54047e250a 100644 --- a/v2/api/apimanagement/v1api20230501preview/policy_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/policy_types_gen.go @@ -170,6 +170,10 @@ func (policy *Policy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *Policy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/product_api_types_gen.go b/v2/api/apimanagement/v1api20230501preview/product_api_types_gen.go index f3549884de7..4d8a63f459c 100644 --- a/v2/api/apimanagement/v1api20230501preview/product_api_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/product_api_types_gen.go @@ -176,6 +176,10 @@ func (productApi *ProductApi) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (productApi *ProductApi) Owner() *genruntime.ResourceReference { + if productApi.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(productApi.Spec) return productApi.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/product_policy_types_gen.go b/v2/api/apimanagement/v1api20230501preview/product_policy_types_gen.go index cab883f2eeb..18783848cc7 100644 --- a/v2/api/apimanagement/v1api20230501preview/product_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/product_policy_types_gen.go @@ -170,6 +170,10 @@ func (policy *ProductPolicy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *ProductPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/product_types_gen.go b/v2/api/apimanagement/v1api20230501preview/product_types_gen.go index f1e382ea323..be944f67a4b 100644 --- a/v2/api/apimanagement/v1api20230501preview/product_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/product_types_gen.go @@ -177,6 +177,10 @@ func (product *Product) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (product *Product) Owner() *genruntime.ResourceReference { + if product.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(product.Spec) return product.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/service_types_gen.go b/v2/api/apimanagement/v1api20230501preview/service_types_gen.go index c44f170b3ee..932fbf6a65d 100644 --- a/v2/api/apimanagement/v1api20230501preview/service_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/service_types_gen.go @@ -176,6 +176,10 @@ func (service *Service) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (service *Service) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/api_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/api_types_gen.go index 80c105b42e6..c57ca4c4f80 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/api_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/api_types_gen.go @@ -135,6 +135,10 @@ func (api *Api) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (api *Api) Owner() *genruntime.ResourceReference { + if api.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(api.Spec) return api.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/api_version_set_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/api_version_set_types_gen.go index 502607c3806..d2061400320 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/api_version_set_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/api_version_set_types_gen.go @@ -137,6 +137,10 @@ func (versionSet *ApiVersionSet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (versionSet *ApiVersionSet) Owner() *genruntime.ResourceReference { + if versionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(versionSet.Spec) return versionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/authorization_provider_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/authorization_provider_types_gen.go index 8b25dfbe35f..975ba0e89fa 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/authorization_provider_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/authorization_provider_types_gen.go @@ -136,6 +136,10 @@ func (provider *AuthorizationProvider) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (provider *AuthorizationProvider) Owner() *genruntime.ResourceReference { + if provider.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(provider.Spec) return provider.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorization_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorization_types_gen.go index 2359e256856..aeefc0a13f2 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorization_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorization_types_gen.go @@ -136,6 +136,10 @@ func (authorization *AuthorizationProvidersAuthorization) NewEmptyStatus() genru // Owner returns the ResourceReference of the owner func (authorization *AuthorizationProvidersAuthorization) Owner() *genruntime.ResourceReference { + if authorization.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(authorization.Spec) return authorization.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorizations_access_policy_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorizations_access_policy_types_gen.go index 8d2ac661b29..f3a7f7e8555 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorizations_access_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/authorization_providers_authorizations_access_policy_types_gen.go @@ -136,6 +136,10 @@ func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) NewEmptyStatus() // Owner returns the ResourceReference of the owner func (policy *AuthorizationProvidersAuthorizationsAccessPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/backend_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/backend_types_gen.go index 9a0e1e83d12..d2390b48b83 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/backend_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/backend_types_gen.go @@ -137,6 +137,10 @@ func (backend *Backend) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (backend *Backend) Owner() *genruntime.ResourceReference { + if backend.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(backend.Spec) return backend.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/named_value_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/named_value_types_gen.go index b58710df527..a80f6f05ce7 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/named_value_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/named_value_types_gen.go @@ -137,6 +137,10 @@ func (value *NamedValue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (value *NamedValue) Owner() *genruntime.ResourceReference { + if value.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(value.Spec) return value.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/policy_fragment_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/policy_fragment_types_gen.go index 50b4baa2b60..b08c1a7180d 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/policy_fragment_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/policy_fragment_types_gen.go @@ -137,6 +137,10 @@ func (fragment *PolicyFragment) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (fragment *PolicyFragment) Owner() *genruntime.ResourceReference { + if fragment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(fragment.Spec) return fragment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/policy_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/policy_types_gen.go index 60603f5756b..c30f24c0ad7 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/policy_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/policy_types_gen.go @@ -137,6 +137,10 @@ func (policy *Policy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *Policy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/product_api_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/product_api_types_gen.go index 82ff371b5bb..042ef66d766 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/product_api_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/product_api_types_gen.go @@ -136,6 +136,10 @@ func (productApi *ProductApi) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (productApi *ProductApi) Owner() *genruntime.ResourceReference { + if productApi.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(productApi.Spec) return productApi.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/product_policy_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/product_policy_types_gen.go index 0596b1af8cb..61d2f45f39c 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/product_policy_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/product_policy_types_gen.go @@ -137,6 +137,10 @@ func (policy *ProductPolicy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *ProductPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/product_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/product_types_gen.go index ddb890ee85c..bbfb36804c3 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/product_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/product_types_gen.go @@ -137,6 +137,10 @@ func (product *Product) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (product *Product) Owner() *genruntime.ResourceReference { + if product.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(product.Spec) return product.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/service_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/service_types_gen.go index a94df115c48..ba93e7f4073 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/service_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/service_types_gen.go @@ -136,6 +136,10 @@ func (service *Service) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (service *Service) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/storage/subscription_types_gen.go b/v2/api/apimanagement/v1api20230501preview/storage/subscription_types_gen.go index 7f2c2634008..a95c3cf2a80 100644 --- a/v2/api/apimanagement/v1api20230501preview/storage/subscription_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/storage/subscription_types_gen.go @@ -137,6 +137,10 @@ func (subscription *Subscription) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (subscription *Subscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/apimanagement/v1api20230501preview/subscription_types_gen.go b/v2/api/apimanagement/v1api20230501preview/subscription_types_gen.go index 7c4dd23b3ca..dfbf0763383 100644 --- a/v2/api/apimanagement/v1api20230501preview/subscription_types_gen.go +++ b/v2/api/apimanagement/v1api20230501preview/subscription_types_gen.go @@ -177,6 +177,10 @@ func (subscription *Subscription) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (subscription *Subscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/appconfiguration/v1api20220501/configuration_store_types_gen.go b/v2/api/appconfiguration/v1api20220501/configuration_store_types_gen.go index 13c9e895843..d96f342ff64 100644 --- a/v2/api/appconfiguration/v1api20220501/configuration_store_types_gen.go +++ b/v2/api/appconfiguration/v1api20220501/configuration_store_types_gen.go @@ -173,6 +173,10 @@ func (store *ConfigurationStore) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (store *ConfigurationStore) Owner() *genruntime.ResourceReference { + if store.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(store.Spec) return store.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/appconfiguration/v1api20220501/storage/configuration_store_types_gen.go b/v2/api/appconfiguration/v1api20220501/storage/configuration_store_types_gen.go index 8a4ce63fea4..a8bec7d64f7 100644 --- a/v2/api/appconfiguration/v1api20220501/storage/configuration_store_types_gen.go +++ b/v2/api/appconfiguration/v1api20220501/storage/configuration_store_types_gen.go @@ -115,6 +115,10 @@ func (store *ConfigurationStore) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (store *ConfigurationStore) Owner() *genruntime.ResourceReference { + if store.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(store.Spec) return store.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/authorization/v1api20200801preview/role_assignment_types_gen.go b/v2/api/authorization/v1api20200801preview/role_assignment_types_gen.go index 1779c21e9b0..79d514d15c4 100644 --- a/v2/api/authorization/v1api20200801preview/role_assignment_types_gen.go +++ b/v2/api/authorization/v1api20200801preview/role_assignment_types_gen.go @@ -169,6 +169,10 @@ func (assignment *RoleAssignment) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (assignment *RoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + return assignment.Spec.Owner.AsResourceReference() } diff --git a/v2/api/authorization/v1api20200801preview/storage/role_assignment_types_gen.go b/v2/api/authorization/v1api20200801preview/storage/role_assignment_types_gen.go index a2e1e40c501..096df63db26 100644 --- a/v2/api/authorization/v1api20200801preview/storage/role_assignment_types_gen.go +++ b/v2/api/authorization/v1api20200801preview/storage/role_assignment_types_gen.go @@ -136,6 +136,10 @@ func (assignment *RoleAssignment) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (assignment *RoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + return assignment.Spec.Owner.AsResourceReference() } diff --git a/v2/api/authorization/v1api20220401/role_assignment_types_gen.go b/v2/api/authorization/v1api20220401/role_assignment_types_gen.go index 3071a706af5..aab841c4e13 100644 --- a/v2/api/authorization/v1api20220401/role_assignment_types_gen.go +++ b/v2/api/authorization/v1api20220401/role_assignment_types_gen.go @@ -166,6 +166,10 @@ func (assignment *RoleAssignment) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (assignment *RoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + return assignment.Spec.Owner.AsResourceReference() } diff --git a/v2/api/authorization/v1api20220401/role_definition_types_gen.go b/v2/api/authorization/v1api20220401/role_definition_types_gen.go index ac0c512db9d..dfd2bf37e0f 100644 --- a/v2/api/authorization/v1api20220401/role_definition_types_gen.go +++ b/v2/api/authorization/v1api20220401/role_definition_types_gen.go @@ -166,6 +166,10 @@ func (definition *RoleDefinition) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (definition *RoleDefinition) Owner() *genruntime.ResourceReference { + if definition.Spec.Owner == nil { + return nil + } + return definition.Spec.Owner.AsResourceReference() } diff --git a/v2/api/authorization/v1api20220401/storage/role_assignment_types_gen.go b/v2/api/authorization/v1api20220401/storage/role_assignment_types_gen.go index 5c4a4b3a0fb..9c4ef325651 100644 --- a/v2/api/authorization/v1api20220401/storage/role_assignment_types_gen.go +++ b/v2/api/authorization/v1api20220401/storage/role_assignment_types_gen.go @@ -115,6 +115,10 @@ func (assignment *RoleAssignment) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (assignment *RoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + return assignment.Spec.Owner.AsResourceReference() } diff --git a/v2/api/authorization/v1api20220401/storage/role_definition_types_gen.go b/v2/api/authorization/v1api20220401/storage/role_definition_types_gen.go index e03dbf902b3..a2fd39bd596 100644 --- a/v2/api/authorization/v1api20220401/storage/role_definition_types_gen.go +++ b/v2/api/authorization/v1api20220401/storage/role_definition_types_gen.go @@ -115,6 +115,10 @@ func (definition *RoleDefinition) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (definition *RoleDefinition) Owner() *genruntime.ResourceReference { + if definition.Spec.Owner == nil { + return nil + } + return definition.Spec.Owner.AsResourceReference() } diff --git a/v2/api/batch/v1api20210101/batch_account_types_gen.go b/v2/api/batch/v1api20210101/batch_account_types_gen.go index 4f981e7bd36..86bf74239f1 100644 --- a/v2/api/batch/v1api20210101/batch_account_types_gen.go +++ b/v2/api/batch/v1api20210101/batch_account_types_gen.go @@ -173,6 +173,10 @@ func (account *BatchAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *BatchAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/batch/v1api20210101/storage/batch_account_types_gen.go b/v2/api/batch/v1api20210101/storage/batch_account_types_gen.go index 73fab764946..23d9968a824 100644 --- a/v2/api/batch/v1api20210101/storage/batch_account_types_gen.go +++ b/v2/api/batch/v1api20210101/storage/batch_account_types_gen.go @@ -115,6 +115,10 @@ func (account *BatchAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *BatchAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/redis_firewall_rule_types_gen.go b/v2/api/cache/v1api20201201/redis_firewall_rule_types_gen.go index 6a664bcd95a..62f4b593b2d 100644 --- a/v2/api/cache/v1api20201201/redis_firewall_rule_types_gen.go +++ b/v2/api/cache/v1api20201201/redis_firewall_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *RedisFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *RedisFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/redis_linked_server_types_gen.go b/v2/api/cache/v1api20201201/redis_linked_server_types_gen.go index 5dc78a000cf..41004a0d79b 100644 --- a/v2/api/cache/v1api20201201/redis_linked_server_types_gen.go +++ b/v2/api/cache/v1api20201201/redis_linked_server_types_gen.go @@ -176,6 +176,10 @@ func (server *RedisLinkedServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *RedisLinkedServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/redis_patch_schedule_types_gen.go b/v2/api/cache/v1api20201201/redis_patch_schedule_types_gen.go index bda60f9c830..31ad74c15fa 100644 --- a/v2/api/cache/v1api20201201/redis_patch_schedule_types_gen.go +++ b/v2/api/cache/v1api20201201/redis_patch_schedule_types_gen.go @@ -169,6 +169,10 @@ func (schedule *RedisPatchSchedule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (schedule *RedisPatchSchedule) Owner() *genruntime.ResourceReference { + if schedule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(schedule.Spec) return schedule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/redis_types_gen.go b/v2/api/cache/v1api20201201/redis_types_gen.go index a4163633c65..034d71c2a30 100644 --- a/v2/api/cache/v1api20201201/redis_types_gen.go +++ b/v2/api/cache/v1api20201201/redis_types_gen.go @@ -176,6 +176,10 @@ func (redis *Redis) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (redis *Redis) Owner() *genruntime.ResourceReference { + if redis.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(redis.Spec) return redis.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/storage/redis_firewall_rule_types_gen.go b/v2/api/cache/v1api20201201/storage/redis_firewall_rule_types_gen.go index 9017aaa9be5..f9a2e41777e 100644 --- a/v2/api/cache/v1api20201201/storage/redis_firewall_rule_types_gen.go +++ b/v2/api/cache/v1api20201201/storage/redis_firewall_rule_types_gen.go @@ -149,6 +149,10 @@ func (rule *RedisFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *RedisFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/storage/redis_linked_server_types_gen.go b/v2/api/cache/v1api20201201/storage/redis_linked_server_types_gen.go index f967cab795a..a2f72558441 100644 --- a/v2/api/cache/v1api20201201/storage/redis_linked_server_types_gen.go +++ b/v2/api/cache/v1api20201201/storage/redis_linked_server_types_gen.go @@ -149,6 +149,10 @@ func (server *RedisLinkedServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *RedisLinkedServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/storage/redis_patch_schedule_types_gen.go b/v2/api/cache/v1api20201201/storage/redis_patch_schedule_types_gen.go index aa0b1ae070f..31af0f9cd94 100644 --- a/v2/api/cache/v1api20201201/storage/redis_patch_schedule_types_gen.go +++ b/v2/api/cache/v1api20201201/storage/redis_patch_schedule_types_gen.go @@ -149,6 +149,10 @@ func (schedule *RedisPatchSchedule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (schedule *RedisPatchSchedule) Owner() *genruntime.ResourceReference { + if schedule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(schedule.Spec) return schedule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20201201/storage/redis_types_gen.go b/v2/api/cache/v1api20201201/storage/redis_types_gen.go index ccd01a05a78..323e1dba298 100644 --- a/v2/api/cache/v1api20201201/storage/redis_types_gen.go +++ b/v2/api/cache/v1api20201201/storage/redis_types_gen.go @@ -150,6 +150,10 @@ func (redis *Redis) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (redis *Redis) Owner() *genruntime.ResourceReference { + if redis.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(redis.Spec) return redis.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20210301/redis_enterprise_database_types_gen.go b/v2/api/cache/v1api20210301/redis_enterprise_database_types_gen.go index 15932d1aedf..420b2caf5d9 100644 --- a/v2/api/cache/v1api20210301/redis_enterprise_database_types_gen.go +++ b/v2/api/cache/v1api20210301/redis_enterprise_database_types_gen.go @@ -176,6 +176,10 @@ func (database *RedisEnterpriseDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *RedisEnterpriseDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20210301/redis_enterprise_types_gen.go b/v2/api/cache/v1api20210301/redis_enterprise_types_gen.go index 0b68ec15c96..e486e230c28 100644 --- a/v2/api/cache/v1api20210301/redis_enterprise_types_gen.go +++ b/v2/api/cache/v1api20210301/redis_enterprise_types_gen.go @@ -176,6 +176,10 @@ func (enterprise *RedisEnterprise) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (enterprise *RedisEnterprise) Owner() *genruntime.ResourceReference { + if enterprise.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(enterprise.Spec) return enterprise.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20210301/storage/redis_enterprise_database_types_gen.go b/v2/api/cache/v1api20210301/storage/redis_enterprise_database_types_gen.go index 2ae344ca938..2124664f427 100644 --- a/v2/api/cache/v1api20210301/storage/redis_enterprise_database_types_gen.go +++ b/v2/api/cache/v1api20210301/storage/redis_enterprise_database_types_gen.go @@ -136,6 +136,10 @@ func (database *RedisEnterpriseDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *RedisEnterpriseDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20210301/storage/redis_enterprise_types_gen.go b/v2/api/cache/v1api20210301/storage/redis_enterprise_types_gen.go index 5cd4b971bcc..834a4a59ef6 100644 --- a/v2/api/cache/v1api20210301/storage/redis_enterprise_types_gen.go +++ b/v2/api/cache/v1api20210301/storage/redis_enterprise_types_gen.go @@ -137,6 +137,10 @@ func (enterprise *RedisEnterprise) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (enterprise *RedisEnterprise) Owner() *genruntime.ResourceReference { + if enterprise.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(enterprise.Spec) return enterprise.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/redis_firewall_rule_types_gen.go b/v2/api/cache/v1api20230401/redis_firewall_rule_types_gen.go index a8b5abf50cc..e093e0f9fd3 100644 --- a/v2/api/cache/v1api20230401/redis_firewall_rule_types_gen.go +++ b/v2/api/cache/v1api20230401/redis_firewall_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *RedisFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *RedisFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/redis_linked_server_types_gen.go b/v2/api/cache/v1api20230401/redis_linked_server_types_gen.go index add794af9d6..09c09d390ba 100644 --- a/v2/api/cache/v1api20230401/redis_linked_server_types_gen.go +++ b/v2/api/cache/v1api20230401/redis_linked_server_types_gen.go @@ -176,6 +176,10 @@ func (server *RedisLinkedServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *RedisLinkedServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/redis_patch_schedule_types_gen.go b/v2/api/cache/v1api20230401/redis_patch_schedule_types_gen.go index e03002f2f26..670a85c3596 100644 --- a/v2/api/cache/v1api20230401/redis_patch_schedule_types_gen.go +++ b/v2/api/cache/v1api20230401/redis_patch_schedule_types_gen.go @@ -169,6 +169,10 @@ func (schedule *RedisPatchSchedule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (schedule *RedisPatchSchedule) Owner() *genruntime.ResourceReference { + if schedule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(schedule.Spec) return schedule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/redis_types_gen.go b/v2/api/cache/v1api20230401/redis_types_gen.go index d2f6d0bc40a..a20771d6dd2 100644 --- a/v2/api/cache/v1api20230401/redis_types_gen.go +++ b/v2/api/cache/v1api20230401/redis_types_gen.go @@ -176,6 +176,10 @@ func (redis *Redis) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (redis *Redis) Owner() *genruntime.ResourceReference { + if redis.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(redis.Spec) return redis.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/storage/redis_firewall_rule_types_gen.go b/v2/api/cache/v1api20230401/storage/redis_firewall_rule_types_gen.go index 725a377d3cf..3c412ff96d0 100644 --- a/v2/api/cache/v1api20230401/storage/redis_firewall_rule_types_gen.go +++ b/v2/api/cache/v1api20230401/storage/redis_firewall_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *RedisFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *RedisFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/storage/redis_linked_server_types_gen.go b/v2/api/cache/v1api20230401/storage/redis_linked_server_types_gen.go index a9a37c32c10..a9db3036102 100644 --- a/v2/api/cache/v1api20230401/storage/redis_linked_server_types_gen.go +++ b/v2/api/cache/v1api20230401/storage/redis_linked_server_types_gen.go @@ -136,6 +136,10 @@ func (server *RedisLinkedServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *RedisLinkedServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/storage/redis_patch_schedule_types_gen.go b/v2/api/cache/v1api20230401/storage/redis_patch_schedule_types_gen.go index 25b08c471db..348d4d0e7a3 100644 --- a/v2/api/cache/v1api20230401/storage/redis_patch_schedule_types_gen.go +++ b/v2/api/cache/v1api20230401/storage/redis_patch_schedule_types_gen.go @@ -136,6 +136,10 @@ func (schedule *RedisPatchSchedule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (schedule *RedisPatchSchedule) Owner() *genruntime.ResourceReference { + if schedule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(schedule.Spec) return schedule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230401/storage/redis_types_gen.go b/v2/api/cache/v1api20230401/storage/redis_types_gen.go index 194560d6da2..e3c366f4456 100644 --- a/v2/api/cache/v1api20230401/storage/redis_types_gen.go +++ b/v2/api/cache/v1api20230401/storage/redis_types_gen.go @@ -137,6 +137,10 @@ func (redis *Redis) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (redis *Redis) Owner() *genruntime.ResourceReference { + if redis.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(redis.Spec) return redis.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230701/redis_enterprise_database_types_gen.go b/v2/api/cache/v1api20230701/redis_enterprise_database_types_gen.go index 6c549503527..028db46a90a 100644 --- a/v2/api/cache/v1api20230701/redis_enterprise_database_types_gen.go +++ b/v2/api/cache/v1api20230701/redis_enterprise_database_types_gen.go @@ -173,6 +173,10 @@ func (database *RedisEnterpriseDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *RedisEnterpriseDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230701/redis_enterprise_types_gen.go b/v2/api/cache/v1api20230701/redis_enterprise_types_gen.go index e5948808430..ae8933ed333 100644 --- a/v2/api/cache/v1api20230701/redis_enterprise_types_gen.go +++ b/v2/api/cache/v1api20230701/redis_enterprise_types_gen.go @@ -173,6 +173,10 @@ func (enterprise *RedisEnterprise) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (enterprise *RedisEnterprise) Owner() *genruntime.ResourceReference { + if enterprise.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(enterprise.Spec) return enterprise.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230701/storage/redis_enterprise_database_types_gen.go b/v2/api/cache/v1api20230701/storage/redis_enterprise_database_types_gen.go index 3b0d05cdbbc..f1613f99c87 100644 --- a/v2/api/cache/v1api20230701/storage/redis_enterprise_database_types_gen.go +++ b/v2/api/cache/v1api20230701/storage/redis_enterprise_database_types_gen.go @@ -115,6 +115,10 @@ func (database *RedisEnterpriseDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *RedisEnterpriseDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230701/storage/redis_enterprise_types_gen.go b/v2/api/cache/v1api20230701/storage/redis_enterprise_types_gen.go index 491c3756e05..f0e775dc0eb 100644 --- a/v2/api/cache/v1api20230701/storage/redis_enterprise_types_gen.go +++ b/v2/api/cache/v1api20230701/storage/redis_enterprise_types_gen.go @@ -116,6 +116,10 @@ func (enterprise *RedisEnterprise) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (enterprise *RedisEnterprise) Owner() *genruntime.ResourceReference { + if enterprise.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(enterprise.Spec) return enterprise.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/redis_firewall_rule_types_gen.go b/v2/api/cache/v1api20230801/redis_firewall_rule_types_gen.go index 4eb83208acb..f918cccbd70 100644 --- a/v2/api/cache/v1api20230801/redis_firewall_rule_types_gen.go +++ b/v2/api/cache/v1api20230801/redis_firewall_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *RedisFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *RedisFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/redis_linked_server_types_gen.go b/v2/api/cache/v1api20230801/redis_linked_server_types_gen.go index 3a747fc59e6..a070758bc1d 100644 --- a/v2/api/cache/v1api20230801/redis_linked_server_types_gen.go +++ b/v2/api/cache/v1api20230801/redis_linked_server_types_gen.go @@ -173,6 +173,10 @@ func (server *RedisLinkedServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *RedisLinkedServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/redis_patch_schedule_types_gen.go b/v2/api/cache/v1api20230801/redis_patch_schedule_types_gen.go index d9f2dbbc318..8c20b103ca6 100644 --- a/v2/api/cache/v1api20230801/redis_patch_schedule_types_gen.go +++ b/v2/api/cache/v1api20230801/redis_patch_schedule_types_gen.go @@ -166,6 +166,10 @@ func (schedule *RedisPatchSchedule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (schedule *RedisPatchSchedule) Owner() *genruntime.ResourceReference { + if schedule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(schedule.Spec) return schedule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/redis_types_gen.go b/v2/api/cache/v1api20230801/redis_types_gen.go index fd8d1d19924..e0159dfca0e 100644 --- a/v2/api/cache/v1api20230801/redis_types_gen.go +++ b/v2/api/cache/v1api20230801/redis_types_gen.go @@ -173,6 +173,10 @@ func (redis *Redis) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (redis *Redis) Owner() *genruntime.ResourceReference { + if redis.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(redis.Spec) return redis.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/storage/redis_firewall_rule_types_gen.go b/v2/api/cache/v1api20230801/storage/redis_firewall_rule_types_gen.go index 001a1f03c38..d994cfe041e 100644 --- a/v2/api/cache/v1api20230801/storage/redis_firewall_rule_types_gen.go +++ b/v2/api/cache/v1api20230801/storage/redis_firewall_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *RedisFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *RedisFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/storage/redis_linked_server_types_gen.go b/v2/api/cache/v1api20230801/storage/redis_linked_server_types_gen.go index 483f46ad53a..229ded0def6 100644 --- a/v2/api/cache/v1api20230801/storage/redis_linked_server_types_gen.go +++ b/v2/api/cache/v1api20230801/storage/redis_linked_server_types_gen.go @@ -115,6 +115,10 @@ func (server *RedisLinkedServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *RedisLinkedServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/storage/redis_patch_schedule_types_gen.go b/v2/api/cache/v1api20230801/storage/redis_patch_schedule_types_gen.go index d589f54ef4c..a02fe2cb065 100644 --- a/v2/api/cache/v1api20230801/storage/redis_patch_schedule_types_gen.go +++ b/v2/api/cache/v1api20230801/storage/redis_patch_schedule_types_gen.go @@ -115,6 +115,10 @@ func (schedule *RedisPatchSchedule) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (schedule *RedisPatchSchedule) Owner() *genruntime.ResourceReference { + if schedule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(schedule.Spec) return schedule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cache/v1api20230801/storage/redis_types_gen.go b/v2/api/cache/v1api20230801/storage/redis_types_gen.go index e6b12e9b2e3..fca7c26af0f 100644 --- a/v2/api/cache/v1api20230801/storage/redis_types_gen.go +++ b/v2/api/cache/v1api20230801/storage/redis_types_gen.go @@ -115,6 +115,10 @@ func (redis *Redis) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (redis *Redis) Owner() *genruntime.ResourceReference { + if redis.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(redis.Spec) return redis.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20210601/profile_types_gen.go b/v2/api/cdn/v1api20210601/profile_types_gen.go index 9103d7e0380..b5bcdb320d1 100644 --- a/v2/api/cdn/v1api20210601/profile_types_gen.go +++ b/v2/api/cdn/v1api20210601/profile_types_gen.go @@ -176,6 +176,10 @@ func (profile *Profile) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (profile *Profile) Owner() *genruntime.ResourceReference { + if profile.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(profile.Spec) return profile.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20210601/profiles_endpoint_types_gen.go b/v2/api/cdn/v1api20210601/profiles_endpoint_types_gen.go index 39cb6269a6e..032d237b36a 100644 --- a/v2/api/cdn/v1api20210601/profiles_endpoint_types_gen.go +++ b/v2/api/cdn/v1api20210601/profiles_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *ProfilesEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (endpoint *ProfilesEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20210601/storage/profile_types_gen.go b/v2/api/cdn/v1api20210601/storage/profile_types_gen.go index 756e8173426..20c2320ab42 100644 --- a/v2/api/cdn/v1api20210601/storage/profile_types_gen.go +++ b/v2/api/cdn/v1api20210601/storage/profile_types_gen.go @@ -136,6 +136,10 @@ func (profile *Profile) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (profile *Profile) Owner() *genruntime.ResourceReference { + if profile.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(profile.Spec) return profile.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20210601/storage/profiles_endpoint_types_gen.go b/v2/api/cdn/v1api20210601/storage/profiles_endpoint_types_gen.go index 4e1df7a25c1..0fba02926eb 100644 --- a/v2/api/cdn/v1api20210601/storage/profiles_endpoint_types_gen.go +++ b/v2/api/cdn/v1api20210601/storage/profiles_endpoint_types_gen.go @@ -116,6 +116,10 @@ func (endpoint *ProfilesEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (endpoint *ProfilesEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/afd_custom_domain_types_gen.go b/v2/api/cdn/v1api20230501/afd_custom_domain_types_gen.go index d5f05beb78f..ddfe6ad5878 100644 --- a/v2/api/cdn/v1api20230501/afd_custom_domain_types_gen.go +++ b/v2/api/cdn/v1api20230501/afd_custom_domain_types_gen.go @@ -173,6 +173,10 @@ func (domain *AfdCustomDomain) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (domain *AfdCustomDomain) Owner() *genruntime.ResourceReference { + if domain.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(domain.Spec) return domain.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/afd_endpoint_types_gen.go b/v2/api/cdn/v1api20230501/afd_endpoint_types_gen.go index 85b5e788bdd..87ace733475 100644 --- a/v2/api/cdn/v1api20230501/afd_endpoint_types_gen.go +++ b/v2/api/cdn/v1api20230501/afd_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *AfdEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (endpoint *AfdEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/afd_origin_group_types_gen.go b/v2/api/cdn/v1api20230501/afd_origin_group_types_gen.go index f0a2f3c4296..ad8fee4f714 100644 --- a/v2/api/cdn/v1api20230501/afd_origin_group_types_gen.go +++ b/v2/api/cdn/v1api20230501/afd_origin_group_types_gen.go @@ -173,6 +173,10 @@ func (group *AfdOriginGroup) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (group *AfdOriginGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/cdn/v1api20230501/afd_origin_types_gen.go b/v2/api/cdn/v1api20230501/afd_origin_types_gen.go index cece957b606..13fdd93505d 100644 --- a/v2/api/cdn/v1api20230501/afd_origin_types_gen.go +++ b/v2/api/cdn/v1api20230501/afd_origin_types_gen.go @@ -173,6 +173,10 @@ func (origin *AfdOrigin) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (origin *AfdOrigin) Owner() *genruntime.ResourceReference { + if origin.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(origin.Spec) return origin.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/profile_types_gen.go b/v2/api/cdn/v1api20230501/profile_types_gen.go index 3d57b31f796..9c42fc83003 100644 --- a/v2/api/cdn/v1api20230501/profile_types_gen.go +++ b/v2/api/cdn/v1api20230501/profile_types_gen.go @@ -173,6 +173,10 @@ func (profile *Profile) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (profile *Profile) Owner() *genruntime.ResourceReference { + if profile.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(profile.Spec) return profile.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/route_types_gen.go b/v2/api/cdn/v1api20230501/route_types_gen.go index b50c4545b70..ed46d1d5013 100644 --- a/v2/api/cdn/v1api20230501/route_types_gen.go +++ b/v2/api/cdn/v1api20230501/route_types_gen.go @@ -173,6 +173,10 @@ func (route *Route) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (route *Route) Owner() *genruntime.ResourceReference { + if route.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(route.Spec) return route.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/rule_set_types_gen.go b/v2/api/cdn/v1api20230501/rule_set_types_gen.go index d62a166ca30..4dd8fa69f2c 100644 --- a/v2/api/cdn/v1api20230501/rule_set_types_gen.go +++ b/v2/api/cdn/v1api20230501/rule_set_types_gen.go @@ -173,6 +173,10 @@ func (ruleSet *RuleSet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (ruleSet *RuleSet) Owner() *genruntime.ResourceReference { + if ruleSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(ruleSet.Spec) return ruleSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/rule_types_gen.go b/v2/api/cdn/v1api20230501/rule_types_gen.go index d50eb1e7c28..80fee00604f 100644 --- a/v2/api/cdn/v1api20230501/rule_types_gen.go +++ b/v2/api/cdn/v1api20230501/rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *Rule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *Rule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/secret_types_gen.go b/v2/api/cdn/v1api20230501/secret_types_gen.go index 7471f6f0832..a8d961ac15f 100644 --- a/v2/api/cdn/v1api20230501/secret_types_gen.go +++ b/v2/api/cdn/v1api20230501/secret_types_gen.go @@ -173,6 +173,10 @@ func (secret *Secret) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (secret *Secret) Owner() *genruntime.ResourceReference { + if secret.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(secret.Spec) return secret.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/security_policy_types_gen.go b/v2/api/cdn/v1api20230501/security_policy_types_gen.go index 710bb485b0d..ee040ae87af 100644 --- a/v2/api/cdn/v1api20230501/security_policy_types_gen.go +++ b/v2/api/cdn/v1api20230501/security_policy_types_gen.go @@ -173,6 +173,10 @@ func (policy *SecurityPolicy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *SecurityPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/afd_custom_domain_types_gen.go b/v2/api/cdn/v1api20230501/storage/afd_custom_domain_types_gen.go index e945bbb140d..a29e9ec3a5f 100644 --- a/v2/api/cdn/v1api20230501/storage/afd_custom_domain_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/afd_custom_domain_types_gen.go @@ -115,6 +115,10 @@ func (domain *AfdCustomDomain) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (domain *AfdCustomDomain) Owner() *genruntime.ResourceReference { + if domain.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(domain.Spec) return domain.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/afd_endpoint_types_gen.go b/v2/api/cdn/v1api20230501/storage/afd_endpoint_types_gen.go index 10891482f2e..ad2f2b734dd 100644 --- a/v2/api/cdn/v1api20230501/storage/afd_endpoint_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/afd_endpoint_types_gen.go @@ -115,6 +115,10 @@ func (endpoint *AfdEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (endpoint *AfdEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/afd_origin_group_types_gen.go b/v2/api/cdn/v1api20230501/storage/afd_origin_group_types_gen.go index e797b82f30a..7fb4d4f4554 100644 --- a/v2/api/cdn/v1api20230501/storage/afd_origin_group_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/afd_origin_group_types_gen.go @@ -115,6 +115,10 @@ func (group *AfdOriginGroup) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (group *AfdOriginGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/cdn/v1api20230501/storage/afd_origin_types_gen.go b/v2/api/cdn/v1api20230501/storage/afd_origin_types_gen.go index 203b1bd441a..dd7ea08aeaf 100644 --- a/v2/api/cdn/v1api20230501/storage/afd_origin_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/afd_origin_types_gen.go @@ -115,6 +115,10 @@ func (origin *AfdOrigin) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (origin *AfdOrigin) Owner() *genruntime.ResourceReference { + if origin.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(origin.Spec) return origin.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/profile_types_gen.go b/v2/api/cdn/v1api20230501/storage/profile_types_gen.go index df2c214a043..72283a7ac3f 100644 --- a/v2/api/cdn/v1api20230501/storage/profile_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/profile_types_gen.go @@ -115,6 +115,10 @@ func (profile *Profile) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (profile *Profile) Owner() *genruntime.ResourceReference { + if profile.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(profile.Spec) return profile.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/route_types_gen.go b/v2/api/cdn/v1api20230501/storage/route_types_gen.go index 420398c282c..da7ad817dc3 100644 --- a/v2/api/cdn/v1api20230501/storage/route_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/route_types_gen.go @@ -115,6 +115,10 @@ func (route *Route) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (route *Route) Owner() *genruntime.ResourceReference { + if route.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(route.Spec) return route.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/rule_set_types_gen.go b/v2/api/cdn/v1api20230501/storage/rule_set_types_gen.go index 59dcf735d8e..fbccaa590a2 100644 --- a/v2/api/cdn/v1api20230501/storage/rule_set_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/rule_set_types_gen.go @@ -115,6 +115,10 @@ func (ruleSet *RuleSet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (ruleSet *RuleSet) Owner() *genruntime.ResourceReference { + if ruleSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(ruleSet.Spec) return ruleSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/rule_types_gen.go b/v2/api/cdn/v1api20230501/storage/rule_types_gen.go index b3622bbe0c0..1f2c1ab6307 100644 --- a/v2/api/cdn/v1api20230501/storage/rule_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *Rule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *Rule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/secret_types_gen.go b/v2/api/cdn/v1api20230501/storage/secret_types_gen.go index 15df57cc19d..2f049f07a63 100644 --- a/v2/api/cdn/v1api20230501/storage/secret_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/secret_types_gen.go @@ -115,6 +115,10 @@ func (secret *Secret) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (secret *Secret) Owner() *genruntime.ResourceReference { + if secret.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(secret.Spec) return secret.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/cdn/v1api20230501/storage/security_policy_types_gen.go b/v2/api/cdn/v1api20230501/storage/security_policy_types_gen.go index 2d6b4dda700..254c77f20f9 100644 --- a/v2/api/cdn/v1api20230501/storage/security_policy_types_gen.go +++ b/v2/api/cdn/v1api20230501/storage/security_policy_types_gen.go @@ -115,6 +115,10 @@ func (policy *SecurityPolicy) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (policy *SecurityPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20200930/disk_types_gen.go b/v2/api/compute/v1api20200930/disk_types_gen.go index 455cc6a26e6..bc68583283e 100644 --- a/v2/api/compute/v1api20200930/disk_types_gen.go +++ b/v2/api/compute/v1api20200930/disk_types_gen.go @@ -176,6 +176,10 @@ func (disk *Disk) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (disk *Disk) Owner() *genruntime.ResourceReference { + if disk.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(disk.Spec) return disk.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20200930/snapshot_types_gen.go b/v2/api/compute/v1api20200930/snapshot_types_gen.go index 3b014fcdaa9..b767b8001ea 100644 --- a/v2/api/compute/v1api20200930/snapshot_types_gen.go +++ b/v2/api/compute/v1api20200930/snapshot_types_gen.go @@ -176,6 +176,10 @@ func (snapshot *Snapshot) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (snapshot *Snapshot) Owner() *genruntime.ResourceReference { + if snapshot.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(snapshot.Spec) return snapshot.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20200930/storage/disk_types_gen.go b/v2/api/compute/v1api20200930/storage/disk_types_gen.go index aac621e42a6..c0c84d449f6 100644 --- a/v2/api/compute/v1api20200930/storage/disk_types_gen.go +++ b/v2/api/compute/v1api20200930/storage/disk_types_gen.go @@ -140,6 +140,10 @@ func (disk *Disk) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (disk *Disk) Owner() *genruntime.ResourceReference { + if disk.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(disk.Spec) return disk.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20200930/storage/snapshot_types_gen.go b/v2/api/compute/v1api20200930/storage/snapshot_types_gen.go index 2c993aac95c..de0f7379926 100644 --- a/v2/api/compute/v1api20200930/storage/snapshot_types_gen.go +++ b/v2/api/compute/v1api20200930/storage/snapshot_types_gen.go @@ -139,6 +139,10 @@ func (snapshot *Snapshot) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (snapshot *Snapshot) Owner() *genruntime.ResourceReference { + if snapshot.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(snapshot.Spec) return snapshot.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/storage/virtual_machine_scale_set_types_gen.go b/v2/api/compute/v1api20201201/storage/virtual_machine_scale_set_types_gen.go index 8b7dacbfff2..d87b960baf4 100644 --- a/v2/api/compute/v1api20201201/storage/virtual_machine_scale_set_types_gen.go +++ b/v2/api/compute/v1api20201201/storage/virtual_machine_scale_set_types_gen.go @@ -138,6 +138,10 @@ func (scaleSet *VirtualMachineScaleSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (scaleSet *VirtualMachineScaleSet) Owner() *genruntime.ResourceReference { + if scaleSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(scaleSet.Spec) return scaleSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/storage/virtual_machine_scale_sets_extension_types_gen.go b/v2/api/compute/v1api20201201/storage/virtual_machine_scale_sets_extension_types_gen.go index 4f2ac043161..3a8a1f19899 100644 --- a/v2/api/compute/v1api20201201/storage/virtual_machine_scale_sets_extension_types_gen.go +++ b/v2/api/compute/v1api20201201/storage/virtual_machine_scale_sets_extension_types_gen.go @@ -137,6 +137,10 @@ func (extension *VirtualMachineScaleSetsExtension) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (extension *VirtualMachineScaleSetsExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/storage/virtual_machine_types_gen.go b/v2/api/compute/v1api20201201/storage/virtual_machine_types_gen.go index b43d2756579..eb3749b46a8 100644 --- a/v2/api/compute/v1api20201201/storage/virtual_machine_types_gen.go +++ b/v2/api/compute/v1api20201201/storage/virtual_machine_types_gen.go @@ -138,6 +138,10 @@ func (machine *VirtualMachine) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (machine *VirtualMachine) Owner() *genruntime.ResourceReference { + if machine.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(machine.Spec) return machine.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/storage/virtual_machines_extension_types_gen.go b/v2/api/compute/v1api20201201/storage/virtual_machines_extension_types_gen.go index 0cafc60324e..29b401108f0 100644 --- a/v2/api/compute/v1api20201201/storage/virtual_machines_extension_types_gen.go +++ b/v2/api/compute/v1api20201201/storage/virtual_machines_extension_types_gen.go @@ -137,6 +137,10 @@ func (extension *VirtualMachinesExtension) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (extension *VirtualMachinesExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/virtual_machine_scale_set_types_gen.go b/v2/api/compute/v1api20201201/virtual_machine_scale_set_types_gen.go index c4e481f8178..34d5cb2ba25 100644 --- a/v2/api/compute/v1api20201201/virtual_machine_scale_set_types_gen.go +++ b/v2/api/compute/v1api20201201/virtual_machine_scale_set_types_gen.go @@ -177,6 +177,10 @@ func (scaleSet *VirtualMachineScaleSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (scaleSet *VirtualMachineScaleSet) Owner() *genruntime.ResourceReference { + if scaleSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(scaleSet.Spec) return scaleSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/virtual_machine_scale_sets_extension_types_gen.go b/v2/api/compute/v1api20201201/virtual_machine_scale_sets_extension_types_gen.go index ef408143cff..e7ccfee0ded 100644 --- a/v2/api/compute/v1api20201201/virtual_machine_scale_sets_extension_types_gen.go +++ b/v2/api/compute/v1api20201201/virtual_machine_scale_sets_extension_types_gen.go @@ -177,6 +177,10 @@ func (extension *VirtualMachineScaleSetsExtension) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (extension *VirtualMachineScaleSetsExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/virtual_machine_types_gen.go b/v2/api/compute/v1api20201201/virtual_machine_types_gen.go index eb3f0781972..27380a7844c 100644 --- a/v2/api/compute/v1api20201201/virtual_machine_types_gen.go +++ b/v2/api/compute/v1api20201201/virtual_machine_types_gen.go @@ -177,6 +177,10 @@ func (machine *VirtualMachine) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (machine *VirtualMachine) Owner() *genruntime.ResourceReference { + if machine.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(machine.Spec) return machine.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20201201/virtual_machines_extension_types_gen.go b/v2/api/compute/v1api20201201/virtual_machines_extension_types_gen.go index e04881cf574..4936e1c3848 100644 --- a/v2/api/compute/v1api20201201/virtual_machines_extension_types_gen.go +++ b/v2/api/compute/v1api20201201/virtual_machines_extension_types_gen.go @@ -177,6 +177,10 @@ func (extension *VirtualMachinesExtension) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (extension *VirtualMachinesExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20210701/image_types_gen.go b/v2/api/compute/v1api20210701/image_types_gen.go index 3de71a7016c..0721a9ae134 100644 --- a/v2/api/compute/v1api20210701/image_types_gen.go +++ b/v2/api/compute/v1api20210701/image_types_gen.go @@ -176,6 +176,10 @@ func (image *Image) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (image *Image) Owner() *genruntime.ResourceReference { + if image.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(image.Spec) return image.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20210701/storage/image_types_gen.go b/v2/api/compute/v1api20210701/storage/image_types_gen.go index 7727993b460..de77e4b928c 100644 --- a/v2/api/compute/v1api20210701/storage/image_types_gen.go +++ b/v2/api/compute/v1api20210701/storage/image_types_gen.go @@ -136,6 +136,10 @@ func (image *Image) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (image *Image) Owner() *genruntime.ResourceReference { + if image.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(image.Spec) return image.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/image_types_gen.go b/v2/api/compute/v1api20220301/image_types_gen.go index 23460d34064..ae55627cb2c 100644 --- a/v2/api/compute/v1api20220301/image_types_gen.go +++ b/v2/api/compute/v1api20220301/image_types_gen.go @@ -173,6 +173,10 @@ func (image *Image) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (image *Image) Owner() *genruntime.ResourceReference { + if image.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(image.Spec) return image.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/storage/image_types_gen.go b/v2/api/compute/v1api20220301/storage/image_types_gen.go index 56feed6486b..ec6c672ce1d 100644 --- a/v2/api/compute/v1api20220301/storage/image_types_gen.go +++ b/v2/api/compute/v1api20220301/storage/image_types_gen.go @@ -116,6 +116,10 @@ func (image *Image) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (image *Image) Owner() *genruntime.ResourceReference { + if image.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(image.Spec) return image.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/storage/virtual_machine_scale_set_types_gen.go b/v2/api/compute/v1api20220301/storage/virtual_machine_scale_set_types_gen.go index b8d0b86c343..5f90a70999d 100644 --- a/v2/api/compute/v1api20220301/storage/virtual_machine_scale_set_types_gen.go +++ b/v2/api/compute/v1api20220301/storage/virtual_machine_scale_set_types_gen.go @@ -116,6 +116,10 @@ func (scaleSet *VirtualMachineScaleSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (scaleSet *VirtualMachineScaleSet) Owner() *genruntime.ResourceReference { + if scaleSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(scaleSet.Spec) return scaleSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/storage/virtual_machine_scale_sets_extension_types_gen.go b/v2/api/compute/v1api20220301/storage/virtual_machine_scale_sets_extension_types_gen.go index e5e3f785527..434d4d4f556 100644 --- a/v2/api/compute/v1api20220301/storage/virtual_machine_scale_sets_extension_types_gen.go +++ b/v2/api/compute/v1api20220301/storage/virtual_machine_scale_sets_extension_types_gen.go @@ -116,6 +116,10 @@ func (extension *VirtualMachineScaleSetsExtension) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (extension *VirtualMachineScaleSetsExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/storage/virtual_machine_types_gen.go b/v2/api/compute/v1api20220301/storage/virtual_machine_types_gen.go index 365015009c7..d3aec3e78d5 100644 --- a/v2/api/compute/v1api20220301/storage/virtual_machine_types_gen.go +++ b/v2/api/compute/v1api20220301/storage/virtual_machine_types_gen.go @@ -117,6 +117,10 @@ func (machine *VirtualMachine) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (machine *VirtualMachine) Owner() *genruntime.ResourceReference { + if machine.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(machine.Spec) return machine.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/storage/virtual_machines_extension_types_gen.go b/v2/api/compute/v1api20220301/storage/virtual_machines_extension_types_gen.go index 795a8fb2672..15e8252111b 100644 --- a/v2/api/compute/v1api20220301/storage/virtual_machines_extension_types_gen.go +++ b/v2/api/compute/v1api20220301/storage/virtual_machines_extension_types_gen.go @@ -116,6 +116,10 @@ func (extension *VirtualMachinesExtension) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (extension *VirtualMachinesExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/virtual_machine_scale_set_types_gen.go b/v2/api/compute/v1api20220301/virtual_machine_scale_set_types_gen.go index 8a30e2f526e..d7a76d1f0e9 100644 --- a/v2/api/compute/v1api20220301/virtual_machine_scale_set_types_gen.go +++ b/v2/api/compute/v1api20220301/virtual_machine_scale_set_types_gen.go @@ -174,6 +174,10 @@ func (scaleSet *VirtualMachineScaleSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (scaleSet *VirtualMachineScaleSet) Owner() *genruntime.ResourceReference { + if scaleSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(scaleSet.Spec) return scaleSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/virtual_machine_scale_sets_extension_types_gen.go b/v2/api/compute/v1api20220301/virtual_machine_scale_sets_extension_types_gen.go index 8f48bb75ef5..bb2b2b15aa9 100644 --- a/v2/api/compute/v1api20220301/virtual_machine_scale_sets_extension_types_gen.go +++ b/v2/api/compute/v1api20220301/virtual_machine_scale_sets_extension_types_gen.go @@ -174,6 +174,10 @@ func (extension *VirtualMachineScaleSetsExtension) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (extension *VirtualMachineScaleSetsExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/virtual_machine_types_gen.go b/v2/api/compute/v1api20220301/virtual_machine_types_gen.go index 72931b8f042..be5d46308b6 100644 --- a/v2/api/compute/v1api20220301/virtual_machine_types_gen.go +++ b/v2/api/compute/v1api20220301/virtual_machine_types_gen.go @@ -174,6 +174,10 @@ func (machine *VirtualMachine) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (machine *VirtualMachine) Owner() *genruntime.ResourceReference { + if machine.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(machine.Spec) return machine.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220301/virtual_machines_extension_types_gen.go b/v2/api/compute/v1api20220301/virtual_machines_extension_types_gen.go index 18344bd8549..93ec4a0d162 100644 --- a/v2/api/compute/v1api20220301/virtual_machines_extension_types_gen.go +++ b/v2/api/compute/v1api20220301/virtual_machines_extension_types_gen.go @@ -174,6 +174,10 @@ func (extension *VirtualMachinesExtension) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (extension *VirtualMachinesExtension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(extension.Spec) return extension.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220702/disk_encryption_set_types_gen.go b/v2/api/compute/v1api20220702/disk_encryption_set_types_gen.go index 86c809389fb..ef61ece02e0 100644 --- a/v2/api/compute/v1api20220702/disk_encryption_set_types_gen.go +++ b/v2/api/compute/v1api20220702/disk_encryption_set_types_gen.go @@ -176,6 +176,10 @@ func (encryptionSet *DiskEncryptionSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (encryptionSet *DiskEncryptionSet) Owner() *genruntime.ResourceReference { + if encryptionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(encryptionSet.Spec) return encryptionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20220702/storage/disk_encryption_set_types_gen.go b/v2/api/compute/v1api20220702/storage/disk_encryption_set_types_gen.go index c29fb475771..77e13050e33 100644 --- a/v2/api/compute/v1api20220702/storage/disk_encryption_set_types_gen.go +++ b/v2/api/compute/v1api20220702/storage/disk_encryption_set_types_gen.go @@ -136,6 +136,10 @@ func (encryptionSet *DiskEncryptionSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (encryptionSet *DiskEncryptionSet) Owner() *genruntime.ResourceReference { + if encryptionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(encryptionSet.Spec) return encryptionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/disk_access_types_gen.go b/v2/api/compute/v1api20240302/disk_access_types_gen.go index ffd021c6ecc..9f4c9ddfbc9 100644 --- a/v2/api/compute/v1api20240302/disk_access_types_gen.go +++ b/v2/api/compute/v1api20240302/disk_access_types_gen.go @@ -173,6 +173,10 @@ func (access *DiskAccess) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (access *DiskAccess) Owner() *genruntime.ResourceReference { + if access.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(access.Spec) return access.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/disk_encryption_set_types_gen.go b/v2/api/compute/v1api20240302/disk_encryption_set_types_gen.go index 8f4a71a3f8f..411ec05c5d1 100644 --- a/v2/api/compute/v1api20240302/disk_encryption_set_types_gen.go +++ b/v2/api/compute/v1api20240302/disk_encryption_set_types_gen.go @@ -173,6 +173,10 @@ func (encryptionSet *DiskEncryptionSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (encryptionSet *DiskEncryptionSet) Owner() *genruntime.ResourceReference { + if encryptionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(encryptionSet.Spec) return encryptionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/disk_types_gen.go b/v2/api/compute/v1api20240302/disk_types_gen.go index 21148def15a..09d6f0c5768 100644 --- a/v2/api/compute/v1api20240302/disk_types_gen.go +++ b/v2/api/compute/v1api20240302/disk_types_gen.go @@ -173,6 +173,10 @@ func (disk *Disk) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (disk *Disk) Owner() *genruntime.ResourceReference { + if disk.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(disk.Spec) return disk.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/snapshot_types_gen.go b/v2/api/compute/v1api20240302/snapshot_types_gen.go index 80540e2b7e7..49ddf849139 100644 --- a/v2/api/compute/v1api20240302/snapshot_types_gen.go +++ b/v2/api/compute/v1api20240302/snapshot_types_gen.go @@ -173,6 +173,10 @@ func (snapshot *Snapshot) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (snapshot *Snapshot) Owner() *genruntime.ResourceReference { + if snapshot.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(snapshot.Spec) return snapshot.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/storage/disk_access_types_gen.go b/v2/api/compute/v1api20240302/storage/disk_access_types_gen.go index e3b24410716..7178855ed88 100644 --- a/v2/api/compute/v1api20240302/storage/disk_access_types_gen.go +++ b/v2/api/compute/v1api20240302/storage/disk_access_types_gen.go @@ -115,6 +115,10 @@ func (access *DiskAccess) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (access *DiskAccess) Owner() *genruntime.ResourceReference { + if access.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(access.Spec) return access.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/storage/disk_encryption_set_types_gen.go b/v2/api/compute/v1api20240302/storage/disk_encryption_set_types_gen.go index dd7ba986f34..5cea3a6ecc7 100644 --- a/v2/api/compute/v1api20240302/storage/disk_encryption_set_types_gen.go +++ b/v2/api/compute/v1api20240302/storage/disk_encryption_set_types_gen.go @@ -115,6 +115,10 @@ func (encryptionSet *DiskEncryptionSet) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (encryptionSet *DiskEncryptionSet) Owner() *genruntime.ResourceReference { + if encryptionSet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(encryptionSet.Spec) return encryptionSet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/storage/disk_types_gen.go b/v2/api/compute/v1api20240302/storage/disk_types_gen.go index 50d8a81bc33..da4ec00ac2d 100644 --- a/v2/api/compute/v1api20240302/storage/disk_types_gen.go +++ b/v2/api/compute/v1api20240302/storage/disk_types_gen.go @@ -115,6 +115,10 @@ func (disk *Disk) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (disk *Disk) Owner() *genruntime.ResourceReference { + if disk.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(disk.Spec) return disk.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/compute/v1api20240302/storage/snapshot_types_gen.go b/v2/api/compute/v1api20240302/storage/snapshot_types_gen.go index 571fabbbc44..ffc58e01248 100644 --- a/v2/api/compute/v1api20240302/storage/snapshot_types_gen.go +++ b/v2/api/compute/v1api20240302/storage/snapshot_types_gen.go @@ -115,6 +115,10 @@ func (snapshot *Snapshot) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (snapshot *Snapshot) Owner() *genruntime.ResourceReference { + if snapshot.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(snapshot.Spec) return snapshot.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerinstance/v1api20211001/container_group_types_gen.go b/v2/api/containerinstance/v1api20211001/container_group_types_gen.go index 2cef0c77866..6cdf865f37e 100644 --- a/v2/api/containerinstance/v1api20211001/container_group_types_gen.go +++ b/v2/api/containerinstance/v1api20211001/container_group_types_gen.go @@ -174,6 +174,10 @@ func (group *ContainerGroup) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (group *ContainerGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/containerinstance/v1api20211001/storage/container_group_types_gen.go b/v2/api/containerinstance/v1api20211001/storage/container_group_types_gen.go index c581821cfa3..696cf0a8590 100644 --- a/v2/api/containerinstance/v1api20211001/storage/container_group_types_gen.go +++ b/v2/api/containerinstance/v1api20211001/storage/container_group_types_gen.go @@ -116,6 +116,10 @@ func (group *ContainerGroup) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (group *ContainerGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/containerregistry/v1api20210901/registry_types_gen.go b/v2/api/containerregistry/v1api20210901/registry_types_gen.go index b57b4395600..0ad99f49e28 100644 --- a/v2/api/containerregistry/v1api20210901/registry_types_gen.go +++ b/v2/api/containerregistry/v1api20210901/registry_types_gen.go @@ -173,6 +173,10 @@ func (registry *Registry) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (registry *Registry) Owner() *genruntime.ResourceReference { + if registry.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(registry.Spec) return registry.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerregistry/v1api20210901/storage/registry_types_gen.go b/v2/api/containerregistry/v1api20210901/storage/registry_types_gen.go index d7f1fc5e716..9c0714a6ebe 100644 --- a/v2/api/containerregistry/v1api20210901/storage/registry_types_gen.go +++ b/v2/api/containerregistry/v1api20210901/storage/registry_types_gen.go @@ -115,6 +115,10 @@ func (registry *Registry) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (registry *Registry) Owner() *genruntime.ResourceReference { + if registry.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(registry.Spec) return registry.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go index f444a5ae3e5..92c483a92a3 100644 --- a/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go @@ -173,6 +173,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20210501/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20210501/managed_clusters_agent_pool_types_gen.go index c9b8333369f..d49d16ea840 100644 --- a/v2/api/containerservice/v1api20210501/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20210501/managed_clusters_agent_pool_types_gen.go @@ -176,6 +176,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go index 98c399fe6c6..027ef7c5621 100644 --- a/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go @@ -146,6 +146,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20210501/storage/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20210501/storage/managed_clusters_agent_pool_types_gen.go index 7626043246a..fda9aa018e4 100644 --- a/v2/api/containerservice/v1api20210501/storage/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20210501/storage/managed_clusters_agent_pool_types_gen.go @@ -149,6 +149,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go index ca869c22d31..9e91195ec17 100644 --- a/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go @@ -203,6 +203,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230201/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20230201/managed_clusters_agent_pool_types_gen.go index 90096648bd9..f3616c47822 100644 --- a/v2/api/containerservice/v1api20230201/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20230201/managed_clusters_agent_pool_types_gen.go @@ -176,6 +176,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go index 127f1784b5b..5eeee6eb33c 100644 --- a/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go @@ -176,6 +176,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230201/storage/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20230201/storage/managed_clusters_agent_pool_types_gen.go index fd5d622137d..f5f0aba12ae 100644 --- a/v2/api/containerservice/v1api20230201/storage/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20230201/storage/managed_clusters_agent_pool_types_gen.go @@ -149,6 +149,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230315preview/fleet_types_gen.go b/v2/api/containerservice/v1api20230315preview/fleet_types_gen.go index 3324c88b1fe..a43b2dd25d4 100644 --- a/v2/api/containerservice/v1api20230315preview/fleet_types_gen.go +++ b/v2/api/containerservice/v1api20230315preview/fleet_types_gen.go @@ -173,6 +173,10 @@ func (fleet *Fleet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (fleet *Fleet) Owner() *genruntime.ResourceReference { + if fleet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(fleet.Spec) return fleet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230315preview/fleets_member_types_gen.go b/v2/api/containerservice/v1api20230315preview/fleets_member_types_gen.go index 72673f85427..a4cd2b54ed1 100644 --- a/v2/api/containerservice/v1api20230315preview/fleets_member_types_gen.go +++ b/v2/api/containerservice/v1api20230315preview/fleets_member_types_gen.go @@ -173,6 +173,10 @@ func (member *FleetsMember) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (member *FleetsMember) Owner() *genruntime.ResourceReference { + if member.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(member.Spec) return member.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230315preview/fleets_update_run_types_gen.go b/v2/api/containerservice/v1api20230315preview/fleets_update_run_types_gen.go index 8dd365c7608..d9abc1d763b 100644 --- a/v2/api/containerservice/v1api20230315preview/fleets_update_run_types_gen.go +++ b/v2/api/containerservice/v1api20230315preview/fleets_update_run_types_gen.go @@ -174,6 +174,10 @@ func (updateRun *FleetsUpdateRun) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (updateRun *FleetsUpdateRun) Owner() *genruntime.ResourceReference { + if updateRun.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(updateRun.Spec) return updateRun.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230315preview/storage/fleet_types_gen.go b/v2/api/containerservice/v1api20230315preview/storage/fleet_types_gen.go index 4314b332604..60701538e63 100644 --- a/v2/api/containerservice/v1api20230315preview/storage/fleet_types_gen.go +++ b/v2/api/containerservice/v1api20230315preview/storage/fleet_types_gen.go @@ -116,6 +116,10 @@ func (fleet *Fleet) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (fleet *Fleet) Owner() *genruntime.ResourceReference { + if fleet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(fleet.Spec) return fleet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230315preview/storage/fleets_member_types_gen.go b/v2/api/containerservice/v1api20230315preview/storage/fleets_member_types_gen.go index bba6250173d..d97d0070e3e 100644 --- a/v2/api/containerservice/v1api20230315preview/storage/fleets_member_types_gen.go +++ b/v2/api/containerservice/v1api20230315preview/storage/fleets_member_types_gen.go @@ -115,6 +115,10 @@ func (member *FleetsMember) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (member *FleetsMember) Owner() *genruntime.ResourceReference { + if member.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(member.Spec) return member.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20230315preview/storage/fleets_update_run_types_gen.go b/v2/api/containerservice/v1api20230315preview/storage/fleets_update_run_types_gen.go index 661cb3bbfbf..361c506a140 100644 --- a/v2/api/containerservice/v1api20230315preview/storage/fleets_update_run_types_gen.go +++ b/v2/api/containerservice/v1api20230315preview/storage/fleets_update_run_types_gen.go @@ -116,6 +116,10 @@ func (updateRun *FleetsUpdateRun) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (updateRun *FleetsUpdateRun) Owner() *genruntime.ResourceReference { + if updateRun.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(updateRun.Spec) return updateRun.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go index abc48a1e8a7..44f19d06fb7 100644 --- a/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go @@ -206,6 +206,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231001/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20231001/managed_clusters_agent_pool_types_gen.go index 9ae8ad94d87..5d82b6ba299 100644 --- a/v2/api/containerservice/v1api20231001/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20231001/managed_clusters_agent_pool_types_gen.go @@ -176,6 +176,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go index 7f209947ab5..3f8f9befbd0 100644 --- a/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go @@ -167,6 +167,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231001/storage/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20231001/storage/managed_clusters_agent_pool_types_gen.go index 56296d99054..762236214a7 100644 --- a/v2/api/containerservice/v1api20231001/storage/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20231001/storage/managed_clusters_agent_pool_types_gen.go @@ -137,6 +137,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231001/storage/trusted_access_role_binding_types_gen.go b/v2/api/containerservice/v1api20231001/storage/trusted_access_role_binding_types_gen.go index 7857d06bc83..a2233e9060a 100644 --- a/v2/api/containerservice/v1api20231001/storage/trusted_access_role_binding_types_gen.go +++ b/v2/api/containerservice/v1api20231001/storage/trusted_access_role_binding_types_gen.go @@ -136,6 +136,10 @@ func (binding *TrustedAccessRoleBinding) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (binding *TrustedAccessRoleBinding) Owner() *genruntime.ResourceReference { + if binding.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(binding.Spec) return binding.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231001/trusted_access_role_binding_types_gen.go b/v2/api/containerservice/v1api20231001/trusted_access_role_binding_types_gen.go index 068e78bf177..c21aaa6d4dc 100644 --- a/v2/api/containerservice/v1api20231001/trusted_access_role_binding_types_gen.go +++ b/v2/api/containerservice/v1api20231001/trusted_access_role_binding_types_gen.go @@ -176,6 +176,10 @@ func (binding *TrustedAccessRoleBinding) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (binding *TrustedAccessRoleBinding) Owner() *genruntime.ResourceReference { + if binding.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(binding.Spec) return binding.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go index 9a0c29618cd..9febee87f30 100644 --- a/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go @@ -196,6 +196,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231102preview/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20231102preview/managed_clusters_agent_pool_types_gen.go index 1debb2992a6..3bd0545579a 100644 --- a/v2/api/containerservice/v1api20231102preview/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20231102preview/managed_clusters_agent_pool_types_gen.go @@ -176,6 +176,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go index b1e28e2e634..60ee139bb80 100644 --- a/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go @@ -170,6 +170,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20231102preview/storage/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20231102preview/storage/managed_clusters_agent_pool_types_gen.go index f79b2e98aee..711caf48b41 100644 --- a/v2/api/containerservice/v1api20231102preview/storage/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20231102preview/storage/managed_clusters_agent_pool_types_gen.go @@ -151,6 +151,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go index c1fc4e42ebf..7efb65a3083 100644 --- a/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go @@ -199,6 +199,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240402preview/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20240402preview/managed_clusters_agent_pool_types_gen.go index 175cdacd166..645f6030d92 100644 --- a/v2/api/containerservice/v1api20240402preview/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/managed_clusters_agent_pool_types_gen.go @@ -176,6 +176,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go index a56c3269846..710bece6d95 100644 --- a/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go @@ -173,6 +173,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240402preview/storage/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20240402preview/storage/managed_clusters_agent_pool_types_gen.go index 7be1a6c3505..0d5c2999cd4 100644 --- a/v2/api/containerservice/v1api20240402preview/storage/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/storage/managed_clusters_agent_pool_types_gen.go @@ -149,6 +149,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240402preview/storage/trusted_access_role_binding_types_gen.go b/v2/api/containerservice/v1api20240402preview/storage/trusted_access_role_binding_types_gen.go index 51d0633166f..175806da65f 100644 --- a/v2/api/containerservice/v1api20240402preview/storage/trusted_access_role_binding_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/storage/trusted_access_role_binding_types_gen.go @@ -150,6 +150,10 @@ func (binding *TrustedAccessRoleBinding) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (binding *TrustedAccessRoleBinding) Owner() *genruntime.ResourceReference { + if binding.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(binding.Spec) return binding.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240402preview/trusted_access_role_binding_types_gen.go b/v2/api/containerservice/v1api20240402preview/trusted_access_role_binding_types_gen.go index 1fdce5966b1..1b6af2cb424 100644 --- a/v2/api/containerservice/v1api20240402preview/trusted_access_role_binding_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/trusted_access_role_binding_types_gen.go @@ -176,6 +176,10 @@ func (binding *TrustedAccessRoleBinding) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (binding *TrustedAccessRoleBinding) Owner() *genruntime.ResourceReference { + if binding.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(binding.Spec) return binding.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/maintenance_configuration_types_gen.go b/v2/api/containerservice/v1api20240901/maintenance_configuration_types_gen.go index 7a28633b7e3..f210f386f46 100644 --- a/v2/api/containerservice/v1api20240901/maintenance_configuration_types_gen.go +++ b/v2/api/containerservice/v1api20240901/maintenance_configuration_types_gen.go @@ -173,6 +173,10 @@ func (configuration *MaintenanceConfiguration) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (configuration *MaintenanceConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20240901/managed_cluster_types_gen.go index 570c6979815..7632e6a14a4 100644 --- a/v2/api/containerservice/v1api20240901/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20240901/managed_cluster_types_gen.go @@ -196,6 +196,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20240901/managed_clusters_agent_pool_types_gen.go index 6ec3feb6e3d..9121546a8e4 100644 --- a/v2/api/containerservice/v1api20240901/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20240901/managed_clusters_agent_pool_types_gen.go @@ -173,6 +173,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/storage/maintenance_configuration_types_gen.go b/v2/api/containerservice/v1api20240901/storage/maintenance_configuration_types_gen.go index 52d6ad1cbd6..1d79f71fcb0 100644 --- a/v2/api/containerservice/v1api20240901/storage/maintenance_configuration_types_gen.go +++ b/v2/api/containerservice/v1api20240901/storage/maintenance_configuration_types_gen.go @@ -115,6 +115,10 @@ func (configuration *MaintenanceConfiguration) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (configuration *MaintenanceConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20240901/storage/managed_cluster_types_gen.go index bd3dab69160..8f6e50fdbf6 100644 --- a/v2/api/containerservice/v1api20240901/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20240901/storage/managed_cluster_types_gen.go @@ -138,6 +138,10 @@ func (cluster *ManagedCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *ManagedCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/storage/managed_clusters_agent_pool_types_gen.go b/v2/api/containerservice/v1api20240901/storage/managed_clusters_agent_pool_types_gen.go index 704bea0daf5..f37abf127fd 100644 --- a/v2/api/containerservice/v1api20240901/storage/managed_clusters_agent_pool_types_gen.go +++ b/v2/api/containerservice/v1api20240901/storage/managed_clusters_agent_pool_types_gen.go @@ -115,6 +115,10 @@ func (pool *ManagedClustersAgentPool) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (pool *ManagedClustersAgentPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/storage/trusted_access_role_binding_types_gen.go b/v2/api/containerservice/v1api20240901/storage/trusted_access_role_binding_types_gen.go index 10cf09945bb..48485956287 100644 --- a/v2/api/containerservice/v1api20240901/storage/trusted_access_role_binding_types_gen.go +++ b/v2/api/containerservice/v1api20240901/storage/trusted_access_role_binding_types_gen.go @@ -115,6 +115,10 @@ func (binding *TrustedAccessRoleBinding) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (binding *TrustedAccessRoleBinding) Owner() *genruntime.ResourceReference { + if binding.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(binding.Spec) return binding.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/containerservice/v1api20240901/trusted_access_role_binding_types_gen.go b/v2/api/containerservice/v1api20240901/trusted_access_role_binding_types_gen.go index 1bbe1b623fb..3d13c016dd8 100644 --- a/v2/api/containerservice/v1api20240901/trusted_access_role_binding_types_gen.go +++ b/v2/api/containerservice/v1api20240901/trusted_access_role_binding_types_gen.go @@ -173,6 +173,10 @@ func (binding *TrustedAccessRoleBinding) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (binding *TrustedAccessRoleBinding) Owner() *genruntime.ResourceReference { + if binding.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(binding.Spec) return binding.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/datafactory/v1api20180601/factory_types_gen.go b/v2/api/datafactory/v1api20180601/factory_types_gen.go index 0aafcc4a629..144f7d59e63 100644 --- a/v2/api/datafactory/v1api20180601/factory_types_gen.go +++ b/v2/api/datafactory/v1api20180601/factory_types_gen.go @@ -174,6 +174,10 @@ func (factory *Factory) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (factory *Factory) Owner() *genruntime.ResourceReference { + if factory.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(factory.Spec) return factory.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/datafactory/v1api20180601/storage/factory_types_gen.go b/v2/api/datafactory/v1api20180601/storage/factory_types_gen.go index 3a1a8ca6158..bbf7062276a 100644 --- a/v2/api/datafactory/v1api20180601/storage/factory_types_gen.go +++ b/v2/api/datafactory/v1api20180601/storage/factory_types_gen.go @@ -116,6 +116,10 @@ func (factory *Factory) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (factory *Factory) Owner() *genruntime.ResourceReference { + if factory.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(factory.Spec) return factory.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20230101/backup_vault_types_gen.go b/v2/api/dataprotection/v1api20230101/backup_vault_types_gen.go index 6e788d9fcdf..952ddef9d81 100644 --- a/v2/api/dataprotection/v1api20230101/backup_vault_types_gen.go +++ b/v2/api/dataprotection/v1api20230101/backup_vault_types_gen.go @@ -199,6 +199,10 @@ func (vault *BackupVault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *BackupVault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20230101/backup_vaults_backup_policy_types_gen.go b/v2/api/dataprotection/v1api20230101/backup_vaults_backup_policy_types_gen.go index 6ec2208b4a3..530ae85b4ed 100644 --- a/v2/api/dataprotection/v1api20230101/backup_vaults_backup_policy_types_gen.go +++ b/v2/api/dataprotection/v1api20230101/backup_vaults_backup_policy_types_gen.go @@ -176,6 +176,10 @@ func (policy *BackupVaultsBackupPolicy) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (policy *BackupVaultsBackupPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20230101/storage/backup_vault_types_gen.go b/v2/api/dataprotection/v1api20230101/storage/backup_vault_types_gen.go index 72245f054d5..02f929eec31 100644 --- a/v2/api/dataprotection/v1api20230101/storage/backup_vault_types_gen.go +++ b/v2/api/dataprotection/v1api20230101/storage/backup_vault_types_gen.go @@ -159,6 +159,10 @@ func (vault *BackupVault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *BackupVault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20230101/storage/backup_vaults_backup_policy_types_gen.go b/v2/api/dataprotection/v1api20230101/storage/backup_vaults_backup_policy_types_gen.go index ab5039287fe..7e811fe770e 100644 --- a/v2/api/dataprotection/v1api20230101/storage/backup_vaults_backup_policy_types_gen.go +++ b/v2/api/dataprotection/v1api20230101/storage/backup_vaults_backup_policy_types_gen.go @@ -136,6 +136,10 @@ func (policy *BackupVaultsBackupPolicy) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (policy *BackupVaultsBackupPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20231101/backup_vault_types_gen.go b/v2/api/dataprotection/v1api20231101/backup_vault_types_gen.go index f0530d366a6..f88c2925279 100644 --- a/v2/api/dataprotection/v1api20231101/backup_vault_types_gen.go +++ b/v2/api/dataprotection/v1api20231101/backup_vault_types_gen.go @@ -196,6 +196,10 @@ func (vault *BackupVault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *BackupVault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20231101/backup_vaults_backup_instance_types_gen.go b/v2/api/dataprotection/v1api20231101/backup_vaults_backup_instance_types_gen.go index 2d134bb356f..000eeaf115b 100644 --- a/v2/api/dataprotection/v1api20231101/backup_vaults_backup_instance_types_gen.go +++ b/v2/api/dataprotection/v1api20231101/backup_vaults_backup_instance_types_gen.go @@ -173,6 +173,10 @@ func (instance *BackupVaultsBackupInstance) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (instance *BackupVaultsBackupInstance) Owner() *genruntime.ResourceReference { + if instance.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(instance.Spec) return instance.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20231101/backup_vaults_backup_policy_types_gen.go b/v2/api/dataprotection/v1api20231101/backup_vaults_backup_policy_types_gen.go index e17b4073e5c..55bbc608c6f 100644 --- a/v2/api/dataprotection/v1api20231101/backup_vaults_backup_policy_types_gen.go +++ b/v2/api/dataprotection/v1api20231101/backup_vaults_backup_policy_types_gen.go @@ -173,6 +173,10 @@ func (policy *BackupVaultsBackupPolicy) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (policy *BackupVaultsBackupPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20231101/storage/backup_vault_types_gen.go b/v2/api/dataprotection/v1api20231101/storage/backup_vault_types_gen.go index 2594b3c0942..46e0c18f4ff 100644 --- a/v2/api/dataprotection/v1api20231101/storage/backup_vault_types_gen.go +++ b/v2/api/dataprotection/v1api20231101/storage/backup_vault_types_gen.go @@ -138,6 +138,10 @@ func (vault *BackupVault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *BackupVault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_instance_types_gen.go b/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_instance_types_gen.go index f3651214a94..85515ff63a3 100644 --- a/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_instance_types_gen.go +++ b/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_instance_types_gen.go @@ -115,6 +115,10 @@ func (instance *BackupVaultsBackupInstance) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (instance *BackupVaultsBackupInstance) Owner() *genruntime.ResourceReference { + if instance.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(instance.Spec) return instance.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_policy_types_gen.go b/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_policy_types_gen.go index 8ead8347edc..151e373aa81 100644 --- a/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_policy_types_gen.go +++ b/v2/api/dataprotection/v1api20231101/storage/backup_vaults_backup_policy_types_gen.go @@ -115,6 +115,10 @@ func (policy *BackupVaultsBackupPolicy) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (policy *BackupVaultsBackupPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformariadb/v1api20180601/configuration_types_gen.go b/v2/api/dbformariadb/v1api20180601/configuration_types_gen.go index feb2eff0a10..9c614f0a35b 100644 --- a/v2/api/dbformariadb/v1api20180601/configuration_types_gen.go +++ b/v2/api/dbformariadb/v1api20180601/configuration_types_gen.go @@ -172,6 +172,10 @@ func (configuration *Configuration) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (configuration *Configuration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformariadb/v1api20180601/database_types_gen.go b/v2/api/dbformariadb/v1api20180601/database_types_gen.go index 838ce39cf67..bbd997ac293 100644 --- a/v2/api/dbformariadb/v1api20180601/database_types_gen.go +++ b/v2/api/dbformariadb/v1api20180601/database_types_gen.go @@ -173,6 +173,10 @@ func (database *Database) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *Database) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformariadb/v1api20180601/server_types_gen.go b/v2/api/dbformariadb/v1api20180601/server_types_gen.go index fd689ef78b3..d61ac2b0b0a 100644 --- a/v2/api/dbformariadb/v1api20180601/server_types_gen.go +++ b/v2/api/dbformariadb/v1api20180601/server_types_gen.go @@ -173,6 +173,10 @@ func (server *Server) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *Server) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformariadb/v1api20180601/storage/configuration_types_gen.go b/v2/api/dbformariadb/v1api20180601/storage/configuration_types_gen.go index 37e15d44ffb..dc5f25e9ed2 100644 --- a/v2/api/dbformariadb/v1api20180601/storage/configuration_types_gen.go +++ b/v2/api/dbformariadb/v1api20180601/storage/configuration_types_gen.go @@ -114,6 +114,10 @@ func (configuration *Configuration) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (configuration *Configuration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformariadb/v1api20180601/storage/database_types_gen.go b/v2/api/dbformariadb/v1api20180601/storage/database_types_gen.go index ee3bf79a771..db4bba2fdc8 100644 --- a/v2/api/dbformariadb/v1api20180601/storage/database_types_gen.go +++ b/v2/api/dbformariadb/v1api20180601/storage/database_types_gen.go @@ -115,6 +115,10 @@ func (database *Database) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *Database) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformariadb/v1api20180601/storage/server_types_gen.go b/v2/api/dbformariadb/v1api20180601/storage/server_types_gen.go index be9acda3167..3970d9541c7 100644 --- a/v2/api/dbformariadb/v1api20180601/storage/server_types_gen.go +++ b/v2/api/dbformariadb/v1api20180601/storage/server_types_gen.go @@ -115,6 +115,10 @@ func (server *Server) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *Server) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20210501/flexible_server_types_gen.go b/v2/api/dbformysql/v1api20210501/flexible_server_types_gen.go index c3810b920e6..08ceb905b1c 100644 --- a/v2/api/dbformysql/v1api20210501/flexible_server_types_gen.go +++ b/v2/api/dbformysql/v1api20210501/flexible_server_types_gen.go @@ -203,6 +203,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20210501/flexible_servers_database_types_gen.go b/v2/api/dbformysql/v1api20210501/flexible_servers_database_types_gen.go index f84cef6a0a3..cbf8ec83c69 100644 --- a/v2/api/dbformysql/v1api20210501/flexible_servers_database_types_gen.go +++ b/v2/api/dbformysql/v1api20210501/flexible_servers_database_types_gen.go @@ -176,6 +176,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20210501/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbformysql/v1api20210501/flexible_servers_firewall_rule_types_gen.go index 204a508e45b..5826fcdb833 100644 --- a/v2/api/dbformysql/v1api20210501/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbformysql/v1api20210501/flexible_servers_firewall_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20210501/storage/flexible_server_types_gen.go b/v2/api/dbformysql/v1api20210501/storage/flexible_server_types_gen.go index 4b05489262d..6e5097f3867 100644 --- a/v2/api/dbformysql/v1api20210501/storage/flexible_server_types_gen.go +++ b/v2/api/dbformysql/v1api20210501/storage/flexible_server_types_gen.go @@ -164,6 +164,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20210501/storage/flexible_servers_database_types_gen.go b/v2/api/dbformysql/v1api20210501/storage/flexible_servers_database_types_gen.go index 826dbbb085f..4e3b6c3430a 100644 --- a/v2/api/dbformysql/v1api20210501/storage/flexible_servers_database_types_gen.go +++ b/v2/api/dbformysql/v1api20210501/storage/flexible_servers_database_types_gen.go @@ -137,6 +137,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20210501/storage/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbformysql/v1api20210501/storage/flexible_servers_firewall_rule_types_gen.go index b9be421d9a7..f1ae3b8f1f5 100644 --- a/v2/api/dbformysql/v1api20210501/storage/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbformysql/v1api20210501/storage/flexible_servers_firewall_rule_types_gen.go @@ -137,6 +137,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20220101/flexible_servers_administrator_types_gen.go b/v2/api/dbformysql/v1api20220101/flexible_servers_administrator_types_gen.go index 5b9499e5d46..c7aa5512e5d 100644 --- a/v2/api/dbformysql/v1api20220101/flexible_servers_administrator_types_gen.go +++ b/v2/api/dbformysql/v1api20220101/flexible_servers_administrator_types_gen.go @@ -169,6 +169,10 @@ func (administrator *FlexibleServersAdministrator) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (administrator *FlexibleServersAdministrator) Owner() *genruntime.ResourceReference { + if administrator.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(administrator.Spec) return administrator.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20220101/flexible_servers_configuration_types_gen.go b/v2/api/dbformysql/v1api20220101/flexible_servers_configuration_types_gen.go index 84de080eabd..3db51c3e938 100644 --- a/v2/api/dbformysql/v1api20220101/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbformysql/v1api20220101/flexible_servers_configuration_types_gen.go @@ -175,6 +175,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20220101/storage/flexible_servers_administrator_types_gen.go b/v2/api/dbformysql/v1api20220101/storage/flexible_servers_administrator_types_gen.go index 7bdc2bf6928..b25bf8427ff 100644 --- a/v2/api/dbformysql/v1api20220101/storage/flexible_servers_administrator_types_gen.go +++ b/v2/api/dbformysql/v1api20220101/storage/flexible_servers_administrator_types_gen.go @@ -136,6 +136,10 @@ func (administrator *FlexibleServersAdministrator) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (administrator *FlexibleServersAdministrator) Owner() *genruntime.ResourceReference { + if administrator.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(administrator.Spec) return administrator.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20220101/storage/flexible_servers_configuration_types_gen.go b/v2/api/dbformysql/v1api20220101/storage/flexible_servers_configuration_types_gen.go index 89204bb1a65..f214c62b722 100644 --- a/v2/api/dbformysql/v1api20220101/storage/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbformysql/v1api20220101/storage/flexible_servers_configuration_types_gen.go @@ -135,6 +135,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/flexible_server_types_gen.go b/v2/api/dbformysql/v1api20230630/flexible_server_types_gen.go index f1f449f4eb5..7267ea0b32d 100644 --- a/v2/api/dbformysql/v1api20230630/flexible_server_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/flexible_server_types_gen.go @@ -200,6 +200,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/flexible_servers_administrator_types_gen.go b/v2/api/dbformysql/v1api20230630/flexible_servers_administrator_types_gen.go index c6769771c23..f5ecd7f871c 100644 --- a/v2/api/dbformysql/v1api20230630/flexible_servers_administrator_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/flexible_servers_administrator_types_gen.go @@ -166,6 +166,10 @@ func (administrator *FlexibleServersAdministrator) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (administrator *FlexibleServersAdministrator) Owner() *genruntime.ResourceReference { + if administrator.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(administrator.Spec) return administrator.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/flexible_servers_configuration_types_gen.go b/v2/api/dbformysql/v1api20230630/flexible_servers_configuration_types_gen.go index 8793fda0f99..61674604458 100644 --- a/v2/api/dbformysql/v1api20230630/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/flexible_servers_configuration_types_gen.go @@ -172,6 +172,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/flexible_servers_database_types_gen.go b/v2/api/dbformysql/v1api20230630/flexible_servers_database_types_gen.go index 5b45a1bc3bb..d92af173d58 100644 --- a/v2/api/dbformysql/v1api20230630/flexible_servers_database_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/flexible_servers_database_types_gen.go @@ -173,6 +173,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbformysql/v1api20230630/flexible_servers_firewall_rule_types_gen.go index d4a2fcaa106..008c74a07ce 100644 --- a/v2/api/dbformysql/v1api20230630/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/flexible_servers_firewall_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/storage/flexible_server_types_gen.go b/v2/api/dbformysql/v1api20230630/storage/flexible_server_types_gen.go index d9e5c4c19c4..af1452a972c 100644 --- a/v2/api/dbformysql/v1api20230630/storage/flexible_server_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/storage/flexible_server_types_gen.go @@ -142,6 +142,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_administrator_types_gen.go b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_administrator_types_gen.go index b4c93c07ccb..f5b754b7263 100644 --- a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_administrator_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_administrator_types_gen.go @@ -115,6 +115,10 @@ func (administrator *FlexibleServersAdministrator) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (administrator *FlexibleServersAdministrator) Owner() *genruntime.ResourceReference { + if administrator.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(administrator.Spec) return administrator.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_configuration_types_gen.go b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_configuration_types_gen.go index fb3b4ee1a4b..1e11d8ed2df 100644 --- a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_configuration_types_gen.go @@ -114,6 +114,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_database_types_gen.go b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_database_types_gen.go index 1d27c47e356..d8c093f809d 100644 --- a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_database_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_database_types_gen.go @@ -115,6 +115,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_firewall_rule_types_gen.go index f16e4980b61..0171d6650e2 100644 --- a/v2/api/dbformysql/v1api20230630/storage/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbformysql/v1api20230630/storage/flexible_servers_firewall_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/flexible_server_types_gen.go index 5d4427710f5..b4718922d30 100644 --- a/v2/api/dbforpostgresql/v1api20210601/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/flexible_server_types_gen.go @@ -176,6 +176,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/flexible_servers_configuration_types_gen.go index 4f2dc404586..b2f095f1dc5 100644 --- a/v2/api/dbforpostgresql/v1api20210601/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/flexible_servers_configuration_types_gen.go @@ -175,6 +175,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/flexible_servers_database_types_gen.go index f4099d01471..5f80060061d 100644 --- a/v2/api/dbforpostgresql/v1api20210601/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/flexible_servers_database_types_gen.go @@ -176,6 +176,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/flexible_servers_firewall_rule_types_gen.go index a9ea02939d5..46e7baa56cb 100644 --- a/v2/api/dbforpostgresql/v1api20210601/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/flexible_servers_firewall_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_server_types_gen.go index 3b273aace3e..e556c2c666d 100644 --- a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_server_types_gen.go @@ -136,6 +136,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_configuration_types_gen.go index 4d68c6a8ead..f5bea4a3a44 100644 --- a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_configuration_types_gen.go @@ -135,6 +135,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_database_types_gen.go index 459d2250b34..109b3d02bf5 100644 --- a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_database_types_gen.go @@ -136,6 +136,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_firewall_rule_types_gen.go index 757dbfe629f..e54eab41451 100644 --- a/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20210601/storage/flexible_servers_firewall_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/flexible_server_types_gen.go index 9bbfd09c864..30f5632df39 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/flexible_server_types_gen.go @@ -197,6 +197,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_configuration_types_gen.go index 932586585d0..ba102da39d5 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_configuration_types_gen.go @@ -175,6 +175,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_database_types_gen.go index 21e451d4945..fa3198ee5db 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_database_types_gen.go @@ -176,6 +176,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_firewall_rule_types_gen.go index 266cfaa9ce3..f035bd528bf 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/flexible_servers_firewall_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_server_types_gen.go index 097913115ef..2853ffbd2d1 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_server_types_gen.go @@ -171,6 +171,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_configuration_types_gen.go index 71c956288ab..7fd96bf3453 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_configuration_types_gen.go @@ -148,6 +148,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_database_types_gen.go index a8557f22858..57024ea8fa4 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_database_types_gen.go @@ -149,6 +149,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_firewall_rule_types_gen.go index 19c7b8a05e4..372620add81 100644 --- a/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20220120preview/storage/flexible_servers_firewall_rule_types_gen.go @@ -149,6 +149,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/flexible_server_types_gen.go index fcde91a7a77..5ff41f33dda 100644 --- a/v2/api/dbforpostgresql/v1api20221201/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/flexible_server_types_gen.go @@ -194,6 +194,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/flexible_servers_configuration_types_gen.go index 65cabdb886d..f90d23261d7 100644 --- a/v2/api/dbforpostgresql/v1api20221201/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/flexible_servers_configuration_types_gen.go @@ -172,6 +172,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/flexible_servers_database_types_gen.go index 164039cdefb..2071ff9da80 100644 --- a/v2/api/dbforpostgresql/v1api20221201/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/flexible_servers_database_types_gen.go @@ -173,6 +173,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/flexible_servers_firewall_rule_types_gen.go index 65503d784b0..a31fa2df5d1 100644 --- a/v2/api/dbforpostgresql/v1api20221201/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/flexible_servers_firewall_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_server_types_gen.go index a8803c2b380..86f1e8deae6 100644 --- a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_server_types_gen.go @@ -136,6 +136,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_configuration_types_gen.go index f17cd9d8f54..9c323d477e9 100644 --- a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_configuration_types_gen.go @@ -114,6 +114,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_database_types_gen.go index 804ad3f6bf5..712e62cc3cd 100644 --- a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_database_types_gen.go @@ -115,6 +115,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_firewall_rule_types_gen.go index 5fb2bc0c4fa..9392593ce47 100644 --- a/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20221201/storage/flexible_servers_firewall_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/flexible_server_types_gen.go index 67e0475d162..99235e5b894 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/flexible_server_types_gen.go @@ -197,6 +197,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_configuration_types_gen.go index 1c6bad54060..2486f5cde10 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_configuration_types_gen.go @@ -175,6 +175,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_database_types_gen.go index 8275d2f6db2..f846b3df0f2 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_database_types_gen.go @@ -176,6 +176,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_firewall_rule_types_gen.go index 621bed6233c..5e631fd890c 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/flexible_servers_firewall_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_server_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_server_types_gen.go index c3b44c41f53..479515fbd13 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_server_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_server_types_gen.go @@ -157,6 +157,10 @@ func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *FlexibleServer) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_configuration_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_configuration_types_gen.go index 5bdae315a99..3f6c9863b42 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_configuration_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_configuration_types_gen.go @@ -135,6 +135,10 @@ func (configuration *FlexibleServersConfiguration) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (configuration *FlexibleServersConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(configuration.Spec) return configuration.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_database_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_database_types_gen.go index 31baee4a0d2..558582722c3 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_database_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_database_types_gen.go @@ -136,6 +136,10 @@ func (database *FlexibleServersDatabase) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (database *FlexibleServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_firewall_rule_types_gen.go b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_firewall_rule_types_gen.go index 64b1749c2ca..8747fc98b6d 100644 --- a/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_firewall_rule_types_gen.go +++ b/v2/api/dbforpostgresql/v1api20230601preview/storage/flexible_servers_firewall_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *FlexibleServersFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *FlexibleServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/devices/v1api20210702/iot_hub_types_gen.go b/v2/api/devices/v1api20210702/iot_hub_types_gen.go index 7830285e631..a9fb63d9970 100644 --- a/v2/api/devices/v1api20210702/iot_hub_types_gen.go +++ b/v2/api/devices/v1api20210702/iot_hub_types_gen.go @@ -173,6 +173,10 @@ func (iotHub *IotHub) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (iotHub *IotHub) Owner() *genruntime.ResourceReference { + if iotHub.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(iotHub.Spec) return iotHub.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/devices/v1api20210702/storage/iot_hub_types_gen.go b/v2/api/devices/v1api20210702/storage/iot_hub_types_gen.go index 256187ce6f2..db0abc887c1 100644 --- a/v2/api/devices/v1api20210702/storage/iot_hub_types_gen.go +++ b/v2/api/devices/v1api20210702/storage/iot_hub_types_gen.go @@ -115,6 +115,10 @@ func (iotHub *IotHub) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (iotHub *IotHub) Owner() *genruntime.ResourceReference { + if iotHub.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(iotHub.Spec) return iotHub.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/database_account_types_gen.go b/v2/api/documentdb/v1api20210515/database_account_types_gen.go index 4bb3adf2515..9064ac0f840 100644 --- a/v2/api/documentdb/v1api20210515/database_account_types_gen.go +++ b/v2/api/documentdb/v1api20210515/database_account_types_gen.go @@ -176,6 +176,10 @@ func (account *DatabaseAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *DatabaseAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/mongodb_database_collection_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/mongodb_database_collection_throughput_setting_types_gen.go index 6acd076715c..3cf76efb0d6 100644 --- a/v2/api/documentdb/v1api20210515/mongodb_database_collection_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/mongodb_database_collection_throughput_setting_types_gen.go @@ -168,6 +168,10 @@ func (setting *MongodbDatabaseCollectionThroughputSetting) NewEmptyStatus() genr // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseCollectionThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/mongodb_database_collection_types_gen.go b/v2/api/documentdb/v1api20210515/mongodb_database_collection_types_gen.go index e258752cf33..fe10277d288 100644 --- a/v2/api/documentdb/v1api20210515/mongodb_database_collection_types_gen.go +++ b/v2/api/documentdb/v1api20210515/mongodb_database_collection_types_gen.go @@ -176,6 +176,10 @@ func (collection *MongodbDatabaseCollection) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (collection *MongodbDatabaseCollection) Owner() *genruntime.ResourceReference { + if collection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(collection.Spec) return collection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/mongodb_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/mongodb_database_throughput_setting_types_gen.go index aba7c5dc6ab..c8aca5377ff 100644 --- a/v2/api/documentdb/v1api20210515/mongodb_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/mongodb_database_throughput_setting_types_gen.go @@ -168,6 +168,10 @@ func (setting *MongodbDatabaseThroughputSetting) NewEmptyStatus() genruntime.Con // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/mongodb_database_types_gen.go b/v2/api/documentdb/v1api20210515/mongodb_database_types_gen.go index 1252d5b87db..b225bcd340c 100644 --- a/v2/api/documentdb/v1api20210515/mongodb_database_types_gen.go +++ b/v2/api/documentdb/v1api20210515/mongodb_database_types_gen.go @@ -176,6 +176,10 @@ func (database *MongodbDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *MongodbDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_database_container_stored_procedure_types_gen.go b/v2/api/documentdb/v1api20210515/sql_database_container_stored_procedure_types_gen.go index 8a372a9ec62..2d76f483338 100644 --- a/v2/api/documentdb/v1api20210515/sql_database_container_stored_procedure_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_database_container_stored_procedure_types_gen.go @@ -176,6 +176,10 @@ func (procedure *SqlDatabaseContainerStoredProcedure) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (procedure *SqlDatabaseContainerStoredProcedure) Owner() *genruntime.ResourceReference { + if procedure.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(procedure.Spec) return procedure.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_database_container_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/sql_database_container_throughput_setting_types_gen.go index 080907bc88c..4839ad71294 100644 --- a/v2/api/documentdb/v1api20210515/sql_database_container_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_database_container_throughput_setting_types_gen.go @@ -168,6 +168,10 @@ func (setting *SqlDatabaseContainerThroughputSetting) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseContainerThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_database_container_trigger_types_gen.go b/v2/api/documentdb/v1api20210515/sql_database_container_trigger_types_gen.go index c5446d991c6..30ea66783c1 100644 --- a/v2/api/documentdb/v1api20210515/sql_database_container_trigger_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_database_container_trigger_types_gen.go @@ -176,6 +176,10 @@ func (trigger *SqlDatabaseContainerTrigger) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (trigger *SqlDatabaseContainerTrigger) Owner() *genruntime.ResourceReference { + if trigger.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(trigger.Spec) return trigger.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_database_container_types_gen.go b/v2/api/documentdb/v1api20210515/sql_database_container_types_gen.go index 95ad7281ab4..f2104a99a6e 100644 --- a/v2/api/documentdb/v1api20210515/sql_database_container_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_database_container_types_gen.go @@ -176,6 +176,10 @@ func (container *SqlDatabaseContainer) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (container *SqlDatabaseContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_database_container_user_defined_function_types_gen.go b/v2/api/documentdb/v1api20210515/sql_database_container_user_defined_function_types_gen.go index b71f317e15b..3baae7d6829 100644 --- a/v2/api/documentdb/v1api20210515/sql_database_container_user_defined_function_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_database_container_user_defined_function_types_gen.go @@ -176,6 +176,10 @@ func (function *SqlDatabaseContainerUserDefinedFunction) NewEmptyStatus() genrun // Owner returns the ResourceReference of the owner func (function *SqlDatabaseContainerUserDefinedFunction) Owner() *genruntime.ResourceReference { + if function.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(function.Spec) return function.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/sql_database_throughput_setting_types_gen.go index 6ad4ea5fa27..fb7ec883ef2 100644 --- a/v2/api/documentdb/v1api20210515/sql_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_database_throughput_setting_types_gen.go @@ -168,6 +168,10 @@ func (setting *SqlDatabaseThroughputSetting) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_database_types_gen.go b/v2/api/documentdb/v1api20210515/sql_database_types_gen.go index e460e4e9659..79e698da936 100644 --- a/v2/api/documentdb/v1api20210515/sql_database_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_database_types_gen.go @@ -176,6 +176,10 @@ func (database *SqlDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *SqlDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/sql_role_assignment_types_gen.go b/v2/api/documentdb/v1api20210515/sql_role_assignment_types_gen.go index 3703dc2f43c..6aab83e2c55 100644 --- a/v2/api/documentdb/v1api20210515/sql_role_assignment_types_gen.go +++ b/v2/api/documentdb/v1api20210515/sql_role_assignment_types_gen.go @@ -169,6 +169,10 @@ func (assignment *SqlRoleAssignment) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (assignment *SqlRoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assignment.Spec) return assignment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/database_account_types_gen.go b/v2/api/documentdb/v1api20210515/storage/database_account_types_gen.go index cef21aee7db..5ea9034bac1 100644 --- a/v2/api/documentdb/v1api20210515/storage/database_account_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/database_account_types_gen.go @@ -136,6 +136,10 @@ func (account *DatabaseAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *DatabaseAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_throughput_setting_types_gen.go index e86198f312b..394baf97961 100644 --- a/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_throughput_setting_types_gen.go @@ -135,6 +135,10 @@ func (setting *MongodbDatabaseCollectionThroughputSetting) NewEmptyStatus() genr // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseCollectionThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_types_gen.go b/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_types_gen.go index d6d61df5c3c..e61e5863f25 100644 --- a/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/mongodb_database_collection_types_gen.go @@ -136,6 +136,10 @@ func (collection *MongodbDatabaseCollection) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (collection *MongodbDatabaseCollection) Owner() *genruntime.ResourceReference { + if collection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(collection.Spec) return collection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/mongodb_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/storage/mongodb_database_throughput_setting_types_gen.go index d541de34a8d..d338785c7ba 100644 --- a/v2/api/documentdb/v1api20210515/storage/mongodb_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/mongodb_database_throughput_setting_types_gen.go @@ -135,6 +135,10 @@ func (setting *MongodbDatabaseThroughputSetting) NewEmptyStatus() genruntime.Con // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/mongodb_database_types_gen.go b/v2/api/documentdb/v1api20210515/storage/mongodb_database_types_gen.go index c2d9c322012..15082294722 100644 --- a/v2/api/documentdb/v1api20210515/storage/mongodb_database_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/mongodb_database_types_gen.go @@ -136,6 +136,10 @@ func (database *MongodbDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *MongodbDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_database_container_stored_procedure_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_database_container_stored_procedure_types_gen.go index d6ef9affc48..47cfbbf4e0b 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_database_container_stored_procedure_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_database_container_stored_procedure_types_gen.go @@ -136,6 +136,10 @@ func (procedure *SqlDatabaseContainerStoredProcedure) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (procedure *SqlDatabaseContainerStoredProcedure) Owner() *genruntime.ResourceReference { + if procedure.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(procedure.Spec) return procedure.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_database_container_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_database_container_throughput_setting_types_gen.go index ed1d4b0c94e..1c750c391d4 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_database_container_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_database_container_throughput_setting_types_gen.go @@ -135,6 +135,10 @@ func (setting *SqlDatabaseContainerThroughputSetting) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseContainerThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_database_container_trigger_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_database_container_trigger_types_gen.go index d820cbc7b14..934a599e9c0 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_database_container_trigger_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_database_container_trigger_types_gen.go @@ -136,6 +136,10 @@ func (trigger *SqlDatabaseContainerTrigger) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (trigger *SqlDatabaseContainerTrigger) Owner() *genruntime.ResourceReference { + if trigger.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(trigger.Spec) return trigger.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_database_container_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_database_container_types_gen.go index b222c168ae5..fe0ddce2248 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_database_container_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_database_container_types_gen.go @@ -136,6 +136,10 @@ func (container *SqlDatabaseContainer) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (container *SqlDatabaseContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_database_container_user_defined_function_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_database_container_user_defined_function_types_gen.go index 456ed05d240..c8286358fad 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_database_container_user_defined_function_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_database_container_user_defined_function_types_gen.go @@ -136,6 +136,10 @@ func (function *SqlDatabaseContainerUserDefinedFunction) NewEmptyStatus() genrun // Owner returns the ResourceReference of the owner func (function *SqlDatabaseContainerUserDefinedFunction) Owner() *genruntime.ResourceReference { + if function.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(function.Spec) return function.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_database_throughput_setting_types_gen.go index cd7ac514a87..9909f6eaf0b 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_database_throughput_setting_types_gen.go @@ -135,6 +135,10 @@ func (setting *SqlDatabaseThroughputSetting) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_database_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_database_types_gen.go index 6e899de6156..e1c76f567a5 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_database_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_database_types_gen.go @@ -136,6 +136,10 @@ func (database *SqlDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *SqlDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20210515/storage/sql_role_assignment_types_gen.go b/v2/api/documentdb/v1api20210515/storage/sql_role_assignment_types_gen.go index 115a19a4b5a..2f06059fc06 100644 --- a/v2/api/documentdb/v1api20210515/storage/sql_role_assignment_types_gen.go +++ b/v2/api/documentdb/v1api20210515/storage/sql_role_assignment_types_gen.go @@ -136,6 +136,10 @@ func (assignment *SqlRoleAssignment) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (assignment *SqlRoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assignment.Spec) return assignment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/database_account_types_gen.go b/v2/api/documentdb/v1api20231115/database_account_types_gen.go index 3b8901f948c..3ed813088f3 100644 --- a/v2/api/documentdb/v1api20231115/database_account_types_gen.go +++ b/v2/api/documentdb/v1api20231115/database_account_types_gen.go @@ -173,6 +173,10 @@ func (account *DatabaseAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *DatabaseAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/mongodb_database_collection_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/mongodb_database_collection_throughput_setting_types_gen.go index cdafc3f54d0..64f7a5f7512 100644 --- a/v2/api/documentdb/v1api20231115/mongodb_database_collection_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/mongodb_database_collection_throughput_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *MongodbDatabaseCollectionThroughputSetting) NewEmptyStatus() genr // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseCollectionThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/mongodb_database_collection_types_gen.go b/v2/api/documentdb/v1api20231115/mongodb_database_collection_types_gen.go index dbdc6a1b27b..1da4fd71276 100644 --- a/v2/api/documentdb/v1api20231115/mongodb_database_collection_types_gen.go +++ b/v2/api/documentdb/v1api20231115/mongodb_database_collection_types_gen.go @@ -173,6 +173,10 @@ func (collection *MongodbDatabaseCollection) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (collection *MongodbDatabaseCollection) Owner() *genruntime.ResourceReference { + if collection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(collection.Spec) return collection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/mongodb_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/mongodb_database_throughput_setting_types_gen.go index 4d22752559b..47ad5a46437 100644 --- a/v2/api/documentdb/v1api20231115/mongodb_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/mongodb_database_throughput_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *MongodbDatabaseThroughputSetting) NewEmptyStatus() genruntime.Con // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/mongodb_database_types_gen.go b/v2/api/documentdb/v1api20231115/mongodb_database_types_gen.go index c6aaee5c44e..2d73533dc8b 100644 --- a/v2/api/documentdb/v1api20231115/mongodb_database_types_gen.go +++ b/v2/api/documentdb/v1api20231115/mongodb_database_types_gen.go @@ -173,6 +173,10 @@ func (database *MongodbDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *MongodbDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_database_container_stored_procedure_types_gen.go b/v2/api/documentdb/v1api20231115/sql_database_container_stored_procedure_types_gen.go index 56a2ab917e5..227d661b0b1 100644 --- a/v2/api/documentdb/v1api20231115/sql_database_container_stored_procedure_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_database_container_stored_procedure_types_gen.go @@ -173,6 +173,10 @@ func (procedure *SqlDatabaseContainerStoredProcedure) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (procedure *SqlDatabaseContainerStoredProcedure) Owner() *genruntime.ResourceReference { + if procedure.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(procedure.Spec) return procedure.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_database_container_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/sql_database_container_throughput_setting_types_gen.go index ed7236b20c6..9016faeb2f9 100644 --- a/v2/api/documentdb/v1api20231115/sql_database_container_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_database_container_throughput_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *SqlDatabaseContainerThroughputSetting) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseContainerThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_database_container_trigger_types_gen.go b/v2/api/documentdb/v1api20231115/sql_database_container_trigger_types_gen.go index ce7fd0b1d58..3da9fb9e072 100644 --- a/v2/api/documentdb/v1api20231115/sql_database_container_trigger_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_database_container_trigger_types_gen.go @@ -173,6 +173,10 @@ func (trigger *SqlDatabaseContainerTrigger) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (trigger *SqlDatabaseContainerTrigger) Owner() *genruntime.ResourceReference { + if trigger.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(trigger.Spec) return trigger.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_database_container_types_gen.go b/v2/api/documentdb/v1api20231115/sql_database_container_types_gen.go index a7b985fbf1d..3c41f88c719 100644 --- a/v2/api/documentdb/v1api20231115/sql_database_container_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_database_container_types_gen.go @@ -173,6 +173,10 @@ func (container *SqlDatabaseContainer) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (container *SqlDatabaseContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_database_container_user_defined_function_types_gen.go b/v2/api/documentdb/v1api20231115/sql_database_container_user_defined_function_types_gen.go index 707a469c48c..3dfa55ee002 100644 --- a/v2/api/documentdb/v1api20231115/sql_database_container_user_defined_function_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_database_container_user_defined_function_types_gen.go @@ -173,6 +173,10 @@ func (function *SqlDatabaseContainerUserDefinedFunction) NewEmptyStatus() genrun // Owner returns the ResourceReference of the owner func (function *SqlDatabaseContainerUserDefinedFunction) Owner() *genruntime.ResourceReference { + if function.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(function.Spec) return function.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/sql_database_throughput_setting_types_gen.go index 4ae65aebc57..56b6f4e6534 100644 --- a/v2/api/documentdb/v1api20231115/sql_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_database_throughput_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *SqlDatabaseThroughputSetting) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_database_types_gen.go b/v2/api/documentdb/v1api20231115/sql_database_types_gen.go index 2342271807f..d591195db2c 100644 --- a/v2/api/documentdb/v1api20231115/sql_database_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_database_types_gen.go @@ -173,6 +173,10 @@ func (database *SqlDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *SqlDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/sql_role_assignment_types_gen.go b/v2/api/documentdb/v1api20231115/sql_role_assignment_types_gen.go index a0c8ff75a87..c391518b316 100644 --- a/v2/api/documentdb/v1api20231115/sql_role_assignment_types_gen.go +++ b/v2/api/documentdb/v1api20231115/sql_role_assignment_types_gen.go @@ -166,6 +166,10 @@ func (assignment *SqlRoleAssignment) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (assignment *SqlRoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assignment.Spec) return assignment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/database_account_types_gen.go b/v2/api/documentdb/v1api20231115/storage/database_account_types_gen.go index 3c949686854..78f69fef484 100644 --- a/v2/api/documentdb/v1api20231115/storage/database_account_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/database_account_types_gen.go @@ -115,6 +115,10 @@ func (account *DatabaseAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *DatabaseAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_throughput_setting_types_gen.go index 335ce51012f..179b03ba89c 100644 --- a/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_throughput_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *MongodbDatabaseCollectionThroughputSetting) NewEmptyStatus() genr // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseCollectionThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_types_gen.go b/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_types_gen.go index 5976b7ad941..2535efc61fa 100644 --- a/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/mongodb_database_collection_types_gen.go @@ -115,6 +115,10 @@ func (collection *MongodbDatabaseCollection) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (collection *MongodbDatabaseCollection) Owner() *genruntime.ResourceReference { + if collection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(collection.Spec) return collection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/mongodb_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/storage/mongodb_database_throughput_setting_types_gen.go index 058cc5c587b..20e9d0ad317 100644 --- a/v2/api/documentdb/v1api20231115/storage/mongodb_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/mongodb_database_throughput_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *MongodbDatabaseThroughputSetting) NewEmptyStatus() genruntime.Con // Owner returns the ResourceReference of the owner func (setting *MongodbDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/mongodb_database_types_gen.go b/v2/api/documentdb/v1api20231115/storage/mongodb_database_types_gen.go index 780cd3bd71d..3994515ecbf 100644 --- a/v2/api/documentdb/v1api20231115/storage/mongodb_database_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/mongodb_database_types_gen.go @@ -115,6 +115,10 @@ func (database *MongodbDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *MongodbDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_database_container_stored_procedure_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_database_container_stored_procedure_types_gen.go index d8fa60bcef8..a59a5c3ac63 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_database_container_stored_procedure_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_database_container_stored_procedure_types_gen.go @@ -115,6 +115,10 @@ func (procedure *SqlDatabaseContainerStoredProcedure) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (procedure *SqlDatabaseContainerStoredProcedure) Owner() *genruntime.ResourceReference { + if procedure.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(procedure.Spec) return procedure.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_database_container_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_database_container_throughput_setting_types_gen.go index 7687553d94a..fa750307641 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_database_container_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_database_container_throughput_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *SqlDatabaseContainerThroughputSetting) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseContainerThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_database_container_trigger_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_database_container_trigger_types_gen.go index 1d862352493..e1565e1ad61 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_database_container_trigger_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_database_container_trigger_types_gen.go @@ -115,6 +115,10 @@ func (trigger *SqlDatabaseContainerTrigger) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (trigger *SqlDatabaseContainerTrigger) Owner() *genruntime.ResourceReference { + if trigger.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(trigger.Spec) return trigger.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_database_container_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_database_container_types_gen.go index 43af543f71e..25c0f0653a0 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_database_container_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_database_container_types_gen.go @@ -115,6 +115,10 @@ func (container *SqlDatabaseContainer) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (container *SqlDatabaseContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_database_container_user_defined_function_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_database_container_user_defined_function_types_gen.go index 3ffb324e66d..be987b4054a 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_database_container_user_defined_function_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_database_container_user_defined_function_types_gen.go @@ -115,6 +115,10 @@ func (function *SqlDatabaseContainerUserDefinedFunction) NewEmptyStatus() genrun // Owner returns the ResourceReference of the owner func (function *SqlDatabaseContainerUserDefinedFunction) Owner() *genruntime.ResourceReference { + if function.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(function.Spec) return function.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_database_throughput_setting_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_database_throughput_setting_types_gen.go index a45d6b6f932..3a3c2608441 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_database_throughput_setting_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_database_throughput_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *SqlDatabaseThroughputSetting) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (setting *SqlDatabaseThroughputSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_database_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_database_types_gen.go index 38148bd9d7a..1a858f9c314 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_database_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_database_types_gen.go @@ -115,6 +115,10 @@ func (database *SqlDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *SqlDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/documentdb/v1api20231115/storage/sql_role_assignment_types_gen.go b/v2/api/documentdb/v1api20231115/storage/sql_role_assignment_types_gen.go index cdf6cd8bf4d..38440c7aa9d 100644 --- a/v2/api/documentdb/v1api20231115/storage/sql_role_assignment_types_gen.go +++ b/v2/api/documentdb/v1api20231115/storage/sql_role_assignment_types_gen.go @@ -115,6 +115,10 @@ func (assignment *SqlRoleAssignment) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (assignment *SqlRoleAssignment) Owner() *genruntime.ResourceReference { + if assignment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assignment.Spec) return assignment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventgrid/v1api20200601/domain_types_gen.go b/v2/api/eventgrid/v1api20200601/domain_types_gen.go index b4866fc7f60..ede1cce138c 100644 --- a/v2/api/eventgrid/v1api20200601/domain_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/domain_types_gen.go @@ -173,6 +173,10 @@ func (domain *Domain) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (domain *Domain) Owner() *genruntime.ResourceReference { + if domain.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(domain.Spec) return domain.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventgrid/v1api20200601/domains_topic_types_gen.go b/v2/api/eventgrid/v1api20200601/domains_topic_types_gen.go index a95c3e7e86c..170ec95962b 100644 --- a/v2/api/eventgrid/v1api20200601/domains_topic_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/domains_topic_types_gen.go @@ -173,6 +173,10 @@ func (topic *DomainsTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *DomainsTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventgrid/v1api20200601/event_subscription_types_gen.go b/v2/api/eventgrid/v1api20200601/event_subscription_types_gen.go index eaea9db4fc4..352be3e29b3 100644 --- a/v2/api/eventgrid/v1api20200601/event_subscription_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/event_subscription_types_gen.go @@ -173,6 +173,10 @@ func (subscription *EventSubscription) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (subscription *EventSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + return subscription.Spec.Owner.AsResourceReference() } diff --git a/v2/api/eventgrid/v1api20200601/storage/domain_types_gen.go b/v2/api/eventgrid/v1api20200601/storage/domain_types_gen.go index 412441be48b..4bd813bab72 100644 --- a/v2/api/eventgrid/v1api20200601/storage/domain_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/storage/domain_types_gen.go @@ -115,6 +115,10 @@ func (domain *Domain) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (domain *Domain) Owner() *genruntime.ResourceReference { + if domain.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(domain.Spec) return domain.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventgrid/v1api20200601/storage/domains_topic_types_gen.go b/v2/api/eventgrid/v1api20200601/storage/domains_topic_types_gen.go index 2911fb4ace8..824a02306c6 100644 --- a/v2/api/eventgrid/v1api20200601/storage/domains_topic_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/storage/domains_topic_types_gen.go @@ -115,6 +115,10 @@ func (topic *DomainsTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *DomainsTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventgrid/v1api20200601/storage/event_subscription_types_gen.go b/v2/api/eventgrid/v1api20200601/storage/event_subscription_types_gen.go index a15f2d7c4f6..c3bd0584755 100644 --- a/v2/api/eventgrid/v1api20200601/storage/event_subscription_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/storage/event_subscription_types_gen.go @@ -115,6 +115,10 @@ func (subscription *EventSubscription) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (subscription *EventSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + return subscription.Spec.Owner.AsResourceReference() } diff --git a/v2/api/eventgrid/v1api20200601/storage/topic_types_gen.go b/v2/api/eventgrid/v1api20200601/storage/topic_types_gen.go index a1345c05ba8..58f54c25733 100644 --- a/v2/api/eventgrid/v1api20200601/storage/topic_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/storage/topic_types_gen.go @@ -136,6 +136,10 @@ func (topic *Topic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *Topic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventgrid/v1api20200601/topic_types_gen.go b/v2/api/eventgrid/v1api20200601/topic_types_gen.go index 62e7de09cef..1427e828921 100644 --- a/v2/api/eventgrid/v1api20200601/topic_types_gen.go +++ b/v2/api/eventgrid/v1api20200601/topic_types_gen.go @@ -194,6 +194,10 @@ func (topic *Topic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *Topic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/namespace_types_gen.go b/v2/api/eventhub/v1api20211101/namespace_types_gen.go index e8b057da891..47bed8d41b1 100644 --- a/v2/api/eventhub/v1api20211101/namespace_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespace_types_gen.go @@ -173,6 +173,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go index f7cc3546f2e..a5822c7c72a 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go index fe51c5e384d..1855a70f43e 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go @@ -173,6 +173,10 @@ func (eventhub *NamespacesEventhub) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (eventhub *NamespacesEventhub) Owner() *genruntime.ResourceReference { + if eventhub.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(eventhub.Spec) return eventhub.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go index be61265bcac..8593138cffe 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *NamespacesEventhubsAuthorizationRule) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (rule *NamespacesEventhubsAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go index d9e69615233..d6a8e929e15 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go @@ -173,6 +173,10 @@ func (group *NamespacesEventhubsConsumerGroup) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (group *NamespacesEventhubsConsumerGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go index fa10a360fde..91433e5a84f 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go @@ -115,6 +115,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go index 564d7689871..6d10c236680 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go index 5d239afd2ed..aa328f4d758 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go @@ -115,6 +115,10 @@ func (eventhub *NamespacesEventhub) NewEmptyStatus() genruntime.ConvertibleStatu // Owner returns the ResourceReference of the owner func (eventhub *NamespacesEventhub) Owner() *genruntime.ResourceReference { + if eventhub.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(eventhub.Spec) return eventhub.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go index 309fe3d3289..5e8eee83417 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *NamespacesEventhubsAuthorizationRule) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (rule *NamespacesEventhubsAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go index be2e1196301..6ce0b08ce96 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go @@ -115,6 +115,10 @@ func (group *NamespacesEventhubsConsumerGroup) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (group *NamespacesEventhubsConsumerGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/insights/v1api20180301/metric_alert_types_gen.go b/v2/api/insights/v1api20180301/metric_alert_types_gen.go index 38a1bac17e9..97f2f52c210 100644 --- a/v2/api/insights/v1api20180301/metric_alert_types_gen.go +++ b/v2/api/insights/v1api20180301/metric_alert_types_gen.go @@ -174,6 +174,10 @@ func (alert *MetricAlert) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (alert *MetricAlert) Owner() *genruntime.ResourceReference { + if alert.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(alert.Spec) return alert.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20180301/storage/metric_alert_types_gen.go b/v2/api/insights/v1api20180301/storage/metric_alert_types_gen.go index 5e85497f01c..069a58bb154 100644 --- a/v2/api/insights/v1api20180301/storage/metric_alert_types_gen.go +++ b/v2/api/insights/v1api20180301/storage/metric_alert_types_gen.go @@ -116,6 +116,10 @@ func (alert *MetricAlert) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (alert *MetricAlert) Owner() *genruntime.ResourceReference { + if alert.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(alert.Spec) return alert.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20180501preview/storage/webtest_types_gen.go b/v2/api/insights/v1api20180501preview/storage/webtest_types_gen.go index 04a9d0d343b..2c8ca3045cf 100644 --- a/v2/api/insights/v1api20180501preview/storage/webtest_types_gen.go +++ b/v2/api/insights/v1api20180501preview/storage/webtest_types_gen.go @@ -136,6 +136,10 @@ func (webtest *Webtest) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (webtest *Webtest) Owner() *genruntime.ResourceReference { + if webtest.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(webtest.Spec) return webtest.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20180501preview/webtest_types_gen.go b/v2/api/insights/v1api20180501preview/webtest_types_gen.go index 2302b4c057b..5875db878bc 100644 --- a/v2/api/insights/v1api20180501preview/webtest_types_gen.go +++ b/v2/api/insights/v1api20180501preview/webtest_types_gen.go @@ -176,6 +176,10 @@ func (webtest *Webtest) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (webtest *Webtest) Owner() *genruntime.ResourceReference { + if webtest.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(webtest.Spec) return webtest.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20200202/component_types_gen.go b/v2/api/insights/v1api20200202/component_types_gen.go index 02cad33bbf2..b7c85687e7e 100644 --- a/v2/api/insights/v1api20200202/component_types_gen.go +++ b/v2/api/insights/v1api20200202/component_types_gen.go @@ -199,6 +199,10 @@ func (component *Component) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (component *Component) Owner() *genruntime.ResourceReference { + if component.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(component.Spec) return component.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20200202/storage/component_types_gen.go b/v2/api/insights/v1api20200202/storage/component_types_gen.go index 250d93719b9..001b20e913b 100644 --- a/v2/api/insights/v1api20200202/storage/component_types_gen.go +++ b/v2/api/insights/v1api20200202/storage/component_types_gen.go @@ -141,6 +141,10 @@ func (component *Component) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (component *Component) Owner() *genruntime.ResourceReference { + if component.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(component.Spec) return component.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20210501preview/diagnostic_setting_types_gen.go b/v2/api/insights/v1api20210501preview/diagnostic_setting_types_gen.go index 4093d726a92..ab4157cbace 100644 --- a/v2/api/insights/v1api20210501preview/diagnostic_setting_types_gen.go +++ b/v2/api/insights/v1api20210501preview/diagnostic_setting_types_gen.go @@ -173,6 +173,10 @@ func (setting *DiagnosticSetting) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (setting *DiagnosticSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + return setting.Spec.Owner.AsResourceReference() } diff --git a/v2/api/insights/v1api20210501preview/storage/diagnostic_setting_types_gen.go b/v2/api/insights/v1api20210501preview/storage/diagnostic_setting_types_gen.go index fefded63bee..8878cebeb1d 100644 --- a/v2/api/insights/v1api20210501preview/storage/diagnostic_setting_types_gen.go +++ b/v2/api/insights/v1api20210501preview/storage/diagnostic_setting_types_gen.go @@ -116,6 +116,10 @@ func (setting *DiagnosticSetting) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (setting *DiagnosticSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + return setting.Spec.Owner.AsResourceReference() } diff --git a/v2/api/insights/v1api20220615/scheduled_query_rule_types_gen.go b/v2/api/insights/v1api20220615/scheduled_query_rule_types_gen.go index 56922752b17..b069cebe921 100644 --- a/v2/api/insights/v1api20220615/scheduled_query_rule_types_gen.go +++ b/v2/api/insights/v1api20220615/scheduled_query_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *ScheduledQueryRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *ScheduledQueryRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20220615/storage/scheduled_query_rule_types_gen.go b/v2/api/insights/v1api20220615/storage/scheduled_query_rule_types_gen.go index 5879ea98d1e..863c324e655 100644 --- a/v2/api/insights/v1api20220615/storage/scheduled_query_rule_types_gen.go +++ b/v2/api/insights/v1api20220615/storage/scheduled_query_rule_types_gen.go @@ -116,6 +116,10 @@ func (rule *ScheduledQueryRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *ScheduledQueryRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20220615/storage/webtest_types_gen.go b/v2/api/insights/v1api20220615/storage/webtest_types_gen.go index ee220af9a74..da125e3c205 100644 --- a/v2/api/insights/v1api20220615/storage/webtest_types_gen.go +++ b/v2/api/insights/v1api20220615/storage/webtest_types_gen.go @@ -115,6 +115,10 @@ func (webtest *Webtest) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (webtest *Webtest) Owner() *genruntime.ResourceReference { + if webtest.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(webtest.Spec) return webtest.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20220615/webtest_types_gen.go b/v2/api/insights/v1api20220615/webtest_types_gen.go index f7790883e3d..26f77084199 100644 --- a/v2/api/insights/v1api20220615/webtest_types_gen.go +++ b/v2/api/insights/v1api20220615/webtest_types_gen.go @@ -173,6 +173,10 @@ func (webtest *Webtest) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (webtest *Webtest) Owner() *genruntime.ResourceReference { + if webtest.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(webtest.Spec) return webtest.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20221001/autoscale_setting_types_gen.go b/v2/api/insights/v1api20221001/autoscale_setting_types_gen.go index 1519f53ff9d..e8efc31be5a 100644 --- a/v2/api/insights/v1api20221001/autoscale_setting_types_gen.go +++ b/v2/api/insights/v1api20221001/autoscale_setting_types_gen.go @@ -173,6 +173,10 @@ func (setting *AutoscaleSetting) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (setting *AutoscaleSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20221001/storage/autoscale_setting_types_gen.go b/v2/api/insights/v1api20221001/storage/autoscale_setting_types_gen.go index d6991121be4..24b6d25134a 100644 --- a/v2/api/insights/v1api20221001/storage/autoscale_setting_types_gen.go +++ b/v2/api/insights/v1api20221001/storage/autoscale_setting_types_gen.go @@ -115,6 +115,10 @@ func (setting *AutoscaleSetting) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (setting *AutoscaleSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/insights/v1api20230101/action_group_types_gen.go b/v2/api/insights/v1api20230101/action_group_types_gen.go index de18b526f20..221a004e9f4 100644 --- a/v2/api/insights/v1api20230101/action_group_types_gen.go +++ b/v2/api/insights/v1api20230101/action_group_types_gen.go @@ -173,6 +173,10 @@ func (group *ActionGroup) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (group *ActionGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/insights/v1api20230101/storage/action_group_types_gen.go b/v2/api/insights/v1api20230101/storage/action_group_types_gen.go index 227541d1acd..0ec272917bf 100644 --- a/v2/api/insights/v1api20230101/storage/action_group_types_gen.go +++ b/v2/api/insights/v1api20230101/storage/action_group_types_gen.go @@ -115,6 +115,10 @@ func (group *ActionGroup) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (group *ActionGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/keyvault/v1api20210401preview/storage/vault_types_gen.go b/v2/api/keyvault/v1api20210401preview/storage/vault_types_gen.go index 928fdf48a4c..6e82c3c3cbd 100644 --- a/v2/api/keyvault/v1api20210401preview/storage/vault_types_gen.go +++ b/v2/api/keyvault/v1api20210401preview/storage/vault_types_gen.go @@ -136,6 +136,10 @@ func (vault *Vault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *Vault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/keyvault/v1api20210401preview/vault_types_gen.go b/v2/api/keyvault/v1api20210401preview/vault_types_gen.go index a26629a74c0..17e3d14f8d5 100644 --- a/v2/api/keyvault/v1api20210401preview/vault_types_gen.go +++ b/v2/api/keyvault/v1api20210401preview/vault_types_gen.go @@ -176,6 +176,10 @@ func (vault *Vault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *Vault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/keyvault/v1api20230701/storage/vault_types_gen.go b/v2/api/keyvault/v1api20230701/storage/vault_types_gen.go index a27ff926699..4804c83ee02 100644 --- a/v2/api/keyvault/v1api20230701/storage/vault_types_gen.go +++ b/v2/api/keyvault/v1api20230701/storage/vault_types_gen.go @@ -115,6 +115,10 @@ func (vault *Vault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *Vault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/keyvault/v1api20230701/vault_types_gen.go b/v2/api/keyvault/v1api20230701/vault_types_gen.go index edb506a21ed..e2e87affdb6 100644 --- a/v2/api/keyvault/v1api20230701/vault_types_gen.go +++ b/v2/api/keyvault/v1api20230701/vault_types_gen.go @@ -173,6 +173,10 @@ func (vault *Vault) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (vault *Vault) Owner() *genruntime.ResourceReference { + if vault.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(vault.Spec) return vault.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/kubernetesconfiguration/v1api20230501/extension_types_gen.go b/v2/api/kubernetesconfiguration/v1api20230501/extension_types_gen.go index f9de38478b7..c954e1ce538 100644 --- a/v2/api/kubernetesconfiguration/v1api20230501/extension_types_gen.go +++ b/v2/api/kubernetesconfiguration/v1api20230501/extension_types_gen.go @@ -197,6 +197,10 @@ func (extension *Extension) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (extension *Extension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + return extension.Spec.Owner.AsResourceReference() } diff --git a/v2/api/kubernetesconfiguration/v1api20230501/flux_configuration_types_gen.go b/v2/api/kubernetesconfiguration/v1api20230501/flux_configuration_types_gen.go index 9a16206415d..11af6c317c5 100644 --- a/v2/api/kubernetesconfiguration/v1api20230501/flux_configuration_types_gen.go +++ b/v2/api/kubernetesconfiguration/v1api20230501/flux_configuration_types_gen.go @@ -173,6 +173,10 @@ func (configuration *FluxConfiguration) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (configuration *FluxConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + return configuration.Spec.Owner.AsResourceReference() } diff --git a/v2/api/kubernetesconfiguration/v1api20230501/storage/extension_types_gen.go b/v2/api/kubernetesconfiguration/v1api20230501/storage/extension_types_gen.go index 1216f0c4d68..7b334df54ec 100644 --- a/v2/api/kubernetesconfiguration/v1api20230501/storage/extension_types_gen.go +++ b/v2/api/kubernetesconfiguration/v1api20230501/storage/extension_types_gen.go @@ -139,6 +139,10 @@ func (extension *Extension) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (extension *Extension) Owner() *genruntime.ResourceReference { + if extension.Spec.Owner == nil { + return nil + } + return extension.Spec.Owner.AsResourceReference() } diff --git a/v2/api/kubernetesconfiguration/v1api20230501/storage/flux_configuration_types_gen.go b/v2/api/kubernetesconfiguration/v1api20230501/storage/flux_configuration_types_gen.go index c212637c72c..82824da1edd 100644 --- a/v2/api/kubernetesconfiguration/v1api20230501/storage/flux_configuration_types_gen.go +++ b/v2/api/kubernetesconfiguration/v1api20230501/storage/flux_configuration_types_gen.go @@ -115,6 +115,10 @@ func (configuration *FluxConfiguration) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (configuration *FluxConfiguration) Owner() *genruntime.ResourceReference { + if configuration.Spec.Owner == nil { + return nil + } + return configuration.Spec.Owner.AsResourceReference() } diff --git a/v2/api/machinelearningservices/v1api20210701/storage/workspace_types_gen.go b/v2/api/machinelearningservices/v1api20210701/storage/workspace_types_gen.go index b877e24f87c..245c12f4610 100644 --- a/v2/api/machinelearningservices/v1api20210701/storage/workspace_types_gen.go +++ b/v2/api/machinelearningservices/v1api20210701/storage/workspace_types_gen.go @@ -136,6 +136,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20210701/storage/workspaces_compute_types_gen.go b/v2/api/machinelearningservices/v1api20210701/storage/workspaces_compute_types_gen.go index 49e01d5c2bd..e34559a058c 100644 --- a/v2/api/machinelearningservices/v1api20210701/storage/workspaces_compute_types_gen.go +++ b/v2/api/machinelearningservices/v1api20210701/storage/workspaces_compute_types_gen.go @@ -137,6 +137,10 @@ func (compute *WorkspacesCompute) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (compute *WorkspacesCompute) Owner() *genruntime.ResourceReference { + if compute.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(compute.Spec) return compute.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20210701/storage/workspaces_connection_types_gen.go b/v2/api/machinelearningservices/v1api20210701/storage/workspaces_connection_types_gen.go index 98ff5e0fa51..1c20306923e 100644 --- a/v2/api/machinelearningservices/v1api20210701/storage/workspaces_connection_types_gen.go +++ b/v2/api/machinelearningservices/v1api20210701/storage/workspaces_connection_types_gen.go @@ -136,6 +136,10 @@ func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference { + if connection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(connection.Spec) return connection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20210701/workspace_types_gen.go b/v2/api/machinelearningservices/v1api20210701/workspace_types_gen.go index 70e0be5a1d2..de43b2a3907 100644 --- a/v2/api/machinelearningservices/v1api20210701/workspace_types_gen.go +++ b/v2/api/machinelearningservices/v1api20210701/workspace_types_gen.go @@ -176,6 +176,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20210701/workspaces_compute_types_gen.go b/v2/api/machinelearningservices/v1api20210701/workspaces_compute_types_gen.go index cd15cdb1117..c3e85de066f 100644 --- a/v2/api/machinelearningservices/v1api20210701/workspaces_compute_types_gen.go +++ b/v2/api/machinelearningservices/v1api20210701/workspaces_compute_types_gen.go @@ -177,6 +177,10 @@ func (compute *WorkspacesCompute) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (compute *WorkspacesCompute) Owner() *genruntime.ResourceReference { + if compute.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(compute.Spec) return compute.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20210701/workspaces_connection_types_gen.go b/v2/api/machinelearningservices/v1api20210701/workspaces_connection_types_gen.go index 19c0bf55b2e..85f1d91ca41 100644 --- a/v2/api/machinelearningservices/v1api20210701/workspaces_connection_types_gen.go +++ b/v2/api/machinelearningservices/v1api20210701/workspaces_connection_types_gen.go @@ -176,6 +176,10 @@ func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference { + if connection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(connection.Spec) return connection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/registry_types_gen.go b/v2/api/machinelearningservices/v1api20240401/registry_types_gen.go index aecc32c1236..42812cb975d 100644 --- a/v2/api/machinelearningservices/v1api20240401/registry_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/registry_types_gen.go @@ -199,6 +199,10 @@ func (registry *Registry) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (registry *Registry) Owner() *genruntime.ResourceReference { + if registry.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(registry.Spec) return registry.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/storage/registry_types_gen.go b/v2/api/machinelearningservices/v1api20240401/storage/registry_types_gen.go index 6fc1d67da83..c77a39faa01 100644 --- a/v2/api/machinelearningservices/v1api20240401/storage/registry_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/storage/registry_types_gen.go @@ -141,6 +141,10 @@ func (registry *Registry) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (registry *Registry) Owner() *genruntime.ResourceReference { + if registry.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(registry.Spec) return registry.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/storage/workspace_types_gen.go b/v2/api/machinelearningservices/v1api20240401/storage/workspace_types_gen.go index 21f136500a3..4b678b7d3eb 100644 --- a/v2/api/machinelearningservices/v1api20240401/storage/workspace_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/storage/workspace_types_gen.go @@ -115,6 +115,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/storage/workspaces_compute_types_gen.go b/v2/api/machinelearningservices/v1api20240401/storage/workspaces_compute_types_gen.go index 708d2d5bdae..3359d84342b 100644 --- a/v2/api/machinelearningservices/v1api20240401/storage/workspaces_compute_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/storage/workspaces_compute_types_gen.go @@ -116,6 +116,10 @@ func (compute *WorkspacesCompute) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (compute *WorkspacesCompute) Owner() *genruntime.ResourceReference { + if compute.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(compute.Spec) return compute.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/storage/workspaces_connection_types_gen.go b/v2/api/machinelearningservices/v1api20240401/storage/workspaces_connection_types_gen.go index b95fb4a8ccc..45ab41e0171 100644 --- a/v2/api/machinelearningservices/v1api20240401/storage/workspaces_connection_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/storage/workspaces_connection_types_gen.go @@ -115,6 +115,10 @@ func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference { + if connection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(connection.Spec) return connection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/workspace_types_gen.go b/v2/api/machinelearningservices/v1api20240401/workspace_types_gen.go index 1cb5360d116..05385251650 100644 --- a/v2/api/machinelearningservices/v1api20240401/workspace_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/workspace_types_gen.go @@ -173,6 +173,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/workspaces_compute_types_gen.go b/v2/api/machinelearningservices/v1api20240401/workspaces_compute_types_gen.go index 6cb62da529c..f17541164f7 100644 --- a/v2/api/machinelearningservices/v1api20240401/workspaces_compute_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/workspaces_compute_types_gen.go @@ -174,6 +174,10 @@ func (compute *WorkspacesCompute) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (compute *WorkspacesCompute) Owner() *genruntime.ResourceReference { + if compute.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(compute.Spec) return compute.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/machinelearningservices/v1api20240401/workspaces_connection_types_gen.go b/v2/api/machinelearningservices/v1api20240401/workspaces_connection_types_gen.go index 8a470b56b3a..513b4abda49 100644 --- a/v2/api/machinelearningservices/v1api20240401/workspaces_connection_types_gen.go +++ b/v2/api/machinelearningservices/v1api20240401/workspaces_connection_types_gen.go @@ -173,6 +173,10 @@ func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference { + if connection.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(connection.Spec) return connection.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20181130/storage/user_assigned_identity_types_gen.go b/v2/api/managedidentity/v1api20181130/storage/user_assigned_identity_types_gen.go index b72a0295ea3..088eb2e76c4 100644 --- a/v2/api/managedidentity/v1api20181130/storage/user_assigned_identity_types_gen.go +++ b/v2/api/managedidentity/v1api20181130/storage/user_assigned_identity_types_gen.go @@ -167,6 +167,10 @@ func (identity *UserAssignedIdentity) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (identity *UserAssignedIdentity) Owner() *genruntime.ResourceReference { + if identity.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(identity.Spec) return identity.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20181130/user_assigned_identity_types_gen.go b/v2/api/managedidentity/v1api20181130/user_assigned_identity_types_gen.go index 9bf5afa2b73..c62e9beb52d 100644 --- a/v2/api/managedidentity/v1api20181130/user_assigned_identity_types_gen.go +++ b/v2/api/managedidentity/v1api20181130/user_assigned_identity_types_gen.go @@ -207,6 +207,10 @@ func (identity *UserAssignedIdentity) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (identity *UserAssignedIdentity) Owner() *genruntime.ResourceReference { + if identity.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(identity.Spec) return identity.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20220131preview/federated_identity_credential_types_gen.go b/v2/api/managedidentity/v1api20220131preview/federated_identity_credential_types_gen.go index 830240efcb1..203964ad5b9 100644 --- a/v2/api/managedidentity/v1api20220131preview/federated_identity_credential_types_gen.go +++ b/v2/api/managedidentity/v1api20220131preview/federated_identity_credential_types_gen.go @@ -176,6 +176,10 @@ func (credential *FederatedIdentityCredential) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (credential *FederatedIdentityCredential) Owner() *genruntime.ResourceReference { + if credential.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(credential.Spec) return credential.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20220131preview/storage/federated_identity_credential_types_gen.go b/v2/api/managedidentity/v1api20220131preview/storage/federated_identity_credential_types_gen.go index aa71d7a126e..d94a8d8bff7 100644 --- a/v2/api/managedidentity/v1api20220131preview/storage/federated_identity_credential_types_gen.go +++ b/v2/api/managedidentity/v1api20220131preview/storage/federated_identity_credential_types_gen.go @@ -136,6 +136,10 @@ func (credential *FederatedIdentityCredential) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (credential *FederatedIdentityCredential) Owner() *genruntime.ResourceReference { + if credential.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(credential.Spec) return credential.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20230131/federated_identity_credential_types_gen.go b/v2/api/managedidentity/v1api20230131/federated_identity_credential_types_gen.go index fbc2cf9b22b..7a3cd00fa24 100644 --- a/v2/api/managedidentity/v1api20230131/federated_identity_credential_types_gen.go +++ b/v2/api/managedidentity/v1api20230131/federated_identity_credential_types_gen.go @@ -173,6 +173,10 @@ func (credential *FederatedIdentityCredential) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (credential *FederatedIdentityCredential) Owner() *genruntime.ResourceReference { + if credential.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(credential.Spec) return credential.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20230131/storage/federated_identity_credential_types_gen.go b/v2/api/managedidentity/v1api20230131/storage/federated_identity_credential_types_gen.go index c1226be3afb..b443a33ee54 100644 --- a/v2/api/managedidentity/v1api20230131/storage/federated_identity_credential_types_gen.go +++ b/v2/api/managedidentity/v1api20230131/storage/federated_identity_credential_types_gen.go @@ -115,6 +115,10 @@ func (credential *FederatedIdentityCredential) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (credential *FederatedIdentityCredential) Owner() *genruntime.ResourceReference { + if credential.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(credential.Spec) return credential.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20230131/storage/user_assigned_identity_types_gen.go b/v2/api/managedidentity/v1api20230131/storage/user_assigned_identity_types_gen.go index 6b130b49122..5e696e7f207 100644 --- a/v2/api/managedidentity/v1api20230131/storage/user_assigned_identity_types_gen.go +++ b/v2/api/managedidentity/v1api20230131/storage/user_assigned_identity_types_gen.go @@ -146,6 +146,10 @@ func (identity *UserAssignedIdentity) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (identity *UserAssignedIdentity) Owner() *genruntime.ResourceReference { + if identity.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(identity.Spec) return identity.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/managedidentity/v1api20230131/user_assigned_identity_types_gen.go b/v2/api/managedidentity/v1api20230131/user_assigned_identity_types_gen.go index 5eca08e047e..8fbc51bce1a 100644 --- a/v2/api/managedidentity/v1api20230131/user_assigned_identity_types_gen.go +++ b/v2/api/managedidentity/v1api20230131/user_assigned_identity_types_gen.go @@ -204,6 +204,10 @@ func (identity *UserAssignedIdentity) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (identity *UserAssignedIdentity) Owner() *genruntime.ResourceReference { + if identity.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(identity.Spec) return identity.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/monitor/v1api20230403/account_types_gen.go b/v2/api/monitor/v1api20230403/account_types_gen.go index 42cadbece66..2d53cd9a27c 100644 --- a/v2/api/monitor/v1api20230403/account_types_gen.go +++ b/v2/api/monitor/v1api20230403/account_types_gen.go @@ -173,6 +173,10 @@ func (account *Account) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *Account) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/monitor/v1api20230403/storage/account_types_gen.go b/v2/api/monitor/v1api20230403/storage/account_types_gen.go index 70d559d264b..7b0de6d25c8 100644 --- a/v2/api/monitor/v1api20230403/storage/account_types_gen.go +++ b/v2/api/monitor/v1api20230403/storage/account_types_gen.go @@ -115,6 +115,10 @@ func (account *Account) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *Account) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network.frontdoor/v1api20220501/storage/web_application_firewall_policy_types_gen.go b/v2/api/network.frontdoor/v1api20220501/storage/web_application_firewall_policy_types_gen.go index 77910d20cc3..65e824aa7d3 100644 --- a/v2/api/network.frontdoor/v1api20220501/storage/web_application_firewall_policy_types_gen.go +++ b/v2/api/network.frontdoor/v1api20220501/storage/web_application_firewall_policy_types_gen.go @@ -115,6 +115,10 @@ func (policy *WebApplicationFirewallPolicy) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (policy *WebApplicationFirewallPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network.frontdoor/v1api20220501/web_application_firewall_policy_types_gen.go b/v2/api/network.frontdoor/v1api20220501/web_application_firewall_policy_types_gen.go index e0fa107b7ce..72bfac2cfc3 100644 --- a/v2/api/network.frontdoor/v1api20220501/web_application_firewall_policy_types_gen.go +++ b/v2/api/network.frontdoor/v1api20220501/web_application_firewall_policy_types_gen.go @@ -173,6 +173,10 @@ func (policy *WebApplicationFirewallPolicy) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (policy *WebApplicationFirewallPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zone_types_gen.go b/v2/api/network/v1api20180501/dns_zone_types_gen.go index dac60ea112c..e43bdf6eca9 100644 --- a/v2/api/network/v1api20180501/dns_zone_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zone_types_gen.go @@ -173,6 +173,10 @@ func (zone *DnsZone) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (zone *DnsZone) Owner() *genruntime.ResourceReference { + if zone.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(zone.Spec) return zone.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_a_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_a_record_types_gen.go index 016378b23bd..3af6486d453 100644 --- a/v2/api/network/v1api20180501/dns_zones_a_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_a_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesARecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_aaaa_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_aaaa_record_types_gen.go index c392353eef3..f79a146429c 100644 --- a/v2/api/network/v1api20180501/dns_zones_aaaa_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_aaaa_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesAAAARecord) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (record *DnsZonesAAAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_caa_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_caa_record_types_gen.go index ae02ba2584b..9e0b0af65ac 100644 --- a/v2/api/network/v1api20180501/dns_zones_caa_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_caa_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesCAARecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesCAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_cname_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_cname_record_types_gen.go index bfff8b85625..6a971fc8cf3 100644 --- a/v2/api/network/v1api20180501/dns_zones_cname_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_cname_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesCNAMERecord) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (record *DnsZonesCNAMERecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_mx_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_mx_record_types_gen.go index 48ff2169696..443ef4eb205 100644 --- a/v2/api/network/v1api20180501/dns_zones_mx_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_mx_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesMXRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesMXRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_ns_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_ns_record_types_gen.go index 95287b867e4..c7800081b7c 100644 --- a/v2/api/network/v1api20180501/dns_zones_ns_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_ns_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesNSRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesNSRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_ptr_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_ptr_record_types_gen.go index 65726daca18..81a1ea88cd4 100644 --- a/v2/api/network/v1api20180501/dns_zones_ptr_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_ptr_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesPTRRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesPTRRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_srv_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_srv_record_types_gen.go index 50f1ea52c2d..a42d6fe4e4a 100644 --- a/v2/api/network/v1api20180501/dns_zones_srv_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_srv_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesSRVRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesSRVRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/dns_zones_txt_record_types_gen.go b/v2/api/network/v1api20180501/dns_zones_txt_record_types_gen.go index c5e281ce957..b497ddf807e 100644 --- a/v2/api/network/v1api20180501/dns_zones_txt_record_types_gen.go +++ b/v2/api/network/v1api20180501/dns_zones_txt_record_types_gen.go @@ -173,6 +173,10 @@ func (record *DnsZonesTXTRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesTXTRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zone_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zone_types_gen.go index 5b52c6ed8ea..ad21eee0444 100644 --- a/v2/api/network/v1api20180501/storage/dns_zone_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zone_types_gen.go @@ -116,6 +116,10 @@ func (zone *DnsZone) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (zone *DnsZone) Owner() *genruntime.ResourceReference { + if zone.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(zone.Spec) return zone.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_a_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_a_record_types_gen.go index 72c4f09cf26..60b4d59ab7e 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_a_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_a_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesARecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_aaaa_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_aaaa_record_types_gen.go index 038bef4946d..e76740ee7f3 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_aaaa_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_aaaa_record_types_gen.go @@ -116,6 +116,10 @@ func (record *DnsZonesAAAARecord) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (record *DnsZonesAAAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_caa_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_caa_record_types_gen.go index e2aeda1f090..b356caf034a 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_caa_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_caa_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesCAARecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesCAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_cname_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_cname_record_types_gen.go index 301e8b5358b..3e117e00145 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_cname_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_cname_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesCNAMERecord) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (record *DnsZonesCNAMERecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_mx_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_mx_record_types_gen.go index 580e7944ba7..a17d36f0b59 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_mx_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_mx_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesMXRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesMXRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_ns_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_ns_record_types_gen.go index d89940de010..f29324f39e1 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_ns_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_ns_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesNSRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesNSRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_ptr_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_ptr_record_types_gen.go index fc815feecad..ae160a78911 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_ptr_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_ptr_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesPTRRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesPTRRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_srv_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_srv_record_types_gen.go index 8a3f505ed5c..3207da34f09 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_srv_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_srv_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesSRVRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesSRVRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180501/storage/dns_zones_txt_record_types_gen.go b/v2/api/network/v1api20180501/storage/dns_zones_txt_record_types_gen.go index fc9a79b19aa..29b9b822910 100644 --- a/v2/api/network/v1api20180501/storage/dns_zones_txt_record_types_gen.go +++ b/v2/api/network/v1api20180501/storage/dns_zones_txt_record_types_gen.go @@ -115,6 +115,10 @@ func (record *DnsZonesTXTRecord) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (record *DnsZonesTXTRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180901/private_dns_zone_types_gen.go b/v2/api/network/v1api20180901/private_dns_zone_types_gen.go index 913eeb15ddc..127a4584d04 100644 --- a/v2/api/network/v1api20180901/private_dns_zone_types_gen.go +++ b/v2/api/network/v1api20180901/private_dns_zone_types_gen.go @@ -176,6 +176,10 @@ func (zone *PrivateDnsZone) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (zone *PrivateDnsZone) Owner() *genruntime.ResourceReference { + if zone.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(zone.Spec) return zone.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20180901/storage/private_dns_zone_types_gen.go b/v2/api/network/v1api20180901/storage/private_dns_zone_types_gen.go index ecdc845b93f..03236beeab7 100644 --- a/v2/api/network/v1api20180901/storage/private_dns_zone_types_gen.go +++ b/v2/api/network/v1api20180901/storage/private_dns_zone_types_gen.go @@ -136,6 +136,10 @@ func (zone *PrivateDnsZone) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (zone *PrivateDnsZone) Owner() *genruntime.ResourceReference { + if zone.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(zone.Spec) return zone.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_a_record_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_a_record_types_gen.go index 656fcc29f3b..e4f7b762e76 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_a_record_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_a_record_types_gen.go @@ -176,6 +176,10 @@ func (record *PrivateDnsZonesARecord) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_aaaa_record_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_aaaa_record_types_gen.go index 0f595a7455c..7c710cbca56 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_aaaa_record_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_aaaa_record_types_gen.go @@ -176,6 +176,10 @@ func (record *PrivateDnsZonesAAAARecord) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesAAAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_cname_record_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_cname_record_types_gen.go index 3e022a7b5c8..aeb06b028e1 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_cname_record_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_cname_record_types_gen.go @@ -176,6 +176,10 @@ func (record *PrivateDnsZonesCNAMERecord) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesCNAMERecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_mx_record_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_mx_record_types_gen.go index a511a9ebf45..dbb95067302 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_mx_record_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_mx_record_types_gen.go @@ -176,6 +176,10 @@ func (record *PrivateDnsZonesMXRecord) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesMXRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_ptr_record_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_ptr_record_types_gen.go index 1af643e47d8..f0c09974fdf 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_ptr_record_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_ptr_record_types_gen.go @@ -176,6 +176,10 @@ func (record *PrivateDnsZonesPTRRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesPTRRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_srv_record_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_srv_record_types_gen.go index a7ce79f1052..9ec1a291e65 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_srv_record_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_srv_record_types_gen.go @@ -176,6 +176,10 @@ func (record *PrivateDnsZonesSRVRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesSRVRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_txt_record_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_txt_record_types_gen.go index 3ca2e7984f5..ef2675c2a65 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_txt_record_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_txt_record_types_gen.go @@ -176,6 +176,10 @@ func (record *PrivateDnsZonesTXTRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesTXTRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/private_dns_zones_virtual_network_link_types_gen.go b/v2/api/network/v1api20200601/private_dns_zones_virtual_network_link_types_gen.go index 9a6a6ad9f88..e5c18fea394 100644 --- a/v2/api/network/v1api20200601/private_dns_zones_virtual_network_link_types_gen.go +++ b/v2/api/network/v1api20200601/private_dns_zones_virtual_network_link_types_gen.go @@ -176,6 +176,10 @@ func (link *PrivateDnsZonesVirtualNetworkLink) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (link *PrivateDnsZonesVirtualNetworkLink) Owner() *genruntime.ResourceReference { + if link.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(link.Spec) return link.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_a_record_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_a_record_types_gen.go index 40a9ae27cf2..6c9156773fe 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_a_record_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_a_record_types_gen.go @@ -136,6 +136,10 @@ func (record *PrivateDnsZonesARecord) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_aaaa_record_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_aaaa_record_types_gen.go index 49e8d7a41c4..17d8fc28ea9 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_aaaa_record_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_aaaa_record_types_gen.go @@ -136,6 +136,10 @@ func (record *PrivateDnsZonesAAAARecord) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesAAAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_cname_record_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_cname_record_types_gen.go index 8ede12dfbdf..b4d1183083e 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_cname_record_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_cname_record_types_gen.go @@ -136,6 +136,10 @@ func (record *PrivateDnsZonesCNAMERecord) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesCNAMERecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_mx_record_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_mx_record_types_gen.go index c4cbf8476d9..410897a383d 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_mx_record_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_mx_record_types_gen.go @@ -136,6 +136,10 @@ func (record *PrivateDnsZonesMXRecord) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesMXRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_ptr_record_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_ptr_record_types_gen.go index 982cb01ce73..63b0bae5c88 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_ptr_record_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_ptr_record_types_gen.go @@ -136,6 +136,10 @@ func (record *PrivateDnsZonesPTRRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesPTRRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_srv_record_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_srv_record_types_gen.go index 7d2c075bc51..9207e303b1e 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_srv_record_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_srv_record_types_gen.go @@ -136,6 +136,10 @@ func (record *PrivateDnsZonesSRVRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesSRVRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_txt_record_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_txt_record_types_gen.go index d08012f8b77..fecf311145d 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_txt_record_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_txt_record_types_gen.go @@ -136,6 +136,10 @@ func (record *PrivateDnsZonesTXTRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesTXTRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20200601/storage/private_dns_zones_virtual_network_link_types_gen.go b/v2/api/network/v1api20200601/storage/private_dns_zones_virtual_network_link_types_gen.go index b6b2c76972b..50d1dde5ac6 100644 --- a/v2/api/network/v1api20200601/storage/private_dns_zones_virtual_network_link_types_gen.go +++ b/v2/api/network/v1api20200601/storage/private_dns_zones_virtual_network_link_types_gen.go @@ -140,6 +140,10 @@ func (link *PrivateDnsZonesVirtualNetworkLink) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (link *PrivateDnsZonesVirtualNetworkLink) Owner() *genruntime.ResourceReference { + if link.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(link.Spec) return link.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/load_balancer_types_gen.go b/v2/api/network/v1api20201101/load_balancer_types_gen.go index 549efee3fd4..96361a4aa10 100644 --- a/v2/api/network/v1api20201101/load_balancer_types_gen.go +++ b/v2/api/network/v1api20201101/load_balancer_types_gen.go @@ -176,6 +176,10 @@ func (balancer *LoadBalancer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (balancer *LoadBalancer) Owner() *genruntime.ResourceReference { + if balancer.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(balancer.Spec) return balancer.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/load_balancers_inbound_nat_rule_types_gen.go b/v2/api/network/v1api20201101/load_balancers_inbound_nat_rule_types_gen.go index 65997511e2f..ca6f8baa92d 100644 --- a/v2/api/network/v1api20201101/load_balancers_inbound_nat_rule_types_gen.go +++ b/v2/api/network/v1api20201101/load_balancers_inbound_nat_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *LoadBalancersInboundNatRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *LoadBalancersInboundNatRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/network_interface_types_gen.go b/v2/api/network/v1api20201101/network_interface_types_gen.go index d65a71bdd81..c0c0b01105b 100644 --- a/v2/api/network/v1api20201101/network_interface_types_gen.go +++ b/v2/api/network/v1api20201101/network_interface_types_gen.go @@ -176,6 +176,10 @@ func (networkInterface *NetworkInterface) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (networkInterface *NetworkInterface) Owner() *genruntime.ResourceReference { + if networkInterface.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(networkInterface.Spec) return networkInterface.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/network_security_group_types_gen.go b/v2/api/network/v1api20201101/network_security_group_types_gen.go index fa9c4342075..964b26c1870 100644 --- a/v2/api/network/v1api20201101/network_security_group_types_gen.go +++ b/v2/api/network/v1api20201101/network_security_group_types_gen.go @@ -176,6 +176,10 @@ func (group *NetworkSecurityGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *NetworkSecurityGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20201101/network_security_groups_security_rule_types_gen.go b/v2/api/network/v1api20201101/network_security_groups_security_rule_types_gen.go index ab92c97527b..2d6ce42d03b 100644 --- a/v2/api/network/v1api20201101/network_security_groups_security_rule_types_gen.go +++ b/v2/api/network/v1api20201101/network_security_groups_security_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *NetworkSecurityGroupsSecurityRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NetworkSecurityGroupsSecurityRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/public_ip_address_types_gen.go b/v2/api/network/v1api20201101/public_ip_address_types_gen.go index bc7df156359..14e76d33830 100644 --- a/v2/api/network/v1api20201101/public_ip_address_types_gen.go +++ b/v2/api/network/v1api20201101/public_ip_address_types_gen.go @@ -176,6 +176,10 @@ func (address *PublicIPAddress) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (address *PublicIPAddress) Owner() *genruntime.ResourceReference { + if address.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(address.Spec) return address.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/route_table_types_gen.go b/v2/api/network/v1api20201101/route_table_types_gen.go index c7344762a98..759ef3f1c58 100644 --- a/v2/api/network/v1api20201101/route_table_types_gen.go +++ b/v2/api/network/v1api20201101/route_table_types_gen.go @@ -176,6 +176,10 @@ func (table *RouteTable) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (table *RouteTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/route_tables_route_types_gen.go b/v2/api/network/v1api20201101/route_tables_route_types_gen.go index 9f9ad060b98..983fc7fcf3e 100644 --- a/v2/api/network/v1api20201101/route_tables_route_types_gen.go +++ b/v2/api/network/v1api20201101/route_tables_route_types_gen.go @@ -176,6 +176,10 @@ func (route *RouteTablesRoute) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (route *RouteTablesRoute) Owner() *genruntime.ResourceReference { + if route.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(route.Spec) return route.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/load_balancer_types_gen.go b/v2/api/network/v1api20201101/storage/load_balancer_types_gen.go index c7076576e1d..4cf85127658 100644 --- a/v2/api/network/v1api20201101/storage/load_balancer_types_gen.go +++ b/v2/api/network/v1api20201101/storage/load_balancer_types_gen.go @@ -138,6 +138,10 @@ func (balancer *LoadBalancer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (balancer *LoadBalancer) Owner() *genruntime.ResourceReference { + if balancer.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(balancer.Spec) return balancer.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/load_balancers_inbound_nat_rule_types_gen.go b/v2/api/network/v1api20201101/storage/load_balancers_inbound_nat_rule_types_gen.go index d8106096e51..c05e527a916 100644 --- a/v2/api/network/v1api20201101/storage/load_balancers_inbound_nat_rule_types_gen.go +++ b/v2/api/network/v1api20201101/storage/load_balancers_inbound_nat_rule_types_gen.go @@ -138,6 +138,10 @@ func (rule *LoadBalancersInboundNatRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *LoadBalancersInboundNatRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/network_interface_types_gen.go b/v2/api/network/v1api20201101/storage/network_interface_types_gen.go index 64fb2aa8c64..50d8622dab7 100644 --- a/v2/api/network/v1api20201101/storage/network_interface_types_gen.go +++ b/v2/api/network/v1api20201101/storage/network_interface_types_gen.go @@ -138,6 +138,10 @@ func (networkInterface *NetworkInterface) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (networkInterface *NetworkInterface) Owner() *genruntime.ResourceReference { + if networkInterface.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(networkInterface.Spec) return networkInterface.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/network_security_group_types_gen.go b/v2/api/network/v1api20201101/storage/network_security_group_types_gen.go index fba72d3fd8a..4f8bba7601e 100644 --- a/v2/api/network/v1api20201101/storage/network_security_group_types_gen.go +++ b/v2/api/network/v1api20201101/storage/network_security_group_types_gen.go @@ -136,6 +136,10 @@ func (group *NetworkSecurityGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *NetworkSecurityGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20201101/storage/network_security_groups_security_rule_types_gen.go b/v2/api/network/v1api20201101/storage/network_security_groups_security_rule_types_gen.go index 45178915072..eead0045cd6 100644 --- a/v2/api/network/v1api20201101/storage/network_security_groups_security_rule_types_gen.go +++ b/v2/api/network/v1api20201101/storage/network_security_groups_security_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *NetworkSecurityGroupsSecurityRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NetworkSecurityGroupsSecurityRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/public_ip_address_types_gen.go b/v2/api/network/v1api20201101/storage/public_ip_address_types_gen.go index 522b16b2ba4..e1455dd96ea 100644 --- a/v2/api/network/v1api20201101/storage/public_ip_address_types_gen.go +++ b/v2/api/network/v1api20201101/storage/public_ip_address_types_gen.go @@ -138,6 +138,10 @@ func (address *PublicIPAddress) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (address *PublicIPAddress) Owner() *genruntime.ResourceReference { + if address.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(address.Spec) return address.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/route_table_types_gen.go b/v2/api/network/v1api20201101/storage/route_table_types_gen.go index abf5626be32..a94ae978859 100644 --- a/v2/api/network/v1api20201101/storage/route_table_types_gen.go +++ b/v2/api/network/v1api20201101/storage/route_table_types_gen.go @@ -136,6 +136,10 @@ func (table *RouteTable) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (table *RouteTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/route_tables_route_types_gen.go b/v2/api/network/v1api20201101/storage/route_tables_route_types_gen.go index 7bb4269090c..1d0a52bd439 100644 --- a/v2/api/network/v1api20201101/storage/route_tables_route_types_gen.go +++ b/v2/api/network/v1api20201101/storage/route_tables_route_types_gen.go @@ -136,6 +136,10 @@ func (route *RouteTablesRoute) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (route *RouteTablesRoute) Owner() *genruntime.ResourceReference { + if route.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(route.Spec) return route.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/virtual_network_gateway_types_gen.go b/v2/api/network/v1api20201101/storage/virtual_network_gateway_types_gen.go index 736b3952007..b6b11f94408 100644 --- a/v2/api/network/v1api20201101/storage/virtual_network_gateway_types_gen.go +++ b/v2/api/network/v1api20201101/storage/virtual_network_gateway_types_gen.go @@ -138,6 +138,10 @@ func (gateway *VirtualNetworkGateway) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (gateway *VirtualNetworkGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/virtual_network_types_gen.go b/v2/api/network/v1api20201101/storage/virtual_network_types_gen.go index 4343b8ad0ec..0738625526c 100644 --- a/v2/api/network/v1api20201101/storage/virtual_network_types_gen.go +++ b/v2/api/network/v1api20201101/storage/virtual_network_types_gen.go @@ -138,6 +138,10 @@ func (network *VirtualNetwork) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (network *VirtualNetwork) Owner() *genruntime.ResourceReference { + if network.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(network.Spec) return network.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/virtual_networks_subnet_types_gen.go b/v2/api/network/v1api20201101/storage/virtual_networks_subnet_types_gen.go index 1a7b5d85281..35a6ca048e4 100644 --- a/v2/api/network/v1api20201101/storage/virtual_networks_subnet_types_gen.go +++ b/v2/api/network/v1api20201101/storage/virtual_networks_subnet_types_gen.go @@ -138,6 +138,10 @@ func (subnet *VirtualNetworksSubnet) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (subnet *VirtualNetworksSubnet) Owner() *genruntime.ResourceReference { + if subnet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subnet.Spec) return subnet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/storage/virtual_networks_virtual_network_peering_types_gen.go b/v2/api/network/v1api20201101/storage/virtual_networks_virtual_network_peering_types_gen.go index ea6d8132d9e..a1686202421 100644 --- a/v2/api/network/v1api20201101/storage/virtual_networks_virtual_network_peering_types_gen.go +++ b/v2/api/network/v1api20201101/storage/virtual_networks_virtual_network_peering_types_gen.go @@ -138,6 +138,10 @@ func (peering *VirtualNetworksVirtualNetworkPeering) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (peering *VirtualNetworksVirtualNetworkPeering) Owner() *genruntime.ResourceReference { + if peering.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(peering.Spec) return peering.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/virtual_network_gateway_types_gen.go b/v2/api/network/v1api20201101/virtual_network_gateway_types_gen.go index f9222d8aba6..2c43f80e2aa 100644 --- a/v2/api/network/v1api20201101/virtual_network_gateway_types_gen.go +++ b/v2/api/network/v1api20201101/virtual_network_gateway_types_gen.go @@ -176,6 +176,10 @@ func (gateway *VirtualNetworkGateway) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (gateway *VirtualNetworkGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/virtual_network_types_gen.go b/v2/api/network/v1api20201101/virtual_network_types_gen.go index 74b3439902b..08d0fb881f9 100644 --- a/v2/api/network/v1api20201101/virtual_network_types_gen.go +++ b/v2/api/network/v1api20201101/virtual_network_types_gen.go @@ -176,6 +176,10 @@ func (network *VirtualNetwork) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (network *VirtualNetwork) Owner() *genruntime.ResourceReference { + if network.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(network.Spec) return network.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/virtual_networks_subnet_types_gen.go b/v2/api/network/v1api20201101/virtual_networks_subnet_types_gen.go index 6bf1ea19fc8..123305d333e 100644 --- a/v2/api/network/v1api20201101/virtual_networks_subnet_types_gen.go +++ b/v2/api/network/v1api20201101/virtual_networks_subnet_types_gen.go @@ -176,6 +176,10 @@ func (subnet *VirtualNetworksSubnet) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (subnet *VirtualNetworksSubnet) Owner() *genruntime.ResourceReference { + if subnet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subnet.Spec) return subnet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20201101/virtual_networks_virtual_network_peering_types_gen.go b/v2/api/network/v1api20201101/virtual_networks_virtual_network_peering_types_gen.go index d445ba3fe65..3400fcde9c2 100644 --- a/v2/api/network/v1api20201101/virtual_networks_virtual_network_peering_types_gen.go +++ b/v2/api/network/v1api20201101/virtual_networks_virtual_network_peering_types_gen.go @@ -176,6 +176,10 @@ func (peering *VirtualNetworksVirtualNetworkPeering) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (peering *VirtualNetworksVirtualNetworkPeering) Owner() *genruntime.ResourceReference { + if peering.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(peering.Spec) return peering.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/storage/traffic_manager_profile_types_gen.go b/v2/api/network/v1api20220401/storage/traffic_manager_profile_types_gen.go index 8b1c20fd8fe..4f5ba5b4784 100644 --- a/v2/api/network/v1api20220401/storage/traffic_manager_profile_types_gen.go +++ b/v2/api/network/v1api20220401/storage/traffic_manager_profile_types_gen.go @@ -138,6 +138,10 @@ func (profile *TrafficManagerProfile) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (profile *TrafficManagerProfile) Owner() *genruntime.ResourceReference { + if profile.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(profile.Spec) return profile.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/storage/traffic_manager_profiles_azure_endpoint_types_gen.go b/v2/api/network/v1api20220401/storage/traffic_manager_profiles_azure_endpoint_types_gen.go index 501ca634737..d823093c603 100644 --- a/v2/api/network/v1api20220401/storage/traffic_manager_profiles_azure_endpoint_types_gen.go +++ b/v2/api/network/v1api20220401/storage/traffic_manager_profiles_azure_endpoint_types_gen.go @@ -115,6 +115,10 @@ func (endpoint *TrafficManagerProfilesAzureEndpoint) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (endpoint *TrafficManagerProfilesAzureEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/storage/traffic_manager_profiles_external_endpoint_types_gen.go b/v2/api/network/v1api20220401/storage/traffic_manager_profiles_external_endpoint_types_gen.go index aeb6c3fef53..e7d776643f4 100644 --- a/v2/api/network/v1api20220401/storage/traffic_manager_profiles_external_endpoint_types_gen.go +++ b/v2/api/network/v1api20220401/storage/traffic_manager_profiles_external_endpoint_types_gen.go @@ -115,6 +115,10 @@ func (endpoint *TrafficManagerProfilesExternalEndpoint) NewEmptyStatus() genrunt // Owner returns the ResourceReference of the owner func (endpoint *TrafficManagerProfilesExternalEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/storage/traffic_manager_profiles_nested_endpoint_types_gen.go b/v2/api/network/v1api20220401/storage/traffic_manager_profiles_nested_endpoint_types_gen.go index 66f990135e1..44865a60640 100644 --- a/v2/api/network/v1api20220401/storage/traffic_manager_profiles_nested_endpoint_types_gen.go +++ b/v2/api/network/v1api20220401/storage/traffic_manager_profiles_nested_endpoint_types_gen.go @@ -115,6 +115,10 @@ func (endpoint *TrafficManagerProfilesNestedEndpoint) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (endpoint *TrafficManagerProfilesNestedEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/traffic_manager_profile_types_gen.go b/v2/api/network/v1api20220401/traffic_manager_profile_types_gen.go index 66a46831525..0c84f9c2494 100644 --- a/v2/api/network/v1api20220401/traffic_manager_profile_types_gen.go +++ b/v2/api/network/v1api20220401/traffic_manager_profile_types_gen.go @@ -196,6 +196,10 @@ func (profile *TrafficManagerProfile) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (profile *TrafficManagerProfile) Owner() *genruntime.ResourceReference { + if profile.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(profile.Spec) return profile.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/traffic_manager_profiles_azure_endpoint_types_gen.go b/v2/api/network/v1api20220401/traffic_manager_profiles_azure_endpoint_types_gen.go index e5ee306e5da..f2e37860212 100644 --- a/v2/api/network/v1api20220401/traffic_manager_profiles_azure_endpoint_types_gen.go +++ b/v2/api/network/v1api20220401/traffic_manager_profiles_azure_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *TrafficManagerProfilesAzureEndpoint) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (endpoint *TrafficManagerProfilesAzureEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/traffic_manager_profiles_external_endpoint_types_gen.go b/v2/api/network/v1api20220401/traffic_manager_profiles_external_endpoint_types_gen.go index 0bb0ca4fef0..e3ab2808ca1 100644 --- a/v2/api/network/v1api20220401/traffic_manager_profiles_external_endpoint_types_gen.go +++ b/v2/api/network/v1api20220401/traffic_manager_profiles_external_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *TrafficManagerProfilesExternalEndpoint) NewEmptyStatus() genrunt // Owner returns the ResourceReference of the owner func (endpoint *TrafficManagerProfilesExternalEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220401/traffic_manager_profiles_nested_endpoint_types_gen.go b/v2/api/network/v1api20220401/traffic_manager_profiles_nested_endpoint_types_gen.go index 24a5f122e47..1ad470f7505 100644 --- a/v2/api/network/v1api20220401/traffic_manager_profiles_nested_endpoint_types_gen.go +++ b/v2/api/network/v1api20220401/traffic_manager_profiles_nested_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *TrafficManagerProfilesNestedEndpoint) NewEmptyStatus() genruntim // Owner returns the ResourceReference of the owner func (endpoint *TrafficManagerProfilesNestedEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/application_gateway_types_gen.go b/v2/api/network/v1api20220701/application_gateway_types_gen.go index 16899445d23..44a65410443 100644 --- a/v2/api/network/v1api20220701/application_gateway_types_gen.go +++ b/v2/api/network/v1api20220701/application_gateway_types_gen.go @@ -173,6 +173,10 @@ func (gateway *ApplicationGateway) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (gateway *ApplicationGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/bastion_host_types_gen.go b/v2/api/network/v1api20220701/bastion_host_types_gen.go index 46735807af5..fa197408772 100644 --- a/v2/api/network/v1api20220701/bastion_host_types_gen.go +++ b/v2/api/network/v1api20220701/bastion_host_types_gen.go @@ -176,6 +176,10 @@ func (host *BastionHost) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (host *BastionHost) Owner() *genruntime.ResourceReference { + if host.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(host.Spec) return host.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/dns_forwarding_rule_sets_forwarding_rule_types_gen.go b/v2/api/network/v1api20220701/dns_forwarding_rule_sets_forwarding_rule_types_gen.go index 87346f922cd..f59e14bf27e 100644 --- a/v2/api/network/v1api20220701/dns_forwarding_rule_sets_forwarding_rule_types_gen.go +++ b/v2/api/network/v1api20220701/dns_forwarding_rule_sets_forwarding_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *DnsForwardingRuleSetsForwardingRule) NewEmptyStatus() genruntime.Con // Owner returns the ResourceReference of the owner func (rule *DnsForwardingRuleSetsForwardingRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/dns_forwarding_rule_sets_virtual_network_link_types_gen.go b/v2/api/network/v1api20220701/dns_forwarding_rule_sets_virtual_network_link_types_gen.go index 0112cf33293..905e33d5a6c 100644 --- a/v2/api/network/v1api20220701/dns_forwarding_rule_sets_virtual_network_link_types_gen.go +++ b/v2/api/network/v1api20220701/dns_forwarding_rule_sets_virtual_network_link_types_gen.go @@ -173,6 +173,10 @@ func (link *DnsForwardingRuleSetsVirtualNetworkLink) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (link *DnsForwardingRuleSetsVirtualNetworkLink) Owner() *genruntime.ResourceReference { + if link.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(link.Spec) return link.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/dns_forwarding_ruleset_types_gen.go b/v2/api/network/v1api20220701/dns_forwarding_ruleset_types_gen.go index 89d0c751135..0e9087e9c44 100644 --- a/v2/api/network/v1api20220701/dns_forwarding_ruleset_types_gen.go +++ b/v2/api/network/v1api20220701/dns_forwarding_ruleset_types_gen.go @@ -173,6 +173,10 @@ func (ruleset *DnsForwardingRuleset) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (ruleset *DnsForwardingRuleset) Owner() *genruntime.ResourceReference { + if ruleset.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(ruleset.Spec) return ruleset.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/dns_resolver_types_gen.go b/v2/api/network/v1api20220701/dns_resolver_types_gen.go index d0dde495cfd..b516f982238 100644 --- a/v2/api/network/v1api20220701/dns_resolver_types_gen.go +++ b/v2/api/network/v1api20220701/dns_resolver_types_gen.go @@ -173,6 +173,10 @@ func (resolver *DnsResolver) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (resolver *DnsResolver) Owner() *genruntime.ResourceReference { + if resolver.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resolver.Spec) return resolver.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/dns_resolvers_inbound_endpoint_types_gen.go b/v2/api/network/v1api20220701/dns_resolvers_inbound_endpoint_types_gen.go index 25ae8417959..2bf1f7ef2bc 100644 --- a/v2/api/network/v1api20220701/dns_resolvers_inbound_endpoint_types_gen.go +++ b/v2/api/network/v1api20220701/dns_resolvers_inbound_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *DnsResolversInboundEndpoint) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (endpoint *DnsResolversInboundEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/dns_resolvers_outbound_endpoint_types_gen.go b/v2/api/network/v1api20220701/dns_resolvers_outbound_endpoint_types_gen.go index 1d9d524b7a0..df3cbaab85e 100644 --- a/v2/api/network/v1api20220701/dns_resolvers_outbound_endpoint_types_gen.go +++ b/v2/api/network/v1api20220701/dns_resolvers_outbound_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *DnsResolversOutboundEndpoint) NewEmptyStatus() genruntime.Conver // Owner returns the ResourceReference of the owner func (endpoint *DnsResolversOutboundEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/nat_gateway_types_gen.go b/v2/api/network/v1api20220701/nat_gateway_types_gen.go index 2592e2217dd..0410ae9b71b 100644 --- a/v2/api/network/v1api20220701/nat_gateway_types_gen.go +++ b/v2/api/network/v1api20220701/nat_gateway_types_gen.go @@ -176,6 +176,10 @@ func (gateway *NatGateway) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (gateway *NatGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/private_endpoint_types_gen.go b/v2/api/network/v1api20220701/private_endpoint_types_gen.go index ba8052e02e4..bfa11bbc92c 100644 --- a/v2/api/network/v1api20220701/private_endpoint_types_gen.go +++ b/v2/api/network/v1api20220701/private_endpoint_types_gen.go @@ -176,6 +176,10 @@ func (endpoint *PrivateEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (endpoint *PrivateEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/private_endpoints_private_dns_zone_group_types_gen.go b/v2/api/network/v1api20220701/private_endpoints_private_dns_zone_group_types_gen.go index d98a7b48a2f..50d4081e28d 100644 --- a/v2/api/network/v1api20220701/private_endpoints_private_dns_zone_group_types_gen.go +++ b/v2/api/network/v1api20220701/private_endpoints_private_dns_zone_group_types_gen.go @@ -176,6 +176,10 @@ func (group *PrivateEndpointsPrivateDnsZoneGroup) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (group *PrivateEndpointsPrivateDnsZoneGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20220701/private_link_service_types_gen.go b/v2/api/network/v1api20220701/private_link_service_types_gen.go index d77a1f5451b..8ddf9ba8666 100644 --- a/v2/api/network/v1api20220701/private_link_service_types_gen.go +++ b/v2/api/network/v1api20220701/private_link_service_types_gen.go @@ -197,6 +197,10 @@ func (service *PrivateLinkService) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (service *PrivateLinkService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/public_ip_prefix_types_gen.go b/v2/api/network/v1api20220701/public_ip_prefix_types_gen.go index 377368aaa75..04419b7a2b9 100644 --- a/v2/api/network/v1api20220701/public_ip_prefix_types_gen.go +++ b/v2/api/network/v1api20220701/public_ip_prefix_types_gen.go @@ -176,6 +176,10 @@ func (prefix *PublicIPPrefix) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (prefix *PublicIPPrefix) Owner() *genruntime.ResourceReference { + if prefix.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(prefix.Spec) return prefix.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/application_gateway_types_gen.go b/v2/api/network/v1api20220701/storage/application_gateway_types_gen.go index 2baa4c113e7..83cc1f97df4 100644 --- a/v2/api/network/v1api20220701/storage/application_gateway_types_gen.go +++ b/v2/api/network/v1api20220701/storage/application_gateway_types_gen.go @@ -117,6 +117,10 @@ func (gateway *ApplicationGateway) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (gateway *ApplicationGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/bastion_host_types_gen.go b/v2/api/network/v1api20220701/storage/bastion_host_types_gen.go index c0ba1d2c076..7f4b7af3200 100644 --- a/v2/api/network/v1api20220701/storage/bastion_host_types_gen.go +++ b/v2/api/network/v1api20220701/storage/bastion_host_types_gen.go @@ -136,6 +136,10 @@ func (host *BastionHost) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (host *BastionHost) Owner() *genruntime.ResourceReference { + if host.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(host.Spec) return host.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_forwarding_rule_types_gen.go b/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_forwarding_rule_types_gen.go index 2202ecc1bd8..03d666c516b 100644 --- a/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_forwarding_rule_types_gen.go +++ b/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_forwarding_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *DnsForwardingRuleSetsForwardingRule) NewEmptyStatus() genruntime.Con // Owner returns the ResourceReference of the owner func (rule *DnsForwardingRuleSetsForwardingRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_virtual_network_link_types_gen.go b/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_virtual_network_link_types_gen.go index d4647681a98..95c3cbc6d03 100644 --- a/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_virtual_network_link_types_gen.go +++ b/v2/api/network/v1api20220701/storage/dns_forwarding_rule_sets_virtual_network_link_types_gen.go @@ -115,6 +115,10 @@ func (link *DnsForwardingRuleSetsVirtualNetworkLink) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (link *DnsForwardingRuleSetsVirtualNetworkLink) Owner() *genruntime.ResourceReference { + if link.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(link.Spec) return link.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/dns_forwarding_ruleset_types_gen.go b/v2/api/network/v1api20220701/storage/dns_forwarding_ruleset_types_gen.go index 04c950d959f..48d4682ac6a 100644 --- a/v2/api/network/v1api20220701/storage/dns_forwarding_ruleset_types_gen.go +++ b/v2/api/network/v1api20220701/storage/dns_forwarding_ruleset_types_gen.go @@ -115,6 +115,10 @@ func (ruleset *DnsForwardingRuleset) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (ruleset *DnsForwardingRuleset) Owner() *genruntime.ResourceReference { + if ruleset.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(ruleset.Spec) return ruleset.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/dns_resolver_types_gen.go b/v2/api/network/v1api20220701/storage/dns_resolver_types_gen.go index dff0a13fc9b..11465352f04 100644 --- a/v2/api/network/v1api20220701/storage/dns_resolver_types_gen.go +++ b/v2/api/network/v1api20220701/storage/dns_resolver_types_gen.go @@ -115,6 +115,10 @@ func (resolver *DnsResolver) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (resolver *DnsResolver) Owner() *genruntime.ResourceReference { + if resolver.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resolver.Spec) return resolver.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/dns_resolvers_inbound_endpoint_types_gen.go b/v2/api/network/v1api20220701/storage/dns_resolvers_inbound_endpoint_types_gen.go index 6675cede700..0b17ca1e8b6 100644 --- a/v2/api/network/v1api20220701/storage/dns_resolvers_inbound_endpoint_types_gen.go +++ b/v2/api/network/v1api20220701/storage/dns_resolvers_inbound_endpoint_types_gen.go @@ -115,6 +115,10 @@ func (endpoint *DnsResolversInboundEndpoint) NewEmptyStatus() genruntime.Convert // Owner returns the ResourceReference of the owner func (endpoint *DnsResolversInboundEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/dns_resolvers_outbound_endpoint_types_gen.go b/v2/api/network/v1api20220701/storage/dns_resolvers_outbound_endpoint_types_gen.go index 38b66943dd0..d376fba2b60 100644 --- a/v2/api/network/v1api20220701/storage/dns_resolvers_outbound_endpoint_types_gen.go +++ b/v2/api/network/v1api20220701/storage/dns_resolvers_outbound_endpoint_types_gen.go @@ -115,6 +115,10 @@ func (endpoint *DnsResolversOutboundEndpoint) NewEmptyStatus() genruntime.Conver // Owner returns the ResourceReference of the owner func (endpoint *DnsResolversOutboundEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/nat_gateway_types_gen.go b/v2/api/network/v1api20220701/storage/nat_gateway_types_gen.go index b0d35bc0bdb..b1b7cd53685 100644 --- a/v2/api/network/v1api20220701/storage/nat_gateway_types_gen.go +++ b/v2/api/network/v1api20220701/storage/nat_gateway_types_gen.go @@ -137,6 +137,10 @@ func (gateway *NatGateway) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (gateway *NatGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/private_endpoint_types_gen.go b/v2/api/network/v1api20220701/storage/private_endpoint_types_gen.go index 2dd868f7ba9..0411fb904ec 100644 --- a/v2/api/network/v1api20220701/storage/private_endpoint_types_gen.go +++ b/v2/api/network/v1api20220701/storage/private_endpoint_types_gen.go @@ -136,6 +136,10 @@ func (endpoint *PrivateEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (endpoint *PrivateEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/private_endpoints_private_dns_zone_group_types_gen.go b/v2/api/network/v1api20220701/storage/private_endpoints_private_dns_zone_group_types_gen.go index 629056e30d5..c5895396a4e 100644 --- a/v2/api/network/v1api20220701/storage/private_endpoints_private_dns_zone_group_types_gen.go +++ b/v2/api/network/v1api20220701/storage/private_endpoints_private_dns_zone_group_types_gen.go @@ -136,6 +136,10 @@ func (group *PrivateEndpointsPrivateDnsZoneGroup) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (group *PrivateEndpointsPrivateDnsZoneGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20220701/storage/private_link_service_types_gen.go b/v2/api/network/v1api20220701/storage/private_link_service_types_gen.go index d6a583a9ad8..ef8dacb2e6a 100644 --- a/v2/api/network/v1api20220701/storage/private_link_service_types_gen.go +++ b/v2/api/network/v1api20220701/storage/private_link_service_types_gen.go @@ -157,6 +157,10 @@ func (service *PrivateLinkService) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (service *PrivateLinkService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20220701/storage/public_ip_prefix_types_gen.go b/v2/api/network/v1api20220701/storage/public_ip_prefix_types_gen.go index 77011e4fbea..535d5f02571 100644 --- a/v2/api/network/v1api20220701/storage/public_ip_prefix_types_gen.go +++ b/v2/api/network/v1api20220701/storage/public_ip_prefix_types_gen.go @@ -137,6 +137,10 @@ func (prefix *PublicIPPrefix) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (prefix *PublicIPPrefix) Owner() *genruntime.ResourceReference { + if prefix.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(prefix.Spec) return prefix.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240101/application_security_group_types_gen.go b/v2/api/network/v1api20240101/application_security_group_types_gen.go index 54a4758a49a..fc77a7afe95 100644 --- a/v2/api/network/v1api20240101/application_security_group_types_gen.go +++ b/v2/api/network/v1api20240101/application_security_group_types_gen.go @@ -173,6 +173,10 @@ func (group *ApplicationSecurityGroup) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (group *ApplicationSecurityGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20240101/storage/application_security_group_types_gen.go b/v2/api/network/v1api20240101/storage/application_security_group_types_gen.go index fec75757559..23a2040c373 100644 --- a/v2/api/network/v1api20240101/storage/application_security_group_types_gen.go +++ b/v2/api/network/v1api20240101/storage/application_security_group_types_gen.go @@ -115,6 +115,10 @@ func (group *ApplicationSecurityGroup) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (group *ApplicationSecurityGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20240101/storage/web_application_firewall_policy_types_gen.go b/v2/api/network/v1api20240101/storage/web_application_firewall_policy_types_gen.go index bc24871aa3e..870dc9a8714 100644 --- a/v2/api/network/v1api20240101/storage/web_application_firewall_policy_types_gen.go +++ b/v2/api/network/v1api20240101/storage/web_application_firewall_policy_types_gen.go @@ -116,6 +116,10 @@ func (policy *WebApplicationFirewallPolicy) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (policy *WebApplicationFirewallPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240101/web_application_firewall_policy_types_gen.go b/v2/api/network/v1api20240101/web_application_firewall_policy_types_gen.go index 4b1dad25bc7..7c58972fee0 100644 --- a/v2/api/network/v1api20240101/web_application_firewall_policy_types_gen.go +++ b/v2/api/network/v1api20240101/web_application_firewall_policy_types_gen.go @@ -173,6 +173,10 @@ func (policy *WebApplicationFirewallPolicy) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (policy *WebApplicationFirewallPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/bastion_host_types_gen.go b/v2/api/network/v1api20240301/bastion_host_types_gen.go index 5bac5d89882..bb284d2094e 100644 --- a/v2/api/network/v1api20240301/bastion_host_types_gen.go +++ b/v2/api/network/v1api20240301/bastion_host_types_gen.go @@ -173,6 +173,10 @@ func (host *BastionHost) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (host *BastionHost) Owner() *genruntime.ResourceReference { + if host.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(host.Spec) return host.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/load_balancer_types_gen.go b/v2/api/network/v1api20240301/load_balancer_types_gen.go index 67b227d17c0..33fad57f2fb 100644 --- a/v2/api/network/v1api20240301/load_balancer_types_gen.go +++ b/v2/api/network/v1api20240301/load_balancer_types_gen.go @@ -173,6 +173,10 @@ func (balancer *LoadBalancer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (balancer *LoadBalancer) Owner() *genruntime.ResourceReference { + if balancer.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(balancer.Spec) return balancer.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/load_balancers_inbound_nat_rule_types_gen.go b/v2/api/network/v1api20240301/load_balancers_inbound_nat_rule_types_gen.go index 3e78da751fd..07cbb1cca4b 100644 --- a/v2/api/network/v1api20240301/load_balancers_inbound_nat_rule_types_gen.go +++ b/v2/api/network/v1api20240301/load_balancers_inbound_nat_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *LoadBalancersInboundNatRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *LoadBalancersInboundNatRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/nat_gateway_types_gen.go b/v2/api/network/v1api20240301/nat_gateway_types_gen.go index 464916c2546..d8093dded10 100644 --- a/v2/api/network/v1api20240301/nat_gateway_types_gen.go +++ b/v2/api/network/v1api20240301/nat_gateway_types_gen.go @@ -173,6 +173,10 @@ func (gateway *NatGateway) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (gateway *NatGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/network_interface_types_gen.go b/v2/api/network/v1api20240301/network_interface_types_gen.go index 2cb2fb661ff..73cf87ab17d 100644 --- a/v2/api/network/v1api20240301/network_interface_types_gen.go +++ b/v2/api/network/v1api20240301/network_interface_types_gen.go @@ -173,6 +173,10 @@ func (networkInterface *NetworkInterface) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (networkInterface *NetworkInterface) Owner() *genruntime.ResourceReference { + if networkInterface.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(networkInterface.Spec) return networkInterface.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/network_security_group_types_gen.go b/v2/api/network/v1api20240301/network_security_group_types_gen.go index 6ac8115fc86..758b63da938 100644 --- a/v2/api/network/v1api20240301/network_security_group_types_gen.go +++ b/v2/api/network/v1api20240301/network_security_group_types_gen.go @@ -173,6 +173,10 @@ func (group *NetworkSecurityGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *NetworkSecurityGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20240301/network_security_groups_security_rule_types_gen.go b/v2/api/network/v1api20240301/network_security_groups_security_rule_types_gen.go index c493c005dee..4698bb614e8 100644 --- a/v2/api/network/v1api20240301/network_security_groups_security_rule_types_gen.go +++ b/v2/api/network/v1api20240301/network_security_groups_security_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *NetworkSecurityGroupsSecurityRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NetworkSecurityGroupsSecurityRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/private_endpoint_types_gen.go b/v2/api/network/v1api20240301/private_endpoint_types_gen.go index cb479a89861..cb0da5ce99d 100644 --- a/v2/api/network/v1api20240301/private_endpoint_types_gen.go +++ b/v2/api/network/v1api20240301/private_endpoint_types_gen.go @@ -173,6 +173,10 @@ func (endpoint *PrivateEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (endpoint *PrivateEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/private_endpoints_private_dns_zone_group_types_gen.go b/v2/api/network/v1api20240301/private_endpoints_private_dns_zone_group_types_gen.go index d05078acea4..b49407b812f 100644 --- a/v2/api/network/v1api20240301/private_endpoints_private_dns_zone_group_types_gen.go +++ b/v2/api/network/v1api20240301/private_endpoints_private_dns_zone_group_types_gen.go @@ -173,6 +173,10 @@ func (group *PrivateEndpointsPrivateDnsZoneGroup) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (group *PrivateEndpointsPrivateDnsZoneGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20240301/private_link_service_types_gen.go b/v2/api/network/v1api20240301/private_link_service_types_gen.go index 67e222b401b..775f27de3c0 100644 --- a/v2/api/network/v1api20240301/private_link_service_types_gen.go +++ b/v2/api/network/v1api20240301/private_link_service_types_gen.go @@ -194,6 +194,10 @@ func (service *PrivateLinkService) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (service *PrivateLinkService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/public_ip_address_types_gen.go b/v2/api/network/v1api20240301/public_ip_address_types_gen.go index 3a8643bee21..593e46ed48c 100644 --- a/v2/api/network/v1api20240301/public_ip_address_types_gen.go +++ b/v2/api/network/v1api20240301/public_ip_address_types_gen.go @@ -173,6 +173,10 @@ func (address *PublicIPAddress) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (address *PublicIPAddress) Owner() *genruntime.ResourceReference { + if address.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(address.Spec) return address.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/public_ip_prefix_types_gen.go b/v2/api/network/v1api20240301/public_ip_prefix_types_gen.go index 1bee28efcc9..2e6f44b42ba 100644 --- a/v2/api/network/v1api20240301/public_ip_prefix_types_gen.go +++ b/v2/api/network/v1api20240301/public_ip_prefix_types_gen.go @@ -173,6 +173,10 @@ func (prefix *PublicIPPrefix) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (prefix *PublicIPPrefix) Owner() *genruntime.ResourceReference { + if prefix.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(prefix.Spec) return prefix.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/route_table_types_gen.go b/v2/api/network/v1api20240301/route_table_types_gen.go index 441f1971ebb..80df6b07399 100644 --- a/v2/api/network/v1api20240301/route_table_types_gen.go +++ b/v2/api/network/v1api20240301/route_table_types_gen.go @@ -173,6 +173,10 @@ func (table *RouteTable) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (table *RouteTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/route_tables_route_types_gen.go b/v2/api/network/v1api20240301/route_tables_route_types_gen.go index 6d9e7de613c..2bd6f557213 100644 --- a/v2/api/network/v1api20240301/route_tables_route_types_gen.go +++ b/v2/api/network/v1api20240301/route_tables_route_types_gen.go @@ -173,6 +173,10 @@ func (route *RouteTablesRoute) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (route *RouteTablesRoute) Owner() *genruntime.ResourceReference { + if route.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(route.Spec) return route.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/bastion_host_types_gen.go b/v2/api/network/v1api20240301/storage/bastion_host_types_gen.go index 2e5175896e8..82be5599bc7 100644 --- a/v2/api/network/v1api20240301/storage/bastion_host_types_gen.go +++ b/v2/api/network/v1api20240301/storage/bastion_host_types_gen.go @@ -116,6 +116,10 @@ func (host *BastionHost) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (host *BastionHost) Owner() *genruntime.ResourceReference { + if host.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(host.Spec) return host.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/load_balancer_types_gen.go b/v2/api/network/v1api20240301/storage/load_balancer_types_gen.go index 0415dfefec2..d318125976e 100644 --- a/v2/api/network/v1api20240301/storage/load_balancer_types_gen.go +++ b/v2/api/network/v1api20240301/storage/load_balancer_types_gen.go @@ -115,6 +115,10 @@ func (balancer *LoadBalancer) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (balancer *LoadBalancer) Owner() *genruntime.ResourceReference { + if balancer.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(balancer.Spec) return balancer.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/load_balancers_inbound_nat_rule_types_gen.go b/v2/api/network/v1api20240301/storage/load_balancers_inbound_nat_rule_types_gen.go index 5308dd32d3a..a9865657945 100644 --- a/v2/api/network/v1api20240301/storage/load_balancers_inbound_nat_rule_types_gen.go +++ b/v2/api/network/v1api20240301/storage/load_balancers_inbound_nat_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *LoadBalancersInboundNatRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *LoadBalancersInboundNatRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/nat_gateway_types_gen.go b/v2/api/network/v1api20240301/storage/nat_gateway_types_gen.go index 9fb85e5bf11..5711754d8a7 100644 --- a/v2/api/network/v1api20240301/storage/nat_gateway_types_gen.go +++ b/v2/api/network/v1api20240301/storage/nat_gateway_types_gen.go @@ -115,6 +115,10 @@ func (gateway *NatGateway) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (gateway *NatGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/network_interface_types_gen.go b/v2/api/network/v1api20240301/storage/network_interface_types_gen.go index e3be2d1b7bd..a100e3cf8be 100644 --- a/v2/api/network/v1api20240301/storage/network_interface_types_gen.go +++ b/v2/api/network/v1api20240301/storage/network_interface_types_gen.go @@ -115,6 +115,10 @@ func (networkInterface *NetworkInterface) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (networkInterface *NetworkInterface) Owner() *genruntime.ResourceReference { + if networkInterface.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(networkInterface.Spec) return networkInterface.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/network_security_group_types_gen.go b/v2/api/network/v1api20240301/storage/network_security_group_types_gen.go index bec7cedbcbc..c745b75614e 100644 --- a/v2/api/network/v1api20240301/storage/network_security_group_types_gen.go +++ b/v2/api/network/v1api20240301/storage/network_security_group_types_gen.go @@ -115,6 +115,10 @@ func (group *NetworkSecurityGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *NetworkSecurityGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20240301/storage/network_security_groups_security_rule_types_gen.go b/v2/api/network/v1api20240301/storage/network_security_groups_security_rule_types_gen.go index e30e2ff15aa..d2149553db1 100644 --- a/v2/api/network/v1api20240301/storage/network_security_groups_security_rule_types_gen.go +++ b/v2/api/network/v1api20240301/storage/network_security_groups_security_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *NetworkSecurityGroupsSecurityRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NetworkSecurityGroupsSecurityRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/private_endpoint_types_gen.go b/v2/api/network/v1api20240301/storage/private_endpoint_types_gen.go index d30d2a6a704..a29285b1f75 100644 --- a/v2/api/network/v1api20240301/storage/private_endpoint_types_gen.go +++ b/v2/api/network/v1api20240301/storage/private_endpoint_types_gen.go @@ -115,6 +115,10 @@ func (endpoint *PrivateEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (endpoint *PrivateEndpoint) Owner() *genruntime.ResourceReference { + if endpoint.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(endpoint.Spec) return endpoint.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/private_endpoints_private_dns_zone_group_types_gen.go b/v2/api/network/v1api20240301/storage/private_endpoints_private_dns_zone_group_types_gen.go index 688dd8735e7..f0b1c883fcd 100644 --- a/v2/api/network/v1api20240301/storage/private_endpoints_private_dns_zone_group_types_gen.go +++ b/v2/api/network/v1api20240301/storage/private_endpoints_private_dns_zone_group_types_gen.go @@ -115,6 +115,10 @@ func (group *PrivateEndpointsPrivateDnsZoneGroup) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (group *PrivateEndpointsPrivateDnsZoneGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/network/v1api20240301/storage/private_link_service_types_gen.go b/v2/api/network/v1api20240301/storage/private_link_service_types_gen.go index ebdce44cf4c..2e7d48252fd 100644 --- a/v2/api/network/v1api20240301/storage/private_link_service_types_gen.go +++ b/v2/api/network/v1api20240301/storage/private_link_service_types_gen.go @@ -136,6 +136,10 @@ func (service *PrivateLinkService) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (service *PrivateLinkService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/public_ip_address_types_gen.go b/v2/api/network/v1api20240301/storage/public_ip_address_types_gen.go index f70f7d1e9ea..ce2b9ef963d 100644 --- a/v2/api/network/v1api20240301/storage/public_ip_address_types_gen.go +++ b/v2/api/network/v1api20240301/storage/public_ip_address_types_gen.go @@ -115,6 +115,10 @@ func (address *PublicIPAddress) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (address *PublicIPAddress) Owner() *genruntime.ResourceReference { + if address.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(address.Spec) return address.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/public_ip_prefix_types_gen.go b/v2/api/network/v1api20240301/storage/public_ip_prefix_types_gen.go index f134407fb85..9fc2d46de26 100644 --- a/v2/api/network/v1api20240301/storage/public_ip_prefix_types_gen.go +++ b/v2/api/network/v1api20240301/storage/public_ip_prefix_types_gen.go @@ -115,6 +115,10 @@ func (prefix *PublicIPPrefix) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (prefix *PublicIPPrefix) Owner() *genruntime.ResourceReference { + if prefix.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(prefix.Spec) return prefix.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/route_table_types_gen.go b/v2/api/network/v1api20240301/storage/route_table_types_gen.go index 7e4d05da64e..e29597f0b25 100644 --- a/v2/api/network/v1api20240301/storage/route_table_types_gen.go +++ b/v2/api/network/v1api20240301/storage/route_table_types_gen.go @@ -115,6 +115,10 @@ func (table *RouteTable) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (table *RouteTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/route_tables_route_types_gen.go b/v2/api/network/v1api20240301/storage/route_tables_route_types_gen.go index a07f6fc705c..019cec74b81 100644 --- a/v2/api/network/v1api20240301/storage/route_tables_route_types_gen.go +++ b/v2/api/network/v1api20240301/storage/route_tables_route_types_gen.go @@ -115,6 +115,10 @@ func (route *RouteTablesRoute) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (route *RouteTablesRoute) Owner() *genruntime.ResourceReference { + if route.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(route.Spec) return route.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/virtual_network_gateway_types_gen.go b/v2/api/network/v1api20240301/storage/virtual_network_gateway_types_gen.go index 5838d1676a2..2caa043f047 100644 --- a/v2/api/network/v1api20240301/storage/virtual_network_gateway_types_gen.go +++ b/v2/api/network/v1api20240301/storage/virtual_network_gateway_types_gen.go @@ -115,6 +115,10 @@ func (gateway *VirtualNetworkGateway) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (gateway *VirtualNetworkGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/virtual_network_types_gen.go b/v2/api/network/v1api20240301/storage/virtual_network_types_gen.go index 1a9e81597d6..84f8e4a6e5b 100644 --- a/v2/api/network/v1api20240301/storage/virtual_network_types_gen.go +++ b/v2/api/network/v1api20240301/storage/virtual_network_types_gen.go @@ -115,6 +115,10 @@ func (network *VirtualNetwork) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (network *VirtualNetwork) Owner() *genruntime.ResourceReference { + if network.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(network.Spec) return network.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/virtual_networks_subnet_types_gen.go b/v2/api/network/v1api20240301/storage/virtual_networks_subnet_types_gen.go index d4089b1cb01..4b5ee65a0d6 100644 --- a/v2/api/network/v1api20240301/storage/virtual_networks_subnet_types_gen.go +++ b/v2/api/network/v1api20240301/storage/virtual_networks_subnet_types_gen.go @@ -115,6 +115,10 @@ func (subnet *VirtualNetworksSubnet) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (subnet *VirtualNetworksSubnet) Owner() *genruntime.ResourceReference { + if subnet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subnet.Spec) return subnet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/storage/virtual_networks_virtual_network_peering_types_gen.go b/v2/api/network/v1api20240301/storage/virtual_networks_virtual_network_peering_types_gen.go index da71d504745..04276d64951 100644 --- a/v2/api/network/v1api20240301/storage/virtual_networks_virtual_network_peering_types_gen.go +++ b/v2/api/network/v1api20240301/storage/virtual_networks_virtual_network_peering_types_gen.go @@ -115,6 +115,10 @@ func (peering *VirtualNetworksVirtualNetworkPeering) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (peering *VirtualNetworksVirtualNetworkPeering) Owner() *genruntime.ResourceReference { + if peering.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(peering.Spec) return peering.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/virtual_network_gateway_types_gen.go b/v2/api/network/v1api20240301/virtual_network_gateway_types_gen.go index 9f09acad3bb..10a686469e1 100644 --- a/v2/api/network/v1api20240301/virtual_network_gateway_types_gen.go +++ b/v2/api/network/v1api20240301/virtual_network_gateway_types_gen.go @@ -173,6 +173,10 @@ func (gateway *VirtualNetworkGateway) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (gateway *VirtualNetworkGateway) Owner() *genruntime.ResourceReference { + if gateway.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec) return gateway.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/virtual_network_types_gen.go b/v2/api/network/v1api20240301/virtual_network_types_gen.go index b3f4c9504fc..40a5c692486 100644 --- a/v2/api/network/v1api20240301/virtual_network_types_gen.go +++ b/v2/api/network/v1api20240301/virtual_network_types_gen.go @@ -173,6 +173,10 @@ func (network *VirtualNetwork) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (network *VirtualNetwork) Owner() *genruntime.ResourceReference { + if network.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(network.Spec) return network.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/virtual_networks_subnet_types_gen.go b/v2/api/network/v1api20240301/virtual_networks_subnet_types_gen.go index cccda2bf5b7..a1015693f0a 100644 --- a/v2/api/network/v1api20240301/virtual_networks_subnet_types_gen.go +++ b/v2/api/network/v1api20240301/virtual_networks_subnet_types_gen.go @@ -173,6 +173,10 @@ func (subnet *VirtualNetworksSubnet) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (subnet *VirtualNetworksSubnet) Owner() *genruntime.ResourceReference { + if subnet.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subnet.Spec) return subnet.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240301/virtual_networks_virtual_network_peering_types_gen.go b/v2/api/network/v1api20240301/virtual_networks_virtual_network_peering_types_gen.go index d807c70d528..b69498e75c5 100644 --- a/v2/api/network/v1api20240301/virtual_networks_virtual_network_peering_types_gen.go +++ b/v2/api/network/v1api20240301/virtual_networks_virtual_network_peering_types_gen.go @@ -173,6 +173,10 @@ func (peering *VirtualNetworksVirtualNetworkPeering) NewEmptyStatus() genruntime // Owner returns the ResourceReference of the owner func (peering *VirtualNetworksVirtualNetworkPeering) Owner() *genruntime.ResourceReference { + if peering.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(peering.Spec) return peering.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zone_types_gen.go b/v2/api/network/v1api20240601/private_dns_zone_types_gen.go index fa31c1f91c7..e91fedea32b 100644 --- a/v2/api/network/v1api20240601/private_dns_zone_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zone_types_gen.go @@ -173,6 +173,10 @@ func (zone *PrivateDnsZone) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (zone *PrivateDnsZone) Owner() *genruntime.ResourceReference { + if zone.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(zone.Spec) return zone.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_a_record_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_a_record_types_gen.go index 9fe3c60a934..2f391ba77fe 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_a_record_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_a_record_types_gen.go @@ -173,6 +173,10 @@ func (record *PrivateDnsZonesARecord) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_aaaa_record_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_aaaa_record_types_gen.go index 2472dbdddaa..77f412594e0 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_aaaa_record_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_aaaa_record_types_gen.go @@ -173,6 +173,10 @@ func (record *PrivateDnsZonesAAAARecord) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesAAAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_cname_record_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_cname_record_types_gen.go index 1aa8b7e548e..125c43edb46 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_cname_record_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_cname_record_types_gen.go @@ -173,6 +173,10 @@ func (record *PrivateDnsZonesCNAMERecord) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesCNAMERecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_mx_record_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_mx_record_types_gen.go index 4b1ea9dcbfe..6df5ad421ed 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_mx_record_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_mx_record_types_gen.go @@ -173,6 +173,10 @@ func (record *PrivateDnsZonesMXRecord) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesMXRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_ptr_record_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_ptr_record_types_gen.go index 75adae3e7aa..8605707ef2a 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_ptr_record_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_ptr_record_types_gen.go @@ -173,6 +173,10 @@ func (record *PrivateDnsZonesPTRRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesPTRRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_srv_record_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_srv_record_types_gen.go index f882b0e221f..482c4682124 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_srv_record_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_srv_record_types_gen.go @@ -173,6 +173,10 @@ func (record *PrivateDnsZonesSRVRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesSRVRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_txt_record_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_txt_record_types_gen.go index 7d5524a3fc6..5ef35c6f982 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_txt_record_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_txt_record_types_gen.go @@ -173,6 +173,10 @@ func (record *PrivateDnsZonesTXTRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesTXTRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/private_dns_zones_virtual_network_link_types_gen.go b/v2/api/network/v1api20240601/private_dns_zones_virtual_network_link_types_gen.go index f41081267e1..c0dc17926a2 100644 --- a/v2/api/network/v1api20240601/private_dns_zones_virtual_network_link_types_gen.go +++ b/v2/api/network/v1api20240601/private_dns_zones_virtual_network_link_types_gen.go @@ -173,6 +173,10 @@ func (link *PrivateDnsZonesVirtualNetworkLink) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (link *PrivateDnsZonesVirtualNetworkLink) Owner() *genruntime.ResourceReference { + if link.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(link.Spec) return link.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zone_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zone_types_gen.go index 5832b306227..9434cc0fa46 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zone_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zone_types_gen.go @@ -115,6 +115,10 @@ func (zone *PrivateDnsZone) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (zone *PrivateDnsZone) Owner() *genruntime.ResourceReference { + if zone.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(zone.Spec) return zone.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_a_record_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_a_record_types_gen.go index 35d012c6767..2eae567db02 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_a_record_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_a_record_types_gen.go @@ -115,6 +115,10 @@ func (record *PrivateDnsZonesARecord) NewEmptyStatus() genruntime.ConvertibleSta // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_aaaa_record_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_aaaa_record_types_gen.go index b3c467b8787..197957b7c8e 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_aaaa_record_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_aaaa_record_types_gen.go @@ -115,6 +115,10 @@ func (record *PrivateDnsZonesAAAARecord) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesAAAARecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_cname_record_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_cname_record_types_gen.go index bfecc7a526e..c9db968af9e 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_cname_record_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_cname_record_types_gen.go @@ -115,6 +115,10 @@ func (record *PrivateDnsZonesCNAMERecord) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesCNAMERecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_mx_record_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_mx_record_types_gen.go index d8a0b71ea64..642d0a41906 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_mx_record_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_mx_record_types_gen.go @@ -115,6 +115,10 @@ func (record *PrivateDnsZonesMXRecord) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesMXRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_ptr_record_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_ptr_record_types_gen.go index 37147d3f0d2..9c077b61c45 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_ptr_record_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_ptr_record_types_gen.go @@ -115,6 +115,10 @@ func (record *PrivateDnsZonesPTRRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesPTRRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_srv_record_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_srv_record_types_gen.go index 7f84b1ee9e1..df917d41df9 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_srv_record_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_srv_record_types_gen.go @@ -115,6 +115,10 @@ func (record *PrivateDnsZonesSRVRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesSRVRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_txt_record_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_txt_record_types_gen.go index 8400a810e83..23ea2daae18 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_txt_record_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_txt_record_types_gen.go @@ -115,6 +115,10 @@ func (record *PrivateDnsZonesTXTRecord) NewEmptyStatus() genruntime.ConvertibleS // Owner returns the ResourceReference of the owner func (record *PrivateDnsZonesTXTRecord) Owner() *genruntime.ResourceReference { + if record.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(record.Spec) return record.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/network/v1api20240601/storage/private_dns_zones_virtual_network_link_types_gen.go b/v2/api/network/v1api20240601/storage/private_dns_zones_virtual_network_link_types_gen.go index 92a4dcc2c36..f86c2122cb0 100644 --- a/v2/api/network/v1api20240601/storage/private_dns_zones_virtual_network_link_types_gen.go +++ b/v2/api/network/v1api20240601/storage/private_dns_zones_virtual_network_link_types_gen.go @@ -115,6 +115,10 @@ func (link *PrivateDnsZonesVirtualNetworkLink) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (link *PrivateDnsZonesVirtualNetworkLink) Owner() *genruntime.ResourceReference { + if link.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(link.Spec) return link.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go b/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go index 9500b84658b..2ff2c9e8f2a 100644 --- a/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go +++ b/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go @@ -115,6 +115,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go b/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go index 17a5992c928..b4b15bfc405 100644 --- a/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go +++ b/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go @@ -173,6 +173,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/redhatopenshift/v1api20231122/open_shift_cluster_types_gen.go b/v2/api/redhatopenshift/v1api20231122/open_shift_cluster_types_gen.go index a9f18cc2ce0..1f69b042d7a 100644 --- a/v2/api/redhatopenshift/v1api20231122/open_shift_cluster_types_gen.go +++ b/v2/api/redhatopenshift/v1api20231122/open_shift_cluster_types_gen.go @@ -173,6 +173,10 @@ func (cluster *OpenShiftCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *OpenShiftCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/redhatopenshift/v1api20231122/storage/open_shift_cluster_types_gen.go b/v2/api/redhatopenshift/v1api20231122/storage/open_shift_cluster_types_gen.go index ea7ce35f23a..1404bc2d56a 100644 --- a/v2/api/redhatopenshift/v1api20231122/storage/open_shift_cluster_types_gen.go +++ b/v2/api/redhatopenshift/v1api20231122/storage/open_shift_cluster_types_gen.go @@ -115,6 +115,10 @@ func (cluster *OpenShiftCluster) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (cluster *OpenShiftCluster) Owner() *genruntime.ResourceReference { + if cluster.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(cluster.Spec) return cluster.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/search/v1api20220901/search_service_types_gen.go b/v2/api/search/v1api20220901/search_service_types_gen.go index fee0d81b05f..81ffe032f23 100644 --- a/v2/api/search/v1api20220901/search_service_types_gen.go +++ b/v2/api/search/v1api20220901/search_service_types_gen.go @@ -174,6 +174,10 @@ func (service *SearchService) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (service *SearchService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/search/v1api20220901/storage/search_service_types_gen.go b/v2/api/search/v1api20220901/storage/search_service_types_gen.go index 0f7472149b1..4f453c14b26 100644 --- a/v2/api/search/v1api20220901/storage/search_service_types_gen.go +++ b/v2/api/search/v1api20220901/storage/search_service_types_gen.go @@ -116,6 +116,10 @@ func (service *SearchService) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (service *SearchService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/namespace_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespace_types_gen.go index fb39d1e177a..a554a3250e1 100644 --- a/v2/api/servicebus/v1api20210101preview/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespace_types_gen.go @@ -176,6 +176,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen.go index 9fd25c358fa..dadd94d78fe 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go index a99ca55c0f2..53a711aa650 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go @@ -176,6 +176,10 @@ func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go index 190512bcf26..8b86c175931 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go @@ -176,6 +176,10 @@ func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go index 02099065996..ba9b66c7d20 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go @@ -176,6 +176,10 @@ func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go index 4b7cfeac409..2ab4c71471c 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go index 8ab29843821..61b53468327 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go @@ -136,6 +136,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go index b736fef576d..6b890c45220 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go index 4e10929affc..8c6d96236a8 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go @@ -136,6 +136,10 @@ func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go index fff9965d2cc..c651a990432 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go @@ -136,6 +136,10 @@ func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go index b0a072c0e9f..cf30aa04ff5 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go @@ -136,6 +136,10 @@ func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go index 237128588d6..d2dd46189fe 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/namespace_types_gen.go b/v2/api/servicebus/v1api20211101/namespace_types_gen.go index f0144aa1b37..21afe3e87d5 100644 --- a/v2/api/servicebus/v1api20211101/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespace_types_gen.go @@ -173,6 +173,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go index 7e54727b5b7..36f9524c6a4 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go index 362b4289c38..b84d96bf09f 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go @@ -173,6 +173,10 @@ func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go index 4e1a4944d2b..5800452ffee 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go @@ -173,6 +173,10 @@ func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go index 543022ecd93..672cf4a2fdc 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go @@ -173,6 +173,10 @@ func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go index e354ff8460c..3d713ddd622 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go index 4df698e284a..fe07cee73a0 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go @@ -115,6 +115,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go index 399a5f908c9..fad6fa316d0 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go index 021a62c9051..f446a8443e2 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go @@ -115,6 +115,10 @@ func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go index 8b400e87ab3..c01fddb1b31 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go @@ -115,6 +115,10 @@ func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go index a6385c01365..653d8e1a948 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go @@ -115,6 +115,10 @@ func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go index fb56228b845..db139790201 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/namespace_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespace_types_gen.go index ee417fb9a36..1f3b024b0f1 100644 --- a/v2/api/servicebus/v1api20221001preview/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/namespace_types_gen.go @@ -176,6 +176,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen.go index 69ce9f6310f..57485c8d41a 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen.go index f4b73ecb4b2..1e676f5e159 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen.go @@ -176,6 +176,10 @@ func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen.go index 05966e2cc50..db31a74e8c4 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen.go @@ -176,6 +176,10 @@ func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen.go index 91eb84e5425..d0948fc759d 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen.go @@ -176,6 +176,10 @@ func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen.go index eea1acdd583..c0981cd26c2 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen.go @@ -176,6 +176,10 @@ func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go index d036421f162..20ef7b2d15a 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go @@ -136,6 +136,10 @@ func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (namespace *Namespace) Owner() *genruntime.ResourceReference { + if namespace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) return namespace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go index 8b711ddde28..94915e44e50 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go index 4d0206d3cc0..c7be19d7e29 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go @@ -136,6 +136,10 @@ func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go index 3a233f2105c..fc89579901b 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go @@ -136,6 +136,10 @@ func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) return topic.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go index b4345743772..47d5c701a66 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go @@ -136,6 +136,10 @@ func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) return subscription.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go index 552d131ef0e..fe7c85c4867 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -136,6 +136,10 @@ func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/signalrservice/v1api20211001/signal_r_types_gen.go b/v2/api/signalrservice/v1api20211001/signal_r_types_gen.go index b630229bfc2..e7ce6c87a6a 100644 --- a/v2/api/signalrservice/v1api20211001/signal_r_types_gen.go +++ b/v2/api/signalrservice/v1api20211001/signal_r_types_gen.go @@ -173,6 +173,10 @@ func (signalR *SignalR) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (signalR *SignalR) Owner() *genruntime.ResourceReference { + if signalR.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(signalR.Spec) return signalR.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/signalrservice/v1api20211001/storage/signal_r_types_gen.go b/v2/api/signalrservice/v1api20211001/storage/signal_r_types_gen.go index 1c1b3528f58..bc8ba06e557 100644 --- a/v2/api/signalrservice/v1api20211001/storage/signal_r_types_gen.go +++ b/v2/api/signalrservice/v1api20211001/storage/signal_r_types_gen.go @@ -115,6 +115,10 @@ func (signalR *SignalR) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (signalR *SignalR) Owner() *genruntime.ResourceReference { + if signalR.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(signalR.Spec) return signalR.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/server_types_gen.go b/v2/api/sql/v1api20211101/server_types_gen.go index 1b2a1466ba7..9f1cb308808 100644 --- a/v2/api/sql/v1api20211101/server_types_gen.go +++ b/v2/api/sql/v1api20211101/server_types_gen.go @@ -194,6 +194,10 @@ func (server *Server) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *Server) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_administrator_types_gen.go b/v2/api/sql/v1api20211101/servers_administrator_types_gen.go index 2eb31759802..32d9fb0e3d6 100644 --- a/v2/api/sql/v1api20211101/servers_administrator_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_administrator_types_gen.go @@ -166,6 +166,10 @@ func (administrator *ServersAdministrator) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (administrator *ServersAdministrator) Owner() *genruntime.ResourceReference { + if administrator.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(administrator.Spec) return administrator.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_advanced_threat_protection_setting_types_gen.go b/v2/api/sql/v1api20211101/servers_advanced_threat_protection_setting_types_gen.go index 7a8622ff07d..8d0f377973a 100644 --- a/v2/api/sql/v1api20211101/servers_advanced_threat_protection_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_advanced_threat_protection_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *ServersAdvancedThreatProtectionSetting) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (setting *ServersAdvancedThreatProtectionSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_auditing_setting_types_gen.go b/v2/api/sql/v1api20211101/servers_auditing_setting_types_gen.go index ed37678a630..de92c7e037e 100644 --- a/v2/api/sql/v1api20211101/servers_auditing_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_auditing_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *ServersAuditingSetting) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (setting *ServersAuditingSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_azure_ad_only_authentication_types_gen.go b/v2/api/sql/v1api20211101/servers_azure_ad_only_authentication_types_gen.go index d9aa2cf7668..729d81f78f1 100644 --- a/v2/api/sql/v1api20211101/servers_azure_ad_only_authentication_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_azure_ad_only_authentication_types_gen.go @@ -166,6 +166,10 @@ func (authentication *ServersAzureADOnlyAuthentication) NewEmptyStatus() genrunt // Owner returns the ResourceReference of the owner func (authentication *ServersAzureADOnlyAuthentication) Owner() *genruntime.ResourceReference { + if authentication.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(authentication.Spec) return authentication.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_connection_policy_types_gen.go b/v2/api/sql/v1api20211101/servers_connection_policy_types_gen.go index 63bc8637025..8a638bf6a63 100644 --- a/v2/api/sql/v1api20211101/servers_connection_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_connection_policy_types_gen.go @@ -165,6 +165,10 @@ func (policy *ServersConnectionPolicy) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (policy *ServersConnectionPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_database_types_gen.go b/v2/api/sql/v1api20211101/servers_database_types_gen.go index aeaabbededd..be428dcba68 100644 --- a/v2/api/sql/v1api20211101/servers_database_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_database_types_gen.go @@ -173,6 +173,10 @@ func (database *ServersDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *ServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_databases_advanced_threat_protection_setting_types_gen.go b/v2/api/sql/v1api20211101/servers_databases_advanced_threat_protection_setting_types_gen.go index c4d4998884b..f47148af33f 100644 --- a/v2/api/sql/v1api20211101/servers_databases_advanced_threat_protection_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_databases_advanced_threat_protection_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *ServersDatabasesAdvancedThreatProtectionSetting) NewEmptyStatus() // Owner returns the ResourceReference of the owner func (setting *ServersDatabasesAdvancedThreatProtectionSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_databases_auditing_setting_types_gen.go b/v2/api/sql/v1api20211101/servers_databases_auditing_setting_types_gen.go index 43e82a67414..361c524b171 100644 --- a/v2/api/sql/v1api20211101/servers_databases_auditing_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_databases_auditing_setting_types_gen.go @@ -165,6 +165,10 @@ func (setting *ServersDatabasesAuditingSetting) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (setting *ServersDatabasesAuditingSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_databases_backup_long_term_retention_policy_types_gen.go b/v2/api/sql/v1api20211101/servers_databases_backup_long_term_retention_policy_types_gen.go index 2b5025c9bdc..99a6ced31de 100644 --- a/v2/api/sql/v1api20211101/servers_databases_backup_long_term_retention_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_databases_backup_long_term_retention_policy_types_gen.go @@ -165,6 +165,10 @@ func (policy *ServersDatabasesBackupLongTermRetentionPolicy) NewEmptyStatus() ge // Owner returns the ResourceReference of the owner func (policy *ServersDatabasesBackupLongTermRetentionPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_databases_backup_short_term_retention_policy_types_gen.go b/v2/api/sql/v1api20211101/servers_databases_backup_short_term_retention_policy_types_gen.go index be5a73aec91..660dcf8de89 100644 --- a/v2/api/sql/v1api20211101/servers_databases_backup_short_term_retention_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_databases_backup_short_term_retention_policy_types_gen.go @@ -165,6 +165,10 @@ func (policy *ServersDatabasesBackupShortTermRetentionPolicy) NewEmptyStatus() g // Owner returns the ResourceReference of the owner func (policy *ServersDatabasesBackupShortTermRetentionPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_databases_security_alert_policy_types_gen.go b/v2/api/sql/v1api20211101/servers_databases_security_alert_policy_types_gen.go index b5e4a7ecf5d..032d4736c85 100644 --- a/v2/api/sql/v1api20211101/servers_databases_security_alert_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_databases_security_alert_policy_types_gen.go @@ -165,6 +165,10 @@ func (policy *ServersDatabasesSecurityAlertPolicy) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (policy *ServersDatabasesSecurityAlertPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_databases_transparent_data_encryption_types_gen.go b/v2/api/sql/v1api20211101/servers_databases_transparent_data_encryption_types_gen.go index b280663c611..df1060389a8 100644 --- a/v2/api/sql/v1api20211101/servers_databases_transparent_data_encryption_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_databases_transparent_data_encryption_types_gen.go @@ -165,6 +165,10 @@ func (encryption *ServersDatabasesTransparentDataEncryption) NewEmptyStatus() ge // Owner returns the ResourceReference of the owner func (encryption *ServersDatabasesTransparentDataEncryption) Owner() *genruntime.ResourceReference { + if encryption.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(encryption.Spec) return encryption.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_databases_vulnerability_assessment_types_gen.go b/v2/api/sql/v1api20211101/servers_databases_vulnerability_assessment_types_gen.go index 8c70bab551b..5d244d257f1 100644 --- a/v2/api/sql/v1api20211101/servers_databases_vulnerability_assessment_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_databases_vulnerability_assessment_types_gen.go @@ -166,6 +166,10 @@ func (assessment *ServersDatabasesVulnerabilityAssessment) NewEmptyStatus() genr // Owner returns the ResourceReference of the owner func (assessment *ServersDatabasesVulnerabilityAssessment) Owner() *genruntime.ResourceReference { + if assessment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assessment.Spec) return assessment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_elastic_pool_types_gen.go b/v2/api/sql/v1api20211101/servers_elastic_pool_types_gen.go index 0f8f283302f..bfcdb280d99 100644 --- a/v2/api/sql/v1api20211101/servers_elastic_pool_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_elastic_pool_types_gen.go @@ -173,6 +173,10 @@ func (pool *ServersElasticPool) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (pool *ServersElasticPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_failover_group_types_gen.go b/v2/api/sql/v1api20211101/servers_failover_group_types_gen.go index b11b1a55066..58ebcbb3f11 100644 --- a/v2/api/sql/v1api20211101/servers_failover_group_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_failover_group_types_gen.go @@ -173,6 +173,10 @@ func (group *ServersFailoverGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *ServersFailoverGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/sql/v1api20211101/servers_firewall_rule_types_gen.go b/v2/api/sql/v1api20211101/servers_firewall_rule_types_gen.go index 658545becd9..402b6c7b154 100644 --- a/v2/api/sql/v1api20211101/servers_firewall_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_firewall_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *ServersFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *ServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_ipv_6_firewall_rule_types_gen.go b/v2/api/sql/v1api20211101/servers_ipv_6_firewall_rule_types_gen.go index d29787edd13..fce74f0f599 100644 --- a/v2/api/sql/v1api20211101/servers_ipv_6_firewall_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_ipv_6_firewall_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *ServersIPV6FirewallRule) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (rule *ServersIPV6FirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_outbound_firewall_rule_types_gen.go b/v2/api/sql/v1api20211101/servers_outbound_firewall_rule_types_gen.go index acdf9e74c0c..716e0595110 100644 --- a/v2/api/sql/v1api20211101/servers_outbound_firewall_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_outbound_firewall_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *ServersOutboundFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *ServersOutboundFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_security_alert_policy_types_gen.go b/v2/api/sql/v1api20211101/servers_security_alert_policy_types_gen.go index fed3d9018a8..f29abf130c1 100644 --- a/v2/api/sql/v1api20211101/servers_security_alert_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_security_alert_policy_types_gen.go @@ -165,6 +165,10 @@ func (policy *ServersSecurityAlertPolicy) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (policy *ServersSecurityAlertPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_virtual_network_rule_types_gen.go b/v2/api/sql/v1api20211101/servers_virtual_network_rule_types_gen.go index 749d2b1b4ea..6f1b621e5ae 100644 --- a/v2/api/sql/v1api20211101/servers_virtual_network_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_virtual_network_rule_types_gen.go @@ -173,6 +173,10 @@ func (rule *ServersVirtualNetworkRule) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (rule *ServersVirtualNetworkRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/servers_vulnerability_assessment_types_gen.go b/v2/api/sql/v1api20211101/servers_vulnerability_assessment_types_gen.go index 622973ec02a..93f2b40753d 100644 --- a/v2/api/sql/v1api20211101/servers_vulnerability_assessment_types_gen.go +++ b/v2/api/sql/v1api20211101/servers_vulnerability_assessment_types_gen.go @@ -166,6 +166,10 @@ func (assessment *ServersVulnerabilityAssessment) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (assessment *ServersVulnerabilityAssessment) Owner() *genruntime.ResourceReference { + if assessment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assessment.Spec) return assessment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/server_types_gen.go b/v2/api/sql/v1api20211101/storage/server_types_gen.go index 29b7aaee901..ccc52608f5e 100644 --- a/v2/api/sql/v1api20211101/storage/server_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/server_types_gen.go @@ -136,6 +136,10 @@ func (server *Server) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (server *Server) Owner() *genruntime.ResourceReference { + if server.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(server.Spec) return server.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_administrator_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_administrator_types_gen.go index feba4c5f666..cbcc5817e44 100644 --- a/v2/api/sql/v1api20211101/storage/servers_administrator_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_administrator_types_gen.go @@ -115,6 +115,10 @@ func (administrator *ServersAdministrator) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (administrator *ServersAdministrator) Owner() *genruntime.ResourceReference { + if administrator.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(administrator.Spec) return administrator.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_advanced_threat_protection_setting_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_advanced_threat_protection_setting_types_gen.go index 653456a570c..0e023997b92 100644 --- a/v2/api/sql/v1api20211101/storage/servers_advanced_threat_protection_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_advanced_threat_protection_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *ServersAdvancedThreatProtectionSetting) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (setting *ServersAdvancedThreatProtectionSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_auditing_setting_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_auditing_setting_types_gen.go index 037e588508d..3ed4c67bb11 100644 --- a/v2/api/sql/v1api20211101/storage/servers_auditing_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_auditing_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *ServersAuditingSetting) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (setting *ServersAuditingSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_azure_ad_only_authentication_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_azure_ad_only_authentication_types_gen.go index e269b6e4cd3..5d168572c68 100644 --- a/v2/api/sql/v1api20211101/storage/servers_azure_ad_only_authentication_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_azure_ad_only_authentication_types_gen.go @@ -115,6 +115,10 @@ func (authentication *ServersAzureADOnlyAuthentication) NewEmptyStatus() genrunt // Owner returns the ResourceReference of the owner func (authentication *ServersAzureADOnlyAuthentication) Owner() *genruntime.ResourceReference { + if authentication.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(authentication.Spec) return authentication.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_connection_policy_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_connection_policy_types_gen.go index 1397bb40877..28f494af8ea 100644 --- a/v2/api/sql/v1api20211101/storage/servers_connection_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_connection_policy_types_gen.go @@ -114,6 +114,10 @@ func (policy *ServersConnectionPolicy) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (policy *ServersConnectionPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_database_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_database_types_gen.go index 6f819164380..d6abf6a8b72 100644 --- a/v2/api/sql/v1api20211101/storage/servers_database_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_database_types_gen.go @@ -115,6 +115,10 @@ func (database *ServersDatabase) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (database *ServersDatabase) Owner() *genruntime.ResourceReference { + if database.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(database.Spec) return database.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_databases_advanced_threat_protection_setting_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_databases_advanced_threat_protection_setting_types_gen.go index 3e9b52f9c46..3bfd32f11ec 100644 --- a/v2/api/sql/v1api20211101/storage/servers_databases_advanced_threat_protection_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_databases_advanced_threat_protection_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *ServersDatabasesAdvancedThreatProtectionSetting) NewEmptyStatus() // Owner returns the ResourceReference of the owner func (setting *ServersDatabasesAdvancedThreatProtectionSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_databases_auditing_setting_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_databases_auditing_setting_types_gen.go index 598e50875cd..be37d72706f 100644 --- a/v2/api/sql/v1api20211101/storage/servers_databases_auditing_setting_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_databases_auditing_setting_types_gen.go @@ -114,6 +114,10 @@ func (setting *ServersDatabasesAuditingSetting) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (setting *ServersDatabasesAuditingSetting) Owner() *genruntime.ResourceReference { + if setting.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(setting.Spec) return setting.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_databases_backup_long_term_retention_policy_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_databases_backup_long_term_retention_policy_types_gen.go index 638e01c125b..5c9bdd88b25 100644 --- a/v2/api/sql/v1api20211101/storage/servers_databases_backup_long_term_retention_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_databases_backup_long_term_retention_policy_types_gen.go @@ -114,6 +114,10 @@ func (policy *ServersDatabasesBackupLongTermRetentionPolicy) NewEmptyStatus() ge // Owner returns the ResourceReference of the owner func (policy *ServersDatabasesBackupLongTermRetentionPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_databases_backup_short_term_retention_policy_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_databases_backup_short_term_retention_policy_types_gen.go index 9de414dec92..9efe49679ea 100644 --- a/v2/api/sql/v1api20211101/storage/servers_databases_backup_short_term_retention_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_databases_backup_short_term_retention_policy_types_gen.go @@ -114,6 +114,10 @@ func (policy *ServersDatabasesBackupShortTermRetentionPolicy) NewEmptyStatus() g // Owner returns the ResourceReference of the owner func (policy *ServersDatabasesBackupShortTermRetentionPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_databases_security_alert_policy_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_databases_security_alert_policy_types_gen.go index efc693c0813..00873235ccd 100644 --- a/v2/api/sql/v1api20211101/storage/servers_databases_security_alert_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_databases_security_alert_policy_types_gen.go @@ -114,6 +114,10 @@ func (policy *ServersDatabasesSecurityAlertPolicy) NewEmptyStatus() genruntime.C // Owner returns the ResourceReference of the owner func (policy *ServersDatabasesSecurityAlertPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_databases_transparent_data_encryption_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_databases_transparent_data_encryption_types_gen.go index 948dc91ae23..a64a50ba6ae 100644 --- a/v2/api/sql/v1api20211101/storage/servers_databases_transparent_data_encryption_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_databases_transparent_data_encryption_types_gen.go @@ -114,6 +114,10 @@ func (encryption *ServersDatabasesTransparentDataEncryption) NewEmptyStatus() ge // Owner returns the ResourceReference of the owner func (encryption *ServersDatabasesTransparentDataEncryption) Owner() *genruntime.ResourceReference { + if encryption.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(encryption.Spec) return encryption.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_databases_vulnerability_assessment_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_databases_vulnerability_assessment_types_gen.go index 3f38060b33e..be907965255 100644 --- a/v2/api/sql/v1api20211101/storage/servers_databases_vulnerability_assessment_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_databases_vulnerability_assessment_types_gen.go @@ -115,6 +115,10 @@ func (assessment *ServersDatabasesVulnerabilityAssessment) NewEmptyStatus() genr // Owner returns the ResourceReference of the owner func (assessment *ServersDatabasesVulnerabilityAssessment) Owner() *genruntime.ResourceReference { + if assessment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assessment.Spec) return assessment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_elastic_pool_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_elastic_pool_types_gen.go index d31076f21c3..4af674d7e8b 100644 --- a/v2/api/sql/v1api20211101/storage/servers_elastic_pool_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_elastic_pool_types_gen.go @@ -115,6 +115,10 @@ func (pool *ServersElasticPool) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (pool *ServersElasticPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_failover_group_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_failover_group_types_gen.go index 7beba9b7316..9968675140b 100644 --- a/v2/api/sql/v1api20211101/storage/servers_failover_group_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_failover_group_types_gen.go @@ -115,6 +115,10 @@ func (group *ServersFailoverGroup) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (group *ServersFailoverGroup) Owner() *genruntime.ResourceReference { + if group.Spec.Owner == nil { + return nil + } + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_firewall_rule_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_firewall_rule_types_gen.go index b978f3d0f6b..74800dbce73 100644 --- a/v2/api/sql/v1api20211101/storage/servers_firewall_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_firewall_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *ServersFirewallRule) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (rule *ServersFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_ipv_6_firewall_rule_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_ipv_6_firewall_rule_types_gen.go index cf0680f0a0d..19a2b566603 100644 --- a/v2/api/sql/v1api20211101/storage/servers_ipv_6_firewall_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_ipv_6_firewall_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *ServersIPV6FirewallRule) NewEmptyStatus() genruntime.ConvertibleStat // Owner returns the ResourceReference of the owner func (rule *ServersIPV6FirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_outbound_firewall_rule_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_outbound_firewall_rule_types_gen.go index b8796665a9b..a8ec6a94333 100644 --- a/v2/api/sql/v1api20211101/storage/servers_outbound_firewall_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_outbound_firewall_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *ServersOutboundFirewallRule) NewEmptyStatus() genruntime.Convertible // Owner returns the ResourceReference of the owner func (rule *ServersOutboundFirewallRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_security_alert_policy_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_security_alert_policy_types_gen.go index cc327a69498..cc3e282f05d 100644 --- a/v2/api/sql/v1api20211101/storage/servers_security_alert_policy_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_security_alert_policy_types_gen.go @@ -114,6 +114,10 @@ func (policy *ServersSecurityAlertPolicy) NewEmptyStatus() genruntime.Convertibl // Owner returns the ResourceReference of the owner func (policy *ServersSecurityAlertPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_virtual_network_rule_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_virtual_network_rule_types_gen.go index 2173e6b7310..1d5d19b4cfb 100644 --- a/v2/api/sql/v1api20211101/storage/servers_virtual_network_rule_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_virtual_network_rule_types_gen.go @@ -115,6 +115,10 @@ func (rule *ServersVirtualNetworkRule) NewEmptyStatus() genruntime.ConvertibleSt // Owner returns the ResourceReference of the owner func (rule *ServersVirtualNetworkRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) return rule.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/sql/v1api20211101/storage/servers_vulnerability_assessment_types_gen.go b/v2/api/sql/v1api20211101/storage/servers_vulnerability_assessment_types_gen.go index 7370fdbeb2c..302db439669 100644 --- a/v2/api/sql/v1api20211101/storage/servers_vulnerability_assessment_types_gen.go +++ b/v2/api/sql/v1api20211101/storage/servers_vulnerability_assessment_types_gen.go @@ -115,6 +115,10 @@ func (assessment *ServersVulnerabilityAssessment) NewEmptyStatus() genruntime.Co // Owner returns the ResourceReference of the owner func (assessment *ServersVulnerabilityAssessment) Owner() *genruntime.ResourceReference { + if assessment.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(assessment.Spec) return assessment.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage/storage_account_types_gen.go b/v2/api/storage/v1api20210401/storage/storage_account_types_gen.go index fa155cbf9f8..ca38cd6d6fa 100644 --- a/v2/api/storage/v1api20210401/storage/storage_account_types_gen.go +++ b/v2/api/storage/v1api20210401/storage/storage_account_types_gen.go @@ -207,6 +207,10 @@ func (account *StorageAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *StorageAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage/storage_accounts_blob_service_types_gen.go b/v2/api/storage/v1api20210401/storage/storage_accounts_blob_service_types_gen.go index 1cb5e778433..048c9aa8783 100644 --- a/v2/api/storage/v1api20210401/storage/storage_accounts_blob_service_types_gen.go +++ b/v2/api/storage/v1api20210401/storage/storage_accounts_blob_service_types_gen.go @@ -148,6 +148,10 @@ func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsBlobService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage/storage_accounts_blob_services_container_types_gen.go b/v2/api/storage/v1api20210401/storage/storage_accounts_blob_services_container_types_gen.go index 553dec876b9..fe8d8c5e049 100644 --- a/v2/api/storage/v1api20210401/storage/storage_accounts_blob_services_container_types_gen.go +++ b/v2/api/storage/v1api20210401/storage/storage_accounts_blob_services_container_types_gen.go @@ -149,6 +149,10 @@ func (container *StorageAccountsBlobServicesContainer) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (container *StorageAccountsBlobServicesContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage/storage_accounts_management_policy_types_gen.go b/v2/api/storage/v1api20210401/storage/storage_accounts_management_policy_types_gen.go index 914b8ccd898..cccd1966f20 100644 --- a/v2/api/storage/v1api20210401/storage/storage_accounts_management_policy_types_gen.go +++ b/v2/api/storage/v1api20210401/storage/storage_accounts_management_policy_types_gen.go @@ -149,6 +149,10 @@ func (policy *StorageAccountsManagementPolicy) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (policy *StorageAccountsManagementPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage/storage_accounts_queue_service_types_gen.go b/v2/api/storage/v1api20210401/storage/storage_accounts_queue_service_types_gen.go index 290a4bd10fa..e2bff427287 100644 --- a/v2/api/storage/v1api20210401/storage/storage_accounts_queue_service_types_gen.go +++ b/v2/api/storage/v1api20210401/storage/storage_accounts_queue_service_types_gen.go @@ -148,6 +148,10 @@ func (service *StorageAccountsQueueService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsQueueService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage/storage_accounts_queue_services_queue_types_gen.go b/v2/api/storage/v1api20210401/storage/storage_accounts_queue_services_queue_types_gen.go index 5fe48cac1fe..93a6ed5b392 100644 --- a/v2/api/storage/v1api20210401/storage/storage_accounts_queue_services_queue_types_gen.go +++ b/v2/api/storage/v1api20210401/storage/storage_accounts_queue_services_queue_types_gen.go @@ -149,6 +149,10 @@ func (queue *StorageAccountsQueueServicesQueue) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (queue *StorageAccountsQueueServicesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage_account_types_gen.go b/v2/api/storage/v1api20210401/storage_account_types_gen.go index d255bd3c709..c421ba0e5b5 100644 --- a/v2/api/storage/v1api20210401/storage_account_types_gen.go +++ b/v2/api/storage/v1api20210401/storage_account_types_gen.go @@ -234,6 +234,10 @@ func (account *StorageAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *StorageAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage_accounts_blob_service_types_gen.go b/v2/api/storage/v1api20210401/storage_accounts_blob_service_types_gen.go index c0ec6d87d6b..44d91f27d9a 100644 --- a/v2/api/storage/v1api20210401/storage_accounts_blob_service_types_gen.go +++ b/v2/api/storage/v1api20210401/storage_accounts_blob_service_types_gen.go @@ -168,6 +168,10 @@ func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsBlobService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage_accounts_blob_services_container_types_gen.go b/v2/api/storage/v1api20210401/storage_accounts_blob_services_container_types_gen.go index 06142b0f624..e97b929ef9b 100644 --- a/v2/api/storage/v1api20210401/storage_accounts_blob_services_container_types_gen.go +++ b/v2/api/storage/v1api20210401/storage_accounts_blob_services_container_types_gen.go @@ -176,6 +176,10 @@ func (container *StorageAccountsBlobServicesContainer) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (container *StorageAccountsBlobServicesContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage_accounts_management_policy_types_gen.go b/v2/api/storage/v1api20210401/storage_accounts_management_policy_types_gen.go index 1e593297e95..fd6a9ed4b9b 100644 --- a/v2/api/storage/v1api20210401/storage_accounts_management_policy_types_gen.go +++ b/v2/api/storage/v1api20210401/storage_accounts_management_policy_types_gen.go @@ -169,6 +169,10 @@ func (policy *StorageAccountsManagementPolicy) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (policy *StorageAccountsManagementPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage_accounts_queue_service_types_gen.go b/v2/api/storage/v1api20210401/storage_accounts_queue_service_types_gen.go index 204b2e7e013..ddeb1b6c790 100644 --- a/v2/api/storage/v1api20210401/storage_accounts_queue_service_types_gen.go +++ b/v2/api/storage/v1api20210401/storage_accounts_queue_service_types_gen.go @@ -168,6 +168,10 @@ func (service *StorageAccountsQueueService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsQueueService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20210401/storage_accounts_queue_services_queue_types_gen.go b/v2/api/storage/v1api20210401/storage_accounts_queue_services_queue_types_gen.go index 0d0416b718b..d8da9bbdb95 100644 --- a/v2/api/storage/v1api20210401/storage_accounts_queue_services_queue_types_gen.go +++ b/v2/api/storage/v1api20210401/storage_accounts_queue_services_queue_types_gen.go @@ -176,6 +176,10 @@ func (queue *StorageAccountsQueueServicesQueue) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (queue *StorageAccountsQueueServicesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_account_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_account_types_gen.go index c9aba5a80f2..39cdc477982 100644 --- a/v2/api/storage/v1api20220901/storage/storage_account_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_account_types_gen.go @@ -194,6 +194,10 @@ func (account *StorageAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *StorageAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_blob_service_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_blob_service_types_gen.go index 665debdccc4..3731b33d711 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_blob_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_blob_service_types_gen.go @@ -135,6 +135,10 @@ func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsBlobService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_blob_services_container_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_blob_services_container_types_gen.go index 50756d8d252..2e5f4b3b3c5 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_blob_services_container_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_blob_services_container_types_gen.go @@ -136,6 +136,10 @@ func (container *StorageAccountsBlobServicesContainer) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (container *StorageAccountsBlobServicesContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_file_service_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_file_service_types_gen.go index 6114d7a4683..aa1b7d1ec28 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_file_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_file_service_types_gen.go @@ -135,6 +135,10 @@ func (service *StorageAccountsFileService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsFileService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_file_services_share_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_file_services_share_types_gen.go index 244e3fb6b54..4de4f19e3ca 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_file_services_share_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_file_services_share_types_gen.go @@ -136,6 +136,10 @@ func (share *StorageAccountsFileServicesShare) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (share *StorageAccountsFileServicesShare) Owner() *genruntime.ResourceReference { + if share.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(share.Spec) return share.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_management_policy_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_management_policy_types_gen.go index c790e1bacc7..bba5afa8ff0 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_management_policy_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_management_policy_types_gen.go @@ -136,6 +136,10 @@ func (policy *StorageAccountsManagementPolicy) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (policy *StorageAccountsManagementPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_queue_service_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_queue_service_types_gen.go index 8a6a95bf5c0..b79df30a09a 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_queue_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_queue_service_types_gen.go @@ -135,6 +135,10 @@ func (service *StorageAccountsQueueService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsQueueService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_queue_services_queue_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_queue_services_queue_types_gen.go index d684ea52f97..2b1d962e58b 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_queue_services_queue_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_queue_services_queue_types_gen.go @@ -136,6 +136,10 @@ func (queue *StorageAccountsQueueServicesQueue) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (queue *StorageAccountsQueueServicesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_table_service_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_table_service_types_gen.go index f24b9914430..70934841a62 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_table_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_table_service_types_gen.go @@ -135,6 +135,10 @@ func (service *StorageAccountsTableService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsTableService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage/storage_accounts_table_services_table_types_gen.go b/v2/api/storage/v1api20220901/storage/storage_accounts_table_services_table_types_gen.go index 202c91b57d2..c002c07f892 100644 --- a/v2/api/storage/v1api20220901/storage/storage_accounts_table_services_table_types_gen.go +++ b/v2/api/storage/v1api20220901/storage/storage_accounts_table_services_table_types_gen.go @@ -136,6 +136,10 @@ func (table *StorageAccountsTableServicesTable) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (table *StorageAccountsTableServicesTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_account_types_gen.go b/v2/api/storage/v1api20220901/storage_account_types_gen.go index 7fa05de2e79..93174856a00 100644 --- a/v2/api/storage/v1api20220901/storage_account_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_account_types_gen.go @@ -234,6 +234,10 @@ func (account *StorageAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *StorageAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_blob_service_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_blob_service_types_gen.go index 2fbd8b3c92f..3adf556cacb 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_blob_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_blob_service_types_gen.go @@ -168,6 +168,10 @@ func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsBlobService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_blob_services_container_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_blob_services_container_types_gen.go index 93da61d4793..7d8d5ce56d2 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_blob_services_container_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_blob_services_container_types_gen.go @@ -176,6 +176,10 @@ func (container *StorageAccountsBlobServicesContainer) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (container *StorageAccountsBlobServicesContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_file_service_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_file_service_types_gen.go index 6c306dd2ad6..ff7ae2b08cc 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_file_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_file_service_types_gen.go @@ -168,6 +168,10 @@ func (service *StorageAccountsFileService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsFileService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_file_services_share_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_file_services_share_types_gen.go index d69b9b63223..f1cb006fb84 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_file_services_share_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_file_services_share_types_gen.go @@ -176,6 +176,10 @@ func (share *StorageAccountsFileServicesShare) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (share *StorageAccountsFileServicesShare) Owner() *genruntime.ResourceReference { + if share.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(share.Spec) return share.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_management_policy_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_management_policy_types_gen.go index 2b3c676475c..79d89f8f551 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_management_policy_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_management_policy_types_gen.go @@ -169,6 +169,10 @@ func (policy *StorageAccountsManagementPolicy) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (policy *StorageAccountsManagementPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_queue_service_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_queue_service_types_gen.go index 3eabc97056f..c52fb66f228 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_queue_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_queue_service_types_gen.go @@ -168,6 +168,10 @@ func (service *StorageAccountsQueueService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsQueueService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_queue_services_queue_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_queue_services_queue_types_gen.go index 8e823394cc7..bb107c58ffd 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_queue_services_queue_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_queue_services_queue_types_gen.go @@ -176,6 +176,10 @@ func (queue *StorageAccountsQueueServicesQueue) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (queue *StorageAccountsQueueServicesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_table_service_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_table_service_types_gen.go index fee7a761815..e0e7f7cc2a8 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_table_service_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_table_service_types_gen.go @@ -168,6 +168,10 @@ func (service *StorageAccountsTableService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsTableService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20220901/storage_accounts_table_services_table_types_gen.go b/v2/api/storage/v1api20220901/storage_accounts_table_services_table_types_gen.go index 3d460ca9837..ec2f5a939f5 100644 --- a/v2/api/storage/v1api20220901/storage_accounts_table_services_table_types_gen.go +++ b/v2/api/storage/v1api20220901/storage_accounts_table_services_table_types_gen.go @@ -176,6 +176,10 @@ func (table *StorageAccountsTableServicesTable) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (table *StorageAccountsTableServicesTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_account_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_account_types_gen.go index f2faa11d56b..85eb58570d6 100644 --- a/v2/api/storage/v1api20230101/storage/storage_account_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_account_types_gen.go @@ -173,6 +173,10 @@ func (account *StorageAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *StorageAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_blob_service_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_blob_service_types_gen.go index 06294fb7749..64c06144c6d 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_blob_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_blob_service_types_gen.go @@ -114,6 +114,10 @@ func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsBlobService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_blob_services_container_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_blob_services_container_types_gen.go index edd35c87645..cce89274d21 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_blob_services_container_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_blob_services_container_types_gen.go @@ -115,6 +115,10 @@ func (container *StorageAccountsBlobServicesContainer) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (container *StorageAccountsBlobServicesContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_file_service_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_file_service_types_gen.go index 90e91e8fea5..6155bcc2d3f 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_file_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_file_service_types_gen.go @@ -114,6 +114,10 @@ func (service *StorageAccountsFileService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsFileService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_file_services_share_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_file_services_share_types_gen.go index 04ac1a607ce..28fa5c24cbb 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_file_services_share_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_file_services_share_types_gen.go @@ -115,6 +115,10 @@ func (share *StorageAccountsFileServicesShare) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (share *StorageAccountsFileServicesShare) Owner() *genruntime.ResourceReference { + if share.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(share.Spec) return share.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_management_policy_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_management_policy_types_gen.go index 8b3b092ed83..aaf0a083a2c 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_management_policy_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_management_policy_types_gen.go @@ -115,6 +115,10 @@ func (policy *StorageAccountsManagementPolicy) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (policy *StorageAccountsManagementPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_queue_service_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_queue_service_types_gen.go index 707b5589a8c..ee7accd4cda 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_queue_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_queue_service_types_gen.go @@ -114,6 +114,10 @@ func (service *StorageAccountsQueueService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsQueueService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_queue_services_queue_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_queue_services_queue_types_gen.go index 752228d2fd1..7bb1fc446dd 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_queue_services_queue_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_queue_services_queue_types_gen.go @@ -115,6 +115,10 @@ func (queue *StorageAccountsQueueServicesQueue) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (queue *StorageAccountsQueueServicesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_table_service_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_table_service_types_gen.go index e0fb148ac98..2b2798610f1 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_table_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_table_service_types_gen.go @@ -114,6 +114,10 @@ func (service *StorageAccountsTableService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsTableService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage/storage_accounts_table_services_table_types_gen.go b/v2/api/storage/v1api20230101/storage/storage_accounts_table_services_table_types_gen.go index fddfdb8eacc..d80f9611b82 100644 --- a/v2/api/storage/v1api20230101/storage/storage_accounts_table_services_table_types_gen.go +++ b/v2/api/storage/v1api20230101/storage/storage_accounts_table_services_table_types_gen.go @@ -115,6 +115,10 @@ func (table *StorageAccountsTableServicesTable) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (table *StorageAccountsTableServicesTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_account_types_gen.go b/v2/api/storage/v1api20230101/storage_account_types_gen.go index 1ac4ef58731..78eae7ff282 100644 --- a/v2/api/storage/v1api20230101/storage_account_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_account_types_gen.go @@ -231,6 +231,10 @@ func (account *StorageAccount) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (account *StorageAccount) Owner() *genruntime.ResourceReference { + if account.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(account.Spec) return account.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_blob_service_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_blob_service_types_gen.go index f99b6be7f3e..e651bcdf1d7 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_blob_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_blob_service_types_gen.go @@ -165,6 +165,10 @@ func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsBlobService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_blob_services_container_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_blob_services_container_types_gen.go index 91306e8b8f1..4b2bf33c3d4 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_blob_services_container_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_blob_services_container_types_gen.go @@ -173,6 +173,10 @@ func (container *StorageAccountsBlobServicesContainer) NewEmptyStatus() genrunti // Owner returns the ResourceReference of the owner func (container *StorageAccountsBlobServicesContainer) Owner() *genruntime.ResourceReference { + if container.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(container.Spec) return container.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_file_service_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_file_service_types_gen.go index d189946b1d7..0f6779426e9 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_file_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_file_service_types_gen.go @@ -165,6 +165,10 @@ func (service *StorageAccountsFileService) NewEmptyStatus() genruntime.Convertib // Owner returns the ResourceReference of the owner func (service *StorageAccountsFileService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_file_services_share_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_file_services_share_types_gen.go index 5022cfd2249..dc78f51eaf5 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_file_services_share_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_file_services_share_types_gen.go @@ -173,6 +173,10 @@ func (share *StorageAccountsFileServicesShare) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (share *StorageAccountsFileServicesShare) Owner() *genruntime.ResourceReference { + if share.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(share.Spec) return share.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_management_policy_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_management_policy_types_gen.go index 50300b8a6db..9eb430683f9 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_management_policy_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_management_policy_types_gen.go @@ -166,6 +166,10 @@ func (policy *StorageAccountsManagementPolicy) NewEmptyStatus() genruntime.Conve // Owner returns the ResourceReference of the owner func (policy *StorageAccountsManagementPolicy) Owner() *genruntime.ResourceReference { + if policy.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(policy.Spec) return policy.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_queue_service_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_queue_service_types_gen.go index 6f1875c1a85..5b19c2bd0d8 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_queue_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_queue_service_types_gen.go @@ -165,6 +165,10 @@ func (service *StorageAccountsQueueService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsQueueService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_queue_services_queue_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_queue_services_queue_types_gen.go index 6a1b80e0a4f..603f22730a0 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_queue_services_queue_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_queue_services_queue_types_gen.go @@ -173,6 +173,10 @@ func (queue *StorageAccountsQueueServicesQueue) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (queue *StorageAccountsQueueServicesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) return queue.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_table_service_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_table_service_types_gen.go index c8e0b1cced4..1dcad2a01f9 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_table_service_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_table_service_types_gen.go @@ -165,6 +165,10 @@ func (service *StorageAccountsTableService) NewEmptyStatus() genruntime.Converti // Owner returns the ResourceReference of the owner func (service *StorageAccountsTableService) Owner() *genruntime.ResourceReference { + if service.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(service.Spec) return service.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/storage/v1api20230101/storage_accounts_table_services_table_types_gen.go b/v2/api/storage/v1api20230101/storage_accounts_table_services_table_types_gen.go index b88d1569738..a94b635263a 100644 --- a/v2/api/storage/v1api20230101/storage_accounts_table_services_table_types_gen.go +++ b/v2/api/storage/v1api20230101/storage_accounts_table_services_table_types_gen.go @@ -173,6 +173,10 @@ func (table *StorageAccountsTableServicesTable) NewEmptyStatus() genruntime.Conv // Owner returns the ResourceReference of the owner func (table *StorageAccountsTableServicesTable) Owner() *genruntime.ResourceReference { + if table.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(table.Spec) return table.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/synapse/v1api20210601/storage/workspace_types_gen.go b/v2/api/synapse/v1api20210601/storage/workspace_types_gen.go index df9a370e64a..9b8549f5954 100644 --- a/v2/api/synapse/v1api20210601/storage/workspace_types_gen.go +++ b/v2/api/synapse/v1api20210601/storage/workspace_types_gen.go @@ -116,6 +116,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/synapse/v1api20210601/storage/workspaces_big_data_pool_types_gen.go b/v2/api/synapse/v1api20210601/storage/workspaces_big_data_pool_types_gen.go index 7131f87308c..793ca5f8d99 100644 --- a/v2/api/synapse/v1api20210601/storage/workspaces_big_data_pool_types_gen.go +++ b/v2/api/synapse/v1api20210601/storage/workspaces_big_data_pool_types_gen.go @@ -115,6 +115,10 @@ func (pool *WorkspacesBigDataPool) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (pool *WorkspacesBigDataPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/synapse/v1api20210601/workspace_types_gen.go b/v2/api/synapse/v1api20210601/workspace_types_gen.go index 11b3852a099..ed4773bf4a7 100644 --- a/v2/api/synapse/v1api20210601/workspace_types_gen.go +++ b/v2/api/synapse/v1api20210601/workspace_types_gen.go @@ -174,6 +174,10 @@ func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) return workspace.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/synapse/v1api20210601/workspaces_big_data_pool_types_gen.go b/v2/api/synapse/v1api20210601/workspaces_big_data_pool_types_gen.go index 4177731a1af..68bf8a31dad 100644 --- a/v2/api/synapse/v1api20210601/workspaces_big_data_pool_types_gen.go +++ b/v2/api/synapse/v1api20210601/workspaces_big_data_pool_types_gen.go @@ -173,6 +173,10 @@ func (pool *WorkspacesBigDataPool) NewEmptyStatus() genruntime.ConvertibleStatus // Owner returns the ResourceReference of the owner func (pool *WorkspacesBigDataPool) Owner() *genruntime.ResourceReference { + if pool.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(pool.Spec) return pool.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/web/v1api20220301/server_farm_types_gen.go b/v2/api/web/v1api20220301/server_farm_types_gen.go index 09087deeab2..cd76ca3d9ce 100644 --- a/v2/api/web/v1api20220301/server_farm_types_gen.go +++ b/v2/api/web/v1api20220301/server_farm_types_gen.go @@ -173,6 +173,10 @@ func (farm *ServerFarm) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (farm *ServerFarm) Owner() *genruntime.ResourceReference { + if farm.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(farm.Spec) return farm.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/web/v1api20220301/site_types_gen.go b/v2/api/web/v1api20220301/site_types_gen.go index f554d2e9544..24d4e5df7b8 100644 --- a/v2/api/web/v1api20220301/site_types_gen.go +++ b/v2/api/web/v1api20220301/site_types_gen.go @@ -173,6 +173,10 @@ func (site *Site) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (site *Site) Owner() *genruntime.ResourceReference { + if site.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(site.Spec) return site.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/web/v1api20220301/storage/server_farm_types_gen.go b/v2/api/web/v1api20220301/storage/server_farm_types_gen.go index 21cb6833ab3..6bce37c42bb 100644 --- a/v2/api/web/v1api20220301/storage/server_farm_types_gen.go +++ b/v2/api/web/v1api20220301/storage/server_farm_types_gen.go @@ -115,6 +115,10 @@ func (farm *ServerFarm) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (farm *ServerFarm) Owner() *genruntime.ResourceReference { + if farm.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(farm.Spec) return farm.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/api/web/v1api20220301/storage/site_types_gen.go b/v2/api/web/v1api20220301/storage/site_types_gen.go index 73739238ede..e34775dc3ca 100644 --- a/v2/api/web/v1api20220301/storage/site_types_gen.go +++ b/v2/api/web/v1api20220301/storage/site_types_gen.go @@ -115,6 +115,10 @@ func (site *Site) NewEmptyStatus() genruntime.ConvertibleStatus { // Owner returns the ResourceReference of the owner func (site *Site) Owner() *genruntime.ResourceReference { + if site.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(site.Spec) return site.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/internal/reconcilers/arm/azure_generic_arm_reconciler_instance.go b/v2/internal/reconcilers/arm/azure_generic_arm_reconciler_instance.go index 84875563a2c..79e516ca58e 100644 --- a/v2/internal/reconcilers/arm/azure_generic_arm_reconciler_instance.go +++ b/v2/internal/reconcilers/arm/azure_generic_arm_reconciler_instance.go @@ -835,7 +835,7 @@ func (r *azureDeploymentReconcilerInstance) deleteResource( // If we have no resourceID to begin with, the Azure resource was never created resourceID := genruntime.GetResourceIDOrDefault(obj) if resourceID == "" { - log.V(Status).Info("Not issuing delete as resource had no ResourceID annotation") + log.V(Status).Info("Not issuing ARM delete as resource had no ResourceID annotation") return ctrl.Result{}, nil } diff --git a/v2/internal/resolver/resource_hierarchy.go b/v2/internal/resolver/resource_hierarchy.go index e879abe0c47..50fae0f77a0 100644 --- a/v2/internal/resolver/resource_hierarchy.go +++ b/v2/internal/resolver/resource_hierarchy.go @@ -101,6 +101,12 @@ func (h ResourceHierarchy) fullyQualifiedARMIDImpl(subscriptionID string, origin lastResource := h[len(h)-1] lastResourceScope := lastResource.GetResourceScope() + // Under normal circumstances, this can't happen - but if there's a problem with the + // webhooks it is possible. We can't create a valid ARM ID without an AzureName, so we fail here. + if lastResource.AzureName() == "" { + return "", eris.Errorf("resource has empty AzureName, cannot create fully qualified ARM ID") + } + if lastResourceScope == genruntime.ResourceScopeExtension { var parentARMID string if lastResource.Owner().IsDirectARMReference() { diff --git a/v2/internal/resolver/resource_hierarchy_test.go b/v2/internal/resolver/resource_hierarchy_test.go index 0e364b86a2b..67045548cfb 100644 --- a/v2/internal/resolver/resource_hierarchy_test.go +++ b/v2/internal/resolver/resource_hierarchy_test.go @@ -12,7 +12,9 @@ import ( . "github.com/onsi/gomega" "github.com/google/uuid" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + batch "github.com/Azure/azure-service-operator/v2/api/batch/v1api20210101" "github.com/Azure/azure-service-operator/v2/internal/resolver" "github.com/Azure/azure-service-operator/v2/internal/util/to" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" @@ -404,3 +406,34 @@ func Test_ResourceHierarchy_ChildResourceIDOverride_ImpactsExtensionResource(t * g.Expect(hierarchy.FullyQualifiedARMID("00000000-0000-0000-0000-000000000000")).To(Equal(expectedARMID)) g.Expect(hierarchy.AzureName()).To(Equal(extensionName)) } + +func Test_ResourceHierarchy_GivenTopLevelResourceMissingAzureName_ReturnsError(t *testing.T) { + t.Parallel() + g := NewGomegaWithT(t) + + resourceGroupName := "myrg" + a := createResourceGroup(resourceGroupName) + + name := "myresource" + b := &batch.BatchAccount{ + TypeMeta: metav1.TypeMeta{ + Kind: "BatchAccount", + APIVersion: batch.GroupVersion.String(), + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: testNamespace, + }, + Spec: batch.BatchAccount_Spec{ + Owner: &genruntime.KnownResourceReference{ + Name: resourceGroupName, + }, + }, + } + + hierarchy := resolver.ResourceHierarchy{a, b} + _, err := hierarchy.FullyQualifiedARMID("00000000-0000-0000-0000-000000000000") + + g.Expect(err).To(HaveOccurred()) + g.Expect(err.Error()).To(ContainSubstring("empty AzureName")) +} diff --git a/v2/pkg/genruntime/admissions.go b/v2/pkg/genruntime/admissions.go index ff6763213c5..b053c31e76f 100644 --- a/v2/pkg/genruntime/admissions.go +++ b/v2/pkg/genruntime/admissions.go @@ -38,8 +38,17 @@ func ValidateWriteOnceProperties(oldObj ARMMetaObject, newObj ARMMetaObject) (ad return nil, nil } - if oldObj.AzureName() != newObj.AzureName() { - errs = append(errs, eris.Errorf("updating 'spec.azureName' is not allowed for '%s : %s", oldObj.GetObjectKind().GroupVersionKind(), oldObj.GetName())) + // Prohibit changing the AzureName, + // but allow it to be set if it's empty. + // + // https://github.com/Azure/azure-service-operator/issues/4306 + oldName := oldObj.AzureName() + if oldName != "" && oldName != newObj.AzureName() { + err := eris.Errorf( + "updating 'spec.azureName' is not allowed for '%s : %s", + oldObj.GetObjectKind().GroupVersionKind(), + oldObj.GetName()) + errs = append(errs, err) } // Ensure that owner has not been changed diff --git a/v2/pkg/genruntime/admissions_test.go b/v2/pkg/genruntime/admissions_test.go new file mode 100644 index 00000000000..61d0bba8aa0 --- /dev/null +++ b/v2/pkg/genruntime/admissions_test.go @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + */ + +package genruntime_test + +import ( + "fmt" + "testing" + + . "github.com/onsi/gomega" + + "github.com/google/uuid" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + batch "github.com/Azure/azure-service-operator/v2/api/batch/v1api20210101" + resources "github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601" + "github.com/Azure/azure-service-operator/v2/internal/resolver" + "github.com/Azure/azure-service-operator/v2/internal/util/to" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func TestValidateWriteOnceProperties_ReturnsExpectedErrors(t *testing.T) { + t.Parallel() + + testSub := uuid.New().String() + resourceGroup := createResourceGroup( + "rg", + testSub, + ) + + otherOwner := &genruntime.KnownResourceReference{ + Name: "other-owner", + } + + cases := map[string]struct { + modifyOriginal func(*batch.BatchAccount) + modifyUpdate func(*batch.BatchAccount) + expectedErrorSubstrings []string + }{ + "WhenNotYetCreated_CanBeModified": { + modifyOriginal: removeResourceIDAnnotation, + }, + "WhenNoChange_CanBeModified": {}, + "WhenOriginalHasNoOwner_CannotAddOwner": { + modifyOriginal: setOwner(nil), + expectedErrorSubstrings: []string{ + "adding an owner", + "already created resource", + "is not allowed", + }, + }, + "WhenUpdateHasNoOwner_CannotRemoveOwner": { + modifyUpdate: setOwner(nil), + expectedErrorSubstrings: []string{ + "removing 'spec.owner'", + "is not allowed", + }, + }, + "WhenUpdateHasDifferentOwner_CannotChangeOwner": { + modifyUpdate: setOwner(otherOwner), + expectedErrorSubstrings: []string{ + "updating 'spec.owner.name'", + "is not allowed", + }, + }, + "WhenUpdateHasDifferentAzureName_CannotChangeAzureName": { + modifyUpdate: setAzureName("new-name"), + expectedErrorSubstrings: []string{ + "updating 'spec.azureName'", + "is not allowed", + }, + }, + "WhenOriginalHasNoAzureName_CanSetAzureName": { + modifyOriginal: setAzureName(""), + }, + } + + for n, c := range cases { + t.Run(n, func(t *testing.T) { + t.Parallel() + g := NewGomegaWithT(t) + + originalAccount := createBatchAccount("acc", resourceGroup) + updatedAccount := originalAccount.DeepCopy() + + if c.modifyOriginal != nil { + c.modifyOriginal(originalAccount) + } + + if c.modifyUpdate != nil { + c.modifyUpdate(updatedAccount) + } + + _, err := genruntime.ValidateWriteOnceProperties(originalAccount, updatedAccount) + + if len(c.expectedErrorSubstrings) == 0 { + g.Expect(err).To(BeNil()) + } else { + g.Expect(err).To(Not(BeNil())) + for _, s := range c.expectedErrorSubstrings { + g.Expect(err.Error()).To(ContainSubstring(s)) + } + } + }) + } +} + +func removeResourceIDAnnotation(acc *batch.BatchAccount) { + delete(acc.ObjectMeta.Annotations, genruntime.ResourceIDAnnotation) +} + +func setAzureName(name string) func(acc *batch.BatchAccount) { + return func(acc *batch.BatchAccount) { + acc.Spec.AzureName = name + } +} + +func setOwner(ref *genruntime.KnownResourceReference) func(acc *batch.BatchAccount) { + return func(acc *batch.BatchAccount) { + acc.Spec.Owner = ref + } +} + +func createResourceGroup( + name string, + namespace string, +) *resources.ResourceGroup { + return &resources.ResourceGroup{ + TypeMeta: metav1.TypeMeta{ + Kind: resolver.ResourceGroupKind, + APIVersion: resources.GroupVersion.String(), + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + }, + Spec: resources.ResourceGroup_Spec{ + Location: to.Ptr("West US"), + AzureName: name, + }, + } +} + +func createBatchAccount( + name string, + owner genruntime.ARMMetaObject, +) *batch.BatchAccount { + return &batch.BatchAccount{ + TypeMeta: metav1.TypeMeta{ + Kind: "BatchAccount", + APIVersion: batch.GroupVersion.String(), + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: owner.GetNamespace(), + Annotations: map[string]string{ + genruntime.ResourceIDAnnotation: fmt.Sprintf("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/%s", name), + }, + }, + Spec: batch.BatchAccount_Spec{ + Owner: &genruntime.KnownResourceReference{ + Name: owner.GetName(), + }, + AzureName: name, + }, + } +} diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_oneof_resource_conversion_on_arm_type_only_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_oneof_resource_conversion_on_arm_type_only_azure_v1api20200101.golden index 2ba0c6b0a4a..0c375b4a9c6 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_oneof_resource_conversion_on_arm_type_only_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_oneof_resource_conversion_on_arm_type_only_azure_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_dependent_resource_and_ownership_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_dependent_resource_and_ownership_azure_v1api20200101.golden index 39bdb745552..06c2a020e62 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_dependent_resource_and_ownership_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_dependent_resource_and_ownership_azure_v1api20200101.golden @@ -146,6 +146,10 @@ func (a *A) GetType() string { // Owner returns the ResourceReference of the owner func (a *A) Owner() *genruntime.ResourceReference { + if a.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(a.Spec) return a.Spec.Owner.AsResourceReference(group, kind) } @@ -431,6 +435,10 @@ func (b *B) GetType() string { // Owner returns the ResourceReference of the owner func (b *B) Owner() *genruntime.ResourceReference { + if b.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(b.Spec) return b.Spec.Owner.AsResourceReference(group, kind) } @@ -716,6 +724,10 @@ func (c *C) GetType() string { // Owner returns the ResourceReference of the owner func (c *C) Owner() *genruntime.ResourceReference { + if c.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(c.Spec) return c.Spec.Owner.AsResourceReference(group, kind) } @@ -1001,6 +1013,10 @@ func (d *D) GetType() string { // Owner returns the ResourceReference of the owner func (d *D) Owner() *genruntime.ResourceReference { + if d.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(d.Spec) return d.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_id_resource_reference_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_id_resource_reference_azure_v1api20200101.golden index 7d55e120d95..ed9ca820f54 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_id_resource_reference_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_id_resource_reference_azure_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_required_and_optional_resource_references_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_required_and_optional_resource_references_azure_v1api20200101.golden index cf395520d11..db59f4923b6 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_required_and_optional_resource_references_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_required_and_optional_resource_references_azure_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_array_properties_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_array_properties_azure_v1api20200101.golden index d7fbea35fd9..20ba8849260 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_array_properties_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_array_properties_azure_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_complex_properties_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_complex_properties_azure_v1api20200101.golden index 22486afa3da..ac73d5110ee 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_complex_properties_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_complex_properties_azure_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_json_fields_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_json_fields_azure_v1api20200101.golden index 078407b638d..9a1b60688a1 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_json_fields_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_json_fields_azure_v1api20200101.golden @@ -149,6 +149,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_map_properties_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_map_properties_azure_v1api20200101.golden index 9de16fcf3f6..459e3a914b7 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_map_properties_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_map_properties_azure_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_renders_spec_azure_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_renders_spec_azure_v1api20200101.golden index 2ba0c6b0a4a..0c375b4a9c6 100644 --- a/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_renders_spec_azure_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/ArmResource/Arm_test_simple_resource_renders_spec_azure_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/EmbeddedTypes/Embedded_type_simple_resource_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/EmbeddedTypes/Embedded_type_simple_resource_v1api20200101.golden index 7ba77a0c32d..ca892705db7 100644 --- a/v2/tools/generator/internal/codegen/testdata/EmbeddedTypes/Embedded_type_simple_resource_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/EmbeddedTypes/Embedded_type_simple_resource_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *FakeResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *FakeResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/EnumNames/Multi_valued_enum_name_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/EnumNames/Multi_valued_enum_name_v1api20200101.golden index 9e45ba21a09..472b3cc31ae 100644 --- a/v2/tools/generator/internal/codegen/testdata/EnumNames/Multi_valued_enum_name_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/EnumNames/Multi_valued_enum_name_v1api20200101.golden @@ -148,6 +148,10 @@ func (resource *AResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *AResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/codegen/testdata/EnumNames/Single_valued_enum_name_v1api20200101.golden b/v2/tools/generator/internal/codegen/testdata/EnumNames/Single_valued_enum_name_v1api20200101.golden index f454e269666..3024ef4e71c 100644 --- a/v2/tools/generator/internal/codegen/testdata/EnumNames/Single_valued_enum_name_v1api20200101.golden +++ b/v2/tools/generator/internal/codegen/testdata/EnumNames/Single_valued_enum_name_v1api20200101.golden @@ -141,6 +141,10 @@ func (resource *AResource) GetType() string { // Owner returns the ResourceReference of the owner func (resource *AResource) Owner() *genruntime.ResourceReference { + if resource.Spec.Owner == nil { + return nil + } + group, kind := genruntime.LookupOwnerGroupKind(resource.Spec) return resource.Spec.Owner.AsResourceReference(group, kind) } diff --git a/v2/tools/generator/internal/interfaces/kubernetes_resource_interface.go b/v2/tools/generator/internal/interfaces/kubernetes_resource_interface.go index cf77b8b836a..1af718b7da5 100644 --- a/v2/tools/generator/internal/interfaces/kubernetes_resource_interface.go +++ b/v2/tools/generator/internal/interfaces/kubernetes_resource_interface.go @@ -409,26 +409,33 @@ func getOwnerFunction( } owner := astbuilder.Selector(specSelector, astmodel.OwnerProperty) + nilOwnerCheck := astbuilder.IfNil(owner, astbuilder.Returns(astbuilder.Nil())) + nilOwnerCheck.Decs.After = dst.EmptyLine switch r.Resource().Scope() { case astmodel.ResourceScopeResourceGroup: fn.AddComments("returns the ResourceReference of the owner") fn.AddStatements( + nilOwnerCheck, lookupGroupAndKindStmt(groupLocal, kindLocal, specSelector), astbuilder.Returns(createResourceReferenceWithGroupKind(dst.NewIdent(groupLocal), dst.NewIdent(kindLocal), owner))) + case astmodel.ResourceScopeExtension: fn.AddComments("returns the ResourceReference of the owner") - fn.AddStatements( + nilOwnerCheck, astbuilder.Returns(createResourceReference(owner))) + case astmodel.ResourceScopeTenant: // Tenant resources never have an owner, just return nil fn.AddComments("returns nil as Tenant scoped resources never have an owner") fn.AddStatements(astbuilder.Returns(astbuilder.Nil())) + case astmodel.ResourceScopeLocation: // Location resources never have an owner, just return nil fn.AddComments("returns nil as Location scoped resources never have an owner") fn.AddStatements(astbuilder.Returns(astbuilder.Nil())) + default: panic(fmt.Sprintf("unknown resource kind: %s", r.Resource().Scope())) }