From 87f6e791656d078fee1d1a40c16e22df72ca5801 Mon Sep 17 00:00:00 2001 From: Bevan Arps Date: Wed, 27 Nov 2024 14:08:13 +1300 Subject: [PATCH] Allow recovery if resources have a missing AzureName (#4460) * Avoid creating an ARM ID if AzureName is empty * Add nil owner check and update tests * Update generated types * Allow AzureName to be set if blank * Code gardening * Update reference * Code gardening --- .../smart_detector_alert_rule_types_gen.go | 4 + .../smart_detector_alert_rule_types_gen.go | 4 + .../prometheus_rule_group_types_gen.go | 4 + .../prometheus_rule_group_types_gen.go | 4 + .../v1api20220801/api_types_gen.go | 4 + .../api_version_set_types_gen.go | 4 + .../authorization_provider_types_gen.go | 4 + ...ation_providers_authorization_types_gen.go | 4 + ..._authorizations_access_policy_types_gen.go | 4 + .../v1api20220801/backend_types_gen.go | 4 + .../v1api20220801/named_value_types_gen.go | 4 + .../policy_fragment_types_gen.go | 4 + .../v1api20220801/policy_types_gen.go | 4 + .../v1api20220801/product_api_types_gen.go | 4 + .../v1api20220801/product_policy_types_gen.go | 4 + .../v1api20220801/product_types_gen.go | 4 + .../v1api20220801/service_types_gen.go | 4 + .../v1api20220801/storage/api_types_gen.go | 4 + .../storage/api_version_set_types_gen.go | 4 + .../authorization_provider_types_gen.go | 4 + ...ation_providers_authorization_types_gen.go | 4 + ..._authorizations_access_policy_types_gen.go | 4 + .../storage/backend_types_gen.go | 4 + .../storage/named_value_types_gen.go | 4 + .../storage/policy_fragment_types_gen.go | 4 + .../v1api20220801/storage/policy_types_gen.go | 4 + .../storage/product_api_types_gen.go | 4 + .../storage/product_policy_types_gen.go | 4 + .../storage/product_types_gen.go | 4 + .../storage/service_types_gen.go | 4 + .../storage/subscription_types_gen.go | 4 + .../v1api20220801/subscription_types_gen.go | 4 + .../v1api20230501preview/api_types_gen.go | 4 + .../api_version_set_types_gen.go | 4 + .../authorization_provider_types_gen.go | 4 + ...ation_providers_authorization_types_gen.go | 4 + ..._authorizations_access_policy_types_gen.go | 4 + .../v1api20230501preview/backend_types_gen.go | 4 + .../named_value_types_gen.go | 4 + .../policy_fragment_types_gen.go | 4 + .../v1api20230501preview/policy_types_gen.go | 4 + .../product_api_types_gen.go | 4 + .../product_policy_types_gen.go | 4 + .../v1api20230501preview/product_types_gen.go | 4 + .../v1api20230501preview/service_types_gen.go | 4 + .../storage/api_types_gen.go | 4 + .../storage/api_version_set_types_gen.go | 4 + .../authorization_provider_types_gen.go | 4 + ...ation_providers_authorization_types_gen.go | 4 + ..._authorizations_access_policy_types_gen.go | 4 + .../storage/backend_types_gen.go | 4 + .../storage/named_value_types_gen.go | 4 + .../storage/policy_fragment_types_gen.go | 4 + .../storage/policy_types_gen.go | 4 + .../storage/product_api_types_gen.go | 4 + .../storage/product_policy_types_gen.go | 4 + .../storage/product_types_gen.go | 4 + .../storage/service_types_gen.go | 4 + .../storage/subscription_types_gen.go | 4 + .../subscription_types_gen.go | 4 + .../configuration_store_types_gen.go | 4 + .../storage/configuration_store_types_gen.go | 4 + .../role_assignment_types_gen.go | 4 + .../storage/role_assignment_types_gen.go | 4 + .../role_assignment_types_gen.go | 4 + .../role_definition_types_gen.go | 4 + .../storage/role_assignment_types_gen.go | 4 + .../storage/role_definition_types_gen.go | 4 + .../v1api20210101/batch_account_types_gen.go | 4 + .../storage/batch_account_types_gen.go | 4 + .../redis_firewall_rule_types_gen.go | 4 + .../redis_linked_server_types_gen.go | 4 + .../redis_patch_schedule_types_gen.go | 4 + v2/api/cache/v1api20201201/redis_types_gen.go | 4 + .../storage/redis_firewall_rule_types_gen.go | 4 + .../storage/redis_linked_server_types_gen.go | 4 + .../storage/redis_patch_schedule_types_gen.go | 4 + .../v1api20201201/storage/redis_types_gen.go | 4 + .../redis_enterprise_database_types_gen.go | 4 + .../redis_enterprise_types_gen.go | 4 + .../redis_enterprise_database_types_gen.go | 4 + .../storage/redis_enterprise_types_gen.go | 4 + .../redis_firewall_rule_types_gen.go | 4 + .../redis_linked_server_types_gen.go | 4 + .../redis_patch_schedule_types_gen.go | 4 + v2/api/cache/v1api20230401/redis_types_gen.go | 4 + .../storage/redis_firewall_rule_types_gen.go | 4 + .../storage/redis_linked_server_types_gen.go | 4 + .../storage/redis_patch_schedule_types_gen.go | 4 + .../v1api20230401/storage/redis_types_gen.go | 4 + .../redis_enterprise_database_types_gen.go | 4 + .../redis_enterprise_types_gen.go | 4 + .../redis_enterprise_database_types_gen.go | 4 + .../storage/redis_enterprise_types_gen.go | 4 + .../redis_firewall_rule_types_gen.go | 4 + .../redis_linked_server_types_gen.go | 4 + .../redis_patch_schedule_types_gen.go | 4 + v2/api/cache/v1api20230801/redis_types_gen.go | 4 + .../storage/redis_firewall_rule_types_gen.go | 4 + .../storage/redis_linked_server_types_gen.go | 4 + .../storage/redis_patch_schedule_types_gen.go | 4 + .../v1api20230801/storage/redis_types_gen.go | 4 + v2/api/cdn/v1api20210601/profile_types_gen.go | 4 + .../profiles_endpoint_types_gen.go | 4 + .../storage/profile_types_gen.go | 4 + .../storage/profiles_endpoint_types_gen.go | 4 + .../afd_custom_domain_types_gen.go | 4 + .../v1api20230501/afd_endpoint_types_gen.go | 4 + .../afd_origin_group_types_gen.go | 4 + .../cdn/v1api20230501/afd_origin_types_gen.go | 4 + v2/api/cdn/v1api20230501/profile_types_gen.go | 4 + v2/api/cdn/v1api20230501/route_types_gen.go | 4 + .../cdn/v1api20230501/rule_set_types_gen.go | 4 + v2/api/cdn/v1api20230501/rule_types_gen.go | 4 + v2/api/cdn/v1api20230501/secret_types_gen.go | 4 + .../security_policy_types_gen.go | 4 + .../storage/afd_custom_domain_types_gen.go | 4 + .../storage/afd_endpoint_types_gen.go | 4 + .../storage/afd_origin_group_types_gen.go | 4 + .../storage/afd_origin_types_gen.go | 4 + .../storage/profile_types_gen.go | 4 + .../v1api20230501/storage/route_types_gen.go | 4 + .../storage/rule_set_types_gen.go | 4 + .../v1api20230501/storage/rule_types_gen.go | 4 + .../v1api20230501/storage/secret_types_gen.go | 4 + .../storage/security_policy_types_gen.go | 4 + .../compute/v1api20200930/disk_types_gen.go | 4 + .../v1api20200930/snapshot_types_gen.go | 4 + .../v1api20200930/storage/disk_types_gen.go | 4 + .../storage/snapshot_types_gen.go | 4 + .../virtual_machine_scale_set_types_gen.go | 4 + ..._machine_scale_sets_extension_types_gen.go | 4 + .../storage/virtual_machine_types_gen.go | 4 + .../virtual_machines_extension_types_gen.go | 4 + .../virtual_machine_scale_set_types_gen.go | 4 + ..._machine_scale_sets_extension_types_gen.go | 4 + .../virtual_machine_types_gen.go | 4 + .../virtual_machines_extension_types_gen.go | 4 + .../compute/v1api20210701/image_types_gen.go | 4 + .../v1api20210701/storage/image_types_gen.go | 4 + .../compute/v1api20220301/image_types_gen.go | 4 + .../v1api20220301/storage/image_types_gen.go | 4 + .../virtual_machine_scale_set_types_gen.go | 4 + ..._machine_scale_sets_extension_types_gen.go | 4 + .../storage/virtual_machine_types_gen.go | 4 + .../virtual_machines_extension_types_gen.go | 4 + .../virtual_machine_scale_set_types_gen.go | 4 + ..._machine_scale_sets_extension_types_gen.go | 4 + .../virtual_machine_types_gen.go | 4 + .../virtual_machines_extension_types_gen.go | 4 + .../disk_encryption_set_types_gen.go | 4 + .../storage/disk_encryption_set_types_gen.go | 4 + .../v1api20240302/disk_access_types_gen.go | 4 + .../disk_encryption_set_types_gen.go | 4 + .../compute/v1api20240302/disk_types_gen.go | 4 + .../v1api20240302/snapshot_types_gen.go | 4 + .../storage/disk_access_types_gen.go | 4 + .../storage/disk_encryption_set_types_gen.go | 4 + .../v1api20240302/storage/disk_types_gen.go | 4 + .../storage/snapshot_types_gen.go | 4 + .../container_group_types_gen.go | 4 + .../storage/container_group_types_gen.go | 4 + .../v1api20210901/registry_types_gen.go | 4 + .../storage/registry_types_gen.go | 4 + .../managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../storage/managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../storage/managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../v1api20230315preview/fleet_types_gen.go | 4 + .../fleets_member_types_gen.go | 4 + .../fleets_update_run_types_gen.go | 4 + .../storage/fleet_types_gen.go | 4 + .../storage/fleets_member_types_gen.go | 4 + .../storage/fleets_update_run_types_gen.go | 4 + .../managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../storage/managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../trusted_access_role_binding_types_gen.go | 4 + .../trusted_access_role_binding_types_gen.go | 4 + .../managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../storage/managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../storage/managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../trusted_access_role_binding_types_gen.go | 4 + .../trusted_access_role_binding_types_gen.go | 4 + .../maintenance_configuration_types_gen.go | 4 + .../managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../maintenance_configuration_types_gen.go | 4 + .../storage/managed_cluster_types_gen.go | 4 + .../managed_clusters_agent_pool_types_gen.go | 4 + .../trusted_access_role_binding_types_gen.go | 4 + .../trusted_access_role_binding_types_gen.go | 4 + .../v1api20180601/factory_types_gen.go | 4 + .../storage/factory_types_gen.go | 4 + .../v1api20230101/backup_vault_types_gen.go | 4 + .../backup_vaults_backup_policy_types_gen.go | 4 + .../storage/backup_vault_types_gen.go | 4 + .../backup_vaults_backup_policy_types_gen.go | 4 + .../v1api20231101/backup_vault_types_gen.go | 4 + ...backup_vaults_backup_instance_types_gen.go | 4 + .../backup_vaults_backup_policy_types_gen.go | 4 + .../storage/backup_vault_types_gen.go | 4 + ...backup_vaults_backup_instance_types_gen.go | 4 + .../backup_vaults_backup_policy_types_gen.go | 4 + .../v1api20180601/configuration_types_gen.go | 4 + .../v1api20180601/database_types_gen.go | 4 + .../v1api20180601/server_types_gen.go | 4 + .../storage/configuration_types_gen.go | 4 + .../storage/database_types_gen.go | 4 + .../v1api20180601/storage/server_types_gen.go | 4 + .../flexible_server_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../storage/flexible_server_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + ...lexible_servers_administrator_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + ...lexible_servers_administrator_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_server_types_gen.go | 4 + ...lexible_servers_administrator_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../storage/flexible_server_types_gen.go | 4 + ...lexible_servers_administrator_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../storage/flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../storage/flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../storage/flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../storage/flexible_server_types_gen.go | 4 + ...lexible_servers_configuration_types_gen.go | 4 + .../flexible_servers_database_types_gen.go | 4 + ...lexible_servers_firewall_rule_types_gen.go | 4 + .../v1api20210702/iot_hub_types_gen.go | 4 + .../storage/iot_hub_types_gen.go | 4 + .../database_account_types_gen.go | 4 + ...collection_throughput_setting_types_gen.go | 4 + .../mongodb_database_collection_types_gen.go | 4 + ...b_database_throughput_setting_types_gen.go | 4 + .../mongodb_database_types_gen.go | 4 + ...se_container_stored_procedure_types_gen.go | 4 + ..._container_throughput_setting_types_gen.go | 4 + ...ql_database_container_trigger_types_gen.go | 4 + .../sql_database_container_types_gen.go | 4 + ...ntainer_user_defined_function_types_gen.go | 4 + ...l_database_throughput_setting_types_gen.go | 4 + .../v1api20210515/sql_database_types_gen.go | 4 + .../sql_role_assignment_types_gen.go | 4 + .../storage/database_account_types_gen.go | 4 + ...collection_throughput_setting_types_gen.go | 4 + .../mongodb_database_collection_types_gen.go | 4 + ...b_database_throughput_setting_types_gen.go | 4 + .../storage/mongodb_database_types_gen.go | 4 + ...se_container_stored_procedure_types_gen.go | 4 + ..._container_throughput_setting_types_gen.go | 4 + ...ql_database_container_trigger_types_gen.go | 4 + .../sql_database_container_types_gen.go | 4 + ...ntainer_user_defined_function_types_gen.go | 4 + ...l_database_throughput_setting_types_gen.go | 4 + .../storage/sql_database_types_gen.go | 4 + .../storage/sql_role_assignment_types_gen.go | 4 + .../database_account_types_gen.go | 4 + ...collection_throughput_setting_types_gen.go | 4 + .../mongodb_database_collection_types_gen.go | 4 + ...b_database_throughput_setting_types_gen.go | 4 + .../mongodb_database_types_gen.go | 4 + ...se_container_stored_procedure_types_gen.go | 4 + ..._container_throughput_setting_types_gen.go | 4 + ...ql_database_container_trigger_types_gen.go | 4 + .../sql_database_container_types_gen.go | 4 + ...ntainer_user_defined_function_types_gen.go | 4 + ...l_database_throughput_setting_types_gen.go | 4 + .../v1api20231115/sql_database_types_gen.go | 4 + .../sql_role_assignment_types_gen.go | 4 + .../storage/database_account_types_gen.go | 4 + ...collection_throughput_setting_types_gen.go | 4 + .../mongodb_database_collection_types_gen.go | 4 + ...b_database_throughput_setting_types_gen.go | 4 + .../storage/mongodb_database_types_gen.go | 4 + ...se_container_stored_procedure_types_gen.go | 4 + ..._container_throughput_setting_types_gen.go | 4 + ...ql_database_container_trigger_types_gen.go | 4 + .../sql_database_container_types_gen.go | 4 + ...ntainer_user_defined_function_types_gen.go | 4 + ...l_database_throughput_setting_types_gen.go | 4 + .../storage/sql_database_types_gen.go | 4 + .../storage/sql_role_assignment_types_gen.go | 4 + .../v1api20200601/domain_types_gen.go | 4 + .../v1api20200601/domains_topic_types_gen.go | 4 + .../event_subscription_types_gen.go | 4 + .../v1api20200601/storage/domain_types_gen.go | 4 + .../storage/domains_topic_types_gen.go | 4 + .../storage/event_subscription_types_gen.go | 4 + .../v1api20200601/storage/topic_types_gen.go | 4 + .../v1api20200601/topic_types_gen.go | 4 + .../v1api20211101/namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../namespaces_eventhub_types_gen.go | 4 + ..._eventhubs_authorization_rule_types_gen.go | 4 + ...aces_eventhubs_consumer_group_types_gen.go | 4 + .../storage/namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../storage/namespaces_eventhub_types_gen.go | 4 + ..._eventhubs_authorization_rule_types_gen.go | 4 + ...aces_eventhubs_consumer_group_types_gen.go | 4 + .../v1api20180301/metric_alert_types_gen.go | 4 + .../storage/metric_alert_types_gen.go | 4 + .../storage/webtest_types_gen.go | 4 + .../v1api20180501preview/webtest_types_gen.go | 4 + .../v1api20200202/component_types_gen.go | 4 + .../storage/component_types_gen.go | 4 + .../diagnostic_setting_types_gen.go | 4 + .../storage/diagnostic_setting_types_gen.go | 4 + .../scheduled_query_rule_types_gen.go | 4 + .../storage/scheduled_query_rule_types_gen.go | 4 + .../storage/webtest_types_gen.go | 4 + .../v1api20220615/webtest_types_gen.go | 4 + .../autoscale_setting_types_gen.go | 4 + .../storage/autoscale_setting_types_gen.go | 4 + .../v1api20230101/action_group_types_gen.go | 4 + .../storage/action_group_types_gen.go | 4 + .../storage/vault_types_gen.go | 4 + .../v1api20210401preview/vault_types_gen.go | 4 + .../v1api20230701/storage/vault_types_gen.go | 4 + .../keyvault/v1api20230701/vault_types_gen.go | 4 + .../v1api20230501/extension_types_gen.go | 4 + .../flux_configuration_types_gen.go | 4 + .../storage/extension_types_gen.go | 4 + .../storage/flux_configuration_types_gen.go | 4 + .../storage/workspace_types_gen.go | 4 + .../storage/workspaces_compute_types_gen.go | 4 + .../workspaces_connection_types_gen.go | 4 + .../v1api20210701/workspace_types_gen.go | 4 + .../workspaces_compute_types_gen.go | 4 + .../workspaces_connection_types_gen.go | 4 + .../v1api20240401/registry_types_gen.go | 4 + .../storage/registry_types_gen.go | 4 + .../storage/workspace_types_gen.go | 4 + .../storage/workspaces_compute_types_gen.go | 4 + .../workspaces_connection_types_gen.go | 4 + .../v1api20240401/workspace_types_gen.go | 4 + .../workspaces_compute_types_gen.go | 4 + .../workspaces_connection_types_gen.go | 4 + .../user_assigned_identity_types_gen.go | 4 + .../user_assigned_identity_types_gen.go | 4 + ...federated_identity_credential_types_gen.go | 4 + ...federated_identity_credential_types_gen.go | 4 + ...federated_identity_credential_types_gen.go | 4 + ...federated_identity_credential_types_gen.go | 4 + .../user_assigned_identity_types_gen.go | 4 + .../user_assigned_identity_types_gen.go | 4 + .../v1api20230403/account_types_gen.go | 4 + .../storage/account_types_gen.go | 4 + ...b_application_firewall_policy_types_gen.go | 4 + ...b_application_firewall_policy_types_gen.go | 4 + .../v1api20180501/dns_zone_types_gen.go | 4 + .../dns_zones_a_record_types_gen.go | 4 + .../dns_zones_aaaa_record_types_gen.go | 4 + .../dns_zones_caa_record_types_gen.go | 4 + .../dns_zones_cname_record_types_gen.go | 4 + .../dns_zones_mx_record_types_gen.go | 4 + .../dns_zones_ns_record_types_gen.go | 4 + .../dns_zones_ptr_record_types_gen.go | 4 + .../dns_zones_srv_record_types_gen.go | 4 + .../dns_zones_txt_record_types_gen.go | 4 + .../storage/dns_zone_types_gen.go | 4 + .../storage/dns_zones_a_record_types_gen.go | 4 + .../dns_zones_aaaa_record_types_gen.go | 4 + .../storage/dns_zones_caa_record_types_gen.go | 4 + .../dns_zones_cname_record_types_gen.go | 4 + .../storage/dns_zones_mx_record_types_gen.go | 4 + .../storage/dns_zones_ns_record_types_gen.go | 4 + .../storage/dns_zones_ptr_record_types_gen.go | 4 + .../storage/dns_zones_srv_record_types_gen.go | 4 + .../storage/dns_zones_txt_record_types_gen.go | 4 + .../private_dns_zone_types_gen.go | 4 + .../storage/private_dns_zone_types_gen.go | 4 + .../private_dns_zones_a_record_types_gen.go | 4 + ...private_dns_zones_aaaa_record_types_gen.go | 4 + ...rivate_dns_zones_cname_record_types_gen.go | 4 + .../private_dns_zones_mx_record_types_gen.go | 4 + .../private_dns_zones_ptr_record_types_gen.go | 4 + .../private_dns_zones_srv_record_types_gen.go | 4 + .../private_dns_zones_txt_record_types_gen.go | 4 + ...ns_zones_virtual_network_link_types_gen.go | 4 + .../private_dns_zones_a_record_types_gen.go | 4 + ...private_dns_zones_aaaa_record_types_gen.go | 4 + ...rivate_dns_zones_cname_record_types_gen.go | 4 + .../private_dns_zones_mx_record_types_gen.go | 4 + .../private_dns_zones_ptr_record_types_gen.go | 4 + .../private_dns_zones_srv_record_types_gen.go | 4 + .../private_dns_zones_txt_record_types_gen.go | 4 + ...ns_zones_virtual_network_link_types_gen.go | 4 + .../v1api20201101/load_balancer_types_gen.go | 4 + ...ad_balancers_inbound_nat_rule_types_gen.go | 4 + .../network_interface_types_gen.go | 4 + .../network_security_group_types_gen.go | 4 + ...security_groups_security_rule_types_gen.go | 4 + .../public_ip_address_types_gen.go | 4 + .../v1api20201101/route_table_types_gen.go | 4 + .../route_tables_route_types_gen.go | 4 + .../storage/load_balancer_types_gen.go | 4 + ...ad_balancers_inbound_nat_rule_types_gen.go | 4 + .../storage/network_interface_types_gen.go | 4 + .../network_security_group_types_gen.go | 4 + ...security_groups_security_rule_types_gen.go | 4 + .../storage/public_ip_address_types_gen.go | 4 + .../storage/route_table_types_gen.go | 4 + .../storage/route_tables_route_types_gen.go | 4 + .../virtual_network_gateway_types_gen.go | 4 + .../storage/virtual_network_types_gen.go | 4 + .../virtual_networks_subnet_types_gen.go | 4 + ...works_virtual_network_peering_types_gen.go | 4 + .../virtual_network_gateway_types_gen.go | 4 + .../virtual_network_types_gen.go | 4 + .../virtual_networks_subnet_types_gen.go | 4 + ...works_virtual_network_peering_types_gen.go | 4 + .../traffic_manager_profile_types_gen.go | 4 + ...nager_profiles_azure_endpoint_types_gen.go | 4 + ...er_profiles_external_endpoint_types_gen.go | 4 + ...ager_profiles_nested_endpoint_types_gen.go | 4 + .../traffic_manager_profile_types_gen.go | 4 + ...nager_profiles_azure_endpoint_types_gen.go | 4 + ...er_profiles_external_endpoint_types_gen.go | 4 + ...ager_profiles_nested_endpoint_types_gen.go | 4 + .../application_gateway_types_gen.go | 4 + .../v1api20220701/bastion_host_types_gen.go | 4 + ...ing_rule_sets_forwarding_rule_types_gen.go | 4 + ...ule_sets_virtual_network_link_types_gen.go | 4 + .../dns_forwarding_ruleset_types_gen.go | 4 + .../v1api20220701/dns_resolver_types_gen.go | 4 + ...ns_resolvers_inbound_endpoint_types_gen.go | 4 + ...s_resolvers_outbound_endpoint_types_gen.go | 4 + .../v1api20220701/nat_gateway_types_gen.go | 4 + .../private_endpoint_types_gen.go | 4 + ...points_private_dns_zone_group_types_gen.go | 4 + .../private_link_service_types_gen.go | 4 + .../public_ip_prefix_types_gen.go | 4 + .../storage/application_gateway_types_gen.go | 4 + .../storage/bastion_host_types_gen.go | 4 + ...ing_rule_sets_forwarding_rule_types_gen.go | 4 + ...ule_sets_virtual_network_link_types_gen.go | 4 + .../dns_forwarding_ruleset_types_gen.go | 4 + .../storage/dns_resolver_types_gen.go | 4 + ...ns_resolvers_inbound_endpoint_types_gen.go | 4 + ...s_resolvers_outbound_endpoint_types_gen.go | 4 + .../storage/nat_gateway_types_gen.go | 4 + .../storage/private_endpoint_types_gen.go | 4 + ...points_private_dns_zone_group_types_gen.go | 4 + .../storage/private_link_service_types_gen.go | 4 + .../storage/public_ip_prefix_types_gen.go | 4 + .../application_security_group_types_gen.go | 4 + .../application_security_group_types_gen.go | 4 + ...b_application_firewall_policy_types_gen.go | 4 + ...b_application_firewall_policy_types_gen.go | 4 + .../v1api20240301/bastion_host_types_gen.go | 4 + .../v1api20240301/load_balancer_types_gen.go | 4 + ...ad_balancers_inbound_nat_rule_types_gen.go | 4 + .../v1api20240301/nat_gateway_types_gen.go | 4 + .../network_interface_types_gen.go | 4 + .../network_security_group_types_gen.go | 4 + ...security_groups_security_rule_types_gen.go | 4 + .../private_endpoint_types_gen.go | 4 + ...points_private_dns_zone_group_types_gen.go | 4 + .../private_link_service_types_gen.go | 4 + .../public_ip_address_types_gen.go | 4 + .../public_ip_prefix_types_gen.go | 4 + .../v1api20240301/route_table_types_gen.go | 4 + .../route_tables_route_types_gen.go | 4 + .../storage/bastion_host_types_gen.go | 4 + .../storage/load_balancer_types_gen.go | 4 + ...ad_balancers_inbound_nat_rule_types_gen.go | 4 + .../storage/nat_gateway_types_gen.go | 4 + .../storage/network_interface_types_gen.go | 4 + .../network_security_group_types_gen.go | 4 + ...security_groups_security_rule_types_gen.go | 4 + .../storage/private_endpoint_types_gen.go | 4 + ...points_private_dns_zone_group_types_gen.go | 4 + .../storage/private_link_service_types_gen.go | 4 + .../storage/public_ip_address_types_gen.go | 4 + .../storage/public_ip_prefix_types_gen.go | 4 + .../storage/route_table_types_gen.go | 4 + .../storage/route_tables_route_types_gen.go | 4 + .../virtual_network_gateway_types_gen.go | 4 + .../storage/virtual_network_types_gen.go | 4 + .../virtual_networks_subnet_types_gen.go | 4 + ...works_virtual_network_peering_types_gen.go | 4 + .../virtual_network_gateway_types_gen.go | 4 + .../virtual_network_types_gen.go | 4 + .../virtual_networks_subnet_types_gen.go | 4 + ...works_virtual_network_peering_types_gen.go | 4 + .../private_dns_zone_types_gen.go | 4 + .../private_dns_zones_a_record_types_gen.go | 4 + ...private_dns_zones_aaaa_record_types_gen.go | 4 + ...rivate_dns_zones_cname_record_types_gen.go | 4 + .../private_dns_zones_mx_record_types_gen.go | 4 + .../private_dns_zones_ptr_record_types_gen.go | 4 + .../private_dns_zones_srv_record_types_gen.go | 4 + .../private_dns_zones_txt_record_types_gen.go | 4 + ...ns_zones_virtual_network_link_types_gen.go | 4 + .../storage/private_dns_zone_types_gen.go | 4 + .../private_dns_zones_a_record_types_gen.go | 4 + ...private_dns_zones_aaaa_record_types_gen.go | 4 + ...rivate_dns_zones_cname_record_types_gen.go | 4 + .../private_dns_zones_mx_record_types_gen.go | 4 + .../private_dns_zones_ptr_record_types_gen.go | 4 + .../private_dns_zones_srv_record_types_gen.go | 4 + .../private_dns_zones_txt_record_types_gen.go | 4 + ...ns_zones_virtual_network_link_types_gen.go | 4 + .../storage/workspace_types_gen.go | 4 + .../v1api20210601/workspace_types_gen.go | 4 + .../open_shift_cluster_types_gen.go | 4 + .../storage/open_shift_cluster_types_gen.go | 4 + .../v1api20220901/search_service_types_gen.go | 4 + .../storage/search_service_types_gen.go | 4 + .../namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../namespaces_queue_types_gen.go | 4 + .../namespaces_topic_types_gen.go | 4 + ...amespaces_topics_subscription_types_gen.go | 4 + ...ces_topics_subscriptions_rule_types_gen.go | 4 + .../storage/namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../storage/namespaces_queue_types_gen.go | 4 + .../storage/namespaces_topic_types_gen.go | 4 + ...amespaces_topics_subscription_types_gen.go | 4 + ...ces_topics_subscriptions_rule_types_gen.go | 4 + .../v1api20211101/namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../namespaces_queue_types_gen.go | 4 + .../namespaces_topic_types_gen.go | 4 + ...amespaces_topics_subscription_types_gen.go | 4 + ...ces_topics_subscriptions_rule_types_gen.go | 4 + .../storage/namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../storage/namespaces_queue_types_gen.go | 4 + .../storage/namespaces_topic_types_gen.go | 4 + ...amespaces_topics_subscription_types_gen.go | 4 + ...ces_topics_subscriptions_rule_types_gen.go | 4 + .../namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../namespaces_queue_types_gen.go | 4 + .../namespaces_topic_types_gen.go | 4 + ...amespaces_topics_subscription_types_gen.go | 4 + ...ces_topics_subscriptions_rule_types_gen.go | 4 + .../storage/namespace_types_gen.go | 4 + ...namespaces_authorization_rule_types_gen.go | 4 + .../storage/namespaces_queue_types_gen.go | 4 + .../storage/namespaces_topic_types_gen.go | 4 + ...amespaces_topics_subscription_types_gen.go | 4 + ...ces_topics_subscriptions_rule_types_gen.go | 4 + .../v1api20211001/signal_r_types_gen.go | 4 + .../storage/signal_r_types_gen.go | 4 + v2/api/sql/v1api20211101/server_types_gen.go | 4 + .../servers_administrator_types_gen.go | 4 + ...ced_threat_protection_setting_types_gen.go | 4 + .../servers_auditing_setting_types_gen.go | 4 + ..._azure_ad_only_authentication_types_gen.go | 4 + .../servers_connection_policy_types_gen.go | 4 + .../servers_database_types_gen.go | 4 + ...ced_threat_protection_setting_types_gen.go | 4 + ...rs_databases_auditing_setting_types_gen.go | 4 + ...up_long_term_retention_policy_types_gen.go | 4 + ...p_short_term_retention_policy_types_gen.go | 4 + ...tabases_security_alert_policy_types_gen.go | 4 + ...s_transparent_data_encryption_types_gen.go | 4 + ...ases_vulnerability_assessment_types_gen.go | 4 + .../servers_elastic_pool_types_gen.go | 4 + .../servers_failover_group_types_gen.go | 4 + .../servers_firewall_rule_types_gen.go | 4 + .../servers_ipv_6_firewall_rule_types_gen.go | 4 + ...ervers_outbound_firewall_rule_types_gen.go | 4 + ...servers_security_alert_policy_types_gen.go | 4 + .../servers_virtual_network_rule_types_gen.go | 4 + ...vers_vulnerability_assessment_types_gen.go | 4 + .../v1api20211101/storage/server_types_gen.go | 4 + .../servers_administrator_types_gen.go | 4 + ...ced_threat_protection_setting_types_gen.go | 4 + .../servers_auditing_setting_types_gen.go | 4 + ..._azure_ad_only_authentication_types_gen.go | 4 + .../servers_connection_policy_types_gen.go | 4 + .../storage/servers_database_types_gen.go | 4 + ...ced_threat_protection_setting_types_gen.go | 4 + ...rs_databases_auditing_setting_types_gen.go | 4 + ...up_long_term_retention_policy_types_gen.go | 4 + ...p_short_term_retention_policy_types_gen.go | 4 + ...tabases_security_alert_policy_types_gen.go | 4 + ...s_transparent_data_encryption_types_gen.go | 4 + ...ases_vulnerability_assessment_types_gen.go | 4 + .../storage/servers_elastic_pool_types_gen.go | 4 + .../servers_failover_group_types_gen.go | 4 + .../servers_firewall_rule_types_gen.go | 4 + .../servers_ipv_6_firewall_rule_types_gen.go | 4 + ...ervers_outbound_firewall_rule_types_gen.go | 4 + ...servers_security_alert_policy_types_gen.go | 4 + .../servers_virtual_network_rule_types_gen.go | 4 + ...vers_vulnerability_assessment_types_gen.go | 4 + .../storage/storage_account_types_gen.go | 4 + ...storage_accounts_blob_service_types_gen.go | 4 + ...ounts_blob_services_container_types_gen.go | 4 + ...ge_accounts_management_policy_types_gen.go | 4 + ...torage_accounts_queue_service_types_gen.go | 4 + ...accounts_queue_services_queue_types_gen.go | 4 + .../storage_account_types_gen.go | 4 + ...storage_accounts_blob_service_types_gen.go | 4 + ...ounts_blob_services_container_types_gen.go | 4 + ...ge_accounts_management_policy_types_gen.go | 4 + ...torage_accounts_queue_service_types_gen.go | 4 + ...accounts_queue_services_queue_types_gen.go | 4 + .../storage/storage_account_types_gen.go | 4 + ...storage_accounts_blob_service_types_gen.go | 4 + ...ounts_blob_services_container_types_gen.go | 4 + ...storage_accounts_file_service_types_gen.go | 4 + ..._accounts_file_services_share_types_gen.go | 4 + ...ge_accounts_management_policy_types_gen.go | 4 + ...torage_accounts_queue_service_types_gen.go | 4 + ...accounts_queue_services_queue_types_gen.go | 4 + ...torage_accounts_table_service_types_gen.go | 4 + ...accounts_table_services_table_types_gen.go | 4 + .../storage_account_types_gen.go | 4 + ...storage_accounts_blob_service_types_gen.go | 4 + ...ounts_blob_services_container_types_gen.go | 4 + ...storage_accounts_file_service_types_gen.go | 4 + ..._accounts_file_services_share_types_gen.go | 4 + ...ge_accounts_management_policy_types_gen.go | 4 + ...torage_accounts_queue_service_types_gen.go | 4 + ...accounts_queue_services_queue_types_gen.go | 4 + ...torage_accounts_table_service_types_gen.go | 4 + ...accounts_table_services_table_types_gen.go | 4 + .../storage/storage_account_types_gen.go | 4 + ...storage_accounts_blob_service_types_gen.go | 4 + ...ounts_blob_services_container_types_gen.go | 4 + ...storage_accounts_file_service_types_gen.go | 4 + ..._accounts_file_services_share_types_gen.go | 4 + ...ge_accounts_management_policy_types_gen.go | 4 + ...torage_accounts_queue_service_types_gen.go | 4 + ...accounts_queue_services_queue_types_gen.go | 4 + ...torage_accounts_table_service_types_gen.go | 4 + ...accounts_table_services_table_types_gen.go | 4 + .../storage_account_types_gen.go | 4 + ...storage_accounts_blob_service_types_gen.go | 4 + ...ounts_blob_services_container_types_gen.go | 4 + ...storage_accounts_file_service_types_gen.go | 4 + ..._accounts_file_services_share_types_gen.go | 4 + ...ge_accounts_management_policy_types_gen.go | 4 + ...torage_accounts_queue_service_types_gen.go | 4 + ...accounts_queue_services_queue_types_gen.go | 4 + ...torage_accounts_table_service_types_gen.go | 4 + ...accounts_table_services_table_types_gen.go | 4 + .../storage/workspace_types_gen.go | 4 + .../workspaces_big_data_pool_types_gen.go | 4 + .../v1api20210601/workspace_types_gen.go | 4 + .../workspaces_big_data_pool_types_gen.go | 4 + .../v1api20220301/server_farm_types_gen.go | 4 + v2/api/web/v1api20220301/site_types_gen.go | 4 + .../storage/server_farm_types_gen.go | 4 + .../v1api20220301/storage/site_types_gen.go | 4 + .../azure_generic_arm_reconciler_instance.go | 2 +- v2/internal/resolver/resource_hierarchy.go | 6 + .../resolver/resource_hierarchy_test.go | 33 ++++ v2/pkg/genruntime/admissions.go | 13 +- v2/pkg/genruntime/admissions_test.go | 169 ++++++++++++++++++ ...n_arm_type_only_azure_v1api20200101.golden | 4 + ...e_and_ownership_azure_v1api20200101.golden | 16 ++ ...ource_reference_azure_v1api20200101.golden | 4 + ...urce_references_azure_v1api20200101.golden | 4 + ...rray_properties_azure_v1api20200101.golden | 4 + ...plex_properties_azure_v1api20200101.golden | 4 + ...rce_json_fields_azure_v1api20200101.golden | 4 + ..._map_properties_azure_v1api20200101.golden | 4 + ...ce_renders_spec_azure_v1api20200101.golden | 4 + ..._type_simple_resource_v1api20200101.golden | 4 + ...ulti_valued_enum_name_v1api20200101.golden | 4 + ...ngle_valued_enum_name_v1api20200101.golden | 4 + .../kubernetes_resource_interface.go | 9 +- 714 files changed, 3072 insertions(+), 4 deletions(-) create mode 100644 v2/pkg/genruntime/admissions_test.go 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 b9da3d702d..410036fe0c 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 d9fe81ba1a..13c4ac7a90 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 9ef8d18b1b..de9300bae1 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 baef6f5d6f..a78c44a718 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 bfd662534c..a275877b79 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 576a5a5792..6d7ef62758 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 54cfcb76d2..cc180000a8 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 1837a013aa..7f591a0e7d 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 11d64b731a..af13892645 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 c938366cf3..b0acd46cba 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 55c54fbb8c..aafb7f658e 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 e6d3776256..330b4e6e8f 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 a5e3bd3f72..e9f067fdaf 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 00769bd761..a0f4e110b9 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 6747ecf8e7..a7df3b0e9f 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 fd9280d2a2..8f7235b9e4 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 909c24af1c..6c8a694a79 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 e3f4041788..86677004c7 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 5c117e6dfa..9bf6280cdc 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 a5f1876d9e..ad43166cfe 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 2bb1ba6432..afd60fd7f8 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 0c4a08d991..63ff2e92b3 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 ce97cb246e..9141499bf7 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 284d444da7..ff50ec7115 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 97097a0be2..c7453d2721 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 5c2c344ad7..22e011dc0e 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 f603785d60..c364b3bea1 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 4bd9dd91ef..bbab10ec02 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 cd74c33105..cd366ea59f 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 fa852efaa9..7f4e5b2c44 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 01bf4558fd..3d72d38d25 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 e1038f423d..5c7d9c2d1a 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 6babc99c00..10fc032baa 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 7359270113..0e26b7a4f6 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 55aeeac33e..f4dd88bafc 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 ce209c8fe4..3636daa361 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 1dddf14837..a320e79b0c 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 fb09fda101..9e54480db0 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 176f1e1242..48d800a194 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 07218960f0..4f2c044cac 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 55b84db8db..c54047e250 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 f3549884de..4d8a63f459 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 cab883f2ee..18783848cc 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 f1e382ea32..be944f67a4 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 c44f170b3e..932fbf6a65 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 80c105b42e..c57ca4c4f8 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 502607c380..d206140032 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 8b25dfbe35..975ba0e89f 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 2359e25685..aeefc0a13f 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 8d2ac661b2..f3a7f7e855 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 9a0e1e83d1..d2390b48b8 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 b58710df52..a80f6f05ce 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 50b4baa2b6..b08c1a7180 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 60603f5756..c30f24c0ad 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 82ff371b5b..042ef66d76 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 0596b1af8c..61d2f45f39 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 ddb890ee85..bbfb36804c 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 a94df115c4..ba93e7f407 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 7f2c263400..a95c3cf2a8 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 7c4dd23b3c..dfbf076338 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 13c9e89584..d96f342ff6 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 8a4ce63fea..a8bec7d64f 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 1779c21e9b..79d514d15c 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 a2e1e40c50..096df63db2 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 3071a706af..aab841c4e1 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 ac0c512db9..dfd2bf37e0 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 5c4a4b3a0f..9c4ef32565 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 e03dbf902b..a2fd39bd59 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 4f981e7bd3..86bf74239f 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 73fab76494..23d9968a82 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 6a664bcd95..62f4b593b2 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 5dc78a000c..41004a0d79 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 bda60f9c83..31ad74c15f 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 a4163633c6..034d71c2a3 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 9017aaa9be..f9a2e41777 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 f967cab795..a2f7255844 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 aa0b1ae070..31af0f9cd9 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 ccd01a05a7..323e1dba29 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 15932d1aed..420b2caf5d 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 0b68ec15c9..e486e230c2 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 2ae344ca93..2124664f42 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 5cd4b971bc..834a4a59ef 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 a8b5abf50c..e093e0f9fd 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 add794af9d..09c09d390b 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 e03002f2f2..670a85c359 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 d2f6d0bc40..a20771d6dd 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 725a377d3c..3c412ff96d 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 a9a37c32c1..a9db303610 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 25b08c471d..348d4d0e7a 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 194560d6da..e3c366f445 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 6c54950352..028db46a90 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 e594880843..ae8933ed33 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 3b0d05cdbb..f1613f99c8 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 491c3756e0..f0e775dc0e 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 4eb83208ac..f918cccbd7 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 3a747fc59e..a070758bc1 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 d9f2dbbc31..8c20b103ca 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 fd8d1d1992..e0159dfca0 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 001a1f03c3..d994cfe041 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 483f46ad53..229ded0def 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 d589f54ef4..a02fe2cb06 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 e6b12e9b2e..fca7c26af0 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 9103d7e038..b5bcdb320d 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 39cb6269a6..032d237b36 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 756e817342..20c2320ab4 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 4e1df7a25c..0fba02926e 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 d5f05beb78..ddfe6ad587 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 85b5e788bd..87ace73347 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 f0a2f3c429..ad8fee4f71 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 cece957b60..13fdd93505 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 3d57b31f79..9c42fc8300 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 b50c4545b7..ed46d1d501 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 d62a166ca3..4dd8fa69f2 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 d50eb1e7c2..80fee00604 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 7471f6f083..a8d961ac15 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 710bb485b0..ee040ae87a 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 e945bbb140..a29e9ec3a5 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 10891482f2..ad2f2b734d 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 e797b82f30..7fb4d4f455 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 203b1bd441..dd7ea08aea 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 df2c214a04..72283a7ac3 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 420398c282..da7ad817dc 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 59dcf735d8..fbccaa590a 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 b3622bbe0c..1f2c1ab630 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 15df57cc19..2f049f07a6 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 2d6b4dda70..254c77f20f 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 455cc6a26e..bc68583283 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 3b014fcdaa..b767b8001e 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 aac621e42a..c0c84d449f 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 2c993aac95..de0f737992 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 8b7dacbfff..d87b960baf 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 4f2ac04316..3a8a1f1989 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 b43d275657..eb3749b46a 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 0cafc60324..29b401108f 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 c4e481f817..34d5cb2ba2 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 ef408143cf..e7ccfee0de 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 eb3f078197..27380a7844 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 e04881cf57..4936e1c384 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 3de71a7016..0721a9ae13 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 7727993b46..de77e4b928 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 23460d3406..ae55627cb2 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 56feed6486..ec6c672ce1 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 b8d0b86c34..5f90a70999 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 e5e3f78552..434d4d4f55 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 365015009c..d3aec3e78d 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 795a8fb267..15e8252111 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 8a30e2f526..d7a76d1f0e 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 8f48bb75ef..bb2b2b15aa 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 72931b8f04..be5d46308b 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 18344bd854..93ec4a0d16 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 86c809389f..ef61ece02e 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 c29fb47577..77e13050e3 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 ffd021c6ec..9f4c9ddfbc 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 8f4a71a3f8..411ec05c5d 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 21148def15..09d6f0c576 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 80540e2b7e..49ddf84913 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 e3b2441071..7178855ed8 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 dd7ba986f3..5cea3a6ecc 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 50d8a81bc3..da4ec00ac2 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 571fabbbc4..ffc58e0124 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 2cef0c7786..6cdf865f37 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 c581821cfa..696cf0a859 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 b57b439560..0ad99f49e2 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 d7f1fc5e71..9c0714a6eb 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 f444a5ae3e..92c483a92a 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 c9b8333369..d49d16ea84 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 98c399fe6c..027ef7c562 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 7626043246..fda9aa018e 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 ca869c22d3..9e91195ec1 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 90096648bd..f3616c4782 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 127f1784b5..5eeee6eb33 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 fd5d622137..f5f0aba12a 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 3324c88b1f..a43b2dd25d 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 72673f8542..a4cd2b54ed 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 8dd365c760..d9abc1d763 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 4314b33260..60701538e6 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 bba6250173..d97d0070e3 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 661cb3bbfb..361c506a14 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 abc48a1e8a..44f19d06fb 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 9ae8ad94d8..5d82b6ba29 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 7f209947ab..3f8f9befbd 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 56296d9905..762236214a 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 7857d06bc8..a2233e9060 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 068e78bf17..c21aaa6d4d 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 9a0c29618c..9febee87f3 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 1debb2992a..3bd0545579 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 b1e28e2e63..60ee139bb8 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 f79b2e98ae..711caf48b4 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 c1fc4e42eb..7efb65a308 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 175cdacd16..645f6030d9 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 a56c326984..710bece6d9 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 7be1a6c350..0d5c2999cd 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 51d0633166..175806da65 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 1fdce5966b..1b6af2cb42 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 7a28633b7e..f210f386f4 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 570c697981..7632e6a14a 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 6ec3feb6e3..9121546a8e 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 52d6ad1cbd..1d79f71fcb 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 bd3dab6916..8f6e50fdbf 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 704bea0daf..f37abf127f 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 10cf09945b..4848595628 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 1bbe1b623f..3d13c016dd 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 0aafcc4a62..144f7d59e6 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 3a1a8ca615..bbf7062276 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 6e788d9fcd..952ddef9d8 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 6ec2208b4a..530ae85b4e 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 72245f054d..02f929eec3 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 ab5039287f..7e811fe770 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 f0530d366a..f88c292527 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 2d134bb356..000eeaf115 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 e17b4073e5..55bbc608c6 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 2594b3c094..46e0c18f4f 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 f3651214a9..85515ff63a 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 8ead8347ed..151e373aa8 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 feb2eff0a1..9c614f0a35 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 838ce39cf6..bbd997ac29 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 fd689ef78b..d61ac2b0b0 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 37e15d44ff..dc5f25e9ed 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 ee3bf79a77..db4bba2fdc 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 be9acda316..3970d9541c 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 c3810b920e..08ceb905b1 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 f84cef6a0a..cbf8ec83c6 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 204a508e45..5826fcdb83 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 4b05489262..6e5097f386 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 826dbbb085..4e3b6c3430 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 b9be421d9a..f1ae3b8f1f 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 5b9499e5d4..c7aa5512e5 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 84de080eab..3db51c3e93 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 7bdc2bf692..b25bf8427f 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 89204bb1a6..f214c62b72 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 f1f449f4eb..7267ea0b32 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 c6769771c2..f5ecd7f871 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 8793fda0f9..6167460445 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 5b45a1bc3b..d92af173d5 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 d4a2fcaa10..008c74a07c 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 d9e5c4c19c..af1452a972 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 b4c93c07cc..f5b754b726 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 fb3b4ee1a4..1e11d8ed2d 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 1d27c47e35..d8c093f809 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 f16e4980b6..0171d6650e 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 5d4427710f..b4718922d3 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 4f2dc40458..b2f095f1dc 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 f4099d0147..5f80060061 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 a9ea02939d..46e7baa56c 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 3b273aace3..e556c2c666 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 4d68c6a8ea..f5bea4a3a4 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 459d2250b3..109b3d02bf 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 757dbfe629..e54eab4145 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 9bbfd09c86..30f5632df3 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 932586585d..ba102da39d 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 21e451d494..fa3198ee5d 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 266cfaa9ce..f035bd528b 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 097913115e..2853ffbd2d 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 71c956288a..7fd96bf345 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 a8557f2285..57024ea8fa 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 19c7b8a05e..372620add8 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 fcde91a7a7..5ff41f33dd 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 65cabdb886..f90d23261d 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 164039cdef..2071ff9da8 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 65503d784b..a31fa2df5d 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 a8803c2b38..86f1e8deae 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 f17cd9d8f5..9c323d477e 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 804ad3f6bf..712e62cc3c 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 5fb2bc0c4f..9392593ce4 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 67e0475d16..99235e5b89 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 1c6bad5406..2486f5cde1 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 8275d2f6db..f846b3df0f 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 621bed6233..5e631fd890 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 c3b44c41f5..479515fbd1 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 5bdae315a9..3f6c9863b4 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 31baee4a0d..558582722c 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 64b1749c2c..8747fc98b6 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 7830285e63..a9fb63d997 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 256187ce6f..db0abc887c 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 4bb3adf251..9064ac0f84 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 6acd076715..3cf76efb0d 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 e258752cf3..fe10277d28 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 aba7c5dc6a..c8aca5377f 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 1252d5b87d..b225bcd340 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 8a372a9ec6..2d76f48333 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 080907bc88..4839ad7129 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 c5446d991c..30ea66783c 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 95ad7281ab..f2104a99a6 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 b71f317e15..3baae7d682 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 6ad4ea5fa2..fb7ec883ef 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 e460e4e965..79e698da93 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 3703dc2f43..6aab83e2c5 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 cef21aee7d..5ea9034bac 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 e86198f312..394baf9796 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 d6d61df5c3..e61e5863f2 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 d541de34a8..d338785c7b 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 c2d9c32201..1508229472 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 d6ef9affc4..47cfbbf4e0 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 ed1d4b0c94..1c750c391d 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 d820cbc7b1..934a599e9c 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 b222c168ae..fe0ddce224 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 456ed05d24..c8286358fa 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 cd7ac514a8..9909f6eaf0 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 6e899de615..e1c76f567a 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 115a19a4b5..2f06059fc0 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 3b8901f948..3ed813088f 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 cdafc3f54d..64f7a5f751 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 dbdc6a1b27..1da4fd7127 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 4d22752559..47ad5a4643 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 c6aaee5c44..2d73533dc8 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 56a2ab917e..227d661b0b 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 ed7236b20c..9016faeb2f 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 ce7fd0b1d5..3da9fb9e07 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 a7b985fbf1..3c41f88c71 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 707a469c48..3dfa55ee00 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 4ae65aebc5..56b6f4e653 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 2342271807..d591195db2 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 a0c8ff75a8..c391518b31 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 3c94968685..78f69fef48 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 335ce51012..179b03ba89 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 5976b7ad94..2535efc61f 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 058cc5c587..20e9d0ad31 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 780cd3bd71..3994515ecb 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 d8fa60bcef..a59a5c3ac6 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 7687553d94..fa75030764 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 1d86235249..e1565e1ad6 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 43af543f71..25c0f0653a 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 3ffb324e66..be987b4054 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 a45d6b6f93..3a3c260844 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 38148bd9d7..1a858f9c31 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 cdf6cd8bf4..38440c7aa9 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 b4866fc7f6..ede1cce138 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 a95c3e7e86..170ec95962 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 eaea9db4fc..352be3e29b 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 412441be48..4bd813bab7 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 2911fb4ace..824a02306c 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 a15f2d7c4f..c3bd058475 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 a1345c05ba..58f54c2573 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 62e7de09ce..1427e82892 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 e8b057da89..47bed8d41b 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 f7cc3546f2..a5822c7c72 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 fe51c5e384..1855a70f43 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 be61265bca..8593138cff 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 d9e6961523..d6a8e929e1 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 fa10a360fd..91433e5a84 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 564d768987..6d10c23668 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 5d239afd2e..aa328f4d75 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 309fe3d328..5e8eee8341 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 be2e119630..6ce0b08ce9 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 38a1bac17e..97f2f52c21 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 5e85497f01..069a58bb15 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 04a9d0d343..2c8ca3045c 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 2302b4c057..5875db878b 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 02cad33bbf..b7c85687e7 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 250d93719b..001b20e913 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 4093d726a9..ab4157cbac 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 fefded63be..8878cebeb1 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 56922752b1..b069cebe92 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 5879ea98d1..863c324e65 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 ee220af9a7..da125e3c20 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 f7790883e3..26f7708419 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 1519f53ff9..e8efc31be5 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 d6991121be..24b6d25134 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 de18b526f2..221a004e9f 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 227541d1ac..0ec272917b 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 928fdf48a4..6e82c3c3cb 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 a26629a74c..17e3d14f8d 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 a27ff92669..4804c83ee0 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 edb506a21e..e2e87affdb 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 f9de38478b..c954e1ce53 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 9a16206415..11af6c317c 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 1216f0c4d6..7b334df54e 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 c212637c72..82824da1ed 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 b877e24f87..245c12f461 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 49e01d5c2b..e34559a058 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 98ff5e0fa5..1c20306923 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 70e0be5a1d..de43b2a390 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 cd15cdb111..c3e85de066 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 19c0bf55b2..85f1d91ca4 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 aecc32c123..42812cb975 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 6fc1d67da8..c77a39faa0 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 21f136500a..4b678b7d3e 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 708d2d5bda..3359d84342 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 b95fb4a8cc..45ab41e017 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 1cb5360d11..0538525165 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 6cb62da529..f17541164f 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 8a470b56b3..513b4abda4 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 b72a0295ea..088eb2e76c 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 9bf5afa2b7..c62e9beb52 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 830240efcb..203964ad5b 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 aa71d7a126..d94a8d8bff 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 fbc2cf9b22..7a3cd00fa2 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 c1226be3af..b443a33ee5 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 6b130b4912..5e696e7f20 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 5eca08e047..8fbc51bce1 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 42cadbece6..2d53cd9a27 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 70d559d264..7b0de6d25c 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 77910d20cc..65e824aa7d 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 e0fa107b7c..72bfac2cfc 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 dac60ea112..e43bdf6eca 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 016378b23b..3af6486d45 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 c392353eef..f79a146429 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 ae02ba2584..9e0b0af65a 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 bfff8b8562..6a971fc8cf 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 48ff216969..443ef4eb20 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 95287b867e..c7800081b7 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 65726daca1..81a1ea88cd 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 50f1ea52c2..a42d6fe4e4 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 c5e281ce95..b497ddf807 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 5b52c6ed8e..ad21eee044 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 72c4f09cf2..60b4d59ab7 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 038bef4946..e76740ee7f 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 e2aeda1f09..b356caf034 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 301e8b5358..3e117e0014 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 580e7944ba..a17d36f0b5 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 d89940de01..f29324f39e 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 fc815feeca..ae160a7891 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 8a3f505ed5..3207da34f0 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 fc9a79b19a..29b9b82291 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 913eeb15dd..127a4584d0 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 ecdc845b93..03236beeab 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 656fcc29f3..e4f7b762e7 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 0f595a7455..7c710cbca5 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 3e022a7b5c..aeb06b028e 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 a511a9ebf4..dbb9506730 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 1af643e47d..f0c09974fd 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 a7ce79f105..9ec1a291e6 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 3ca2e7984f..ef2675c2a6 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 9a6a6ad9f8..e5c18fea39 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 40a9ae27cf..6c9156773f 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 49e8d7a41c..17d8fc28ea 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 8ede12dfbd..b4d1183083 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 c4cbf8476d..410897a383 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 982cb01ce7..63b0bae5c8 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 7d2c075bc5..9207e303b1 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 d08012f8b7..fecf311145 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 b6b2c76972..50d1dde5ac 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 549efee3fd..96361a4aa1 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 65997511e2..ca6f8baa92 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 d65a71bdd8..c0c0b01105 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 fa9c434207..964b26c187 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 ab92c97527..2d6ce42d03 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 bc7df15635..14e76d3383 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 c7344762a9..759ef3f1c5 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 9f9ad060b9..983fc7fcf3 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 c7076576e1..4cf8512765 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 d8106096e5..c05e527a91 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 64fb2aa8c6..50d8622dab 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 fba72d3fd8..4f8bba7601 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 4517891507..eead0045cd 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 522b16b2ba..e1455dd96e 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 abf5626be3..a94ae97885 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 7bb4269090..1d0a52bd43 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 736b395200..b6b11f9440 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 4343b8ad0e..0738625526 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 1a7b5d8528..35a6ca048e 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 ea6d8132d9..a168620242 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 f9222d8aba..2c43f80e2a 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 74b3439902..08d0fb881f 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 6bf1ea19fc..123305d333 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 d445ba3fe6..3400fcde9c 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 8b1c20fd8f..4f5ba5b478 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 501ca63473..d823093c60 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 aeb6c3fef5..e7d776643f 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 66f990135e..44865a6064 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 66a4683152..0c84f9c249 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 e5ee306e5d..f2e3786021 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 0bb0ca4fef..e3ab2808ca 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 24a5f122e4..1ad470f750 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 16899445d2..44a6541044 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 46735807af..fa19740877 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 87346f922c..f59e14bf27 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 0112cf3329..905e33d5a6 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 89d0c75113..0e9087e9c4 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 d0dde495cf..b516f98223 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 25ae841795..2bf1f7ef2b 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 1d9d524b7a..df3cbaab85 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 2592e2217d..0410ae9b71 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 ba8052e02e..bfa11bbc92 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 d98a7b48a2..50d4081e28 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 d77a1f5451..8ddf9ba866 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 377368aaa7..04419b7a2b 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 2baa4c113e..83cc1f97df 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 c0ba1d2c07..7f4b7af320 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 2202ecc1bd..03d666c516 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 d4647681a9..95c3cbc6d0 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 04c950d959..48d4682ac6 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 dff0a13fc9..11465352f0 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 6675cede70..0b17ca1e8b 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 38b66943dd..d376fba2b6 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 b0d35bc0bd..b1b7cd5368 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 2dd868f7ba..0411fb904e 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 629056e30d..c5895396a4 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 d6a583a9ad..ef8dacb2e6 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 77011e4fbe..535d5f0257 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 54a4758a49..fc77a7afe9 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 fec7575755..23a2040c37 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 bc24871aa3..870dc9a871 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 4b1dad25bc..7c58972fee 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 5bac5d8988..bb284d2094 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 67b227d17c..33fad57f2f 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 3e78da751f..07cbb1cca4 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 464916c254..d8093dded1 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 2cb2fb661f..73cf87ab17 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 6ac8115fc8..758b63da93 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 c493c005de..4698bb614e 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 cb479a8986..cb0da5ce99 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 d05078acea..b49407b812 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 67e222b401..775f27de3c 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 3a8643bee2..593e46ed48 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 1bee28efcc..2e6f44b42b 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 441f1971eb..80df6b0739 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 6d9e7de613..2bd6f55721 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 2e5175896e..82be5599bc 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 0415dfefec..d318125976 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 5308dd32d3..a986565794 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 9fb85e5bf1..5711754d8a 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 e3be2d1b7b..a100e3cf8b 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 bec7cedbcb..c745b75614 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 e30e2ff15a..d2149553db 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 d30d2a6a70..a29285b1f7 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 688dd8735e..f0b1c883fc 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 ebdce44cf4..2e7d48252f 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 f70f7d1e9e..ce2b9ef963 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 f134407fb8..9fc2d46de2 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 7e4d05da64..e29597f0b2 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 a07f6fc705..019cec74b8 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 5838d1676a..2caa043f04 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 1a9e81597d..84f8e4a6e5 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 d4089b1cb0..4b5ee65a0d 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 da71d50474..04276d6495 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 9f09acad3b..10a686469e 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 b3f4c9504f..40a5c69248 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 cccda2bf5b..a1015693f0 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 d807c70d52..b69498e75c 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 fa31c1f91c..e91fedea32 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 9fe3c60a93..2f391ba77f 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 2472dbddda..77f412594e 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 1aa8b7e548..125c43edb4 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 4b1ea9dcbf..6df5ad421e 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 75adae3e7a..8605707ef2 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 f882b0e221..482c468212 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 7d5524a3fc..5ef35c6f98 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 f41081267e..c0dc17926a 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 5832b30622..9434cc0fa4 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 35d012c676..2eae567db0 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 b3c467b878..197957b7c8 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 bfecc7a526..c9db968af9 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 d8a0b71ea6..642d0a4190 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 37147d3f0d..9c077b61c4 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 7f84b1ee9e..df917d41df 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 8400a810e8..23ea2daae1 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 92a4dcc2c3..f86c2122cb 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 9500b84658..2ff2c9e8f2 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 17a5992c92..b4b15bfc40 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 a9f18cc2ce..1f69b042d7 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 ea7ce35f23..1404bc2d56 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 fee0d81b05..81ffe032f2 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 0f7472149b..4f453c14b2 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 fb39d1e177..a554a3250e 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 9fd25c358f..dadd94d78f 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 a99ca55c0f..53a711aa65 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 190512bcf2..8b86c17593 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 0209906599..ba9b66c7d2 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 4b7cfeac40..2ab4c71471 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 8ab2984382..61b5346832 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 b736fef576..6b890c4522 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 4e10929aff..8c6d96236a 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 fff9965d2c..c651a99043 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 b0a072c0e9..cf30aa04ff 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 237128588d..d2dd46189f 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 f0144aa1b3..21afe3e87d 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 7e54727b5b..36f9524c6a 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 362b4289c3..b84d96bf09 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 4e1a4944d2..5800452ffe 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 543022ecd9..672cf4a2fd 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 e354ff8460..3d713ddd62 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 4df698e284..fe07cee73a 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 399a5f908c..fad6fa316d 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 021a62c905..f446a8443e 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 8b400e87ab..c01fddb1b3 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 a6385c0136..653d8e1a94 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 fb56228b84..db13979020 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 ee417fb9a3..1f3b024b0f 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 69ce9f6310..57485c8d41 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 f4b73ecb4b..1e676f5e15 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 05966e2cc5..db31a74e8c 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 91eb84e542..d0948fc759 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 eea1acdd58..c0981cd26c 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 d036421f16..20ef7b2d15 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 8b711ddde2..94915e44e5 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 4d0206d3cc..c7be19d7e2 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 3a233f2105..fc89579901 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 b434574377..47d5c701a6 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 552d131ef0..fe7c85c486 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 b630229bfc..e7ce6c87a6 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 1c1b3528f5..bc8ba06e55 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 1b2a1466ba..9f1cb30880 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 2eb3175980..32d9fb0e3d 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 7a8622ff07..8d0f377973 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 ed37678a63..de92c7e037 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 d9aa2cf766..729d81f78f 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 63bc863702..8a638bf6a6 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 aeaabbeded..be428dcba6 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 c4d4998884..f47148af33 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 43e82a6741..361c524b17 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 2b5025c9bd..99a6ced31d 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 be5a73aec9..660dcf8de8 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 b5e4a7ecf5..032d4736c8 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 b280663c61..df1060389a 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 8c70bab551..5d244d257f 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 0f8f283302..bfcdb280d9 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 b11b1a5506..58ebcbb3f1 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 658545becd..402b6c7b15 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 d29787edd1..fce74f0f59 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 acdf9e74c0..716e059511 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 fed3d9018a..f29abf130c 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 749d2b1b4e..6f1b621e5a 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 622973ec02..93f2b40753 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 29b7aaee90..ccc52608f5 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 feba4c5f66..cbcc5817e4 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 653456a570..0e023997b9 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 037e588508..3ed4c67bb1 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 e269b6e4cd..5d168572c6 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 1397bb4087..28f494af8e 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 6f81916438..d6abf6a8b7 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 3e9b52f9c4..3bfd32f11e 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 598e50875c..be37d72706 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 638e01c125..5c9bdd88b2 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 9de414dec9..9efe49679e 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 efc693c081..00873235cc 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 948dc91ae2..a64a50ba6a 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 3f38060b33..be90796525 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 d31076f21c..4af674d7e8 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 7beba9b731..9968675140 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 b978f3d0f6..74800dbce7 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 cf0680f0a0..19a2b56660 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 b8796665a9..a8ec6a9433 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 cc327a6949..cc3e282f05 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 2173e6b731..1d5d19b4cf 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 7370fdbeb2..302db43966 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 fa155cbf9f..ca38cd6d6f 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 1cb5e77843..048c9aa878 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 553dec876b..fe8d8c5e04 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 914b8ccd89..cccd1966f2 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 290a4bd10f..e2bff42728 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 5fe48cac1f..93a6ed5b39 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 d255bd3c70..c421ba0e5b 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 c0ec6d87d6..44d91f27d9 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 06142b0f62..e97b929ef9 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 1e593297e9..fd6a9ed4b9 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 204b2e7e01..ddeb1b6c79 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 0d0416b718..d8da9bbdb9 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 c9aba5a80f..39cdc47798 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 665debdccc..3731b33d71 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 50756d8d25..2e5f4b3b3c 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 6114d7a468..aa1b7d1ec2 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 244e3fb6b5..4de4f19e3c 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 c790e1bacc..bba5afa8ff 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 8a6a95bf5c..b79df30a09 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 d684ea52f9..2b1d962e58 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 f24b991443..70934841a6 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 202c91b57d..c002c07f89 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 7fa05de2e7..93174856a0 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 2fbd8b3c92..3adf556cac 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 93da61d479..7d8d5ce56d 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 6c306dd2ad..ff7ae2b08c 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 d69b9b6322..f1cb006fb8 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 2b3c676475..79d89f8f55 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 3eabc97056..c52fb66f22 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 8e823394cc..bb107c58ff 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 fee7a76181..e0e7f7cc2a 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 3d460ca983..ec2f5a939f 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 f2faa11d56..85eb58570d 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 06294fb774..64c06144c6 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 edd35c8764..cce89274d2 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 90e91e8fea..6155bcc2d3 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 04ac1a607c..28fa5c24cb 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 8b3b092ed8..aaf0a083a2 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 707b5589a8..ee7accd4cd 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 752228d2fd..7bb1fc446d 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 e0fb148ac9..2b2798610f 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 fddfdb8eac..d80f9611b8 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 1ac4ef5873..78eae7ff28 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 f99b6be7f3..e651bcdf1d 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 91306e8b8f..4b2bf33c3d 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 d189946b1d..0f6779426e 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 5022cfd224..dc78f51eaf 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 50300b8a6d..9eb430683f 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 6f1875c1a8..5b19c2bd0d 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 6a1b80e0a4..603f22730a 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 c8e0b1cced..1dcad2a01f 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 b88d156973..a94b635263 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 df9a370e64..9b8549f595 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 7131f87308..793ca5f8d9 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 11b3852a09..ed4773bf4a 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 4177731a1a..68bf8a31da 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 09087deeab..cd76ca3d9c 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 f554d2e954..24d4e5df7b 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 21cb6833ab..6bce37c42b 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 73739238ed..e34775dc3c 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 84875563a2..79e516ca58 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 e879abe0c4..50fae0f77a 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 0e364b86a2..67045548cf 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 ff6763213c..b053c31e76 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 0000000000..61d0bba8aa --- /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 2ba0c6b0a4..0c375b4a9c 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 39bdb74555..06c2a020e6 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 7d55e120d9..ed9ca820f5 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 cf395520d1..db59f4923b 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 d7fbea35fd..20ba884926 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 22486afa3d..ac73d5110e 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 078407b638..9a1b60688a 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 9de16fcf3f..459e3a914b 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 2ba0c6b0a4..0c375b4a9c 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 7ba77a0c32..ca892705db 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 9e45ba21a0..472b3cc31a 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 f454e26966..3024ef4e71 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 cf77b8b836..1af718b7da 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())) }