From b4acb33ea2f07082791ca315a100e1318cb66aa9 Mon Sep 17 00:00:00 2001 From: igomez06 Date: Fri, 8 Dec 2023 09:35:51 -0700 Subject: [PATCH] Updated Rancher to import the framework from the repo rancher/shepherd. --- go.mod | 5 +- go.sum | 2 + tests/README.md | 22 +- tests/framework/clients/corral/config.go | 40 - tests/framework/clients/corral/corral.go | 219 --- tests/framework/clients/dynamic/dynamic.go | 123 -- tests/framework/clients/ec2/client.go | 39 - tests/framework/clients/ec2/config.go | 26 - tests/framework/clients/helm/helm.go | 106 -- tests/framework/clients/k3d/config.go | 10 - tests/framework/clients/k3d/k3d.go | 190 --- .../framework/clients/provisioning/client.go | 36 - .../framework/clients/provisioning/cluster.go | 23 - .../clients/rancher/catalog/client.go | 22 - .../clients/rancher/catalog/clusterrepo.go | 116 -- tests/framework/clients/rancher/client.go | 374 ----- tests/framework/clients/rancher/config.go | 17 - .../v3/zz_generated_aci_network_provider.go | 216 --- .../management/v3/zz_generated_action.go | 12 - .../zz_generated_active_directory_config.go | 86 -- ...d_active_directory_test_and_apply_input.go | 16 - .../management/v3/zz_generated_adfs_config.go | 52 - .../v3/zz_generated_aes_configuration.go | 10 - .../management/v3/zz_generated_affinity.go | 14 - ...enerated_agent_deployment_customization.go | 14 - .../zz_generated_aks_cluster_config_spec.go | 76 - .../v3/zz_generated_aks_node_pool.go | 42 - .../management/v3/zz_generated_aks_status.go | 14 - .../v3/zz_generated_alert_status.go | 10 - .../v3/zz_generated_alidns_provider_config.go | 14 - .../v3/zz_generated_allowed_csidriver.go | 10 - .../v3/zz_generated_allowed_flex_volume.go | 10 - .../v3/zz_generated_allowed_host_path.go | 12 - .../management/v3/zz_generated_answer.go | 16 - .../v3/zz_generated_app_condition.go | 20 - .../v3/zz_generated_attached_volume.go | 10 - .../management/v3/zz_generated_audit_log.go | 12 - .../v3/zz_generated_audit_log_config.go | 20 - .../management/v3/zz_generated_auth_config.go | 128 -- .../v3/zz_generated_auth_config_conditions.go | 20 - .../v3/zz_generated_auth_config_status.go | 10 - .../v3/zz_generated_auth_webhook_config.go | 12 - .../v3/zz_generated_authn_config.go | 14 - .../v3/zz_generated_authz_config.go | 12 - .../v3/zz_generated_aws_cloud_provider.go | 12 - ...d_aws_elastic_block_store_volume_source.go | 16 - .../v3/zz_generated_azure_adconfig.go | 50 - ...zz_generated_azure_adconfig_apply_input.go | 12 - ...zz_generated_azure_adconfig_test_output.go | 10 - .../v3/zz_generated_azure_cloud_provider.go | 74 - .../zz_generated_azure_disk_volume_source.go | 20 - .../zz_generated_azure_file_volume_source.go | 14 - .../v3/zz_generated_backup_config.go | 20 - .../v3/zz_generated_bastion_host.go | 26 - ..._generated_block_storage_openstack_opts.go | 14 - .../zz_generated_calico_network_provider.go | 10 - .../v3/zz_generated_canal_network_provider.go | 10 - .../v3/zz_generated_capabilities.go | 20 - .../management/v3/zz_generated_catalog.go | 164 --- .../v3/zz_generated_catalog_condition.go | 20 - .../v3/zz_generated_catalog_refresh.go | 10 - .../v3/zz_generated_catalog_secrets.go | 10 - .../v3/zz_generated_catalog_spec.go | 24 - .../v3/zz_generated_catalog_status.go | 18 - .../v3/zz_generated_catalog_template.go | 166 --- .../zz_generated_catalog_template_version.go | 158 -- .../v3/zz_generated_ceph_fsvolume_source.go | 20 - .../v3/zz_generated_cert_expiration.go | 10 - .../v3/zz_generated_change_password_input.go | 12 - .../v3/zz_generated_cinder_volume_source.go | 16 - .../management/v3/zz_generated_client.go | 150 -- .../v3/zz_generated_cloud_credential.go | 122 -- .../v3/zz_generated_cloud_credential_spec.go | 14 - .../v3/zz_generated_cloud_provider.go | 24 - ...zz_generated_cloudflare_provider_config.go | 16 - .../management/v3/zz_generated_cluster.go | 357 ----- .../v3/zz_generated_cluster_alert.go | 148 -- .../v3/zz_generated_cluster_alert_group.go | 140 -- .../v3/zz_generated_cluster_alert_rule.go | 180 --- .../zz_generated_cluster_alert_rule_spec.go | 34 - .../v3/zz_generated_cluster_alert_spec.go | 28 - .../v3/zz_generated_cluster_catalog.go | 168 --- .../zz_generated_cluster_component_status.go | 12 - .../v3/zz_generated_cluster_condition.go | 20 - .../v3/zz_generated_cluster_group_spec.go | 22 - .../v3/zz_generated_cluster_logging.go | 168 --- .../v3/zz_generated_cluster_logging_spec.go | 32 - .../v3/zz_generated_cluster_logging_status.go | 14 - ...zz_generated_cluster_metric_names_input.go | 10 - .../v3/zz_generated_cluster_monitor_graph.go | 146 -- ...zz_generated_cluster_monitor_graph_spec.go | 26 - ...zz_generated_cluster_registration_token.go | 144 -- ...nerated_cluster_registration_token_spec.go | 10 - ...rated_cluster_registration_token_status.go | 24 - ...generated_cluster_role_template_binding.go | 132 -- .../v3/zz_generated_cluster_scan_rule.go | 12 - .../v3/zz_generated_cluster_secrets.go | 40 - .../v3/zz_generated_cluster_spec.go | 78 - .../v3/zz_generated_cluster_spec_base.go | 42 - .../v3/zz_generated_cluster_status.go | 90 -- .../v3/zz_generated_cluster_template.go | 124 -- ...rated_cluster_template_questions_output.go | 10 - .../zz_generated_cluster_template_revision.go | 186 --- ...ted_cluster_template_revision_condition.go | 20 - ...enerated_cluster_template_revision_spec.go | 18 - ...erated_cluster_template_revision_status.go | 40 - .../v3/zz_generated_cluster_template_spec.go | 16 - .../v3/zz_generated_cluster_test_input.go | 24 - .../zz_generated_cluster_upgrade_strategy.go | 16 - .../v3/zz_generated_component_condition.go | 16 - .../v3/zz_generated_compose_condition.go | 20 - .../v3/zz_generated_compose_config.go | 128 -- .../v3/zz_generated_compose_spec.go | 10 - .../v3/zz_generated_compose_status.go | 10 - .../management/v3/zz_generated_condition.go | 20 - .../zz_generated_config_map_key_selector.go | 14 - ...generated_config_map_node_config_source.go | 18 - .../v3/zz_generated_config_map_projection.go | 14 - .../zz_generated_config_map_volume_source.go | 16 - .../v3/zz_generated_container_image.go | 12 - .../zz_generated_container_resource_limit.go | 16 - .../management/v3/zz_generated_cpu_info.go | 10 - .../v3/zz_generated_csi_volume_source.go | 18 - .../v3/zz_generated_custom_config.go | 24 - .../v3/zz_generated_custom_target_config.go | 16 - .../v3/zz_generated_daemon_endpoint.go | 10 - ...zz_generated_daemon_set_update_strategy.go | 12 - .../v3/zz_generated_deployment_strategy.go | 12 - .../v3/zz_generated_dingtalk_config.go | 14 - .../v3/zz_generated_disk_vsphere_opts.go | 10 - .../management/v3/zz_generated_dns_config.go | 28 - .../management/v3/zz_generated_docker_info.go | 48 - .../v3/zz_generated_downward_apiprojection.go | 10 - .../zz_generated_downward_apivolume_file.go | 16 - .../zz_generated_downward_apivolume_source.go | 12 - .../management/v3/zz_generated_duration.go | 8 - .../v3/zz_generated_dynamic_schema.go | 152 -- .../v3/zz_generated_dynamic_schema_spec.go | 34 - .../v3/zz_generated_dynamic_schema_status.go | 10 - .../v3/zz_generated_ecr_credential_plugin.go | 14 - .../zz_generated_eks_cluster_config_spec.go | 42 - .../management/v3/zz_generated_eks_status.go | 24 - .../v3/zz_generated_elasticsearch_config.go | 30 - .../zz_generated_empty_dir_volume_source.go | 12 - .../zz_generated_encryption_configuration.go | 14 - .../management/v3/zz_generated_env_var.go | 14 - .../v3/zz_generated_env_var_source.go | 16 - .../zz_generated_ephemeral_volume_source.go | 10 - .../management/v3/zz_generated_etcd_backup.go | 136 -- .../v3/zz_generated_etcd_backup_condition.go | 20 - .../v3/zz_generated_etcd_backup_spec.go | 16 - .../v3/zz_generated_etcd_backup_status.go | 14 - .../v3/zz_generated_etcd_service.go | 48 - .../v3/zz_generated_event_rate_limit.go | 12 - .../management/v3/zz_generated_event_rule.go | 12 - .../v3/zz_generated_export_output.go | 10 - .../management/v3/zz_generated_extra_env.go | 14 - .../v3/zz_generated_extra_volume.go | 68 - .../v3/zz_generated_extra_volume_mount.go | 20 - .../v3/zz_generated_fc_volume_source.go | 18 - .../management/v3/zz_generated_feature.go | 128 -- .../v3/zz_generated_feature_spec.go | 10 - .../v3/zz_generated_feature_status.go | 16 - .../management/v3/zz_generated_field.go | 40 - .../management/v3/zz_generated_file.go | 12 - .../management/v3/zz_generated_filter.go | 10 - .../zz_generated_flannel_network_provider.go | 10 - .../v3/zz_generated_fleet_workspace.go | 120 -- .../v3/zz_generated_fleet_workspace_status.go | 8 - .../v3/zz_generated_flex_volume_source.go | 18 - .../v3/zz_generated_flocker_volume_source.go | 12 - .../zz_generated_fluent_forwarder_config.go | 24 - .../v3/zz_generated_fluent_server.go | 22 - .../v3/zz_generated_free_ipa_config.go | 84 -- ...generated_free_ipa_test_and_apply_input.go | 14 - .../zz_generated_fs_group_strategy_options.go | 12 - ...rated_gce_persistent_disk_volume_source.go | 16 - ...z_generated_generate_kube_config_output.go | 10 - .../v3/zz_generated_git_repo_volume_source.go | 14 - .../v3/zz_generated_github_config.go | 46 - .../zz_generated_github_config_apply_input.go | 14 - .../zz_generated_github_config_test_output.go | 10 - .../v3/zz_generated_gke_cidr_block.go | 12 - .../v3/zz_generated_gke_cluster_addons.go | 14 - .../zz_generated_gke_cluster_config_spec.go | 54 - ...d_gke_master_authorized_networks_config.go | 12 - .../v3/zz_generated_gke_node_config.go | 28 - .../zz_generated_gke_node_pool_autoscaling.go | 14 - .../v3/zz_generated_gke_node_pool_config.go | 22 - .../zz_generated_gke_node_pool_management.go | 12 - .../v3/zz_generated_gke_node_taint_config.go | 14 - ...zz_generated_gke_private_cluster_config.go | 14 - .../management/v3/zz_generated_gke_status.go | 12 - .../zz_generated_gkeip_allocation_policy.go | 24 - .../v3/zz_generated_global_aws_opts.go | 28 - .../management/v3/zz_generated_global_dns.go | 152 -- .../v3/zz_generated_global_dns_provider.go | 128 -- .../zz_generated_global_dns_provider_spec.go | 18 - .../v3/zz_generated_global_dns_spec.go | 20 - .../v3/zz_generated_global_dns_status.go | 12 - .../v3/zz_generated_global_openstack_opts.go | 30 - .../management/v3/zz_generated_global_role.go | 126 -- .../v3/zz_generated_global_role_binding.go | 124 -- .../v3/zz_generated_global_vsphere_opts.go | 32 - .../zz_generated_glusterfs_volume_source.go | 14 - .../v3/zz_generated_google_oauth_config.go | 46 - ...nerated_google_oauth_config_apply_input.go | 14 - ...nerated_google_oauth_config_test_output.go | 10 - .../management/v3/zz_generated_group.go | 118 -- .../v3/zz_generated_group_member.go | 122 -- .../zz_generated_harvester_cloud_provider.go | 10 - .../v3/zz_generated_health_check.go | 10 - .../zz_generated_host_path_volume_source.go | 12 - .../v3/zz_generated_host_port_range.go | 12 - .../management/v3/zz_generated_id_range.go | 12 - .../v3/zz_generated_identity_configuration.go | 8 - .../zz_generated_import_cluster_yaml_input.go | 16 - .../v3/zz_generated_import_yaml_output.go | 10 - .../v3/zz_generated_imported_config.go | 10 - .../management/v3/zz_generated_info.go | 26 - .../v3/zz_generated_ingress_capabilities.go | 12 - .../v3/zz_generated_ingress_config.go | 42 - .../v3/zz_generated_internal_node_spec.go | 18 - .../v3/zz_generated_internal_node_status.go | 28 - .../v3/zz_generated_iscsi_volume_source.go | 30 - .../management/v3/zz_generated_k3s_config.go | 12 - .../v3/zz_generated_kafka_config.go | 28 - .../management/v3/zz_generated_key.go | 12 - .../v3/zz_generated_key_cloak_config.go | 52 - .../v3/zz_generated_key_cloak_oidcconfig.go | 52 - .../management/v3/zz_generated_key_to_path.go | 14 - .../v3/zz_generated_kms_configuration.go | 18 - .../v3/zz_generated_kontainer_driver.go | 163 --- .../v3/zz_generated_kontainer_driver_spec.go | 20 - .../zz_generated_kontainer_driver_status.go | 16 - .../v3/zz_generated_kube_apiservice.go | 44 - .../zz_generated_kube_controller_service.go | 30 - .../v3/zz_generated_kubelet_service.go | 36 - .../v3/zz_generated_kubeproxy_service.go | 26 - .../v3/zz_generated_kubernetes_info.go | 12 - ...z_generated_kubernetes_services_options.go | 20 - .../v3/zz_generated_label_selector.go | 12 - ...zz_generated_label_selector_requirement.go | 14 - .../v3/zz_generated_launch_template.go | 14 - .../management/v3/zz_generated_ldap_config.go | 180 --- .../management/v3/zz_generated_ldap_fields.go | 60 - .../zz_generated_linear_autoscaler_params.go | 18 - ...zz_generated_load_balancer_capabilities.go | 16 - ..._generated_load_balancer_openstack_opts.go | 30 - ...z_generated_local_cluster_auth_endpoint.go | 14 - .../v3/zz_generated_local_config.go | 34 - .../v3/zz_generated_local_object_reference.go | 10 - .../v3/zz_generated_logging_condition.go | 20 - .../v3/zz_generated_management_secret.go | 126 -- .../management/v3/zz_generated_map_delta.go | 12 - .../management/v3/zz_generated_member.go | 14 - .../management/v3/zz_generated_memory_info.go | 10 - .../zz_generated_metadata_openstack_opts.go | 12 - .../v3/zz_generated_metadata_update.go | 12 - .../v3/zz_generated_metric_names_output.go | 12 - .../management/v3/zz_generated_metric_rule.go | 18 - .../v3/zz_generated_monitor_metric.go | 158 -- .../v3/zz_generated_monitor_metric_spec.go | 14 - .../v3/zz_generated_monitoring_condition.go | 20 - .../v3/zz_generated_monitoring_config.go | 22 - .../v3/zz_generated_monitoring_input.go | 14 - .../v3/zz_generated_monitoring_output.go | 14 - .../v3/zz_generated_monitoring_status.go | 12 - .../v3/zz_generated_ms_teams_config.go | 12 - .../v3/zz_generated_multi_cluster_app.go | 165 --- ...zz_generated_multi_cluster_app_revision.go | 122 -- ...erated_multi_cluster_app_rollback_input.go | 10 - .../v3/zz_generated_multi_cluster_app_spec.go | 26 - .../zz_generated_multi_cluster_app_status.go | 14 - .../zz_generated_namespace_resource_quota.go | 10 - .../v3/zz_generated_network_config.go | 30 - .../v3/zz_generated_network_vshpere_opts.go | 10 - .../v3/zz_generated_nfs_volume_source.go | 14 - .../management/v3/zz_generated_node.go | 229 --- .../v3/zz_generated_node_address.go | 12 - .../v3/zz_generated_node_affinity.go | 12 - .../v3/zz_generated_node_condition.go | 20 - .../v3/zz_generated_node_config_source.go | 10 - .../v3/zz_generated_node_config_status.go | 16 - .../v3/zz_generated_node_daemon_endpoints.go | 10 - .../v3/zz_generated_node_drain_input.go | 18 - .../management/v3/zz_generated_node_driver.go | 160 -- .../v3/zz_generated_node_driver_spec.go | 28 - .../v3/zz_generated_node_driver_status.go | 16 - .../management/v3/zz_generated_node_group.go | 46 - .../management/v3/zz_generated_node_info.go | 16 - .../management/v3/zz_generated_node_plan.go | 14 - .../management/v3/zz_generated_node_pool.go | 156 -- .../v3/zz_generated_node_pool_spec.go | 34 - .../v3/zz_generated_node_pool_status.go | 10 - .../management/v3/zz_generated_node_rule.go | 18 - .../v3/zz_generated_node_selector.go | 10 - .../zz_generated_node_selector_requirement.go | 14 - .../v3/zz_generated_node_selector_term.go | 12 - .../management/v3/zz_generated_node_spec.go | 50 - .../management/v3/zz_generated_node_status.go | 46 - .../v3/zz_generated_node_system_info.go | 28 - .../v3/zz_generated_node_template.go | 160 -- .../zz_generated_node_template_condition.go | 18 - .../v3/zz_generated_node_template_spec.go | 44 - .../v3/zz_generated_node_template_status.go | 10 - .../v3/zz_generated_node_upgrade_strategy.go | 16 - .../management/v3/zz_generated_nodelocal.go | 16 - .../v3/zz_generated_notification.go | 24 - .../management/v3/zz_generated_notifier.go | 166 --- .../v3/zz_generated_notifier_spec.go | 30 - .../v3/zz_generated_notifier_status.go | 14 - .../v3/zz_generated_object_field_selector.go | 12 - .../management/v3/zz_generated_object_meta.go | 28 - .../v3/zz_generated_oidc_apply_input.go | 14 - .../management/v3/zz_generated_oidc_config.go | 52 - .../v3/zz_generated_oidc_test_output.go | 10 - .../management/v3/zz_generated_okta_config.go | 54 - .../v3/zz_generated_open_ldap_config.go | 86 -- ...enerated_open_ldap_test_and_apply_input.go | 14 - .../zz_generated_openstack_cloud_provider.go | 18 - .../management/v3/zz_generated_os_info.go | 14 - .../v3/zz_generated_owner_reference.go | 20 - .../v3/zz_generated_pagerduty_config.go | 12 - ..._generated_persistent_volume_claim_spec.go | 24 - ...erated_persistent_volume_claim_template.go | 12 - ...d_persistent_volume_claim_volume_source.go | 12 - ...ed_photon_persistent_disk_volume_source.go | 12 - .../management/v3/zz_generated_ping_config.go | 52 - .../v3/zz_generated_pod_affinity.go | 12 - .../v3/zz_generated_pod_affinity_term.go | 16 - .../v3/zz_generated_pod_anti_affinity.go | 12 - .../management/v3/zz_generated_pod_rule.go | 16 - .../zz_generated_pod_security_policy_spec.go | 56 - ..._generated_pod_security_policy_template.go | 168 --- ...ecurity_policy_template_project_binding.go | 124 -- .../management/v3/zz_generated_policy_rule.go | 18 - .../management/v3/zz_generated_port_check.go | 14 - .../v3/zz_generated_portworx_volume_source.go | 14 - .../management/v3/zz_generated_preference.go | 122 -- .../zz_generated_preferred_scheduling_term.go | 12 - .../management/v3/zz_generated_principal.go | 142 -- .../v3/zz_generated_private_registry.go | 18 - .../management/v3/zz_generated_process.go | 40 - .../management/v3/zz_generated_project.go | 188 --- .../v3/zz_generated_project_alert.go | 146 -- .../v3/zz_generated_project_alert_group.go | 140 -- .../v3/zz_generated_project_alert_rule.go | 176 --- .../zz_generated_project_alert_rule_spec.go | 30 - .../v3/zz_generated_project_alert_spec.go | 26 - .../v3/zz_generated_project_catalog.go | 168 --- .../v3/zz_generated_project_condition.go | 20 - .../v3/zz_generated_project_group_spec.go | 22 - .../v3/zz_generated_project_logging.go | 162 -- .../v3/zz_generated_project_logging_spec.go | 30 - .../v3/zz_generated_project_logging_status.go | 12 - ...zz_generated_project_metric_names_input.go | 10 - .../v3/zz_generated_project_monitor_graph.go | 146 -- ...zz_generated_project_monitor_graph_spec.go | 26 - .../v3/zz_generated_project_network_policy.go | 132 -- ...z_generated_project_network_policy_spec.go | 12 - ...generated_project_network_policy_status.go | 8 - .../v3/zz_generated_project_resource_quota.go | 12 - ...generated_project_role_template_binding.go | 134 -- .../v3/zz_generated_project_spec.go | 22 - .../v3/zz_generated_project_status.go | 14 - .../v3/zz_generated_project_test_input.go | 24 - .../zz_generated_projected_volume_source.go | 12 - .../v3/zz_generated_provider_configuration.go | 18 - .../v3/zz_generated_public_endpoint.go | 28 - .../v3/zz_generated_query_cluster_graph.go | 12 - ...zz_generated_query_cluster_graph_output.go | 12 - ...zz_generated_query_cluster_metric_input.go | 18 - .../v3/zz_generated_query_graph_input.go | 20 - .../v3/zz_generated_query_metric_output.go | 12 - .../v3/zz_generated_query_project_graph.go | 12 - ...zz_generated_query_project_graph_output.go | 12 - ...zz_generated_query_project_metric_input.go | 18 - .../management/v3/zz_generated_question.go | 44 - .../v3/zz_generated_quobyte_volume_source.go | 20 - ...erated_rancher_kubernetes_engine_config.go | 62 - .../zz_generated_rancher_user_notification.go | 122 -- .../v3/zz_generated_rbd_volume_source.go | 24 - .../management/v3/zz_generated_recipient.go | 14 - .../v3/zz_generated_resource_configuration.go | 12 - .../zz_generated_resource_field_selector.go | 14 - .../v3/zz_generated_resource_quota_limit.go | 34 - .../v3/zz_generated_resource_requirements.go | 12 - .../v3/zz_generated_restore_config.go | 12 - ...enerated_restore_from_etcd_backup_input.go | 12 - .../management/v3/zz_generated_rke2config.go | 12 - .../management/v3/zz_generated_rke_addon.go | 120 -- .../v3/zz_generated_rke_config_node.go | 38 - .../v3/zz_generated_rke_config_node_plan.go | 22 - .../v3/zz_generated_rke_config_services.go | 20 - .../v3/zz_generated_rke_k8s_service_option.go | 120 -- .../v3/zz_generated_rke_k8s_system_image.go | 120 -- .../v3/zz_generated_rke_system_images.go | 90 -- .../management/v3/zz_generated_rke_taint.go | 16 - .../v3/zz_generated_role_template.go | 140 -- .../v3/zz_generated_rolling_update.go | 12 - .../zz_generated_rolling_update_daemon_set.go | 16 - .../zz_generated_rolling_update_deployment.go | 16 - .../zz_generated_rotate_certificate_input.go | 12 - .../zz_generated_rotate_certificate_output.go | 10 - .../v3/zz_generated_rotate_certificates.go | 12 - ..._generated_rotate_encryption_key_output.go | 10 - .../v3/zz_generated_route53provider_config.go | 22 - .../v3/zz_generated_route_openstack_opts.go | 10 - ...generated_run_as_group_strategy_options.go | 12 - ..._generated_run_as_user_strategy_options.go | 12 - ...enerated_runtime_class_strategy_options.go | 12 - .../v3/zz_generated_s3backup_config.go | 22 - .../v3/zz_generated_s3credential_config.go | 24 - .../v3/zz_generated_saml_config_test_input.go | 10 - .../zz_generated_saml_config_test_output.go | 10 - .../management/v3/zz_generated_saml_token.go | 124 -- .../v3/zz_generated_save_as_template_input.go | 12 - .../zz_generated_save_as_template_output.go | 12 - .../v3/zz_generated_scale_iovolume_source.go | 28 - .../v3/zz_generated_scheduler_service.go | 26 - .../v3/zz_generated_se_linux_options.go | 16 - .../zz_generated_se_linux_strategy_options.go | 12 - .../zz_generated_search_principals_input.go | 12 - .../v3/zz_generated_secret_key_selector.go | 14 - .../v3/zz_generated_secret_projection.go | 14 - .../v3/zz_generated_secret_volume_source.go | 16 - .../zz_generated_secretbox_configuration.go | 10 - .../zz_generated_secrets_encryption_config.go | 12 - ...erated_service_account_token_projection.go | 14 - .../v3/zz_generated_service_override.go | 20 - .../v3/zz_generated_set_password_input.go | 10 - ..._set_pod_security_policy_template_input.go | 10 - .../management/v3/zz_generated_setting.go | 126 -- .../v3/zz_generated_shibboleth_config.go | 54 - .../v3/zz_generated_slack_config.go | 14 - .../management/v3/zz_generated_smtp_config.go | 22 - .../v3/zz_generated_splunk_config.go | 26 - .../zz_generated_storage_osvolume_source.go | 18 - .../v3/zz_generated_sub_question.go | 40 - ...ed_supplemental_groups_strategy_options.go | 12 - .../v3/zz_generated_syslog_config.go | 28 - .../v3/zz_generated_system_service_rule.go | 10 - .../management/v3/zz_generated_taint.go | 16 - .../management/v3/zz_generated_target.go | 16 - .../v3/zz_generated_target_event.go | 12 - .../management/v3/zz_generated_target_node.go | 18 - .../management/v3/zz_generated_target_pod.go | 16 - .../v3/zz_generated_target_system_service.go | 10 - .../v3/zz_generated_target_workload.go | 14 - .../management/v3/zz_generated_template.go | 166 --- .../v3/zz_generated_template_content.go | 120 -- .../v3/zz_generated_template_spec.go | 48 - .../v3/zz_generated_template_status.go | 10 - .../v3/zz_generated_template_version.go | 158 -- .../v3/zz_generated_template_version_spec.go | 40 - .../zz_generated_template_version_status.go | 10 - .../management/v3/zz_generated_time_series.go | 12 - .../management/v3/zz_generated_token.go | 155 -- .../management/v3/zz_generated_toleration.go | 18 - ..._generated_typed_local_object_reference.go | 14 - ...enerated_update_global_dnstargets_input.go | 10 - ..._update_multi_cluster_app_targets_input.go | 12 - .../v3/zz_generated_upgrade_strategy.go | 10 - .../management/v3/zz_generated_user.go | 169 --- .../v3/zz_generated_user_attribute.go | 34 - .../v3/zz_generated_user_condition.go | 20 - .../management/v3/zz_generated_user_spec.go | 8 - .../management/v3/zz_generated_user_status.go | 10 - .../management/v3/zz_generated_values.go | 16 - .../v3/zz_generated_version_commits.go | 10 - .../v3/zz_generated_virtual_center_config.go | 18 - .../v3/zz_generated_volume_projection.go | 16 - .../v3/zz_generated_vsphere_cloud_provider.go | 18 - ...ated_vsphere_virtual_disk_volume_source.go | 16 - .../v3/zz_generated_weave_network_provider.go | 10 - .../v3/zz_generated_webhook_config.go | 12 - .../v3/zz_generated_wechat_config.go | 22 - ...zz_generated_weighted_pod_affinity_term.go | 12 - .../v3/zz_generated_workload_rule.go | 14 - .../v3/zz_generated_workspace_vsphere_opts.go | 18 - .../management/v3/zz_generated_y_axis.go | 10 - tests/framework/clients/rancher/v1/client.go | 445 ------ tests/framework/clients/rke/client.go | 36 - tests/framework/clients/rkecli/rkecli.go | 36 - tests/framework/clients/rkecli/state.go | 205 --- .../codegen/generator/cleanup/main.go | 18 - .../framework/codegen/generator/generator.go | 43 - tests/framework/codegen/main.go | 48 - .../extensions/charts/awsoutoftree.go | 265 ---- tests/framework/extensions/charts/charts.go | 371 ----- .../extensions/charts/gatekeeperconfig.go | 37 - .../extensions/charts/gatekeeperresources.go | 62 - .../extensions/charts/opaconstraint.go | 49 - tests/framework/extensions/charts/payloads.go | 113 -- .../extensions/charts/ranchergatekeeper.go | 300 ---- .../extensions/charts/rancheristio.go | 308 ---- .../extensions/charts/rancherlogging.go | 201 --- .../extensions/charts/ranchermonitoring.go | 345 ----- .../extensions/charts/rancherwebhook.go | 8 - tests/framework/extensions/charts/verify.go | 34 - .../extensions/cloudcredentials/aws/create.go | 29 - .../extensions/cloudcredentials/aws_config.go | 11 - .../cloudcredentials/azure/create.go | 29 - .../cloudcredentials/azure_config.go | 12 - .../cloudcredentials/cloudcredentials.go | 25 - .../cloudcredentials/digitalocean/create.go | 29 - .../cloudcredentials/digitalocean_config.go | 9 - .../cloudcredentials/google/create.go | 29 - .../cloudcredentials/google_config.go | 9 - .../cloudcredentials/harvester/create.go | 29 - .../cloudcredentials/harvester_config.go | 11 - .../cloudcredentials/linode/create.go | 29 - .../cloudcredentials/linode_config.go | 9 - .../cloudcredentials/vsphere/create.go | 29 - .../cloudcredentials/vsphere_config.go | 12 - .../clusterrolebindings.go | 5 - .../clusters/aks/aks_cluster_config.go | 100 -- .../extensions/clusters/aks/create.go | 28 - .../extensions/clusters/aks/nodepools.go | 72 - .../bundledclusters/bundledclusters.go | 45 - .../clusters/bundledclusters/get.go | 32 - .../clusters/bundledclusters/list.go | 72 - .../clusters/bundledclusters/update.go | 215 --- .../extensions/clusters/clusterconfig.go | 62 - .../extensions/clusters/clustermeta.go | 112 -- .../framework/extensions/clusters/clusters.go | 1301 ----------------- .../extensions/clusters/clustertypes.go | 13 - .../extensions/clusters/dynamicSchema.go | 25 - .../extensions/clusters/eks/create.go | 27 - .../clusters/eks/eks_cluster_config.go | 116 -- .../extensions/clusters/eks/nodepools.go | 72 - .../extensions/clusters/gke/create.go | 27 - .../clusters/gke/gke_cluster_config.go | 259 ---- .../extensions/clusters/gke/nodepools.go | 72 - tests/framework/extensions/clusters/import.go | 248 ---- .../clusters/kubernetesversions/all.go | 289 ---- .../clusters/kubernetesversions/available.go | 334 ----- .../clusters/kubernetesversions/default.go | 83 -- .../extensions/codecoverage/codecoverage.go | 185 --- .../extensions/configmaps/configmaps.go | 16 - .../framework/extensions/defaults/defaults.go | 11 - .../extensions/etcdsnapshot/config.go | 15 - .../extensions/etcdsnapshot/etcdsnapshot.go | 242 --- .../extensions/hardening/k3s/audit.yaml | 4 - .../extensions/hardening/k3s/harden_nodes.go | 106 -- .../extensions/hardening/k3s/psa.yaml | 18 - .../extensions/hardening/k3s/psp.yaml | 36 - .../hardening/k3s/system-policy.yaml | 117 -- .../hardening/rke2/account-update.sh | 6 - .../hardening/rke2/account-update.yaml | 5 - .../extensions/hardening/rke2/harden_nodes.go | 88 -- .../extensions/ingresses/ingresses.go | 101 -- .../extensions/ingresses/template.go | 43 - .../kubeapi/authorization/authorization.go | 67 - .../extensions/kubeapi/cluster/summary.go | 27 - .../kubeapi/configmaps/configmaps.go | 55 - .../customresourcedefinitions.go | 28 - .../customresourcedefinitions/delete.go | 44 - .../kubeapi/customresourcedefinitions/list.go | 24 - .../framework/extensions/kubeapi/helm/helm.go | 96 -- .../extensions/kubeapi/ingresses/create.go | 42 - .../extensions/kubeapi/ingresses/ingresses.go | 39 - .../extensions/kubeapi/ingresses/list.go | 55 - .../extensions/kubeapi/namespaces/create.go | 132 -- .../extensions/kubeapi/namespaces/list.go | 55 - .../kubeapi/namespaces/namespaces.go | 51 - .../extensions/kubeapi/nodes/nodes.go | 59 - .../extensions/kubeapi/rbac/create.go | 70 - .../framework/extensions/kubeapi/rbac/list.go | 64 - .../framework/extensions/kubeapi/rbac/rbac.go | 38 - .../framework/extensions/kubeapi/resource.go | 18 - .../extensions/kubeapi/resourcequotas/list.go | 43 - .../kubeapi/resourcequotas/resourcequotas.go | 35 - .../extensions/kubeapi/secrets/basicAuth.go | 21 - .../extensions/kubeapi/secrets/create.go | 38 - .../extensions/kubeapi/secrets/list.go | 56 - .../kubeapi/secrets/patchsecrets.go | 49 - .../extensions/kubeapi/secrets/secrets.go | 42 - .../extensions/kubeapi/services/create.go | 51 - .../kubeapi/storageclasses/awsebs/create.go | 56 - .../storageclasses/awsebs/volumetype.go | 15 - .../kubeapi/storageclasses/storageclasses.go | 35 - .../extensions/kubeapi/tokens/patchtokens.go | 49 - .../persistentvolumeclaims.go | 88 -- .../persistentvolumes/awsebs/create.go | 54 - .../persistentvolumes/nodeselectorterms.go | 15 - .../persistentvolumes/persistentvolumes.go | 49 - .../extensions/kubeapi/webhook/webhook.go | 37 - .../kubeapi/workloads/cronjobs/create.go | 92 -- .../kubeapi/workloads/daemonsets/create.go | 57 - .../workloads/daemonsets/daemonsets.go | 41 - .../kubeapi/workloads/daemonsets/list.go | 56 - .../kubeapi/workloads/deployments/create.go | 66 - .../kubeapi/workloads/deployments/list.go | 54 - .../kubeapi/workloads/jobs/create.go | 86 -- .../kubeapi/workloads/pods/podstatus.go | 59 - .../extensions/kubeapi/workloads/template.go | 43 - .../extensions/kubeconfig/contexts.go | 16 - tests/framework/extensions/kubeconfig/exec.go | 113 -- .../extensions/kubeconfig/kubeconfig.go | 28 - .../extensions/kubeconfig/podlogs.go | 61 - .../extensions/kubeconfig/restgetter.go | 58 - tests/framework/extensions/kubectl/apply.go | 96 -- tests/framework/extensions/kubectl/explain.go | 65 - .../framework/extensions/kubectl/template.go | 118 -- .../machinepools/amazonec2_machine_config.go | 57 - .../machinepools/azure_machine_config.go | 74 - .../digitalocean_machine_config.go | 59 - .../machinepools/harvester_machine_config.go | 49 - .../machinepools/linode_machine_config.go | 61 - .../extensions/machinepools/machinepools.go | 196 --- .../machinepools/vsphere_machine_config.go | 94 -- .../framework/extensions/namespaces/create.go | 149 -- tests/framework/extensions/nodes/ec2/ec2.go | 183 --- .../framework/extensions/nodes/node_status.go | 139 -- .../extensions/pipeline/clustername.go | 15 - .../extensions/pipeline/configuration.go | 178 --- .../extensions/pipeline/releaseupgrade.go | 119 -- tests/framework/extensions/pipeline/setup.go | 155 -- .../extensions/pipeline/testcommand.go | 15 - .../framework/extensions/prime/primechecks.go | 41 - .../framework/extensions/projects/projects.go | 69 - .../framework/extensions/projects/template.go | 16 - .../extensions/provisioning/creates.go | 927 ------------ .../extensions/provisioning/customcluster.go | 14 - .../extensions/provisioning/nodeproviders.go | 63 - .../extensions/provisioning/providers.go | 139 -- .../framework/extensions/provisioning/ssh.go | 89 -- .../extensions/provisioning/upgrade.go | 41 - .../extensions/provisioning/verify.go | 495 ------- .../extensions/provisioninginput/config.go | 222 --- .../extensions/psact/createdeployment.go | 103 -- .../extensions/rancherversion/config.go | 13 - .../rancherversion/rancherversion.go | 35 - tests/framework/extensions/rbac/config.go | 11 - tests/framework/extensions/rbac/verify.go | 255 ---- .../extensions/registries/registries.go | 70 - .../resourcequotas/resourcequotas.go | 26 - .../rke1/componentchecks/etcdversion.go | 46 - .../extensions/rke1/nodepools/nodepools.go | 142 -- .../rke1/nodetemplates/aws/create.go | 30 - .../rke1/nodetemplates/aws_config.go | 42 - .../rke1/nodetemplates/azure/create.go | 30 - .../rke1/nodetemplates/azure_config.go | 37 - .../rke1/nodetemplates/harvester/create.go | 30 - .../rke1/nodetemplates/harvester_config.go | 30 - .../rke1/nodetemplates/linode/create.go | 30 - .../rke1/nodetemplates/linode_config.go | 25 - .../rke1/nodetemplates/nodetemplates.go | 41 - .../rke1/nodetemplates/vsphere/create.go | 30 - .../rke1/nodetemplates/vsphere_config.go | 39 - .../extensions/scalinginput/config.go | 42 - tests/framework/extensions/secrets/secrets.go | 5 - .../framework/extensions/secrets/template.go | 18 - .../serviceaccounts/serviceaccounts.go | 38 - .../framework/extensions/services/services.go | 5 - .../framework/extensions/services/template.go | 21 - tests/framework/extensions/services/verify.go | 61 - tests/framework/extensions/settings/shell.go | 30 - .../extensions/sshkeys/downloadsshkeys.go | 50 - tests/framework/extensions/token/create.go | 78 - .../tokenregistration/tokenregistration.go | 39 - .../extensions/unstructured/unstructured.go | 29 - .../passwordgenerator/passwordgenerator.go | 13 - tests/framework/extensions/users/users.go | 382 ----- .../framework/extensions/workloads/create.go | 37 - .../extensions/workloads/pods/pod_status.go | 93 -- .../extensions/workloads/pods/verify.go | 56 - .../extensions/workloads/template.go | 120 -- .../framework/extensions/workloads/verify.go | 32 - .../extensions/workloads/workloads.go | 6 - tests/framework/generator.go | 4 - tests/framework/pkg/clientbase/common.go | 395 ----- tests/framework/pkg/clientbase/ops.go | 432 ------ tests/framework/pkg/config/config.go | 121 -- tests/framework/pkg/config/file.go | 18 - .../pkg/environmentflag/environmentflag.go | 45 - .../pkg/environmentflag/environmentflags.go | 21 - .../environmentflag/zz_environmentflags.go | 32 - tests/framework/pkg/file/file.go | 64 - tests/framework/pkg/killserver/killserver.go | 47 - .../pkg/namegenerator/namegenerator.go | 46 - tests/framework/pkg/nodes/nodes.go | 153 -- .../framework/pkg/portforward/portforward.go | 82 -- .../schemas/management.cattle.io/v3/schema.go | 1039 ------------- .../schemas/management.cattle.io/v3/types.go | 27 - tests/framework/pkg/session/session.go | 82 -- tests/framework/pkg/wait/watch.go | 52 - tests/v2/codecoverage/agent/main.go | 2 +- tests/v2/codecoverage/rancher/main.go | 2 +- tests/v2/codecoverage/ranchercleanup/main.go | 12 +- .../ranchercover/codecoverage_test.go | 6 +- tests/v2/codecoverage/rancherha/main.go | 4 +- tests/v2/codecoverage/setuprancher/main.go | 38 +- .../catalogv2/cluster_repo_test.go | 8 +- .../catalogv2/system_charts_version_test.go | 16 +- .../integration/projects/project_user_test.go | 12 +- .../projects/resource_quota_test.go | 16 +- tests/v2/integration/rtbs/rtbs_test.go | 20 +- tests/v2/integration/setup/main.go | 12 +- .../v2/integration/steveapi/steve_api_test.go | 30 +- .../validation/certrotation/cert_rotation.go | 12 +- .../certrotation/cert_rotation_test.go | 8 +- tests/v2/validation/charts/gatekeeper.go | 6 +- tests/v2/validation/charts/gatekeeper_test.go | 16 +- .../gatekeeperallowednamespaces_test.go | 8 +- ...keeperallowednamespacespostupgrade_test.go | 4 +- tests/v2/validation/charts/istio.go | 10 +- tests/v2/validation/charts/istio_test.go | 16 +- tests/v2/validation/charts/monitoring.go | 18 +- tests/v2/validation/charts/monitoring_test.go | 24 +- tests/v2/validation/charts/webhook.go | 4 +- tests/v2/validation/charts/webhook_test.go | 18 +- .../validation/configmaps/generatedfields.go | 4 +- .../configmaps/generatedfields_test.go | 12 +- .../deleting/delete_cluster_rke1_test.go | 8 +- .../deleting/delete_cluster_test.go | 8 +- tests/v2/validation/nodescaling/replace.go | 12 +- .../nodescaling/scale_replace_rke1_test.go | 8 +- .../nodescaling/scale_replace_test.go | 12 +- .../scaling_custom_cluster_rke1_test.go | 12 +- .../scaling_custom_cluster_test.go | 12 +- .../scaling_node_driver_aks_test.go | 12 +- .../scaling_node_driver_eks_test.go | 12 +- .../scaling_node_driver_gke_test.go | 12 +- .../scaling_node_driver_rke1_test.go | 12 +- .../nodescaling/scaling_node_driver_test.go | 12 +- .../nodescaling/scaling_nodepools.go | 18 +- .../pipeline/downstreamcleanup/main.go | 16 +- .../validation/pipeline/hapostinstall/main.go | 14 +- .../validation/pipeline/qase/reporter/main.go | 17 +- .../pipeline/ranchercleanup/main.go | 12 +- .../v2/validation/pipeline/rancherha/main.go | 12 +- .../pipeline/releaseupgrade/main.go | 12 +- tests/v2/validation/prime/prime_test.go | 12 +- .../airgap/k3s_custom_cluster_test.go | 16 +- .../airgap/rke1_custom_cluster_test.go | 16 +- .../airgap/rke2_custom_cluster_test.go | 16 +- .../hosted/aks/hosted_provisioning_test.go | 16 +- .../hosted/eks/hosted_provisioning_test.go | 16 +- .../hosted/gke/hosted_provisioning_test.go | 16 +- .../hostname_truncation_test.go | 16 +- .../provisioning/k3s/custom_cluster_test.go | 22 +- .../k3s/post_kdm_oob_release_test.go | 10 +- .../k3s/provisioning_node_driver_test.go | 22 +- .../provisioning/permutations/permutations.go | 30 +- .../provisioning/registries/registry_test.go | 22 +- .../provisioning/rke1/custom_cluster_test.go | 22 +- .../rke1/post_kdm_oob_release_test.go | 10 +- .../rke1/provisioning_node_driver_test.go | 22 +- .../validation/provisioning/rke2/ace_test.go | 18 +- .../provisioning/rke2/custom_cluster_test.go | 22 +- .../rke2/post_kdm_oob_release_test.go | 10 +- .../rke2/provisioning_node_driver_test.go | 22 +- .../publicapi/crdgeneration/crd_generation.go | 8 +- .../crdgeneration/crd_generation_test.go | 4 +- tests/v2/validation/rbac/rbac.go | 16 +- .../validation/rbac/rbac_additional_test.go | 22 +- .../validation/rbac/rbac_etcd_backup_test.go | 12 +- tests/v2/validation/rbac/rbac_psa_test.go | 18 +- tests/v2/validation/rbac/rbac_test.go | 14 +- tests/v2/validation/shell/shell_test.go | 10 +- tests/v2/validation/snapshot/snapshot.go | 22 +- .../snapshot_restore_k8s_upgrade_test.go | 8 +- .../snapshot/snapshot_restore_test.go | 8 +- .../snapshot_restore_upgrade_strategy_test.go | 8 +- .../standalone/corral_generic_test.go | 6 +- tests/v2/validation/token/token_test.go | 10 +- tests/v2/validation/upgrade/config.go | 22 +- tests/v2/validation/upgrade/kubernetes.go | 10 +- .../v2/validation/upgrade/kubernetes_test.go | 18 +- tests/v2/validation/upgrade/workload.go | 22 +- tests/v2/validation/upgrade/workload_test.go | 27 +- .../v2prov/encryption_key_rotation_test.go | 18 +- 775 files changed, 615 insertions(+), 38985 deletions(-) delete mode 100644 tests/framework/clients/corral/config.go delete mode 100644 tests/framework/clients/corral/corral.go delete mode 100644 tests/framework/clients/dynamic/dynamic.go delete mode 100644 tests/framework/clients/ec2/client.go delete mode 100644 tests/framework/clients/ec2/config.go delete mode 100644 tests/framework/clients/helm/helm.go delete mode 100644 tests/framework/clients/k3d/config.go delete mode 100644 tests/framework/clients/k3d/k3d.go delete mode 100644 tests/framework/clients/provisioning/client.go delete mode 100644 tests/framework/clients/provisioning/cluster.go delete mode 100644 tests/framework/clients/rancher/catalog/client.go delete mode 100644 tests/framework/clients/rancher/catalog/clusterrepo.go delete mode 100644 tests/framework/clients/rancher/client.go delete mode 100644 tests/framework/clients/rancher/config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_aci_network_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_action.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_test_and_apply_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_adfs_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_aes_configuration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_affinity.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_agent_deployment_customization.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_cluster_config_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_node_pool.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_alert_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_alidns_provider_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_csidriver.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_flex_volume.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_host_path.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_answer.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_app_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_attached_volume.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_conditions.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_webhook_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_authn_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_authz_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_cloud_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_elastic_block_store_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_apply_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_test_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_cloud_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_disk_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_file_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_backup_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_bastion_host.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_block_storage_openstack_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_calico_network_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_canal_network_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_capabilities.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_refresh.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_secrets.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template_version.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ceph_fsvolume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cert_expiration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_change_password_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cinder_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_client.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cloudflare_provider_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_group.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_catalog.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_component_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_group_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_metric_names_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_role_template_binding.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_scan_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_secrets.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec_base.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_questions_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_test_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_upgrade_strategy.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_component_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_key_selector.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_node_config_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_projection.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_container_image.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_container_resource_limit.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_cpu_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_csi_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_target_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_endpoint.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_set_update_strategy.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_deployment_strategy.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_dingtalk_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_disk_vsphere_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_dns_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_docker_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apiprojection.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_file.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_duration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ecr_credential_plugin.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_cluster_config_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_elasticsearch_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_empty_dir_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_encryption_configuration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ephemeral_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_service.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rate_limit.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_export_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_env.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume_mount.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_fc_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_feature.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_field.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_file.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_filter.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_flannel_network_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_flex_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_flocker_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_forwarder_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_server.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_test_and_apply_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_fs_group_strategy_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gce_persistent_disk_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_generate_kube_config_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_git_repo_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_apply_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_test_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cidr_block.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_addons.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_config_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_master_authorized_networks_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_autoscaling.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_management.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_taint_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_private_cluster_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_gkeip_allocation_policy.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_aws_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_openstack_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role_binding.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_global_vsphere_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_glusterfs_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_apply_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_test_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_group.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_group_member.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_harvester_cloud_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_health_check.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_host_path_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_host_port_range.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_id_range.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_identity_configuration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_import_cluster_yaml_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_import_yaml_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_imported_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_capabilities.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_iscsi_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_k3s_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kafka_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_key.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_oidcconfig.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_key_to_path.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kms_configuration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_apiservice.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_controller_service.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kubelet_service.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kubeproxy_service.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_services_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector_requirement.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_launch_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_fields.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_linear_autoscaler_params.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_capabilities.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_openstack_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_local_cluster_auth_endpoint.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_local_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_local_object_reference.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_logging_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_management_secret.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_map_delta.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_member.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_memory_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_openstack_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_update.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_names_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ms_teams_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_revision.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_rollback_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_namespace_resource_quota.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_network_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_network_vshpere_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_nfs_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_address.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_affinity.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_daemon_endpoints.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_drain_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_group.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_plan.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_requirement.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_term.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_system_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_node_upgrade_strategy.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_nodelocal.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_notification.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_object_field_selector.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_object_meta.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_apply_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_test_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_okta_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_test_and_apply_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_openstack_cloud_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_os_info.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_owner_reference.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pagerduty_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_photon_persistent_disk_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_ping_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity_term.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_anti_affinity.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template_project_binding.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_policy_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_port_check.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_portworx_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_preference.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_preferred_scheduling_term.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_principal.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_private_registry.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_process.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_group.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_catalog.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_group_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_metric_names_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_resource_quota.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_role_template_binding.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_project_test_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_projected_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_provider_configuration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_public_endpoint.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_metric_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_graph_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_metric_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_metric_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_question.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_quobyte_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_kubernetes_engine_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_user_notification.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rbd_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_recipient.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_configuration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_field_selector.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_quota_limit.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_requirements.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_from_etcd_backup_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke2config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_addon.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node_plan.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_services.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_service_option.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_system_image.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_system_images.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_taint.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_role_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_daemon_set.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_deployment.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificates.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_encryption_key_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_route53provider_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_route_openstack_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_group_strategy_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_user_strategy_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_runtime_class_strategy_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_s3backup_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_s3credential_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_token.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_output.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_scale_iovolume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_scheduler_service.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_strategy_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_search_principals_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_key_selector.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_projection.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_secretbox_configuration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_secrets_encryption_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_service_account_token_projection.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_service_override.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_set_password_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_set_pod_security_policy_template_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_setting.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_shibboleth_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_slack_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_smtp_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_splunk_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_storage_osvolume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_sub_question.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_supplemental_groups_strategy_options.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_syslog_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_system_service_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_taint.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_target.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_target_event.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_target_node.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_target_pod.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_target_system_service.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_target_workload.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_template.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_template_content.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_template_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_template_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_time_series.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_token.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_toleration.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_typed_local_object_reference.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_update_global_dnstargets_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_update_multi_cluster_app_targets_input.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_upgrade_strategy.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_user.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_user_attribute.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_user_condition.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_user_spec.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_user_status.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_values.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_version_commits.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_virtual_center_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_volume_projection.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_cloud_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_virtual_disk_volume_source.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_weave_network_provider.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_webhook_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_wechat_config.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_weighted_pod_affinity_term.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_workload_rule.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_workspace_vsphere_opts.go delete mode 100644 tests/framework/clients/rancher/generated/management/v3/zz_generated_y_axis.go delete mode 100644 tests/framework/clients/rancher/v1/client.go delete mode 100644 tests/framework/clients/rke/client.go delete mode 100644 tests/framework/clients/rkecli/rkecli.go delete mode 100644 tests/framework/clients/rkecli/state.go delete mode 100644 tests/framework/codegen/generator/cleanup/main.go delete mode 100644 tests/framework/codegen/generator/generator.go delete mode 100644 tests/framework/codegen/main.go delete mode 100644 tests/framework/extensions/charts/awsoutoftree.go delete mode 100644 tests/framework/extensions/charts/charts.go delete mode 100644 tests/framework/extensions/charts/gatekeeperconfig.go delete mode 100644 tests/framework/extensions/charts/gatekeeperresources.go delete mode 100644 tests/framework/extensions/charts/opaconstraint.go delete mode 100644 tests/framework/extensions/charts/payloads.go delete mode 100644 tests/framework/extensions/charts/ranchergatekeeper.go delete mode 100644 tests/framework/extensions/charts/rancheristio.go delete mode 100644 tests/framework/extensions/charts/rancherlogging.go delete mode 100644 tests/framework/extensions/charts/ranchermonitoring.go delete mode 100644 tests/framework/extensions/charts/rancherwebhook.go delete mode 100644 tests/framework/extensions/charts/verify.go delete mode 100644 tests/framework/extensions/cloudcredentials/aws/create.go delete mode 100644 tests/framework/extensions/cloudcredentials/aws_config.go delete mode 100644 tests/framework/extensions/cloudcredentials/azure/create.go delete mode 100644 tests/framework/extensions/cloudcredentials/azure_config.go delete mode 100644 tests/framework/extensions/cloudcredentials/cloudcredentials.go delete mode 100644 tests/framework/extensions/cloudcredentials/digitalocean/create.go delete mode 100644 tests/framework/extensions/cloudcredentials/digitalocean_config.go delete mode 100644 tests/framework/extensions/cloudcredentials/google/create.go delete mode 100644 tests/framework/extensions/cloudcredentials/google_config.go delete mode 100644 tests/framework/extensions/cloudcredentials/harvester/create.go delete mode 100644 tests/framework/extensions/cloudcredentials/harvester_config.go delete mode 100644 tests/framework/extensions/cloudcredentials/linode/create.go delete mode 100644 tests/framework/extensions/cloudcredentials/linode_config.go delete mode 100644 tests/framework/extensions/cloudcredentials/vsphere/create.go delete mode 100644 tests/framework/extensions/cloudcredentials/vsphere_config.go delete mode 100644 tests/framework/extensions/clusterrolebindings/clusterrolebindings.go delete mode 100644 tests/framework/extensions/clusters/aks/aks_cluster_config.go delete mode 100644 tests/framework/extensions/clusters/aks/create.go delete mode 100644 tests/framework/extensions/clusters/aks/nodepools.go delete mode 100644 tests/framework/extensions/clusters/bundledclusters/bundledclusters.go delete mode 100644 tests/framework/extensions/clusters/bundledclusters/get.go delete mode 100644 tests/framework/extensions/clusters/bundledclusters/list.go delete mode 100644 tests/framework/extensions/clusters/bundledclusters/update.go delete mode 100644 tests/framework/extensions/clusters/clusterconfig.go delete mode 100644 tests/framework/extensions/clusters/clustermeta.go delete mode 100644 tests/framework/extensions/clusters/clusters.go delete mode 100644 tests/framework/extensions/clusters/clustertypes.go delete mode 100644 tests/framework/extensions/clusters/dynamicSchema.go delete mode 100644 tests/framework/extensions/clusters/eks/create.go delete mode 100644 tests/framework/extensions/clusters/eks/eks_cluster_config.go delete mode 100644 tests/framework/extensions/clusters/eks/nodepools.go delete mode 100644 tests/framework/extensions/clusters/gke/create.go delete mode 100644 tests/framework/extensions/clusters/gke/gke_cluster_config.go delete mode 100644 tests/framework/extensions/clusters/gke/nodepools.go delete mode 100644 tests/framework/extensions/clusters/import.go delete mode 100644 tests/framework/extensions/clusters/kubernetesversions/all.go delete mode 100644 tests/framework/extensions/clusters/kubernetesversions/available.go delete mode 100644 tests/framework/extensions/clusters/kubernetesversions/default.go delete mode 100644 tests/framework/extensions/codecoverage/codecoverage.go delete mode 100644 tests/framework/extensions/configmaps/configmaps.go delete mode 100644 tests/framework/extensions/defaults/defaults.go delete mode 100644 tests/framework/extensions/etcdsnapshot/config.go delete mode 100644 tests/framework/extensions/etcdsnapshot/etcdsnapshot.go delete mode 100644 tests/framework/extensions/hardening/k3s/audit.yaml delete mode 100644 tests/framework/extensions/hardening/k3s/harden_nodes.go delete mode 100644 tests/framework/extensions/hardening/k3s/psa.yaml delete mode 100644 tests/framework/extensions/hardening/k3s/psp.yaml delete mode 100644 tests/framework/extensions/hardening/k3s/system-policy.yaml delete mode 100644 tests/framework/extensions/hardening/rke2/account-update.sh delete mode 100644 tests/framework/extensions/hardening/rke2/account-update.yaml delete mode 100644 tests/framework/extensions/hardening/rke2/harden_nodes.go delete mode 100644 tests/framework/extensions/ingresses/ingresses.go delete mode 100644 tests/framework/extensions/ingresses/template.go delete mode 100644 tests/framework/extensions/kubeapi/authorization/authorization.go delete mode 100644 tests/framework/extensions/kubeapi/cluster/summary.go delete mode 100644 tests/framework/extensions/kubeapi/configmaps/configmaps.go delete mode 100644 tests/framework/extensions/kubeapi/customresourcedefinitions/customresourcedefinitions.go delete mode 100644 tests/framework/extensions/kubeapi/customresourcedefinitions/delete.go delete mode 100644 tests/framework/extensions/kubeapi/customresourcedefinitions/list.go delete mode 100644 tests/framework/extensions/kubeapi/helm/helm.go delete mode 100644 tests/framework/extensions/kubeapi/ingresses/create.go delete mode 100644 tests/framework/extensions/kubeapi/ingresses/ingresses.go delete mode 100644 tests/framework/extensions/kubeapi/ingresses/list.go delete mode 100644 tests/framework/extensions/kubeapi/namespaces/create.go delete mode 100644 tests/framework/extensions/kubeapi/namespaces/list.go delete mode 100644 tests/framework/extensions/kubeapi/namespaces/namespaces.go delete mode 100644 tests/framework/extensions/kubeapi/nodes/nodes.go delete mode 100644 tests/framework/extensions/kubeapi/rbac/create.go delete mode 100644 tests/framework/extensions/kubeapi/rbac/list.go delete mode 100644 tests/framework/extensions/kubeapi/rbac/rbac.go delete mode 100644 tests/framework/extensions/kubeapi/resource.go delete mode 100644 tests/framework/extensions/kubeapi/resourcequotas/list.go delete mode 100644 tests/framework/extensions/kubeapi/resourcequotas/resourcequotas.go delete mode 100644 tests/framework/extensions/kubeapi/secrets/basicAuth.go delete mode 100644 tests/framework/extensions/kubeapi/secrets/create.go delete mode 100644 tests/framework/extensions/kubeapi/secrets/list.go delete mode 100644 tests/framework/extensions/kubeapi/secrets/patchsecrets.go delete mode 100644 tests/framework/extensions/kubeapi/secrets/secrets.go delete mode 100644 tests/framework/extensions/kubeapi/services/create.go delete mode 100644 tests/framework/extensions/kubeapi/storageclasses/awsebs/create.go delete mode 100644 tests/framework/extensions/kubeapi/storageclasses/awsebs/volumetype.go delete mode 100644 tests/framework/extensions/kubeapi/storageclasses/storageclasses.go delete mode 100644 tests/framework/extensions/kubeapi/tokens/patchtokens.go delete mode 100644 tests/framework/extensions/kubeapi/volumes/persistentvolumeclaims/persistentvolumeclaims.go delete mode 100644 tests/framework/extensions/kubeapi/volumes/persistentvolumes/awsebs/create.go delete mode 100644 tests/framework/extensions/kubeapi/volumes/persistentvolumes/nodeselectorterms.go delete mode 100644 tests/framework/extensions/kubeapi/volumes/persistentvolumes/persistentvolumes.go delete mode 100644 tests/framework/extensions/kubeapi/webhook/webhook.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/cronjobs/create.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/daemonsets/create.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/daemonsets/daemonsets.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/daemonsets/list.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/deployments/create.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/deployments/list.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/jobs/create.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/pods/podstatus.go delete mode 100644 tests/framework/extensions/kubeapi/workloads/template.go delete mode 100644 tests/framework/extensions/kubeconfig/contexts.go delete mode 100644 tests/framework/extensions/kubeconfig/exec.go delete mode 100644 tests/framework/extensions/kubeconfig/kubeconfig.go delete mode 100644 tests/framework/extensions/kubeconfig/podlogs.go delete mode 100644 tests/framework/extensions/kubeconfig/restgetter.go delete mode 100644 tests/framework/extensions/kubectl/apply.go delete mode 100644 tests/framework/extensions/kubectl/explain.go delete mode 100644 tests/framework/extensions/kubectl/template.go delete mode 100644 tests/framework/extensions/machinepools/amazonec2_machine_config.go delete mode 100644 tests/framework/extensions/machinepools/azure_machine_config.go delete mode 100644 tests/framework/extensions/machinepools/digitalocean_machine_config.go delete mode 100644 tests/framework/extensions/machinepools/harvester_machine_config.go delete mode 100644 tests/framework/extensions/machinepools/linode_machine_config.go delete mode 100644 tests/framework/extensions/machinepools/machinepools.go delete mode 100644 tests/framework/extensions/machinepools/vsphere_machine_config.go delete mode 100644 tests/framework/extensions/namespaces/create.go delete mode 100644 tests/framework/extensions/nodes/ec2/ec2.go delete mode 100644 tests/framework/extensions/nodes/node_status.go delete mode 100644 tests/framework/extensions/pipeline/clustername.go delete mode 100644 tests/framework/extensions/pipeline/configuration.go delete mode 100644 tests/framework/extensions/pipeline/releaseupgrade.go delete mode 100644 tests/framework/extensions/pipeline/setup.go delete mode 100644 tests/framework/extensions/pipeline/testcommand.go delete mode 100644 tests/framework/extensions/prime/primechecks.go delete mode 100644 tests/framework/extensions/projects/projects.go delete mode 100644 tests/framework/extensions/projects/template.go delete mode 100644 tests/framework/extensions/provisioning/creates.go delete mode 100644 tests/framework/extensions/provisioning/customcluster.go delete mode 100644 tests/framework/extensions/provisioning/nodeproviders.go delete mode 100644 tests/framework/extensions/provisioning/providers.go delete mode 100644 tests/framework/extensions/provisioning/ssh.go delete mode 100644 tests/framework/extensions/provisioning/upgrade.go delete mode 100644 tests/framework/extensions/provisioning/verify.go delete mode 100644 tests/framework/extensions/provisioninginput/config.go delete mode 100644 tests/framework/extensions/psact/createdeployment.go delete mode 100644 tests/framework/extensions/rancherversion/config.go delete mode 100644 tests/framework/extensions/rancherversion/rancherversion.go delete mode 100644 tests/framework/extensions/rbac/config.go delete mode 100644 tests/framework/extensions/rbac/verify.go delete mode 100644 tests/framework/extensions/registries/registries.go delete mode 100644 tests/framework/extensions/resourcequotas/resourcequotas.go delete mode 100644 tests/framework/extensions/rke1/componentchecks/etcdversion.go delete mode 100644 tests/framework/extensions/rke1/nodepools/nodepools.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/aws/create.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/aws_config.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/azure/create.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/azure_config.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/harvester/create.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/harvester_config.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/linode/create.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/linode_config.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/nodetemplates.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/vsphere/create.go delete mode 100644 tests/framework/extensions/rke1/nodetemplates/vsphere_config.go delete mode 100644 tests/framework/extensions/scalinginput/config.go delete mode 100644 tests/framework/extensions/secrets/secrets.go delete mode 100644 tests/framework/extensions/secrets/template.go delete mode 100644 tests/framework/extensions/serviceaccounts/serviceaccounts.go delete mode 100644 tests/framework/extensions/services/services.go delete mode 100644 tests/framework/extensions/services/template.go delete mode 100644 tests/framework/extensions/services/verify.go delete mode 100644 tests/framework/extensions/settings/shell.go delete mode 100644 tests/framework/extensions/sshkeys/downloadsshkeys.go delete mode 100644 tests/framework/extensions/token/create.go delete mode 100644 tests/framework/extensions/tokenregistration/tokenregistration.go delete mode 100644 tests/framework/extensions/unstructured/unstructured.go delete mode 100644 tests/framework/extensions/users/passwordgenerator/passwordgenerator.go delete mode 100644 tests/framework/extensions/users/users.go delete mode 100644 tests/framework/extensions/workloads/create.go delete mode 100644 tests/framework/extensions/workloads/pods/pod_status.go delete mode 100644 tests/framework/extensions/workloads/pods/verify.go delete mode 100644 tests/framework/extensions/workloads/template.go delete mode 100644 tests/framework/extensions/workloads/verify.go delete mode 100644 tests/framework/extensions/workloads/workloads.go delete mode 100644 tests/framework/generator.go delete mode 100644 tests/framework/pkg/clientbase/common.go delete mode 100644 tests/framework/pkg/clientbase/ops.go delete mode 100644 tests/framework/pkg/config/config.go delete mode 100644 tests/framework/pkg/config/file.go delete mode 100644 tests/framework/pkg/environmentflag/environmentflag.go delete mode 100644 tests/framework/pkg/environmentflag/environmentflags.go delete mode 100644 tests/framework/pkg/environmentflag/zz_environmentflags.go delete mode 100644 tests/framework/pkg/file/file.go delete mode 100644 tests/framework/pkg/killserver/killserver.go delete mode 100644 tests/framework/pkg/namegenerator/namegenerator.go delete mode 100644 tests/framework/pkg/nodes/nodes.go delete mode 100644 tests/framework/pkg/portforward/portforward.go delete mode 100644 tests/framework/pkg/schemas/management.cattle.io/v3/schema.go delete mode 100644 tests/framework/pkg/schemas/management.cattle.io/v3/types.go delete mode 100644 tests/framework/pkg/session/session.go delete mode 100644 tests/framework/pkg/wait/watch.go diff --git a/go.mod b/go.mod index 992d4541aa2..c8edb53105b 100644 --- a/go.mod +++ b/go.mod @@ -166,6 +166,7 @@ require ( require ( github.com/antihax/optional v1.0.0 github.com/containers/image/v5 v5.25.0 + github.com/rancher/shepherd v0.0.0-20240130172559-0b66a23953f2 go.qase.io/client v0.0.0-20231114201952-65195ec001fa ) @@ -339,7 +340,7 @@ require ( github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.6 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/pkg/sftp v1.13.5 + github.com/pkg/sftp v1.13.5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect @@ -352,7 +353,7 @@ require ( github.com/shopspring/decimal v1.2.0 // indirect github.com/smartystreets/goconvey v1.7.2 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect diff --git a/go.sum b/go.sum index 2c9ebb39260..db4a3339ea6 100644 --- a/go.sum +++ b/go.sum @@ -1214,6 +1214,8 @@ github.com/rancher/remotedialer v0.2.6-0.20220624190122-ea57207bf2b8 h1:leqh0chj github.com/rancher/remotedialer v0.2.6-0.20220624190122-ea57207bf2b8/go.mod h1:BwwztuvViX2JrLLUwDlsYt5DiyUwHLlzynRwkZLAY0Q= github.com/rancher/rke v1.4.10 h1:JP3j9mPjPojopN73Qwu5efKw9PQ7od+GKrHpVJLW3fg= github.com/rancher/rke v1.4.10/go.mod h1:zCL+we25sFDQb2jo6EojX8zxBfbB7FxL6Lte6A6eCiY= +github.com/rancher/shepherd v0.0.0-20240130172559-0b66a23953f2 h1:dIhaNNzN32qrKfhCwPs8L5lTWy2NTy3xzSDcMzccxYU= +github.com/rancher/shepherd v0.0.0-20240130172559-0b66a23953f2/go.mod h1:544XWejV/CYcv5NL+NztxJHL2FnZzMqcaz6tdUd/VOs= github.com/rancher/steve v0.0.0-20230717160251-d040cffef385 h1:xMR4LJY5C4LAkJbmVKYvu4BaCYXx2fu99a0K+gErpA0= github.com/rancher/steve v0.0.0-20230717160251-d040cffef385/go.mod h1:lCxhhsajJHMUnj0EU+3mbrucc6mHDYD94abDiWX6I/Y= github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20210727200656-10b094e30007 h1:ru+mqGnxMmKeU0Q3XIDxkARvInDIqT1hH2amTcsjxI4= diff --git a/tests/README.md b/tests/README.md index 90bf66e42b5..48bf5980dab 100644 --- a/tests/README.md +++ b/tests/README.md @@ -10,7 +10,7 @@ The Rancher Test Framework provides tools for writing integrations and validatio To run rancher integration tests you will need: - a running instance of rancher with an accessible url - a rancher access token for the admin user -- [golang 1.17](https://go.dev/doc/install) +- [golang 1.19](https://go.dev/doc/install) - [k3d](https://k3d.io/v5.1.0/) #### Validation @@ -26,25 +26,9 @@ Integration tests - Don't require any external configuration or access to any ot Validation tests - Require access to external services, and needs to a config file to run them. -### Extensions +## Framework -Extensions are functions that complete common operations used by tests. Extensions should not require much configuration or support multiple behaviors. Extensions should be simple enough that they can be used in many tests without needing to be tested themselves. - -### Clients - -Clients are used to create the resources in the tests. The advantage of the cients is they register the cleanups with sessions, making resource cleanup trivial. There are three clients; the rancher client, dynamic client, and the k3d client. The rancher client is used to create resources on a rancher instance. Given a host url, and a bearer token the rancher client communicates directly with the rancher instance. The dynamic client is used as means of communication on a downstream cluster, and used for kubernete resource management on that cluster. The k3d client is used to create a minimal k3d cluster, this is to give the integration tests the ability to test against a downstream cluster. - -### Wait - -Wait is used to monitor resources, and wait for specified conditions. There are multiple ways to wait for a resource. There is WatchWait that uses the watch.Interface of a resource to wait until the check function returns true. For more generic polling or waiting, the "k8s.io/apimachinery/pkg/util/wait" package can be used. - -### Sessions - -Sessions are used to track resources created by tests. A session allows cleanup functions to be registered while it is open. Once a session is closed the cleanup functions will be called latest to oldest. Sessions should be closed after a set of tests that use the same resources is completed. This eliminates the need for each test to create and tear down its own resources allowing for more efficient reuse of some resources. When pared with a client sessions are a powerful tool that can track and cleanup any resource a tests creates with no additional work from the developer. - -### Configuration - -Configuration is loaded from the yaml or json file described in `CATTLE_TEST_CONFIG`. Configuration objects are loaded from their associated key in the configuration file. Default values can also be set on configuration objects. +Shepherd is our testing framework and is located https://github.com/rancher/shepherd. For more info please visit the repo. ## How to Write Tests diff --git a/tests/framework/clients/corral/config.go b/tests/framework/clients/corral/config.go deleted file mode 100644 index 0bef81e5002..00000000000 --- a/tests/framework/clients/corral/config.go +++ /dev/null @@ -1,40 +0,0 @@ -package corral - -import ( - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -// The json/yaml config key for the corral package to be build .. -const ( - corralPackageConfigConfigurationFileKey = "corralPackages" - corralConfigConfigurationFileKey = "corralConfigs" -) - -// Configs is a struct that for necessary corral config environment variables to build a corral -type Configs struct { - CorralConfigVars map[string]string `json:"corralConfigVars" yaml:"corralConfigVars"` - CorralConfigUser string `json:"corralConfigUser" yaml:"corralConfigUser" default:"jenkauto"` - CorralSSHPath string `json:"corralSSHPath" yaml:"corralSSHPath" default:"/root/.ssh/public.pub"` -} - -// Packages is a struct that has the path to the packages -type Packages struct { - CorralPackageImages map[string]string `json:"corralPackageImages" yaml:"corralPackageImages"` - HasCleanup bool `json:"hasCleanup" yaml:"hasCleanup" default:"true"` - HasDebug bool `json:"hasDebug" yaml:"hasDebug" default:"false"` - HasCustomRepo string `json:"hasCustomRepo" yaml:"hasCustomRepo"` -} - -// PackagesConfig is a function that reads in the corral package object from the config file -func PackagesConfig() *Packages { - var corralPackages Packages - config.LoadConfig(corralPackageConfigConfigurationFileKey, &corralPackages) - return &corralPackages -} - -// Configurations is a function that reads in the corral config vars from the config file -func Configurations() *Configs { - var corralConfigs Configs - config.LoadConfig(corralConfigConfigurationFileKey, &corralConfigs) - return &corralConfigs -} diff --git a/tests/framework/clients/corral/corral.go b/tests/framework/clients/corral/corral.go deleted file mode 100644 index 120a87d55ab..00000000000 --- a/tests/framework/clients/corral/corral.go +++ /dev/null @@ -1,219 +0,0 @@ -package corral - -import ( - "bytes" - "fmt" - "io" - "os/exec" - "regexp" - "strings" - - "github.com/pkg/errors" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/sirupsen/logrus" -) - -const ( - debugFlag = "--trace" - skipCleanupFlag = "--skip-cleanup" - corralPrivateSSHKey = "corral_private_key" - corralPublicSSHKey = "corral_public_key" -) - -// GetCorralEnvVar gets corral environment variables -func GetCorralEnvVar(corralName, envVar string) (string, error) { - msg, err := exec.Command("corral", "vars", corralName, envVar).CombinedOutput() - if err != nil { - return "", errors.Wrap(err, "GetCorralEnvVar: "+string(msg)) - } - - corralEnvVar := string(msg) - corralEnvVar = strings.TrimSuffix(corralEnvVar, "\n") - return corralEnvVar, nil -} - -// SetupCorralConfig sets the corral config vars. It takes a map[string]string as a parameter; the key is the value and the value the value you are setting -// For example we are getting the aws config vars to build a corral from aws. -// results := aws.AWSCorralConfigVars() -// err := corral.SetupCorralConfig(results) -func SetupCorralConfig(configVars map[string]string, configUser string, configSSHPath string) error { - msg, err := exec.Command("corral", "config", "--user_id", configUser, "--public_key", configSSHPath).CombinedOutput() - if err != nil { - return errors.Wrap(err, "Unable to set configuraion: "+string(msg)) - } - for variable, value := range configVars { - msg, err := exec.Command("corral", "config", "vars", "set", variable, value).CombinedOutput() - if err != nil { - return errors.Wrap(err, "SetupCorralConfig: "+string(msg)) - } - } - return nil -} - -// SetCustomRepo sets a custom repo for corral to use. It takes a string as a parameter which is the repo you want to use -func SetCustomRepo(repo string) error { - msg, err := exec.Command("git", "clone", repo, "corral-packages").CombinedOutput() - if err != nil { - return errors.Wrap(err, "Failed to git clone remote repo: "+string(msg)) - } - makemsg, err := exec.Command("make", "init", "-C", "corral-packages").CombinedOutput() - if err != nil { - return errors.Wrap(err, "Failed to git clone remote repo: "+string(makemsg)) - } - makebuildmsg, err := exec.Command("make", "build", "-C", "corral-packages").CombinedOutput() - if err != nil { - return errors.Wrap(err, "Failed to git clone remote repo: "+string(makebuildmsg)) - } - logrus.Infof("Successfully set custom repo: %s", repo) - return nil -} - -// CreateCorral creates a corral taking the corral name, the package path, and a debug set so if someone wants to view the -// corral create log -func CreateCorral(ts *session.Session, corralName, packageName string, debug bool, cleanup bool) ([]byte, error) { - ts.RegisterCleanupFunc(func() error { - return DeleteCorral(corralName) - }) - - args := []string{"create"} - if !cleanup { - args = append(args, skipCleanupFlag) - } - if debug { - args = append(args, debugFlag) - } - args = append(args, corralName, packageName) - logrus.Infof("Creating corral with the following parameters: %v", args) - // complicated, but running the command in a way that allows us to - // capture the output and error(s) and print it to the console - msg, err := exec.Command("corral", args...).CombinedOutput() - logrus.Infof("Corral create output: %s", string(msg)) - if err != nil { - return nil, errors.Wrap(err, "Unable to create corral: "+string(msg)) - } - - return msg, nil -} - -// DeleteCorral deletes a corral based on the corral name -func DeleteCorral(corralName string) error { - msg, err := exec.Command("corral", "delete", corralName).CombinedOutput() - if err != nil { - return errors.Wrap(err, "DeleteCorral: "+string(msg)) - } - return nil -} - -// ListCorral lists the corrals that currently created -func ListCorral() (map[string]string, error) { - corralMapList := make(map[string]string) - msg, err := exec.Command("corral", "list").CombinedOutput() - if err != nil { - return nil, errors.Wrap(err, "ListCorral: "+string(msg)) - } - // The corral list command comes in this format. So the regular - // expression is we can get the corral name and its state from the commandline - // +------------+--------+ - // | NAME | STATUS | - // +------------+--------+ - // | corralname | READY | - // +------------+--------+ - corralNameRegEx := regexp.MustCompile(`\w+ +\| +\w+`) - corralList := corralNameRegEx.FindAllString(string(msg), -1) - if len(corralList) == 1 { - return corralMapList, nil - } - for _, corral := range corralList[1:] { - corralRegEx := regexp.MustCompile(` +\|`) - corralNameStatus := corralRegEx.Split(corral, -1) - corralMapList[corralNameStatus[0]] = corralNameStatus[1] - } - return corralMapList, nil -} - -// GetKubeConfig gets the kubeconfig of corral's cluster -func GetKubeConfig(corral string) ([]byte, error) { - firstCommand := exec.Command("corral", "vars", corral, "kubeconfig") - secondCommand := exec.Command("base64", "--decode") - - reader, writer := io.Pipe() - firstCommand.Stdout = writer - secondCommand.Stdin = reader - - var byteBuffer bytes.Buffer - secondCommand.Stdout = &byteBuffer - - err := firstCommand.Start() - if err != nil { - return nil, err - } - - err = secondCommand.Start() - if err != nil { - return nil, err - } - - err = firstCommand.Wait() - if err != nil { - return nil, err - } - - err = writer.Close() - if err != nil { - return nil, err - } - - err = secondCommand.Wait() - if err != nil { - return nil, err - } - - return byteBuffer.Bytes(), nil -} - -// UpdateCorralConfig updates a specific corral config var -func UpdateCorralConfig(configVar, value string) error { - msg, err := exec.Command("corral", "config", "vars", "set", configVar, value).CombinedOutput() - if err != nil { - return errors.Wrap(err, "SetupCorralConfig: "+string(msg)) - } - return nil -} - -func DeleteAllCorrals() error { - corralList, err := ListCorral() - if err != nil { - return err - } - for corralName := range corralList { - err := DeleteCorral(corralName) - logrus.Infof("The Corral %s was deleted.", corralName) - if err != nil { - return err - } - } - return nil -} - -// SetCorralSSHKeys is a helper function that will set the corral ssh keys previously generated by `corralName` -func SetCorralSSHKeys(corralName string) error { - privateSSHkey, err := GetCorralEnvVar(corralName, corralPrivateSSHKey) - if err != nil { - return err - } - - privateSSHkey = strings.Replace(privateSSHkey, "\n", "\\n", -1) - privateSSHkey = fmt.Sprintf("\"%s\"", privateSSHkey) - - err = UpdateCorralConfig(corralPrivateSSHKey, privateSSHkey) - if err != nil { - return err - } - - publicSSHkey, err := GetCorralEnvVar(corralName, corralPublicSSHKey) - if err != nil { - return err - } - - return UpdateCorralConfig(corralPublicSSHKey, publicSSHkey) -} diff --git a/tests/framework/clients/dynamic/dynamic.go b/tests/framework/clients/dynamic/dynamic.go deleted file mode 100644 index 81257cc59f6..00000000000 --- a/tests/framework/clients/dynamic/dynamic.go +++ /dev/null @@ -1,123 +0,0 @@ -package dynamic - -import ( - "context" - "fmt" - - "k8s.io/client-go/rest" - - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/dynamic" -) - -// Client is a struct that embedds the dynamic.Interface(dynamic client) and has Session as an attribute -// The session.Session attributes is passed all way down to the ResourceClient to keep track of the resources created by the dynamic client -type Client struct { - dynamic.Interface - ts *session.Session -} - -// NewForConfig creates a new dynamic client or returns an error. -func NewForConfig(ts *session.Session, inConfig *rest.Config) (dynamic.Interface, error) { - logrus.Debugf("Dynamic Client Host:%s", inConfig.Host) - - dynamicClient, err := dynamic.NewForConfig(inConfig) - if err != nil { - return nil, err - } - - return &Client{ - Interface: dynamicClient, - ts: ts, - }, nil -} - -// Resource takes a schema.GroupVersionResource parameter to set the appropriate resource interface e.g. -// -// schema.GroupVersionResource { -// Group: "management.cattle.io", -// Version: "v3", -// Resource: "users", -// } -func (d *Client) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface { - return &NamespaceableResourceClient{ - NamespaceableResourceInterface: d.Interface.Resource(resource), - ts: d.ts, - } -} - -// NamespaceableResourceClient is a struct that has dynamic.NamespaceableResourceInterface embedded, and has session.Session as an attribute. -// This is inorder to overwrite dynamic.NamespaceableResourceInterface's Namespace function. -type NamespaceableResourceClient struct { - dynamic.NamespaceableResourceInterface - ts *session.Session -} - -// Namespace returns a dynamic.ResourceInterface that is embedded in ResourceClient, so ultimately its Create is overwritten. -func (d *NamespaceableResourceClient) Namespace(s string) dynamic.ResourceInterface { - return &ResourceClient{ - ResourceInterface: d.NamespaceableResourceInterface.Namespace(s), - ts: d.ts, - } -} - -// ResourceClient has dynamic.ResourceInterface embedded so dynamic.ResourceInterface's Create can be overwritten. -type ResourceClient struct { - dynamic.ResourceInterface - ts *session.Session -} - -var ( - // some GVKs are special and cannot be cleaned up because they do not exist - // after being created (eg: SelfSubjectAccessReview). We'll not register - // cleanup functions when creating objects of these kinds. - noCleanupGVKs = []schema.GroupVersionKind{ - { - Group: "authorization.k8s.io", - Version: "v1", - Kind: "SelfSubjectAccessReview", - }, - } -) - -func needsCleanup(obj *unstructured.Unstructured) bool { - for _, gvk := range noCleanupGVKs { - if obj.GroupVersionKind() == gvk { - return false - } - } - return true -} - -// Create is dynamic.ResourceInterface's Create function, that is being overwritten to register its delete function to the session.Session -// that is being reference. -func (c *ResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) { - unstructuredObj, err := c.ResourceInterface.Create(ctx, obj, opts, subresources...) - if err != nil { - return nil, err - } - - if needsCleanup(obj) { - c.ts.RegisterCleanupFunc(func() error { - err := c.Delete(context.TODO(), unstructuredObj.GetName(), metav1.DeleteOptions{}, subresources...) - if errors.IsNotFound(err) { - return nil - } - - name := unstructuredObj.GetName() - if unstructuredObj.GetNamespace() != "" { - name = unstructuredObj.GetNamespace() + "/" + name - } - gvk := unstructuredObj.GetObjectKind().GroupVersionKind() - - return fmt.Errorf("unable to delete (%v) %v: %w", gvk, name, err) - }) - } - - return unstructuredObj, err -} diff --git a/tests/framework/clients/ec2/client.go b/tests/framework/clients/ec2/client.go deleted file mode 100644 index 73b4486c21c..00000000000 --- a/tests/framework/clients/ec2/client.go +++ /dev/null @@ -1,39 +0,0 @@ -package ec2 - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -// Client is a struct that wraps the needed AWSEC2Config object, and ec2.EC2 which makes the actual calls to aws. -type Client struct { - SVC *ec2.EC2 - ClientConfig *AWSEC2Configs -} - -// NewClient is a constructor that creates an *Client which a wrapper for a "github.com/aws/aws-sdk-go/service/ec2" session and -// the aws ec2 config. -func NewClient() (*Client, error) { - awsEC2ClientConfig := new(AWSEC2Configs) - - config.LoadConfig(ConfigurationFileKey, awsEC2ClientConfig) - - credential := credentials.NewStaticCredentials(awsEC2ClientConfig.AWSAccessKeyID, awsEC2ClientConfig.AWSSecretAccessKey, "") - sess, err := session.NewSession(&aws.Config{ - Credentials: credential, - Region: aws.String(awsEC2ClientConfig.Region)}, - ) - if err != nil { - return nil, err - } - - // Create EC2 service client - svc := ec2.New(sess) - return &Client{ - SVC: svc, - ClientConfig: awsEC2ClientConfig, - }, nil -} diff --git a/tests/framework/clients/ec2/config.go b/tests/framework/clients/ec2/config.go deleted file mode 100644 index 935a3677f7b..00000000000 --- a/tests/framework/clients/ec2/config.go +++ /dev/null @@ -1,26 +0,0 @@ -package ec2 - -// The json/yaml config key for the AWSEC2onfig -const ConfigurationFileKey = "awsEC2Configs" - -// AWSEC2Configs is the AWS authentication configuration for accessing and launching ec2 instances -type AWSEC2Configs struct { - AWSEC2Config []AWSEC2Config `json:"awsEC2Config" yaml:"awsEC2Config"` - AWSAccessKeyID string `json:"awsAccessKeyID" yaml:"awsAccessKeyID"` - AWSSecretAccessKey string `json:"awsSecretAccessKey" yaml:"awsSecretAccessKey"` - Region string `json:"region" yaml:"region"` -} - -// AWSEC2Config is the instance-specific configuration needed to launch ec2 instances in AWS -type AWSEC2Config struct { - InstanceType string `json:"instanceType" yaml:"instanceType"` - AWSRegionAZ string `json:"awsRegionAZ" yaml:"awsRegionAZ"` - AWSAMI string `json:"awsAMI" yaml:"awsAMI"` - AWSSecurityGroups []string `json:"awsSecurityGroups" yaml:"awsSecurityGroups"` - AWSSSHKeyName string `json:"awsSSHKeyName" yaml:"awsSSHKeyName"` - AWSCICDInstanceTag string `json:"awsCICDInstanceTag" yaml:"awsCICDInstanceTag"` - AWSIAMProfile string `json:"awsIAMProfile" yaml:"awsIAMProfile"` - AWSUser string `json:"awsUser" yaml:"awsUser"` - VolumeSize int `json:"volumeSize" yaml:"volumeSize"` - Roles []string `json:"roles" yaml:"roles"` -} diff --git a/tests/framework/clients/helm/helm.go b/tests/framework/clients/helm/helm.go deleted file mode 100644 index 19618037a4c..00000000000 --- a/tests/framework/clients/helm/helm.go +++ /dev/null @@ -1,106 +0,0 @@ -package helm - -import ( - "os/exec" - - "github.com/pkg/errors" - "github.com/rancher/rancher/tests/framework/pkg/session" -) - -var helmCmd = "helm_v3" - -// InstallChart installs a helm chart using helm CLI. -// Send the helm set command strings such as "--set", "installCRDs=true" -// in the args argument to be prepended to the helm install command. -func InstallChart(ts *session.Session, releaseName, helmRepo, namespace, version string, args ...string) error { - // Register cleanup function - ts.RegisterCleanupFunc(func() error { - return UninstallChart(releaseName, namespace) - }) - - // Default helm install command - commandArgs := []string{ - "install", - releaseName, - helmRepo, - "--namespace", - namespace, - "--wait", - } - - commandArgs = append(commandArgs, args...) - - if version != "" { - commandArgs = append(commandArgs, "--version", version) - } - - msg, err := exec.Command(helmCmd, commandArgs...).CombinedOutput() - if err != nil { - return errors.Wrap(err, "InstallChart: "+string(msg)) - } - - return nil -} - -// UpgradeChart upgrades a helm chart using helm CLI. -// Send the helm set command strings such as "--set", "installCRDs=true" -// in the args argument to be prepended to the helm upgrade command. -func UpgradeChart(ts *session.Session, releaseName, helmRepo, namespace, version string, args ...string) error { - // Register cleanup function - ts.RegisterCleanupFunc(func() error { - return UninstallChart(releaseName, namespace) - }) - - // Default helm upgrade command - commandArgs := []string{ - "upgrade", - releaseName, - helmRepo, - "--namespace", - namespace, - "--wait", - } - - commandArgs = append(commandArgs, args...) - - if version != "" { - commandArgs = append(commandArgs, "--version", version) - } - - msg, err := exec.Command(helmCmd, commandArgs...).CombinedOutput() - if err != nil { - return errors.Wrap(err, "UpgradeChart: "+string(msg)) - } - - return nil -} - -// UninstallChart uninstalls a helm chart using helm CLI in a given namespace -// using the releaseName provided. -func UninstallChart(releaseName, namespace string, args ...string) error { - // Default helm uninstall command - commandArgs := []string{ - "uninstall", - releaseName, - "--namespace", - namespace, - "--wait", - } - - msg, err := exec.Command(helmCmd, commandArgs...).CombinedOutput() - if err != nil { - return errors.Wrap(err, "UninstallChart: "+string(msg)) - } - - return nil -} - -// AddHelmRepo adds the specified helm repository using the helm repo add command. -func AddHelmRepo(name, url string) error { - msg, err := exec.Command(helmCmd, "repo", "add", name, url).CombinedOutput() - if err != nil { - return errors.Wrap(err, "AddHelmRepo: "+string(msg)) - } - - return nil -} diff --git a/tests/framework/clients/k3d/config.go b/tests/framework/clients/k3d/config.go deleted file mode 100644 index f1bcdf86218..00000000000 --- a/tests/framework/clients/k3d/config.go +++ /dev/null @@ -1,10 +0,0 @@ -package k3d - -// The json/yaml config key for the k3d config -const ConfigurationFileKey = "k3d" - -// Config is configuration needed to create k3d cluster for integration testing. -type Config struct { - image string `yaml:"image" default:"rancher/k3s:v1.21.3-k3s1"` - createTimeout int `yaml:"createTimeout" default:"120s"` -} diff --git a/tests/framework/clients/k3d/k3d.go b/tests/framework/clients/k3d/k3d.go deleted file mode 100644 index a63d35a17b6..00000000000 --- a/tests/framework/clients/k3d/k3d.go +++ /dev/null @@ -1,190 +0,0 @@ -package k3d - -import ( - "context" - "fmt" - "os/exec" - - "github.com/pkg/errors" - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" - "github.com/rancher/wrangler/pkg/randomtoken" - "github.com/sirupsen/logrus" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" -) - -var importTimeout = int64(60 * 20) - -// CreateK3DCluster creates a minimal k3d cluster and returns a rest config for connecting to the newly created cluster. -// If a name is not given a random one will be generated. -func CreateK3DCluster(ts *session.Session, name, hostname string, servers, agents int) (*rest.Config, error) { - k3dConfig := new(Config) - config.LoadConfig(ConfigurationFileKey, k3dConfig) - - name = defaultName(name) - - ts.RegisterCleanupFunc(func() error { - return DeleteK3DCluster(name) - }) - - args := []string{ - "cluster", - "create", - name, - "--no-lb", - fmt.Sprintf("--servers=%d", servers), - fmt.Sprintf("--agents=%d", agents), - "--kubeconfig-update-default=false", - "--kubeconfig-switch-context=false", - fmt.Sprintf("--timeout=%d", k3dConfig.createTimeout), - `--k3s-arg=--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%`, - `--k3s-arg=--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%`, - `--k3s-arg=--disable=traefik`, - `--k3s-arg=--disable=servicelb`, - `--k3s-arg=--disable=metrics-serve`, - `--k3s-arg=--disable=local-storage`, - } - - if hostname != "" { - apiHost := fmt.Sprintf("--api-port=%s", hostname) - args = append(args, apiHost) - } - - msg, err := exec.Command("k3d", args...).CombinedOutput() - if err != nil { - return nil, errors.Wrap(err, "CreateK3DCluster: "+string(msg)) - } - - configBytes, err := exec.Command("k3d", "kubeconfig", "get", name).Output() - if err != nil { - return nil, errors.Wrap(err, "CreateK3DCluster: failed to get kubeconfig for k3d cluster") - } - - restConfig, err := clientcmd.RESTConfigFromKubeConfig(configBytes) - if err != nil { - return nil, errors.Wrap(err, "CreateK3DCluster: failed to parse kubeconfig for k3d cluster") - } - - return restConfig, nil -} - -// DeleteK3DCluster deletes the k3d cluster with the given name. An error is returned if the cluster does not exist. -func DeleteK3DCluster(name string) error { - return exec.Command("k3d", "cluster", "delete", name).Run() -} - -// ImportImage imports an image from docker into the specified k3d cluster. Meant to use local docker images without -// having to setup a registry. -func ImportImage(image, clusterName string) error { - msg, err := exec.Command("k3d", "image", "import", image, fmt.Sprintf("--cluster=%s", clusterName)).CombinedOutput() - if err != nil { - return errors.Wrap(err, "ImportImage: "+string(msg)) - } - return nil -} - -// CreateAndImportK3DCluster creates a new k3d cluster and imports it into rancher. -func CreateAndImportK3DCluster(client *rancher.Client, name, image, hostname string, servers, agents int, importImage bool) (*apisV1.Cluster, error) { - var err error - - name = defaultName(name) - - // create the provisioning cluster - logrus.Infof("Creating provisioning cluster...") - cluster := &apisV1.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: "fleet-default", - }, - } - clusterObj, err := client.Steve.SteveType(clusters.ProvisioningSteveResourceType).Create(cluster) - if err != nil { - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to create provisioning cluster") - } - - // create the k3d cluster - logrus.Infof("Creating K3D cluster...") - downRest, err := CreateK3DCluster(client.Session, name, hostname, servers, agents) - if err != nil { - _ = client.Steve.SteveType(clusters.ProvisioningSteveResourceType).Delete(clusterObj) - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to create k3d cluster") - } - - if importImage { - logrus.Infof("Importing image to K3D cluster...") - err = ImportImage(image, name) - if err != nil { - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to import image to k3d cluster") - } - } - - kubeProvisioningClient, err := client.GetKubeAPIProvisioningClient() - if err != nil { - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to instantiate kube api provisioning client") - } - // wait for the provisioning cluster - logrus.Infof("Waiting for provisioning cluster...") - clusterWatch, err := kubeProvisioningClient.Clusters("fleet-default").Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to watch for the imported cluster") - } - - var impCluster *apisV1.Cluster - err = wait.WatchWait(clusterWatch, func(event watch.Event) (bool, error) { - cluster := event.Object.(*apisV1.Cluster) - if cluster.Name == name { - impCluster, err = kubeProvisioningClient.Clusters("fleet-default").Get(context.TODO(), name, metav1.GetOptions{}) - return true, err - } - - return false, nil - - }) - if err != nil { - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to watch for management cluster") - } - - // import the k3d cluster - logrus.Infof("Importing cluster...") - err = clusters.ImportCluster(client, impCluster, downRest) - if err != nil { - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to import cluster") - } - - // wait for the imported cluster to be ready - logrus.Infof("Waiting for imported cluster...") - clusterWatch, err = kubeProvisioningClient.Clusters("fleet-default").Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + name, - TimeoutSeconds: &importTimeout, - }) - - checkFunc := clusters.IsImportedClusterReady - err = wait.WatchWait(clusterWatch, checkFunc) - - if err != nil { - return nil, errors.Wrap(err, "CreateAndImportK3DCluster: failed to wait for imported cluster ready status") - } - - return impCluster, nil -} - -// defaultName returns a random string if name is empty, otherwise name is returned unmodified. -func defaultName(name string) string { - if name == "" { - name, _ = randomtoken.Generate() - name = name[:8] - } - - return name -} diff --git a/tests/framework/clients/provisioning/client.go b/tests/framework/clients/provisioning/client.go deleted file mode 100644 index f735bb518c4..00000000000 --- a/tests/framework/clients/provisioning/client.go +++ /dev/null @@ -1,36 +0,0 @@ -package provisioning - -import ( - provisionClientV1 "github.com/rancher/rancher/pkg/generated/clientset/versioned/typed/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/pkg/session" - "k8s.io/client-go/rest" -) - -// Client is a struct that embedds the `ProvisioningV1Interface` (provisioning client) and has Session as an attribute -// The session.Session attributes is passed all way down to the Cluster -type Client struct { - provisionClientV1.ProvisioningV1Interface - ts *session.Session -} - -// Cluster is a struct that embedds ClusterInterface and has session.Session as an attribute to keep track of the resources created by ClusterInterface -type Cluster struct { - provisionClientV1.ClusterInterface - ts *session.Session -} - -// NewForConfig creates a new ProvisioningV1Client for the given config. It also takes session.Session as parameter to track the resources -// the ProvisioningV1Client creates -func NewForConfig(c *rest.Config, ts *session.Session) (*Client, error) { - provClient, err := provisionClientV1.NewForConfig(c) - if err != nil { - return nil, err - } - - return &Client{provClient, ts}, nil -} - -// Clusters takes a namespace a returns a Cluster object that is used for the CRUD of a pkg/apis/provisioning.cattle.io/v1 Cluster -func (p *Client) Clusters(namespace string) *Cluster { - return &Cluster{p.ProvisioningV1Interface.Clusters(namespace), p.ts} -} diff --git a/tests/framework/clients/provisioning/cluster.go b/tests/framework/clients/provisioning/cluster.go deleted file mode 100644 index cd7668fc615..00000000000 --- a/tests/framework/clients/provisioning/cluster.go +++ /dev/null @@ -1,23 +0,0 @@ -package provisioning - -import ( - "context" - - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Create is ClusterInterface's Create function, that is being overwritten to register its delete function to the session.Session -// that is being reference. -func (c *Cluster) Create(ctx context.Context, cluster *apisV1.Cluster, opts metav1.CreateOptions) (*apisV1.Cluster, error) { - c.ts.RegisterCleanupFunc(func() error { - err := c.Delete(context.TODO(), cluster.GetName(), metav1.DeleteOptions{}) - if errors.IsNotFound(err) { - return nil - } - - return err - }) - return c.ClusterInterface.Create(ctx, cluster, opts) -} diff --git a/tests/framework/clients/rancher/catalog/client.go b/tests/framework/clients/rancher/catalog/client.go deleted file mode 100644 index e3470b6550c..00000000000 --- a/tests/framework/clients/rancher/catalog/client.go +++ /dev/null @@ -1,22 +0,0 @@ -package catalog - -import ( - catalogClientV1 "github.com/rancher/rancher/pkg/generated/clientset/versioned/typed/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/pkg/session" - "k8s.io/client-go/rest" -) - -// Client is a struct that embedds the `CatalogV1Interface` (catalog client) -type Client struct { - catalogClientV1.CatalogV1Interface -} - -// NewForConfig creates a new CatalogV1Client for the given config. -func NewForConfig(c *rest.Config, ts *session.Session) (*Client, error) { - catalogClient, err := catalogClientV1.NewForConfig(c) - if err != nil { - return nil, err - } - - return &Client{catalogClient}, nil -} diff --git a/tests/framework/clients/rancher/catalog/clusterrepo.go b/tests/framework/clients/rancher/catalog/clusterrepo.go deleted file mode 100644 index 9761877d594..00000000000 --- a/tests/framework/clients/rancher/catalog/clusterrepo.go +++ /dev/null @@ -1,116 +0,0 @@ -package catalog - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/rancher/rancher/pkg/api/steve/catalog/types" - scheme "github.com/rancher/rancher/pkg/generated/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - ClusterRepoSteveResourceType = "catalog.cattle.io.clusterrepo" - - action = "action" - chartsURL = "v1/catalog.cattle.io.clusterrepos/" - link = "link" - index = "index" - install = "install" - RancherChartRepo = "rancher-charts" - rancherAppsURL = "v1/catalog.cattle.io.apps/" - upgrade = "upgrade" - uninstall = "uninstall" -) - -// GetListChartVersions is used to get the list of versions of `chartName` from a given `repoName` -func (c *Client) GetListChartVersions(chartName, repoName string) ([]string, error) { - result, err := c.RESTClient().Get(). - AbsPath(chartsURL+repoName).Param(link, index). - VersionedParams(&metav1.GetOptions{}, scheme.ParameterCodec). - Do(context.TODO()).Raw() - - if err != nil { - return nil, err - } - - var mapResponse map[string]interface{} - if err = json.Unmarshal(result, &mapResponse); err != nil { - return nil, err - } - - entries := mapResponse["entries"] - specifiedChartEntries := entries.(map[string]interface{})[chartName].([]interface{}) - if len(specifiedChartEntries) < 1 { - return nil, fmt.Errorf("failed to find chart %s from the chart repo", chartName) - } - - versionsList := []string{} - for _, entry := range specifiedChartEntries { - entryMap := entry.(map[string]interface{}) - versionsList = append(versionsList, entryMap["version"].(string)) - } - - return versionsList, nil -} - -// GetLatestChartVersion is used to get the lastest version of `chartName` from a given `repoName` -func (c *Client) GetLatestChartVersion(chartName string, repoName string) (string, error) { - versionsList, err := c.GetListChartVersions(chartName, repoName) - if err != nil { - return "", err - } - lastestVersion := versionsList[0] - - return lastestVersion, nil -} - -// InstallChart installs the chart according to the parameter `chart` from a given repoName -func (c *Client) InstallChart(chart *types.ChartInstallAction, repoName string) error { - bodyContent, err := json.Marshal(chart) - if err != nil { - return err - } - - result := c.RESTClient().Post(). - AbsPath(chartsURL+repoName).Param(action, install). - VersionedParams(&metav1.CreateOptions{}, scheme.ParameterCodec). - Body(bodyContent). - Do(context.TODO()) - return result.Error() -} - -// UpgradeChart upgrades the chart according to the parameter `chart` -func (c *Client) UpgradeChart(chart *types.ChartUpgradeAction, repoName string) error { - bodyContent, err := json.Marshal(chart) - if err != nil { - return err - } - - result := c.RESTClient().Post(). - AbsPath(chartsURL+repoName).Param(action, upgrade). - VersionedParams(&metav1.CreateOptions{}, scheme.ParameterCodec). - Body(bodyContent). - Do(context.TODO()) - - return result.Error() -} - -// UninstallChart uninstalls the chart according to `chartNamespace`, `chartName`, and `uninstallAction` -func (c *Client) UninstallChart(chartName, chartNamespace string, uninstallAction *types.ChartUninstallAction) error { - bodyContent, err := json.Marshal(uninstallAction) - if err != nil { - return err - } - - url := rancherAppsURL + chartNamespace - result := c.RESTClient().Post(). - Name(chartName). - AbsPath(url).Param(action, uninstall). - Body(bodyContent). - VersionedParams(&metav1.CreateOptions{}, scheme.ParameterCodec). - Do(context.TODO()) - - return result.Error() -} diff --git a/tests/framework/clients/rancher/client.go b/tests/framework/clients/rancher/client.go deleted file mode 100644 index 9b8cd481225..00000000000 --- a/tests/framework/clients/rancher/client.go +++ /dev/null @@ -1,374 +0,0 @@ -package rancher - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "net/http" - - "github.com/pkg/errors" - "github.com/rancher/norman/httperror" - frameworkDynamic "github.com/rancher/rancher/tests/framework/clients/dynamic" - "github.com/rancher/rancher/tests/framework/clients/ec2" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - - kubeProvisioning "github.com/rancher/rancher/tests/framework/clients/provisioning" - kubeRKE "github.com/rancher/rancher/tests/framework/clients/rke" - "github.com/rancher/rancher/tests/framework/pkg/clientbase" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - "github.com/rancher/rancher/tests/framework/pkg/session" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" -) - -// Client is the main rancher Client object that gives an end user access to the Provisioning and Management -// clients in order to create resources on rancher -type Client struct { - // Client used to access management.cattle.io v3 API resources - Management *management.Client - // Client used to access Steve v1 API resources - Steve *v1.Client - // Client used to access catalog.cattle.io v1 API resources (apps, charts, etc.) - Catalog *catalog.Client - // Config used to test against a rancher instance - RancherConfig *Config - // Session is the session object used by the client to track all the resources being created by the client. - Session *session.Session - // Flags is the environment flags used by the client to test selectively against a rancher instance. - Flags *environmentflag.EnvironmentFlags - restConfig *rest.Config -} - -// NewClient is the constructor to the initializing a rancher Client. It takes a bearer token and session.Session. If bearer token is not provided, -// the bearer token provided in the configuration file is used. -func NewClient(bearerToken string, session *session.Session) (*Client, error) { - rancherConfig := new(Config) - config.LoadConfig(ConfigurationFileKey, rancherConfig) - - environmentFlags := environmentflag.NewEnvironmentFlags() - environmentflag.LoadEnvironmentFlags(environmentflag.ConfigurationFileKey, environmentFlags) - - if bearerToken == "" { - bearerToken = rancherConfig.AdminToken - } - - c := &Client{ - RancherConfig: rancherConfig, - Flags: &environmentFlags, - } - - session.CleanupEnabled = *rancherConfig.Cleanup - - var err error - restConfig := newRestConfig(bearerToken, rancherConfig) - c.restConfig = restConfig - c.Session = session - c.Management, err = management.NewClient(clientOpts(restConfig, c.RancherConfig)) - if err != nil { - return nil, err - } - - c.Management.Ops.Session = session - - c.Steve, err = v1.NewClient(clientOptsV1(restConfig, c.RancherConfig)) - if err != nil { - return nil, err - } - - c.Steve.Ops.Session = session - - catalogClient, err := catalog.NewForConfig(restConfig, session) - if err != nil { - return nil, err - } - - c.Catalog = catalogClient - - return c, nil -} - -// newRestConfig is a constructor that sets ups rest.Config the configuration used by the Provisioning client. -func newRestConfig(bearerToken string, rancherConfig *Config) *rest.Config { - return &rest.Config{ - Host: rancherConfig.Host, - BearerToken: bearerToken, - TLSClientConfig: rest.TLSClientConfig{ - Insecure: *rancherConfig.Insecure, - CAFile: rancherConfig.CAFile, - }, - } -} - -// clientOpts is a constructor that sets ups clientbase.ClientOpts the configuration used by the Management client. -func clientOpts(restConfig *rest.Config, rancherConfig *Config) *clientbase.ClientOpts { - return &clientbase.ClientOpts{ - URL: fmt.Sprintf("https://%s/v3", rancherConfig.Host), - TokenKey: restConfig.BearerToken, - Insecure: restConfig.Insecure, - CACerts: rancherConfig.CACerts, - } -} - -// clientOptsV1 is a constructor that sets ups clientbase.ClientOpts the configuration used by the v1 Rancher clients. -func clientOptsV1(restConfig *rest.Config, rancherConfig *Config) *clientbase.ClientOpts { - return &clientbase.ClientOpts{ - URL: fmt.Sprintf("https://%s/v1", rancherConfig.Host), - TokenKey: restConfig.BearerToken, - Insecure: restConfig.Insecure, - CACerts: rancherConfig.CACerts, - } -} - -// doAction is used to post an action to an endpoint, and marshal the response into the output parameter. -func (c *Client) doAction(endpoint, action string, body []byte, output interface{}) error { - url := "https://" + c.restConfig.Host + endpoint + "?action=" + action - req, err := http.NewRequest("POST", url, bytes.NewBuffer(body)) - if err != nil { - return err - } - - req.Header.Add("Authorization", "Bearer "+c.restConfig.BearerToken) - req.Header.Set("Content-Type", "application/json") - - resp, err := c.Management.APIBaseClient.Ops.Client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return httperror.NewAPIErrorLong(resp.StatusCode, resp.Status, url) - } - - byteContent, err := io.ReadAll(resp.Body) - if err != nil { - return err - } - - if len(byteContent) > 0 { - err = json.Unmarshal(byteContent, output) - if err != nil { - return err - } - return nil - } - return fmt.Errorf("received empty response") -} - -// AsUser accepts a user object, and then creates a token for said `user`. Then it instantiates and returns a Client using the token created. -// This function uses the login action, and user must have a correct username and password combination. -func (c *Client) AsUser(user *management.User) (*Client, error) { - returnedToken, err := c.login(user) - if err != nil { - return nil, err - } - - return NewClient(returnedToken.Token, c.Session) -} - -// ReLogin reinstantiates a Client to update its API schema. This function would be used for a non admin user that needs to be -// "reloaded" inorder to have updated permissions for certain resources. -func (c *Client) ReLogin() (*Client, error) { - return NewClient(c.restConfig.BearerToken, c.Session) -} - -// WithSession accepts a session.Session and instantiates a new Client to reference this new session.Session. The main purpose is to use it -// when created "sub sessions" when tracking resources created at a test case scope. -func (c *Client) WithSession(session *session.Session) (*Client, error) { - return NewClient(c.restConfig.BearerToken, session) -} - -// GetClusterCatalogClient is a function that takes a clusterID and instantiates a catalog client to directly communicate with that specific cluster. -func (c *Client) GetClusterCatalogClient(clusterID string) (*catalog.Client, error) { - restConfig := *c.restConfig - restConfig.Host = fmt.Sprintf("https://%s/k8s/clusters/%s", c.restConfig.Host, clusterID) - - catalogClient, err := catalog.NewForConfig(&restConfig, c.Session) - if err != nil { - return nil, err - } - - return catalogClient, nil -} - -// GetRancherDynamicClient is a helper function that instantiates a dynamic client to communicate with the rancher host. -func (c *Client) GetRancherDynamicClient() (dynamic.Interface, error) { - dynamic, err := frameworkDynamic.NewForConfig(c.Session, c.restConfig) - if err != nil { - return nil, err - } - return dynamic, nil -} - -// GetKubeAPIProvisioningClient is a function that instantiates a provisioning client that communicates with the Kube API of a cluster -func (c *Client) GetKubeAPIProvisioningClient() (*kubeProvisioning.Client, error) { - provClient, err := kubeProvisioning.NewForConfig(c.restConfig, c.Session) - if err != nil { - return nil, err - } - - return provClient, nil -} - -// GetKubeAPIRKEClient is a function that instantiates a rke client that communicates with the Kube API of a cluster -func (c *Client) GetKubeAPIRKEClient() (*kubeRKE.Client, error) { - rkeClient, err := kubeRKE.NewForConfig(c.restConfig, c.Session) - if err != nil { - return nil, err - } - - return rkeClient, nil -} - -// GetDownStreamClusterClient is a helper function that instantiates a dynamic client to communicate with a specific cluster. -func (c *Client) GetDownStreamClusterClient(clusterID string) (dynamic.Interface, error) { - restConfig := *c.restConfig - restConfig.Host = fmt.Sprintf("https://%s/k8s/clusters/%s", c.restConfig.Host, clusterID) - - dynamic, err := frameworkDynamic.NewForConfig(c.Session, &restConfig) - if err != nil { - return nil, err - } - return dynamic, nil -} - -// SwitchContext is a helper function that changes the current context to `context` and instantiates a dynamic client -func (c *Client) SwitchContext(context string, clientConfig *clientcmd.ClientConfig) (dynamic.Interface, error) { - overrides := clientcmd.ConfigOverrides{CurrentContext: context} - - rawConfig, err := (*clientConfig).RawConfig() - if err != nil { - return nil, err - } - - updatedConfig := clientcmd.NewNonInteractiveClientConfig(rawConfig, rawConfig.CurrentContext, &overrides, (*clientConfig).ConfigAccess()) - - restConfig, err := updatedConfig.ClientConfig() - if err != nil { - return nil, err - } - - dynamic, err := frameworkDynamic.NewForConfig(c.Session, restConfig) - if err != nil { - return nil, err - } - - return dynamic, nil -} - -// GetEC2Client is a helper function that instantiates an aws ec2 client to communicate with the ec2 instances on aws. -func (c *Client) GetEC2Client() (*ec2.Client, error) { - return ec2.NewClient() -} - -// GetManagementWatchInterface is a functions used to get a watch.Interface from a resource created by the Management Client. -// As is the Management resources do not have a watch.Interface, so therefore, the dynamic Client is used to get the watch.Interface. -// The `schemaType` is a string that is found in different Management clients packages. Ex) management.ProjectType -func (c *Client) GetManagementWatchInterface(schemaType string, opts metav1.ListOptions) (watch.Interface, error) { - schemaResource, ok := c.Management.APIBaseClient.Ops.Types[schemaType] - if !ok { - return nil, errors.New("Unknown schema type [" + schemaType + "]") - } - - groupVersionResource := schema.GroupVersionResource{ - Group: "management.cattle.io", - Version: "v3", - Resource: schemaResource.PluralName, - } - dynamicClient, err := c.GetRancherDynamicClient() - if err != nil { - return nil, err - } - - return dynamicClient.Resource(groupVersionResource).Watch(context.TODO(), opts) -} - -// login uses the local authentication provider to authenticate a user and return the subsequent token. -func (c *Client) login(user *management.User) (*management.Token, error) { - token := &management.Token{} - bodyContent, err := json.Marshal(struct { - Username string `json:"username"` - Password string `json:"password"` - }{ - Username: user.Username, - Password: user.Password, - }) - if err != nil { - return nil, err - } - err = c.doAction("/v3-public/localProviders/local", "login", bodyContent, token) - if err != nil { - return nil, err - } - - return token, nil -} - -// IsConnected is a helper function that pings rancher ping endpoint with the management, steve and rest clients. -// Returns boolean value depending on if all the clients are able to get pong respond. -func (c *Client) IsConnected() (isConnected bool, err error) { - mngmntPong, err := c.ping(c.Management.APIBaseClient.Ops.Client) - if err != nil { - return - } - - stevePong, err := c.ping(c.Steve.APIBaseClient.Ops.Client) - if err != nil { - return - } - - restHTTP, err := rest.HTTPClientFor(c.restConfig) - if err != nil { - return false, err - } - restPong, err := c.ping(restHTTP) - if err != nil { - return - } - - isConnected = mngmntPong == stevePong == restPong != isConnected - return -} - -// ping uses http client to ping rancher ping endpoint, returns boolean value if pong is returned -func (c *Client) ping(httpClient *http.Client) (bool, error) { - url := "https://" + c.restConfig.Host + "/ping" - pong := "pong" - - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return false, err - } - - req.Header.Add("Authorization", "Bearer "+c.restConfig.BearerToken) - req.Header.Set("Content-Type", "application/json") - - resp, err := httpClient.Do(req) - if err != nil { - return false, err - } - - if resp != nil { - defer resp.Body.Close() - - bodyBytes, err := io.ReadAll(resp.Body) - if err != nil { - return false, err - } - if len(bodyBytes) > 0 { - return string(bodyBytes) == pong, err - } - } - - return false, err -} diff --git a/tests/framework/clients/rancher/config.go b/tests/framework/clients/rancher/config.go deleted file mode 100644 index 2c8a6d613e6..00000000000 --- a/tests/framework/clients/rancher/config.go +++ /dev/null @@ -1,17 +0,0 @@ -package rancher - -// The json/yaml config key for the rancher config -const ConfigurationFileKey = "rancher" - -// Config is configuration need to test against a rancher instance -type Config struct { - Host string `yaml:"host"` - AdminToken string `yaml:"adminToken"` - AdminPassword string `yaml:"adminPassword"` - Insecure *bool `yaml:"insecure" default:"true"` - Cleanup *bool `yaml:"cleanup" default:"true"` - CAFile string `yaml:"caFile" default:""` - CACerts string `yaml:"caCerts" default:""` - ClusterName string `yaml:"clusterName" default:""` - ShellImage string `yaml:"shellImage" default:""` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aci_network_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_aci_network_provider.go deleted file mode 100644 index 5e626065e92..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aci_network_provider.go +++ /dev/null @@ -1,216 +0,0 @@ -package client - -const ( - AciNetworkProviderType = "aciNetworkProvider" - AciNetworkProviderFieldAEP = "aep" - AciNetworkProviderFieldAccProvisionOperatorMemoryLimit = "accProvisionOperatorMemoryLimit" - AciNetworkProviderFieldAccProvisionOperatorMemoryRequest = "accProvisionOperatorMemoryRequest" - AciNetworkProviderFieldAciContainersControllerMemoryLimit = "aciContainersControllerMemoryLimit" - AciNetworkProviderFieldAciContainersControllerMemoryRequest = "aciContainersControllerMemoryRequest" - AciNetworkProviderFieldAciContainersHostMemoryLimit = "aciContainersHostMemoryLimit" - AciNetworkProviderFieldAciContainersHostMemoryRequest = "aciContainersHostMemoryRequest" - AciNetworkProviderFieldAciContainersMemoryLimit = "aciContainersMemoryLimit" - AciNetworkProviderFieldAciContainersMemoryRequest = "aciContainersMemoryRequest" - AciNetworkProviderFieldAciContainersOperatorMemoryLimit = "aciContainersOperatorMemoryLimit" - AciNetworkProviderFieldAciContainersOperatorMemoryRequest = "aciContainersOperatorMemoryRequest" - AciNetworkProviderFieldAciMultipod = "aciMultipod" - AciNetworkProviderFieldAciMultipodUbuntu = "aciMultipodUbuntu" - AciNetworkProviderFieldAddExternalSubnetsToRdconfig = "addExternalSubnetsToRdconfig" - AciNetworkProviderFieldApicHosts = "apicHosts" - AciNetworkProviderFieldApicRefreshTickerAdjust = "apicRefreshTickerAdjust" - AciNetworkProviderFieldApicRefreshTime = "apicRefreshTime" - AciNetworkProviderFieldApicSubscriptionDelay = "apicSubscriptionDelay" - AciNetworkProviderFieldApicUserCrt = "apicUserCrt" - AciNetworkProviderFieldApicUserKey = "apicUserKey" - AciNetworkProviderFieldApicUserName = "apicUserName" - AciNetworkProviderFieldCApic = "capic" - AciNetworkProviderFieldControllerLogLevel = "controllerLogLevel" - AciNetworkProviderFieldDhcpDelay = "dhcpDelay" - AciNetworkProviderFieldDhcpRenewMaxRetryCount = "dhcpRenewMaxRetryCount" - AciNetworkProviderFieldDisablePeriodicSnatGlobalInfoSync = "disablePeriodicSnatGlobalInfoSync" - AciNetworkProviderFieldDisableWaitForNetwork = "disableWaitForNetwork" - AciNetworkProviderFieldDropLogEnable = "dropLogEnable" - AciNetworkProviderFieldDurationWaitForNetwork = "durationWaitForNetwork" - AciNetworkProviderFieldDynamicExternalSubnet = "externDynamic" - AciNetworkProviderFieldEnableEndpointSlice = "enableEndpointSlice" - AciNetworkProviderFieldEncapType = "encapType" - AciNetworkProviderFieldEpRegistry = "epRegistry" - AciNetworkProviderFieldGbpPodSubnet = "gbpPodSubnet" - AciNetworkProviderFieldHostAgentLogLevel = "hostAgentLogLevel" - AciNetworkProviderFieldHppOptimization = "hppOptimization" - AciNetworkProviderFieldImagePullPolicy = "imagePullPolicy" - AciNetworkProviderFieldImagePullSecret = "imagePullSecret" - AciNetworkProviderFieldInfraVlan = "infraVlan" - AciNetworkProviderFieldInstallIstio = "installIstio" - AciNetworkProviderFieldIstioProfile = "istioProfile" - AciNetworkProviderFieldKafkaBrokers = "kafkaBrokers" - AciNetworkProviderFieldKafkaClientCrt = "kafkaClientCrt" - AciNetworkProviderFieldKafkaClientKey = "kafkaClientKey" - AciNetworkProviderFieldKubeAPIVlan = "kubeApiVlan" - AciNetworkProviderFieldL3Out = "l3out" - AciNetworkProviderFieldL3OutExternalNetworks = "l3outExternalNetworks" - AciNetworkProviderFieldMTUHeadRoom = "mtuHeadRoom" - AciNetworkProviderFieldMaxNodesSvcGraph = "maxNodesSvcGraph" - AciNetworkProviderFieldMcastDaemonMemoryLimit = "mcastDaemonMemoryLimit" - AciNetworkProviderFieldMcastDaemonMemoryRequest = "mcastDaemonMemoryRequest" - AciNetworkProviderFieldMcastRangeEnd = "mcastRangeEnd" - AciNetworkProviderFieldMcastRangeStart = "mcastRangeStart" - AciNetworkProviderFieldMultusDisable = "multusDisable" - AciNetworkProviderFieldNoPriorityClass = "noPriorityClass" - AciNetworkProviderFieldNoWaitForServiceEpReadiness = "noWaitForServiceEpReadiness" - AciNetworkProviderFieldNodePodIfEnable = "nodePodIfEnable" - AciNetworkProviderFieldNodeSubnet = "nodeSubnet" - AciNetworkProviderFieldOVSMemoryLimit = "ovsMemoryLimit" - AciNetworkProviderFieldOVSMemoryRequest = "ovsMemoryRequest" - AciNetworkProviderFieldOpflexAgentLogLevel = "opflexLogLevel" - AciNetworkProviderFieldOpflexAgentMemoryLimit = "opflexAgentMemoryLimit" - AciNetworkProviderFieldOpflexAgentMemoryRequest = "opflexAgentMemoryRequest" - AciNetworkProviderFieldOpflexAgentOpflexAsyncjsonEnabled = "opflexAgentOpflexAsyncjsonEnabled" - AciNetworkProviderFieldOpflexAgentOvsAsyncjsonEnabled = "opflexAgentOvsAsyncjsonEnabled" - AciNetworkProviderFieldOpflexAgentPolicyRetryDelayTimer = "opflexAgentPolicyRetryDelayTimer" - AciNetworkProviderFieldOpflexClientSSL = "opflexClientSsl" - AciNetworkProviderFieldOpflexDeviceDeleteTimeout = "opflexDeviceDeleteTimeout" - AciNetworkProviderFieldOpflexDeviceReconnectWaitTimeout = "opflexDeviceReconnectWaitTimeout" - AciNetworkProviderFieldOpflexMode = "opflexMode" - AciNetworkProviderFieldOpflexServerPort = "opflexServerPort" - AciNetworkProviderFieldOverlayVRFName = "overlayVrfName" - AciNetworkProviderFieldPBRTrackingNonSnat = "pbrTrackingNonSnat" - AciNetworkProviderFieldPodSubnetChunkSize = "podSubnetChunkSize" - AciNetworkProviderFieldRunGbpContainer = "runGbpContainer" - AciNetworkProviderFieldRunOpflexServerContainer = "runOpflexServerContainer" - AciNetworkProviderFieldServiceGraphEndpointAddDelay = "serviceGraphEndpointAddDelay" - AciNetworkProviderFieldServiceGraphEndpointAddServices = "serviceGraphEndpointAddServices" - AciNetworkProviderFieldServiceGraphSubnet = "nodeSvcSubnet" - AciNetworkProviderFieldServiceMonitorInterval = "serviceMonitorInterval" - AciNetworkProviderFieldServiceVlan = "serviceVlan" - AciNetworkProviderFieldSleepTimeSnatGlobalInfoSync = "sleepTimeSnatGlobalInfoSync" - AciNetworkProviderFieldSnatContractScope = "snatContractScope" - AciNetworkProviderFieldSnatNamespace = "snatNamespace" - AciNetworkProviderFieldSnatPortRangeEnd = "snatPortRangeEnd" - AciNetworkProviderFieldSnatPortRangeStart = "snatPortRangeStart" - AciNetworkProviderFieldSnatPortsPerNode = "snatPortsPerNode" - AciNetworkProviderFieldSriovEnable = "sriovEnable" - AciNetworkProviderFieldStaticExternalSubnet = "externStatic" - AciNetworkProviderFieldSubnetDomainName = "subnetDomainName" - AciNetworkProviderFieldSystemIdentifier = "systemId" - AciNetworkProviderFieldTenant = "tenant" - AciNetworkProviderFieldToken = "token" - AciNetworkProviderFieldUseAciAnywhereCRD = "useAciAnywhereCrd" - AciNetworkProviderFieldUseAciCniPriorityClass = "useAciCniPriorityClass" - AciNetworkProviderFieldUseClusterRole = "useClusterRole" - AciNetworkProviderFieldUseHostNetnsVolume = "useHostNetnsVolume" - AciNetworkProviderFieldUseOpflexServerVolume = "useOpflexServerVolume" - AciNetworkProviderFieldUsePrivilegedContainer = "usePrivilegedContainer" - AciNetworkProviderFieldUseSystemNodePriorityClass = "useSystemNodePriorityClass" - AciNetworkProviderFieldVRFName = "vrfName" - AciNetworkProviderFieldVRFTenant = "vrfTenant" - AciNetworkProviderFieldVmmController = "vmmController" - AciNetworkProviderFieldVmmDomain = "vmmDomain" -) - -type AciNetworkProvider struct { - AEP string `json:"aep,omitempty" yaml:"aep,omitempty"` - AccProvisionOperatorMemoryLimit string `json:"accProvisionOperatorMemoryLimit,omitempty" yaml:"accProvisionOperatorMemoryLimit,omitempty"` - AccProvisionOperatorMemoryRequest string `json:"accProvisionOperatorMemoryRequest,omitempty" yaml:"accProvisionOperatorMemoryRequest,omitempty"` - AciContainersControllerMemoryLimit string `json:"aciContainersControllerMemoryLimit,omitempty" yaml:"aciContainersControllerMemoryLimit,omitempty"` - AciContainersControllerMemoryRequest string `json:"aciContainersControllerMemoryRequest,omitempty" yaml:"aciContainersControllerMemoryRequest,omitempty"` - AciContainersHostMemoryLimit string `json:"aciContainersHostMemoryLimit,omitempty" yaml:"aciContainersHostMemoryLimit,omitempty"` - AciContainersHostMemoryRequest string `json:"aciContainersHostMemoryRequest,omitempty" yaml:"aciContainersHostMemoryRequest,omitempty"` - AciContainersMemoryLimit string `json:"aciContainersMemoryLimit,omitempty" yaml:"aciContainersMemoryLimit,omitempty"` - AciContainersMemoryRequest string `json:"aciContainersMemoryRequest,omitempty" yaml:"aciContainersMemoryRequest,omitempty"` - AciContainersOperatorMemoryLimit string `json:"aciContainersOperatorMemoryLimit,omitempty" yaml:"aciContainersOperatorMemoryLimit,omitempty"` - AciContainersOperatorMemoryRequest string `json:"aciContainersOperatorMemoryRequest,omitempty" yaml:"aciContainersOperatorMemoryRequest,omitempty"` - AciMultipod string `json:"aciMultipod,omitempty" yaml:"aciMultipod,omitempty"` - AciMultipodUbuntu string `json:"aciMultipodUbuntu,omitempty" yaml:"aciMultipodUbuntu,omitempty"` - AddExternalSubnetsToRdconfig string `json:"addExternalSubnetsToRdconfig,omitempty" yaml:"addExternalSubnetsToRdconfig,omitempty"` - ApicHosts []string `json:"apicHosts,omitempty" yaml:"apicHosts,omitempty"` - ApicRefreshTickerAdjust string `json:"apicRefreshTickerAdjust,omitempty" yaml:"apicRefreshTickerAdjust,omitempty"` - ApicRefreshTime string `json:"apicRefreshTime,omitempty" yaml:"apicRefreshTime,omitempty"` - ApicSubscriptionDelay string `json:"apicSubscriptionDelay,omitempty" yaml:"apicSubscriptionDelay,omitempty"` - ApicUserCrt string `json:"apicUserCrt,omitempty" yaml:"apicUserCrt,omitempty"` - ApicUserKey string `json:"apicUserKey,omitempty" yaml:"apicUserKey,omitempty"` - ApicUserName string `json:"apicUserName,omitempty" yaml:"apicUserName,omitempty"` - CApic string `json:"capic,omitempty" yaml:"capic,omitempty"` - ControllerLogLevel string `json:"controllerLogLevel,omitempty" yaml:"controllerLogLevel,omitempty"` - DhcpDelay string `json:"dhcpDelay,omitempty" yaml:"dhcpDelay,omitempty"` - DhcpRenewMaxRetryCount string `json:"dhcpRenewMaxRetryCount,omitempty" yaml:"dhcpRenewMaxRetryCount,omitempty"` - DisablePeriodicSnatGlobalInfoSync string `json:"disablePeriodicSnatGlobalInfoSync,omitempty" yaml:"disablePeriodicSnatGlobalInfoSync,omitempty"` - DisableWaitForNetwork string `json:"disableWaitForNetwork,omitempty" yaml:"disableWaitForNetwork,omitempty"` - DropLogEnable string `json:"dropLogEnable,omitempty" yaml:"dropLogEnable,omitempty"` - DurationWaitForNetwork string `json:"durationWaitForNetwork,omitempty" yaml:"durationWaitForNetwork,omitempty"` - DynamicExternalSubnet string `json:"externDynamic,omitempty" yaml:"externDynamic,omitempty"` - EnableEndpointSlice string `json:"enableEndpointSlice,omitempty" yaml:"enableEndpointSlice,omitempty"` - EncapType string `json:"encapType,omitempty" yaml:"encapType,omitempty"` - EpRegistry string `json:"epRegistry,omitempty" yaml:"epRegistry,omitempty"` - GbpPodSubnet string `json:"gbpPodSubnet,omitempty" yaml:"gbpPodSubnet,omitempty"` - HostAgentLogLevel string `json:"hostAgentLogLevel,omitempty" yaml:"hostAgentLogLevel,omitempty"` - HppOptimization string `json:"hppOptimization,omitempty" yaml:"hppOptimization,omitempty"` - ImagePullPolicy string `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"` - ImagePullSecret string `json:"imagePullSecret,omitempty" yaml:"imagePullSecret,omitempty"` - InfraVlan string `json:"infraVlan,omitempty" yaml:"infraVlan,omitempty"` - InstallIstio string `json:"installIstio,omitempty" yaml:"installIstio,omitempty"` - IstioProfile string `json:"istioProfile,omitempty" yaml:"istioProfile,omitempty"` - KafkaBrokers []string `json:"kafkaBrokers,omitempty" yaml:"kafkaBrokers,omitempty"` - KafkaClientCrt string `json:"kafkaClientCrt,omitempty" yaml:"kafkaClientCrt,omitempty"` - KafkaClientKey string `json:"kafkaClientKey,omitempty" yaml:"kafkaClientKey,omitempty"` - KubeAPIVlan string `json:"kubeApiVlan,omitempty" yaml:"kubeApiVlan,omitempty"` - L3Out string `json:"l3out,omitempty" yaml:"l3out,omitempty"` - L3OutExternalNetworks []string `json:"l3outExternalNetworks,omitempty" yaml:"l3outExternalNetworks,omitempty"` - MTUHeadRoom string `json:"mtuHeadRoom,omitempty" yaml:"mtuHeadRoom,omitempty"` - MaxNodesSvcGraph string `json:"maxNodesSvcGraph,omitempty" yaml:"maxNodesSvcGraph,omitempty"` - McastDaemonMemoryLimit string `json:"mcastDaemonMemoryLimit,omitempty" yaml:"mcastDaemonMemoryLimit,omitempty"` - McastDaemonMemoryRequest string `json:"mcastDaemonMemoryRequest,omitempty" yaml:"mcastDaemonMemoryRequest,omitempty"` - McastRangeEnd string `json:"mcastRangeEnd,omitempty" yaml:"mcastRangeEnd,omitempty"` - McastRangeStart string `json:"mcastRangeStart,omitempty" yaml:"mcastRangeStart,omitempty"` - MultusDisable string `json:"multusDisable,omitempty" yaml:"multusDisable,omitempty"` - NoPriorityClass string `json:"noPriorityClass,omitempty" yaml:"noPriorityClass,omitempty"` - NoWaitForServiceEpReadiness string `json:"noWaitForServiceEpReadiness,omitempty" yaml:"noWaitForServiceEpReadiness,omitempty"` - NodePodIfEnable string `json:"nodePodIfEnable,omitempty" yaml:"nodePodIfEnable,omitempty"` - NodeSubnet string `json:"nodeSubnet,omitempty" yaml:"nodeSubnet,omitempty"` - OVSMemoryLimit string `json:"ovsMemoryLimit,omitempty" yaml:"ovsMemoryLimit,omitempty"` - OVSMemoryRequest string `json:"ovsMemoryRequest,omitempty" yaml:"ovsMemoryRequest,omitempty"` - OpflexAgentLogLevel string `json:"opflexLogLevel,omitempty" yaml:"opflexLogLevel,omitempty"` - OpflexAgentMemoryLimit string `json:"opflexAgentMemoryLimit,omitempty" yaml:"opflexAgentMemoryLimit,omitempty"` - OpflexAgentMemoryRequest string `json:"opflexAgentMemoryRequest,omitempty" yaml:"opflexAgentMemoryRequest,omitempty"` - OpflexAgentOpflexAsyncjsonEnabled string `json:"opflexAgentOpflexAsyncjsonEnabled,omitempty" yaml:"opflexAgentOpflexAsyncjsonEnabled,omitempty"` - OpflexAgentOvsAsyncjsonEnabled string `json:"opflexAgentOvsAsyncjsonEnabled,omitempty" yaml:"opflexAgentOvsAsyncjsonEnabled,omitempty"` - OpflexAgentPolicyRetryDelayTimer string `json:"opflexAgentPolicyRetryDelayTimer,omitempty" yaml:"opflexAgentPolicyRetryDelayTimer,omitempty"` - OpflexClientSSL string `json:"opflexClientSsl,omitempty" yaml:"opflexClientSsl,omitempty"` - OpflexDeviceDeleteTimeout string `json:"opflexDeviceDeleteTimeout,omitempty" yaml:"opflexDeviceDeleteTimeout,omitempty"` - OpflexDeviceReconnectWaitTimeout string `json:"opflexDeviceReconnectWaitTimeout,omitempty" yaml:"opflexDeviceReconnectWaitTimeout,omitempty"` - OpflexMode string `json:"opflexMode,omitempty" yaml:"opflexMode,omitempty"` - OpflexServerPort string `json:"opflexServerPort,omitempty" yaml:"opflexServerPort,omitempty"` - OverlayVRFName string `json:"overlayVrfName,omitempty" yaml:"overlayVrfName,omitempty"` - PBRTrackingNonSnat string `json:"pbrTrackingNonSnat,omitempty" yaml:"pbrTrackingNonSnat,omitempty"` - PodSubnetChunkSize string `json:"podSubnetChunkSize,omitempty" yaml:"podSubnetChunkSize,omitempty"` - RunGbpContainer string `json:"runGbpContainer,omitempty" yaml:"runGbpContainer,omitempty"` - RunOpflexServerContainer string `json:"runOpflexServerContainer,omitempty" yaml:"runOpflexServerContainer,omitempty"` - ServiceGraphEndpointAddDelay string `json:"serviceGraphEndpointAddDelay,omitempty" yaml:"serviceGraphEndpointAddDelay,omitempty"` - ServiceGraphEndpointAddServices []map[string]string `json:"serviceGraphEndpointAddServices,omitempty" yaml:"serviceGraphEndpointAddServices,omitempty"` - ServiceGraphSubnet string `json:"nodeSvcSubnet,omitempty" yaml:"nodeSvcSubnet,omitempty"` - ServiceMonitorInterval string `json:"serviceMonitorInterval,omitempty" yaml:"serviceMonitorInterval,omitempty"` - ServiceVlan string `json:"serviceVlan,omitempty" yaml:"serviceVlan,omitempty"` - SleepTimeSnatGlobalInfoSync string `json:"sleepTimeSnatGlobalInfoSync,omitempty" yaml:"sleepTimeSnatGlobalInfoSync,omitempty"` - SnatContractScope string `json:"snatContractScope,omitempty" yaml:"snatContractScope,omitempty"` - SnatNamespace string `json:"snatNamespace,omitempty" yaml:"snatNamespace,omitempty"` - SnatPortRangeEnd string `json:"snatPortRangeEnd,omitempty" yaml:"snatPortRangeEnd,omitempty"` - SnatPortRangeStart string `json:"snatPortRangeStart,omitempty" yaml:"snatPortRangeStart,omitempty"` - SnatPortsPerNode string `json:"snatPortsPerNode,omitempty" yaml:"snatPortsPerNode,omitempty"` - SriovEnable string `json:"sriovEnable,omitempty" yaml:"sriovEnable,omitempty"` - StaticExternalSubnet string `json:"externStatic,omitempty" yaml:"externStatic,omitempty"` - SubnetDomainName string `json:"subnetDomainName,omitempty" yaml:"subnetDomainName,omitempty"` - SystemIdentifier string `json:"systemId,omitempty" yaml:"systemId,omitempty"` - Tenant string `json:"tenant,omitempty" yaml:"tenant,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` - UseAciAnywhereCRD string `json:"useAciAnywhereCrd,omitempty" yaml:"useAciAnywhereCrd,omitempty"` - UseAciCniPriorityClass string `json:"useAciCniPriorityClass,omitempty" yaml:"useAciCniPriorityClass,omitempty"` - UseClusterRole string `json:"useClusterRole,omitempty" yaml:"useClusterRole,omitempty"` - UseHostNetnsVolume string `json:"useHostNetnsVolume,omitempty" yaml:"useHostNetnsVolume,omitempty"` - UseOpflexServerVolume string `json:"useOpflexServerVolume,omitempty" yaml:"useOpflexServerVolume,omitempty"` - UsePrivilegedContainer string `json:"usePrivilegedContainer,omitempty" yaml:"usePrivilegedContainer,omitempty"` - UseSystemNodePriorityClass string `json:"useSystemNodePriorityClass,omitempty" yaml:"useSystemNodePriorityClass,omitempty"` - VRFName string `json:"vrfName,omitempty" yaml:"vrfName,omitempty"` - VRFTenant string `json:"vrfTenant,omitempty" yaml:"vrfTenant,omitempty"` - VmmController string `json:"vmmController,omitempty" yaml:"vmmController,omitempty"` - VmmDomain string `json:"vmmDomain,omitempty" yaml:"vmmDomain,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_action.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_action.go deleted file mode 100644 index 6e6334bd1ef..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_action.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ActionType = "action" - ActionFieldInput = "input" - ActionFieldOutput = "output" -) - -type Action struct { - Input string `json:"input,omitempty" yaml:"input,omitempty"` - Output string `json:"output,omitempty" yaml:"output,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_config.go deleted file mode 100644 index 51146186577..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_config.go +++ /dev/null @@ -1,86 +0,0 @@ -package client - -const ( - ActiveDirectoryConfigType = "activeDirectoryConfig" - ActiveDirectoryConfigFieldAccessMode = "accessMode" - ActiveDirectoryConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - ActiveDirectoryConfigFieldAnnotations = "annotations" - ActiveDirectoryConfigFieldCertificate = "certificate" - ActiveDirectoryConfigFieldConnectionTimeout = "connectionTimeout" - ActiveDirectoryConfigFieldCreated = "created" - ActiveDirectoryConfigFieldCreatorID = "creatorId" - ActiveDirectoryConfigFieldDefaultLoginDomain = "defaultLoginDomain" - ActiveDirectoryConfigFieldEnabled = "enabled" - ActiveDirectoryConfigFieldGroupDNAttribute = "groupDNAttribute" - ActiveDirectoryConfigFieldGroupMemberMappingAttribute = "groupMemberMappingAttribute" - ActiveDirectoryConfigFieldGroupMemberUserAttribute = "groupMemberUserAttribute" - ActiveDirectoryConfigFieldGroupNameAttribute = "groupNameAttribute" - ActiveDirectoryConfigFieldGroupObjectClass = "groupObjectClass" - ActiveDirectoryConfigFieldGroupSearchAttribute = "groupSearchAttribute" - ActiveDirectoryConfigFieldGroupSearchBase = "groupSearchBase" - ActiveDirectoryConfigFieldGroupSearchFilter = "groupSearchFilter" - ActiveDirectoryConfigFieldLabels = "labels" - ActiveDirectoryConfigFieldName = "name" - ActiveDirectoryConfigFieldNestedGroupMembershipEnabled = "nestedGroupMembershipEnabled" - ActiveDirectoryConfigFieldOwnerReferences = "ownerReferences" - ActiveDirectoryConfigFieldPort = "port" - ActiveDirectoryConfigFieldRemoved = "removed" - ActiveDirectoryConfigFieldServers = "servers" - ActiveDirectoryConfigFieldServiceAccountPassword = "serviceAccountPassword" - ActiveDirectoryConfigFieldServiceAccountUsername = "serviceAccountUsername" - ActiveDirectoryConfigFieldStartTLS = "starttls" - ActiveDirectoryConfigFieldStatus = "status" - ActiveDirectoryConfigFieldTLS = "tls" - ActiveDirectoryConfigFieldType = "type" - ActiveDirectoryConfigFieldUUID = "uuid" - ActiveDirectoryConfigFieldUserDisabledBitMask = "userDisabledBitMask" - ActiveDirectoryConfigFieldUserEnabledAttribute = "userEnabledAttribute" - ActiveDirectoryConfigFieldUserLoginAttribute = "userLoginAttribute" - ActiveDirectoryConfigFieldUserNameAttribute = "userNameAttribute" - ActiveDirectoryConfigFieldUserObjectClass = "userObjectClass" - ActiveDirectoryConfigFieldUserSearchAttribute = "userSearchAttribute" - ActiveDirectoryConfigFieldUserSearchBase = "userSearchBase" - ActiveDirectoryConfigFieldUserSearchFilter = "userSearchFilter" -) - -type ActiveDirectoryConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connectionTimeout,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DefaultLoginDomain string `json:"defaultLoginDomain,omitempty" yaml:"defaultLoginDomain,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GroupDNAttribute string `json:"groupDNAttribute,omitempty" yaml:"groupDNAttribute,omitempty"` - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"groupMemberMappingAttribute,omitempty"` - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"groupMemberUserAttribute,omitempty"` - GroupNameAttribute string `json:"groupNameAttribute,omitempty" yaml:"groupNameAttribute,omitempty"` - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"groupObjectClass,omitempty"` - GroupSearchAttribute string `json:"groupSearchAttribute,omitempty" yaml:"groupSearchAttribute,omitempty"` - GroupSearchBase string `json:"groupSearchBase,omitempty" yaml:"groupSearchBase,omitempty"` - GroupSearchFilter string `json:"groupSearchFilter,omitempty" yaml:"groupSearchFilter,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NestedGroupMembershipEnabled *bool `json:"nestedGroupMembershipEnabled,omitempty" yaml:"nestedGroupMembershipEnabled,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Servers []string `json:"servers,omitempty" yaml:"servers,omitempty"` - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"serviceAccountPassword,omitempty"` - ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" yaml:"serviceAccountUsername,omitempty"` - StartTLS bool `json:"starttls,omitempty" yaml:"starttls,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"userDisabledBitMask,omitempty"` - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"userEnabledAttribute,omitempty"` - UserLoginAttribute string `json:"userLoginAttribute,omitempty" yaml:"userLoginAttribute,omitempty"` - UserNameAttribute string `json:"userNameAttribute,omitempty" yaml:"userNameAttribute,omitempty"` - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"userObjectClass,omitempty"` - UserSearchAttribute string `json:"userSearchAttribute,omitempty" yaml:"userSearchAttribute,omitempty"` - UserSearchBase string `json:"userSearchBase,omitempty" yaml:"userSearchBase,omitempty"` - UserSearchFilter string `json:"userSearchFilter,omitempty" yaml:"userSearchFilter,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_test_and_apply_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_test_and_apply_input.go deleted file mode 100644 index 3055af4fa10..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_active_directory_test_and_apply_input.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ActiveDirectoryTestAndApplyInputType = "activeDirectoryTestAndApplyInput" - ActiveDirectoryTestAndApplyInputFieldActiveDirectoryConfig = "activeDirectoryConfig" - ActiveDirectoryTestAndApplyInputFieldEnabled = "enabled" - ActiveDirectoryTestAndApplyInputFieldPassword = "password" - ActiveDirectoryTestAndApplyInputFieldUsername = "username" -) - -type ActiveDirectoryTestAndApplyInput struct { - ActiveDirectoryConfig *ActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty" yaml:"activeDirectoryConfig,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_adfs_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_adfs_config.go deleted file mode 100644 index 5170ec83ee9..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_adfs_config.go +++ /dev/null @@ -1,52 +0,0 @@ -package client - -const ( - ADFSConfigType = "adfsConfig" - ADFSConfigFieldAccessMode = "accessMode" - ADFSConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - ADFSConfigFieldAnnotations = "annotations" - ADFSConfigFieldCreated = "created" - ADFSConfigFieldCreatorID = "creatorId" - ADFSConfigFieldDisplayNameField = "displayNameField" - ADFSConfigFieldEnabled = "enabled" - ADFSConfigFieldEntityID = "entityID" - ADFSConfigFieldGroupsField = "groupsField" - ADFSConfigFieldIDPMetadataContent = "idpMetadataContent" - ADFSConfigFieldLabels = "labels" - ADFSConfigFieldName = "name" - ADFSConfigFieldOwnerReferences = "ownerReferences" - ADFSConfigFieldRancherAPIHost = "rancherApiHost" - ADFSConfigFieldRemoved = "removed" - ADFSConfigFieldSpCert = "spCert" - ADFSConfigFieldSpKey = "spKey" - ADFSConfigFieldStatus = "status" - ADFSConfigFieldType = "type" - ADFSConfigFieldUIDField = "uidField" - ADFSConfigFieldUUID = "uuid" - ADFSConfigFieldUserNameField = "userNameField" -) - -type ADFSConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DisplayNameField string `json:"displayNameField,omitempty" yaml:"displayNameField,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - EntityID string `json:"entityID,omitempty" yaml:"entityID,omitempty"` - GroupsField string `json:"groupsField,omitempty" yaml:"groupsField,omitempty"` - IDPMetadataContent string `json:"idpMetadataContent,omitempty" yaml:"idpMetadataContent,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - RancherAPIHost string `json:"rancherApiHost,omitempty" yaml:"rancherApiHost,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SpCert string `json:"spCert,omitempty" yaml:"spCert,omitempty"` - SpKey string `json:"spKey,omitempty" yaml:"spKey,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UIDField string `json:"uidField,omitempty" yaml:"uidField,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserNameField string `json:"userNameField,omitempty" yaml:"userNameField,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aes_configuration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_aes_configuration.go deleted file mode 100644 index 21732a17039..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aes_configuration.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - AESConfigurationType = "aesConfiguration" - AESConfigurationFieldKeys = "keys" -) - -type AESConfiguration struct { - Keys []Key `json:"keys,omitempty" yaml:"keys,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_affinity.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_affinity.go deleted file mode 100644 index 0489c3d6575..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_affinity.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - AffinityType = "affinity" - AffinityFieldNodeAffinity = "nodeAffinity" - AffinityFieldPodAffinity = "podAffinity" - AffinityFieldPodAntiAffinity = "podAntiAffinity" -) - -type Affinity struct { - NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty" yaml:"nodeAffinity,omitempty"` - PodAffinity *PodAffinity `json:"podAffinity,omitempty" yaml:"podAffinity,omitempty"` - PodAntiAffinity *PodAntiAffinity `json:"podAntiAffinity,omitempty" yaml:"podAntiAffinity,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_agent_deployment_customization.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_agent_deployment_customization.go deleted file mode 100644 index 841e6e13d7a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_agent_deployment_customization.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - AgentDeploymentCustomizationType = "agentDeploymentCustomization" - AgentDeploymentCustomizationFieldAppendTolerations = "appendTolerations" - AgentDeploymentCustomizationFieldOverrideAffinity = "overrideAffinity" - AgentDeploymentCustomizationFieldOverrideResourceRequirements = "overrideResourceRequirements" -) - -type AgentDeploymentCustomization struct { - AppendTolerations []Toleration `json:"appendTolerations,omitempty" yaml:"appendTolerations,omitempty"` - OverrideAffinity *Affinity `json:"overrideAffinity,omitempty" yaml:"overrideAffinity,omitempty"` - OverrideResourceRequirements *ResourceRequirements `json:"overrideResourceRequirements,omitempty" yaml:"overrideResourceRequirements,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_cluster_config_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_cluster_config_spec.go deleted file mode 100644 index d6caad1ac4b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_cluster_config_spec.go +++ /dev/null @@ -1,76 +0,0 @@ -package client - -const ( - AKSClusterConfigSpecType = "aksClusterConfigSpec" - AKSClusterConfigSpecFieldAuthBaseURL = "authBaseUrl" - AKSClusterConfigSpecFieldAuthorizedIPRanges = "authorizedIpRanges" - AKSClusterConfigSpecFieldAzureCredentialSecret = "azureCredentialSecret" - AKSClusterConfigSpecFieldBaseURL = "baseUrl" - AKSClusterConfigSpecFieldClusterName = "clusterName" - AKSClusterConfigSpecFieldDNSPrefix = "dnsPrefix" - AKSClusterConfigSpecFieldHTTPApplicationRouting = "httpApplicationRouting" - AKSClusterConfigSpecFieldImported = "imported" - AKSClusterConfigSpecFieldKubernetesVersion = "kubernetesVersion" - AKSClusterConfigSpecFieldLinuxAdminUsername = "linuxAdminUsername" - AKSClusterConfigSpecFieldLinuxSSHPublicKey = "sshPublicKey" - AKSClusterConfigSpecFieldLoadBalancerSKU = "loadBalancerSku" - AKSClusterConfigSpecFieldLogAnalyticsWorkspaceGroup = "logAnalyticsWorkspaceGroup" - AKSClusterConfigSpecFieldLogAnalyticsWorkspaceName = "logAnalyticsWorkspaceName" - AKSClusterConfigSpecFieldManagedIdentity = "managedIdentity" - AKSClusterConfigSpecFieldMonitoring = "monitoring" - AKSClusterConfigSpecFieldNetworkDNSServiceIP = "dnsServiceIp" - AKSClusterConfigSpecFieldNetworkDockerBridgeCIDR = "dockerBridgeCidr" - AKSClusterConfigSpecFieldNetworkPlugin = "networkPlugin" - AKSClusterConfigSpecFieldNetworkPodCIDR = "podCidr" - AKSClusterConfigSpecFieldNetworkPolicy = "networkPolicy" - AKSClusterConfigSpecFieldNetworkServiceCIDR = "serviceCidr" - AKSClusterConfigSpecFieldNodePools = "nodePools" - AKSClusterConfigSpecFieldNodeResourceGroup = "nodeResourceGroup" - AKSClusterConfigSpecFieldOutboundType = "outboundType" - AKSClusterConfigSpecFieldPrivateCluster = "privateCluster" - AKSClusterConfigSpecFieldPrivateDNSZone = "privateDnsZone" - AKSClusterConfigSpecFieldResourceGroup = "resourceGroup" - AKSClusterConfigSpecFieldResourceLocation = "resourceLocation" - AKSClusterConfigSpecFieldSubnet = "subnet" - AKSClusterConfigSpecFieldTags = "tags" - AKSClusterConfigSpecFieldUserAssignedIdentity = "userAssignedIdentity" - AKSClusterConfigSpecFieldVirtualNetwork = "virtualNetwork" - AKSClusterConfigSpecFieldVirtualNetworkResourceGroup = "virtualNetworkResourceGroup" -) - -type AKSClusterConfigSpec struct { - AuthBaseURL *string `json:"authBaseUrl,omitempty" yaml:"authBaseUrl,omitempty"` - AuthorizedIPRanges *[]string `json:"authorizedIpRanges,omitempty" yaml:"authorizedIpRanges,omitempty"` - AzureCredentialSecret string `json:"azureCredentialSecret,omitempty" yaml:"azureCredentialSecret,omitempty"` - BaseURL *string `json:"baseUrl,omitempty" yaml:"baseUrl,omitempty"` - ClusterName string `json:"clusterName,omitempty" yaml:"clusterName,omitempty"` - DNSPrefix *string `json:"dnsPrefix,omitempty" yaml:"dnsPrefix,omitempty"` - HTTPApplicationRouting *bool `json:"httpApplicationRouting,omitempty" yaml:"httpApplicationRouting,omitempty"` - Imported bool `json:"imported,omitempty" yaml:"imported,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` - LinuxAdminUsername *string `json:"linuxAdminUsername,omitempty" yaml:"linuxAdminUsername,omitempty"` - LinuxSSHPublicKey *string `json:"sshPublicKey,omitempty" yaml:"sshPublicKey,omitempty"` - LoadBalancerSKU *string `json:"loadBalancerSku,omitempty" yaml:"loadBalancerSku,omitempty"` - LogAnalyticsWorkspaceGroup *string `json:"logAnalyticsWorkspaceGroup,omitempty" yaml:"logAnalyticsWorkspaceGroup,omitempty"` - LogAnalyticsWorkspaceName *string `json:"logAnalyticsWorkspaceName,omitempty" yaml:"logAnalyticsWorkspaceName,omitempty"` - ManagedIdentity **bool `json:"managedIdentity,omitempty" yaml:"managedIdentity,omitempty"` - Monitoring *bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` - NetworkDNSServiceIP *string `json:"dnsServiceIp,omitempty" yaml:"dnsServiceIp,omitempty"` - NetworkDockerBridgeCIDR *string `json:"dockerBridgeCidr,omitempty" yaml:"dockerBridgeCidr,omitempty"` - NetworkPlugin *string `json:"networkPlugin,omitempty" yaml:"networkPlugin,omitempty"` - NetworkPodCIDR *string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"` - NetworkPolicy *string `json:"networkPolicy,omitempty" yaml:"networkPolicy,omitempty"` - NetworkServiceCIDR *string `json:"serviceCidr,omitempty" yaml:"serviceCidr,omitempty"` - NodePools []AKSNodePool `json:"nodePools,omitempty" yaml:"nodePools,omitempty"` - NodeResourceGroup *string `json:"nodeResourceGroup,omitempty" yaml:"nodeResourceGroup,omitempty"` - OutboundType *string `json:"outboundType,omitempty" yaml:"outboundType,omitempty"` - PrivateCluster *bool `json:"privateCluster,omitempty" yaml:"privateCluster,omitempty"` - PrivateDNSZone *string `json:"privateDnsZone,omitempty" yaml:"privateDnsZone,omitempty"` - ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resourceGroup,omitempty"` - ResourceLocation string `json:"resourceLocation,omitempty" yaml:"resourceLocation,omitempty"` - Subnet *string `json:"subnet,omitempty" yaml:"subnet,omitempty"` - Tags map[string]string `json:"tags,omitempty" yaml:"tags,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty" yaml:"userAssignedIdentity,omitempty"` - VirtualNetwork *string `json:"virtualNetwork,omitempty" yaml:"virtualNetwork,omitempty"` - VirtualNetworkResourceGroup *string `json:"virtualNetworkResourceGroup,omitempty" yaml:"virtualNetworkResourceGroup,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_node_pool.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_node_pool.go deleted file mode 100644 index 43e5721cbbe..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_node_pool.go +++ /dev/null @@ -1,42 +0,0 @@ -package client - -const ( - AKSNodePoolType = "aksNodePool" - AKSNodePoolFieldAvailabilityZones = "availabilityZones" - AKSNodePoolFieldCount = "count" - AKSNodePoolFieldEnableAutoScaling = "enableAutoScaling" - AKSNodePoolFieldMaxCount = "maxCount" - AKSNodePoolFieldMaxPods = "maxPods" - AKSNodePoolFieldMaxSurge = "maxSurge" - AKSNodePoolFieldMinCount = "minCount" - AKSNodePoolFieldMode = "mode" - AKSNodePoolFieldName = "name" - AKSNodePoolFieldNodeLabels = "nodeLabels" - AKSNodePoolFieldNodeTaints = "nodeTaints" - AKSNodePoolFieldOrchestratorVersion = "orchestratorVersion" - AKSNodePoolFieldOsDiskSizeGB = "osDiskSizeGB" - AKSNodePoolFieldOsDiskType = "osDiskType" - AKSNodePoolFieldOsType = "osType" - AKSNodePoolFieldVMSize = "vmSize" - AKSNodePoolFieldVnetSubnetID = "vnetSubnetID" -) - -type AKSNodePool struct { - AvailabilityZones *[]string `json:"availabilityZones,omitempty" yaml:"availabilityZones,omitempty"` - Count *int64 `json:"count,omitempty" yaml:"count,omitempty"` - EnableAutoScaling *bool `json:"enableAutoScaling,omitempty" yaml:"enableAutoScaling,omitempty"` - MaxCount *int64 `json:"maxCount,omitempty" yaml:"maxCount,omitempty"` - MaxPods *int64 `json:"maxPods,omitempty" yaml:"maxPods,omitempty"` - MaxSurge string `json:"maxSurge,omitempty" yaml:"maxSurge,omitempty"` - MinCount *int64 `json:"minCount,omitempty" yaml:"minCount,omitempty"` - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - Name *string `json:"name,omitempty" yaml:"name,omitempty"` - NodeLabels map[string]string `json:"nodeLabels,omitempty" yaml:"nodeLabels,omitempty"` - NodeTaints []string `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - OrchestratorVersion *string `json:"orchestratorVersion,omitempty" yaml:"orchestratorVersion,omitempty"` - OsDiskSizeGB *int64 `json:"osDiskSizeGB,omitempty" yaml:"osDiskSizeGB,omitempty"` - OsDiskType string `json:"osDiskType,omitempty" yaml:"osDiskType,omitempty"` - OsType string `json:"osType,omitempty" yaml:"osType,omitempty"` - VMSize string `json:"vmSize,omitempty" yaml:"vmSize,omitempty"` - VnetSubnetID *string `json:"vnetSubnetID,omitempty" yaml:"vnetSubnetID,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_status.go deleted file mode 100644 index 91074c032fd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aks_status.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - AKSStatusType = "aksStatus" - AKSStatusFieldPrivateRequiresTunnel = "privateRequiresTunnel" - AKSStatusFieldRBACEnabled = "rbacEnabled" - AKSStatusFieldUpstreamSpec = "upstreamSpec" -) - -type AKSStatus struct { - PrivateRequiresTunnel *bool `json:"privateRequiresTunnel,omitempty" yaml:"privateRequiresTunnel,omitempty"` - RBACEnabled *bool `json:"rbacEnabled,omitempty" yaml:"rbacEnabled,omitempty"` - UpstreamSpec *AKSClusterConfigSpec `json:"upstreamSpec,omitempty" yaml:"upstreamSpec,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_alert_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_alert_status.go deleted file mode 100644 index cae1f9ee2cb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_alert_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - AlertStatusType = "alertStatus" - AlertStatusFieldAlertState = "alertState" -) - -type AlertStatus struct { - AlertState string `json:"alertState,omitempty" yaml:"alertState,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_alidns_provider_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_alidns_provider_config.go deleted file mode 100644 index a58df2cace0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_alidns_provider_config.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - AlidnsProviderConfigType = "alidnsProviderConfig" - AlidnsProviderConfigFieldAccessKey = "accessKey" - AlidnsProviderConfigFieldAdditionalOptions = "additionalOptions" - AlidnsProviderConfigFieldSecretKey = "secretKey" -) - -type AlidnsProviderConfig struct { - AccessKey string `json:"accessKey,omitempty" yaml:"accessKey,omitempty"` - AdditionalOptions map[string]string `json:"additionalOptions,omitempty" yaml:"additionalOptions,omitempty"` - SecretKey string `json:"secretKey,omitempty" yaml:"secretKey,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_csidriver.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_csidriver.go deleted file mode 100644 index c49cfb3d520..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_csidriver.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - AllowedCSIDriverType = "allowedCSIDriver" - AllowedCSIDriverFieldName = "name" -) - -type AllowedCSIDriver struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_flex_volume.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_flex_volume.go deleted file mode 100644 index 8b7d9585b7e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_flex_volume.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - AllowedFlexVolumeType = "allowedFlexVolume" - AllowedFlexVolumeFieldDriver = "driver" -) - -type AllowedFlexVolume struct { - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_host_path.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_host_path.go deleted file mode 100644 index 3249f332e05..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_allowed_host_path.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - AllowedHostPathType = "allowedHostPath" - AllowedHostPathFieldPathPrefix = "pathPrefix" - AllowedHostPathFieldReadOnly = "readOnly" -) - -type AllowedHostPath struct { - PathPrefix string `json:"pathPrefix,omitempty" yaml:"pathPrefix,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_answer.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_answer.go deleted file mode 100644 index d79e0c9e27a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_answer.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - AnswerType = "answer" - AnswerFieldClusterID = "clusterId" - AnswerFieldProjectID = "projectId" - AnswerFieldValues = "values" - AnswerFieldValuesSetString = "valuesSetString" -) - -type Answer struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Values map[string]string `json:"values,omitempty" yaml:"values,omitempty"` - ValuesSetString map[string]string `json:"valuesSetString,omitempty" yaml:"valuesSetString,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_app_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_app_condition.go deleted file mode 100644 index 9d633aeeaec..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_app_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - AppConditionType = "appCondition" - AppConditionFieldLastTransitionTime = "lastTransitionTime" - AppConditionFieldLastUpdateTime = "lastUpdateTime" - AppConditionFieldMessage = "message" - AppConditionFieldReason = "reason" - AppConditionFieldStatus = "status" - AppConditionFieldType = "type" -) - -type AppCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_attached_volume.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_attached_volume.go deleted file mode 100644 index c3bbe0e6550..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_attached_volume.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - AttachedVolumeType = "attachedVolume" - AttachedVolumeFieldName = "name" -) - -type AttachedVolume struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log.go deleted file mode 100644 index 7d605ca8b38..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - AuditLogType = "auditLog" - AuditLogFieldConfiguration = "configuration" - AuditLogFieldEnabled = "enabled" -) - -type AuditLog struct { - Configuration *AuditLogConfig `json:"configuration,omitempty" yaml:"configuration,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log_config.go deleted file mode 100644 index d1d82897371..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_audit_log_config.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - AuditLogConfigType = "auditLogConfig" - AuditLogConfigFieldFormat = "format" - AuditLogConfigFieldMaxAge = "maxAge" - AuditLogConfigFieldMaxBackup = "maxBackup" - AuditLogConfigFieldMaxSize = "maxSize" - AuditLogConfigFieldPath = "path" - AuditLogConfigFieldPolicy = "policy" -) - -type AuditLogConfig struct { - Format string `json:"format,omitempty" yaml:"format,omitempty"` - MaxAge int64 `json:"maxAge,omitempty" yaml:"maxAge,omitempty"` - MaxBackup int64 `json:"maxBackup,omitempty" yaml:"maxBackup,omitempty"` - MaxSize int64 `json:"maxSize,omitempty" yaml:"maxSize,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - Policy map[string]interface{} `json:"policy,omitempty" yaml:"policy,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config.go deleted file mode 100644 index ac6c47bbd3d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config.go +++ /dev/null @@ -1,128 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - AuthConfigType = "authConfig" - AuthConfigFieldAccessMode = "accessMode" - AuthConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - AuthConfigFieldAnnotations = "annotations" - AuthConfigFieldCreated = "created" - AuthConfigFieldCreatorID = "creatorId" - AuthConfigFieldEnabled = "enabled" - AuthConfigFieldLabels = "labels" - AuthConfigFieldName = "name" - AuthConfigFieldOwnerReferences = "ownerReferences" - AuthConfigFieldRemoved = "removed" - AuthConfigFieldStatus = "status" - AuthConfigFieldType = "type" - AuthConfigFieldUUID = "uuid" -) - -type AuthConfig struct { - types.Resource - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type AuthConfigCollection struct { - types.Collection - Data []AuthConfig `json:"data,omitempty"` - client *AuthConfigClient -} - -type AuthConfigClient struct { - apiClient *Client -} - -type AuthConfigOperations interface { - List(opts *types.ListOpts) (*AuthConfigCollection, error) - ListAll(opts *types.ListOpts) (*AuthConfigCollection, error) - Create(opts *AuthConfig) (*AuthConfig, error) - Update(existing *AuthConfig, updates interface{}) (*AuthConfig, error) - Replace(existing *AuthConfig) (*AuthConfig, error) - ByID(id string) (*AuthConfig, error) - Delete(container *AuthConfig) error -} - -func newAuthConfigClient(apiClient *Client) *AuthConfigClient { - return &AuthConfigClient{ - apiClient: apiClient, - } -} - -func (c *AuthConfigClient) Create(container *AuthConfig) (*AuthConfig, error) { - resp := &AuthConfig{} - err := c.apiClient.Ops.DoCreate(AuthConfigType, container, resp) - return resp, err -} - -func (c *AuthConfigClient) Update(existing *AuthConfig, updates interface{}) (*AuthConfig, error) { - resp := &AuthConfig{} - err := c.apiClient.Ops.DoUpdate(AuthConfigType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AuthConfigClient) Replace(obj *AuthConfig) (*AuthConfig, error) { - resp := &AuthConfig{} - err := c.apiClient.Ops.DoReplace(AuthConfigType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *AuthConfigClient) List(opts *types.ListOpts) (*AuthConfigCollection, error) { - resp := &AuthConfigCollection{} - err := c.apiClient.Ops.DoList(AuthConfigType, opts, resp) - resp.client = c - return resp, err -} - -func (c *AuthConfigClient) ListAll(opts *types.ListOpts) (*AuthConfigCollection, error) { - resp := &AuthConfigCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *AuthConfigCollection) Next() (*AuthConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AuthConfigCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AuthConfigClient) ByID(id string) (*AuthConfig, error) { - resp := &AuthConfig{} - err := c.apiClient.Ops.DoByID(AuthConfigType, id, resp) - return resp, err -} - -func (c *AuthConfigClient) Delete(container *AuthConfig) error { - return c.apiClient.Ops.DoResourceDelete(AuthConfigType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_conditions.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_conditions.go deleted file mode 100644 index bf92ef016d1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_conditions.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - AuthConfigConditionsType = "authConfigConditions" - AuthConfigConditionsFieldLastTransitionTime = "lastTransitionTime" - AuthConfigConditionsFieldLastUpdateTime = "lastUpdateTime" - AuthConfigConditionsFieldMessage = "message" - AuthConfigConditionsFieldReason = "reason" - AuthConfigConditionsFieldStatus = "status" - AuthConfigConditionsFieldType = "type" -) - -type AuthConfigConditions struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_status.go deleted file mode 100644 index e92cbec76c8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_config_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - AuthConfigStatusType = "authConfigStatus" - AuthConfigStatusFieldConditions = "conditions" -) - -type AuthConfigStatus struct { - Conditions []AuthConfigConditions `json:"conditions,omitempty" yaml:"conditions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_webhook_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_webhook_config.go deleted file mode 100644 index b9bbc1a80ec..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_auth_webhook_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - AuthWebhookConfigType = "authWebhookConfig" - AuthWebhookConfigFieldCacheTimeout = "cacheTimeout" - AuthWebhookConfigFieldConfigFile = "configFile" -) - -type AuthWebhookConfig struct { - CacheTimeout string `json:"cacheTimeout,omitempty" yaml:"cacheTimeout,omitempty"` - ConfigFile string `json:"configFile,omitempty" yaml:"configFile,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_authn_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_authn_config.go deleted file mode 100644 index e740e61947e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_authn_config.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - AuthnConfigType = "authnConfig" - AuthnConfigFieldSANs = "sans" - AuthnConfigFieldStrategy = "strategy" - AuthnConfigFieldWebhook = "webhook" -) - -type AuthnConfig struct { - SANs []string `json:"sans,omitempty" yaml:"sans,omitempty"` - Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` - Webhook *AuthWebhookConfig `json:"webhook,omitempty" yaml:"webhook,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_authz_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_authz_config.go deleted file mode 100644 index ee491dcd6d7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_authz_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - AuthzConfigType = "authzConfig" - AuthzConfigFieldMode = "mode" - AuthzConfigFieldOptions = "options" -) - -type AuthzConfig struct { - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_cloud_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_cloud_provider.go deleted file mode 100644 index bb1ebd01a9f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_cloud_provider.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - AWSCloudProviderType = "awsCloudProvider" - AWSCloudProviderFieldGlobal = "global" - AWSCloudProviderFieldServiceOverride = "serviceOverride" -) - -type AWSCloudProvider struct { - Global *GlobalAwsOpts `json:"global,omitempty" yaml:"global,omitempty"` - ServiceOverride map[string]ServiceOverride `json:"serviceOverride,omitempty" yaml:"serviceOverride,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_elastic_block_store_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_elastic_block_store_volume_source.go deleted file mode 100644 index 5765e83e45c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_aws_elastic_block_store_volume_source.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - AWSElasticBlockStoreVolumeSourceType = "awsElasticBlockStoreVolumeSource" - AWSElasticBlockStoreVolumeSourceFieldFSType = "fsType" - AWSElasticBlockStoreVolumeSourceFieldPartition = "partition" - AWSElasticBlockStoreVolumeSourceFieldReadOnly = "readOnly" - AWSElasticBlockStoreVolumeSourceFieldVolumeID = "volumeID" -) - -type AWSElasticBlockStoreVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - Partition int64 `json:"partition,omitempty" yaml:"partition,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - VolumeID string `json:"volumeID,omitempty" yaml:"volumeID,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig.go deleted file mode 100644 index b4cb153d3a8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig.go +++ /dev/null @@ -1,50 +0,0 @@ -package client - -const ( - AzureADConfigType = "azureADConfig" - AzureADConfigFieldAccessMode = "accessMode" - AzureADConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - AzureADConfigFieldAnnotations = "annotations" - AzureADConfigFieldApplicationID = "applicationId" - AzureADConfigFieldApplicationSecret = "applicationSecret" - AzureADConfigFieldAuthEndpoint = "authEndpoint" - AzureADConfigFieldCreated = "created" - AzureADConfigFieldCreatorID = "creatorId" - AzureADConfigFieldEnabled = "enabled" - AzureADConfigFieldEndpoint = "endpoint" - AzureADConfigFieldGraphEndpoint = "graphEndpoint" - AzureADConfigFieldLabels = "labels" - AzureADConfigFieldName = "name" - AzureADConfigFieldOwnerReferences = "ownerReferences" - AzureADConfigFieldRancherURL = "rancherUrl" - AzureADConfigFieldRemoved = "removed" - AzureADConfigFieldStatus = "status" - AzureADConfigFieldTenantID = "tenantId" - AzureADConfigFieldTokenEndpoint = "tokenEndpoint" - AzureADConfigFieldType = "type" - AzureADConfigFieldUUID = "uuid" -) - -type AzureADConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ApplicationID string `json:"applicationId,omitempty" yaml:"applicationId,omitempty"` - ApplicationSecret string `json:"applicationSecret,omitempty" yaml:"applicationSecret,omitempty"` - AuthEndpoint string `json:"authEndpoint,omitempty" yaml:"authEndpoint,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - GraphEndpoint string `json:"graphEndpoint,omitempty" yaml:"graphEndpoint,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - RancherURL string `json:"rancherUrl,omitempty" yaml:"rancherUrl,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - TenantID string `json:"tenantId,omitempty" yaml:"tenantId,omitempty"` - TokenEndpoint string `json:"tokenEndpoint,omitempty" yaml:"tokenEndpoint,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_apply_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_apply_input.go deleted file mode 100644 index a1e5b3922ac..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_apply_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - AzureADConfigApplyInputType = "azureADConfigApplyInput" - AzureADConfigApplyInputFieldCode = "code" - AzureADConfigApplyInputFieldConfig = "config" -) - -type AzureADConfigApplyInput struct { - Code string `json:"code,omitempty" yaml:"code,omitempty"` - Config *AzureADConfig `json:"config,omitempty" yaml:"config,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_test_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_test_output.go deleted file mode 100644 index 4ce9827955a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_adconfig_test_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - AzureADConfigTestOutputType = "azureADConfigTestOutput" - AzureADConfigTestOutputFieldRedirectURL = "redirectUrl" -) - -type AzureADConfigTestOutput struct { - RedirectURL string `json:"redirectUrl,omitempty" yaml:"redirectUrl,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_cloud_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_cloud_provider.go deleted file mode 100644 index df355ec2b3d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_cloud_provider.go +++ /dev/null @@ -1,74 +0,0 @@ -package client - -const ( - AzureCloudProviderType = "azureCloudProvider" - AzureCloudProviderFieldAADClientCertPassword = "aadClientCertPassword" - AzureCloudProviderFieldAADClientCertPath = "aadClientCertPath" - AzureCloudProviderFieldAADClientID = "aadClientId" - AzureCloudProviderFieldAADClientSecret = "aadClientSecret" - AzureCloudProviderFieldCloud = "cloud" - AzureCloudProviderFieldCloudProviderBackoff = "cloudProviderBackoff" - AzureCloudProviderFieldCloudProviderBackoffDuration = "cloudProviderBackoffDuration" - AzureCloudProviderFieldCloudProviderBackoffExponent = "cloudProviderBackoffExponent" - AzureCloudProviderFieldCloudProviderBackoffJitter = "cloudProviderBackoffJitter" - AzureCloudProviderFieldCloudProviderBackoffRetries = "cloudProviderBackoffRetries" - AzureCloudProviderFieldCloudProviderRateLimit = "cloudProviderRateLimit" - AzureCloudProviderFieldCloudProviderRateLimitBucket = "cloudProviderRateLimitBucket" - AzureCloudProviderFieldCloudProviderRateLimitQPS = "cloudProviderRateLimitQPS" - AzureCloudProviderFieldExcludeMasterFromStandardLB = "excludeMasterFromStandardLB" - AzureCloudProviderFieldLoadBalancerSku = "loadBalancerSku" - AzureCloudProviderFieldLocation = "location" - AzureCloudProviderFieldMaximumLoadBalancerRuleCount = "maximumLoadBalancerRuleCount" - AzureCloudProviderFieldPrimaryAvailabilitySetName = "primaryAvailabilitySetName" - AzureCloudProviderFieldPrimaryScaleSetName = "primaryScaleSetName" - AzureCloudProviderFieldResourceGroup = "resourceGroup" - AzureCloudProviderFieldRouteTableName = "routeTableName" - AzureCloudProviderFieldSecurityGroupName = "securityGroupName" - AzureCloudProviderFieldSecurityGroupResourceGroup = "securityGroupResourceGroup" - AzureCloudProviderFieldSubnetName = "subnetName" - AzureCloudProviderFieldSubscriptionID = "subscriptionId" - AzureCloudProviderFieldTags = "tags" - AzureCloudProviderFieldTenantID = "tenantId" - AzureCloudProviderFieldUseInstanceMetadata = "useInstanceMetadata" - AzureCloudProviderFieldUseManagedIdentityExtension = "useManagedIdentityExtension" - AzureCloudProviderFieldUserAssignedIdentityID = "userAssignedIdentityID" - AzureCloudProviderFieldVMType = "vmType" - AzureCloudProviderFieldVnetName = "vnetName" - AzureCloudProviderFieldVnetResourceGroup = "vnetResourceGroup" -) - -type AzureCloudProvider struct { - AADClientCertPassword string `json:"aadClientCertPassword,omitempty" yaml:"aadClientCertPassword,omitempty"` - AADClientCertPath string `json:"aadClientCertPath,omitempty" yaml:"aadClientCertPath,omitempty"` - AADClientID string `json:"aadClientId,omitempty" yaml:"aadClientId,omitempty"` - AADClientSecret string `json:"aadClientSecret,omitempty" yaml:"aadClientSecret,omitempty"` - Cloud string `json:"cloud,omitempty" yaml:"cloud,omitempty"` - CloudProviderBackoff bool `json:"cloudProviderBackoff,omitempty" yaml:"cloudProviderBackoff,omitempty"` - CloudProviderBackoffDuration int64 `json:"cloudProviderBackoffDuration,omitempty" yaml:"cloudProviderBackoffDuration,omitempty"` - CloudProviderBackoffExponent int64 `json:"cloudProviderBackoffExponent,omitempty" yaml:"cloudProviderBackoffExponent,omitempty"` - CloudProviderBackoffJitter int64 `json:"cloudProviderBackoffJitter,omitempty" yaml:"cloudProviderBackoffJitter,omitempty"` - CloudProviderBackoffRetries int64 `json:"cloudProviderBackoffRetries,omitempty" yaml:"cloudProviderBackoffRetries,omitempty"` - CloudProviderRateLimit bool `json:"cloudProviderRateLimit,omitempty" yaml:"cloudProviderRateLimit,omitempty"` - CloudProviderRateLimitBucket int64 `json:"cloudProviderRateLimitBucket,omitempty" yaml:"cloudProviderRateLimitBucket,omitempty"` - CloudProviderRateLimitQPS int64 `json:"cloudProviderRateLimitQPS,omitempty" yaml:"cloudProviderRateLimitQPS,omitempty"` - ExcludeMasterFromStandardLB *bool `json:"excludeMasterFromStandardLB,omitempty" yaml:"excludeMasterFromStandardLB,omitempty"` - LoadBalancerSku string `json:"loadBalancerSku,omitempty" yaml:"loadBalancerSku,omitempty"` - Location string `json:"location,omitempty" yaml:"location,omitempty"` - MaximumLoadBalancerRuleCount int64 `json:"maximumLoadBalancerRuleCount,omitempty" yaml:"maximumLoadBalancerRuleCount,omitempty"` - PrimaryAvailabilitySetName string `json:"primaryAvailabilitySetName,omitempty" yaml:"primaryAvailabilitySetName,omitempty"` - PrimaryScaleSetName string `json:"primaryScaleSetName,omitempty" yaml:"primaryScaleSetName,omitempty"` - ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resourceGroup,omitempty"` - RouteTableName string `json:"routeTableName,omitempty" yaml:"routeTableName,omitempty"` - SecurityGroupName string `json:"securityGroupName,omitempty" yaml:"securityGroupName,omitempty"` - SecurityGroupResourceGroup string `json:"securityGroupResourceGroup,omitempty" yaml:"securityGroupResourceGroup,omitempty"` - SubnetName string `json:"subnetName,omitempty" yaml:"subnetName,omitempty"` - SubscriptionID string `json:"subscriptionId,omitempty" yaml:"subscriptionId,omitempty"` - Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` - TenantID string `json:"tenantId,omitempty" yaml:"tenantId,omitempty"` - UseInstanceMetadata bool `json:"useInstanceMetadata,omitempty" yaml:"useInstanceMetadata,omitempty"` - UseManagedIdentityExtension bool `json:"useManagedIdentityExtension,omitempty" yaml:"useManagedIdentityExtension,omitempty"` - UserAssignedIdentityID string `json:"userAssignedIdentityID,omitempty" yaml:"userAssignedIdentityID,omitempty"` - VMType string `json:"vmType,omitempty" yaml:"vmType,omitempty"` - VnetName string `json:"vnetName,omitempty" yaml:"vnetName,omitempty"` - VnetResourceGroup string `json:"vnetResourceGroup,omitempty" yaml:"vnetResourceGroup,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_disk_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_disk_volume_source.go deleted file mode 100644 index 28920c00189..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_disk_volume_source.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - AzureDiskVolumeSourceType = "azureDiskVolumeSource" - AzureDiskVolumeSourceFieldCachingMode = "cachingMode" - AzureDiskVolumeSourceFieldDataDiskURI = "diskURI" - AzureDiskVolumeSourceFieldDiskName = "diskName" - AzureDiskVolumeSourceFieldFSType = "fsType" - AzureDiskVolumeSourceFieldKind = "kind" - AzureDiskVolumeSourceFieldReadOnly = "readOnly" -) - -type AzureDiskVolumeSource struct { - CachingMode string `json:"cachingMode,omitempty" yaml:"cachingMode,omitempty"` - DataDiskURI string `json:"diskURI,omitempty" yaml:"diskURI,omitempty"` - DiskName string `json:"diskName,omitempty" yaml:"diskName,omitempty"` - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - ReadOnly *bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_file_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_file_volume_source.go deleted file mode 100644 index 3be8571cc9e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_azure_file_volume_source.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - AzureFileVolumeSourceType = "azureFileVolumeSource" - AzureFileVolumeSourceFieldReadOnly = "readOnly" - AzureFileVolumeSourceFieldSecretName = "secretName" - AzureFileVolumeSourceFieldShareName = "shareName" -) - -type AzureFileVolumeSource struct { - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SecretName string `json:"secretName,omitempty" yaml:"secretName,omitempty"` - ShareName string `json:"shareName,omitempty" yaml:"shareName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_backup_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_backup_config.go deleted file mode 100644 index 140cf15ccc8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_backup_config.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - BackupConfigType = "backupConfig" - BackupConfigFieldEnabled = "enabled" - BackupConfigFieldIntervalHours = "intervalHours" - BackupConfigFieldRetention = "retention" - BackupConfigFieldS3BackupConfig = "s3BackupConfig" - BackupConfigFieldSafeTimestamp = "safeTimestamp" - BackupConfigFieldTimeout = "timeout" -) - -type BackupConfig struct { - Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - IntervalHours int64 `json:"intervalHours,omitempty" yaml:"intervalHours,omitempty"` - Retention int64 `json:"retention,omitempty" yaml:"retention,omitempty"` - S3BackupConfig *S3BackupConfig `json:"s3BackupConfig,omitempty" yaml:"s3BackupConfig,omitempty"` - SafeTimestamp bool `json:"safeTimestamp,omitempty" yaml:"safeTimestamp,omitempty"` - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_bastion_host.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_bastion_host.go deleted file mode 100644 index ac24e24f5d8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_bastion_host.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - BastionHostType = "bastionHost" - BastionHostFieldAddress = "address" - BastionHostFieldIgnoreProxyEnvVars = "ignoreProxyEnvVars" - BastionHostFieldPort = "port" - BastionHostFieldSSHAgentAuth = "sshAgentAuth" - BastionHostFieldSSHCert = "sshCert" - BastionHostFieldSSHCertPath = "sshCertPath" - BastionHostFieldSSHKey = "sshKey" - BastionHostFieldSSHKeyPath = "sshKeyPath" - BastionHostFieldUser = "user" -) - -type BastionHost struct { - Address string `json:"address,omitempty" yaml:"address,omitempty"` - IgnoreProxyEnvVars bool `json:"ignoreProxyEnvVars,omitempty" yaml:"ignoreProxyEnvVars,omitempty"` - Port string `json:"port,omitempty" yaml:"port,omitempty"` - SSHAgentAuth bool `json:"sshAgentAuth,omitempty" yaml:"sshAgentAuth,omitempty"` - SSHCert string `json:"sshCert,omitempty" yaml:"sshCert,omitempty"` - SSHCertPath string `json:"sshCertPath,omitempty" yaml:"sshCertPath,omitempty"` - SSHKey string `json:"sshKey,omitempty" yaml:"sshKey,omitempty"` - SSHKeyPath string `json:"sshKeyPath,omitempty" yaml:"sshKeyPath,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_block_storage_openstack_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_block_storage_openstack_opts.go deleted file mode 100644 index b95bb36e1f8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_block_storage_openstack_opts.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - BlockStorageOpenstackOptsType = "blockStorageOpenstackOpts" - BlockStorageOpenstackOptsFieldBSVersion = "bs-version" - BlockStorageOpenstackOptsFieldIgnoreVolumeAZ = "ignore-volume-az" - BlockStorageOpenstackOptsFieldTrustDevicePath = "trust-device-path" -) - -type BlockStorageOpenstackOpts struct { - BSVersion string `json:"bs-version,omitempty" yaml:"bs-version,omitempty"` - IgnoreVolumeAZ bool `json:"ignore-volume-az,omitempty" yaml:"ignore-volume-az,omitempty"` - TrustDevicePath bool `json:"trust-device-path,omitempty" yaml:"trust-device-path,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_calico_network_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_calico_network_provider.go deleted file mode 100644 index 4bfc50b09db..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_calico_network_provider.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CalicoNetworkProviderType = "calicoNetworkProvider" - CalicoNetworkProviderFieldCloudProvider = "cloudProvider" -) - -type CalicoNetworkProvider struct { - CloudProvider string `json:"cloudProvider,omitempty" yaml:"cloudProvider,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_canal_network_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_canal_network_provider.go deleted file mode 100644 index e648a18cabe..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_canal_network_provider.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CanalNetworkProviderType = "canalNetworkProvider" - CanalNetworkProviderFieldIface = "iface" -) - -type CanalNetworkProvider struct { - Iface string `json:"iface,omitempty" yaml:"iface,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_capabilities.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_capabilities.go deleted file mode 100644 index 665e5b46e08..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_capabilities.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - CapabilitiesType = "capabilities" - CapabilitiesFieldIngressCapabilities = "ingressCapabilities" - CapabilitiesFieldLoadBalancerCapabilities = "loadBalancerCapabilities" - CapabilitiesFieldNodePoolScalingSupported = "nodePoolScalingSupported" - CapabilitiesFieldNodePortRange = "nodePortRange" - CapabilitiesFieldPspEnabled = "pspEnabled" - CapabilitiesFieldTaintSupport = "taintSupport" -) - -type Capabilities struct { - IngressCapabilities []IngressCapabilities `json:"ingressCapabilities,omitempty" yaml:"ingressCapabilities,omitempty"` - LoadBalancerCapabilities *LoadBalancerCapabilities `json:"loadBalancerCapabilities,omitempty" yaml:"loadBalancerCapabilities,omitempty"` - NodePoolScalingSupported bool `json:"nodePoolScalingSupported,omitempty" yaml:"nodePoolScalingSupported,omitempty"` - NodePortRange string `json:"nodePortRange,omitempty" yaml:"nodePortRange,omitempty"` - PspEnabled bool `json:"pspEnabled,omitempty" yaml:"pspEnabled,omitempty"` - TaintSupport *bool `json:"taintSupport,omitempty" yaml:"taintSupport,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog.go deleted file mode 100644 index 4d3233823d8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog.go +++ /dev/null @@ -1,164 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - CatalogType = "catalog" - CatalogFieldAnnotations = "annotations" - CatalogFieldBranch = "branch" - CatalogFieldCatalogSecrets = "catalogSecrets" - CatalogFieldCommit = "commit" - CatalogFieldConditions = "conditions" - CatalogFieldCreated = "created" - CatalogFieldCreatorID = "creatorId" - CatalogFieldCredentialSecret = "credentialSecret" - CatalogFieldDescription = "description" - CatalogFieldHelmVersion = "helmVersion" - CatalogFieldKind = "kind" - CatalogFieldLabels = "labels" - CatalogFieldLastRefreshTimestamp = "lastRefreshTimestamp" - CatalogFieldName = "name" - CatalogFieldOwnerReferences = "ownerReferences" - CatalogFieldPassword = "password" - CatalogFieldRemoved = "removed" - CatalogFieldState = "state" - CatalogFieldTransitioning = "transitioning" - CatalogFieldTransitioningMessage = "transitioningMessage" - CatalogFieldURL = "url" - CatalogFieldUUID = "uuid" - CatalogFieldUsername = "username" -) - -type Catalog struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type CatalogCollection struct { - types.Collection - Data []Catalog `json:"data,omitempty"` - client *CatalogClient -} - -type CatalogClient struct { - apiClient *Client -} - -type CatalogOperations interface { - List(opts *types.ListOpts) (*CatalogCollection, error) - ListAll(opts *types.ListOpts) (*CatalogCollection, error) - Create(opts *Catalog) (*Catalog, error) - Update(existing *Catalog, updates interface{}) (*Catalog, error) - Replace(existing *Catalog) (*Catalog, error) - ByID(id string) (*Catalog, error) - Delete(container *Catalog) error - - ActionRefresh(resource *Catalog) (*CatalogRefresh, error) - - CollectionActionRefresh(resource *CatalogCollection) (*CatalogRefresh, error) -} - -func newCatalogClient(apiClient *Client) *CatalogClient { - return &CatalogClient{ - apiClient: apiClient, - } -} - -func (c *CatalogClient) Create(container *Catalog) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoCreate(CatalogType, container, resp) - return resp, err -} - -func (c *CatalogClient) Update(existing *Catalog, updates interface{}) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoUpdate(CatalogType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogClient) Replace(obj *Catalog) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoReplace(CatalogType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *CatalogClient) List(opts *types.ListOpts) (*CatalogCollection, error) { - resp := &CatalogCollection{} - err := c.apiClient.Ops.DoList(CatalogType, opts, resp) - resp.client = c - return resp, err -} - -func (c *CatalogClient) ListAll(opts *types.ListOpts) (*CatalogCollection, error) { - resp := &CatalogCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *CatalogCollection) Next() (*CatalogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogClient) ByID(id string) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoByID(CatalogType, id, resp) - return resp, err -} - -func (c *CatalogClient) Delete(container *Catalog) error { - return c.apiClient.Ops.DoResourceDelete(CatalogType, &container.Resource) -} - -func (c *CatalogClient) ActionRefresh(resource *Catalog) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoAction(CatalogType, "refresh", &resource.Resource, nil, resp) - return resp, err -} - -func (c *CatalogClient) CollectionActionRefresh(resource *CatalogCollection) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoCollectionAction(CatalogType, "refresh", &resource.Collection, nil, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_condition.go deleted file mode 100644 index 0aba7f4ea00..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - CatalogConditionType = "catalogCondition" - CatalogConditionFieldLastTransitionTime = "lastTransitionTime" - CatalogConditionFieldLastUpdateTime = "lastUpdateTime" - CatalogConditionFieldMessage = "message" - CatalogConditionFieldReason = "reason" - CatalogConditionFieldStatus = "status" - CatalogConditionFieldType = "type" -) - -type CatalogCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_refresh.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_refresh.go deleted file mode 100644 index b2f825f7107..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_refresh.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CatalogRefreshType = "catalogRefresh" - CatalogRefreshFieldCatalogs = "catalogs" -) - -type CatalogRefresh struct { - Catalogs []string `json:"catalogs,omitempty" yaml:"catalogs,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_secrets.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_secrets.go deleted file mode 100644 index d89c146f839..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_secrets.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CatalogSecretsType = "catalogSecrets" - CatalogSecretsFieldCredentialSecret = "credentialSecret" -) - -type CatalogSecrets struct { - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_spec.go deleted file mode 100644 index 0eb5c87d010..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_spec.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - CatalogSpecType = "catalogSpec" - CatalogSpecFieldBranch = "branch" - CatalogSpecFieldCatalogKind = "catalogKind" - CatalogSpecFieldCatalogSecrets = "catalogSecrets" - CatalogSpecFieldDescription = "description" - CatalogSpecFieldHelmVersion = "helmVersion" - CatalogSpecFieldPassword = "password" - CatalogSpecFieldURL = "url" - CatalogSpecFieldUsername = "username" -) - -type CatalogSpec struct { - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogKind string `json:"catalogKind,omitempty" yaml:"catalogKind,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_status.go deleted file mode 100644 index 624f1434bb7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_status.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - CatalogStatusType = "catalogStatus" - CatalogStatusFieldCommit = "commit" - CatalogStatusFieldConditions = "conditions" - CatalogStatusFieldCredentialSecret = "credentialSecret" - CatalogStatusFieldHelmVersionCommits = "helmVersionCommits" - CatalogStatusFieldLastRefreshTimestamp = "lastRefreshTimestamp" -) - -type CatalogStatus struct { - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - HelmVersionCommits map[string]VersionCommits `json:"helmVersionCommits,omitempty" yaml:"helmVersionCommits,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template.go deleted file mode 100644 index bc609f8a5d6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template.go +++ /dev/null @@ -1,166 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - CatalogTemplateType = "catalogTemplate" - CatalogTemplateFieldAnnotations = "annotations" - CatalogTemplateFieldCatalogID = "catalogId" - CatalogTemplateFieldCategories = "categories" - CatalogTemplateFieldCategory = "category" - CatalogTemplateFieldClusterCatalogID = "clusterCatalogId" - CatalogTemplateFieldClusterID = "clusterId" - CatalogTemplateFieldCreated = "created" - CatalogTemplateFieldCreatorID = "creatorId" - CatalogTemplateFieldDefaultTemplateVersionID = "defaultTemplateVersionId" - CatalogTemplateFieldDefaultVersion = "defaultVersion" - CatalogTemplateFieldDescription = "description" - CatalogTemplateFieldFolderName = "folderName" - CatalogTemplateFieldIcon = "icon" - CatalogTemplateFieldIconFilename = "iconFilename" - CatalogTemplateFieldLabels = "labels" - CatalogTemplateFieldMaintainer = "maintainer" - CatalogTemplateFieldName = "name" - CatalogTemplateFieldOwnerReferences = "ownerReferences" - CatalogTemplateFieldPath = "path" - CatalogTemplateFieldProjectCatalogID = "projectCatalogId" - CatalogTemplateFieldProjectID = "projectId" - CatalogTemplateFieldProjectURL = "projectURL" - CatalogTemplateFieldReadme = "readme" - CatalogTemplateFieldRemoved = "removed" - CatalogTemplateFieldState = "state" - CatalogTemplateFieldStatus = "status" - CatalogTemplateFieldTransitioning = "transitioning" - CatalogTemplateFieldTransitioningMessage = "transitioningMessage" - CatalogTemplateFieldUUID = "uuid" - CatalogTemplateFieldUpgradeFrom = "upgradeFrom" - CatalogTemplateFieldVersionLinks = "versionLinks" - CatalogTemplateFieldVersions = "versions" -) - -type CatalogTemplate struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - CatalogID string `json:"catalogId,omitempty" yaml:"catalogId,omitempty"` - Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` - Category string `json:"category,omitempty" yaml:"category,omitempty"` - ClusterCatalogID string `json:"clusterCatalogId,omitempty" yaml:"clusterCatalogId,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DefaultTemplateVersionID string `json:"defaultTemplateVersionId,omitempty" yaml:"defaultTemplateVersionId,omitempty"` - DefaultVersion string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - FolderName string `json:"folderName,omitempty" yaml:"folderName,omitempty"` - Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` - IconFilename string `json:"iconFilename,omitempty" yaml:"iconFilename,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Maintainer string `json:"maintainer,omitempty" yaml:"maintainer,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ProjectCatalogID string `json:"projectCatalogId,omitempty" yaml:"projectCatalogId,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - ProjectURL string `json:"projectURL,omitempty" yaml:"projectURL,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgradeFrom,omitempty"` - VersionLinks map[string]string `json:"versionLinks,omitempty" yaml:"versionLinks,omitempty"` - Versions []TemplateVersionSpec `json:"versions,omitempty" yaml:"versions,omitempty"` -} - -type CatalogTemplateCollection struct { - types.Collection - Data []CatalogTemplate `json:"data,omitempty"` - client *CatalogTemplateClient -} - -type CatalogTemplateClient struct { - apiClient *Client -} - -type CatalogTemplateOperations interface { - List(opts *types.ListOpts) (*CatalogTemplateCollection, error) - ListAll(opts *types.ListOpts) (*CatalogTemplateCollection, error) - Create(opts *CatalogTemplate) (*CatalogTemplate, error) - Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) - Replace(existing *CatalogTemplate) (*CatalogTemplate, error) - ByID(id string) (*CatalogTemplate, error) - Delete(container *CatalogTemplate) error -} - -func newCatalogTemplateClient(apiClient *Client) *CatalogTemplateClient { - return &CatalogTemplateClient{ - apiClient: apiClient, - } -} - -func (c *CatalogTemplateClient) Create(container *CatalogTemplate) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoCreate(CatalogTemplateType, container, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoUpdate(CatalogTemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Replace(obj *CatalogTemplate) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoReplace(CatalogTemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *CatalogTemplateClient) List(opts *types.ListOpts) (*CatalogTemplateCollection, error) { - resp := &CatalogTemplateCollection{} - err := c.apiClient.Ops.DoList(CatalogTemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *CatalogTemplateClient) ListAll(opts *types.ListOpts) (*CatalogTemplateCollection, error) { - resp := &CatalogTemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *CatalogTemplateCollection) Next() (*CatalogTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogTemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogTemplateClient) ByID(id string) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoByID(CatalogTemplateType, id, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Delete(container *CatalogTemplate) error { - return c.apiClient.Ops.DoResourceDelete(CatalogTemplateType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template_version.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template_version.go deleted file mode 100644 index 520ed186466..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_catalog_template_version.go +++ /dev/null @@ -1,158 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - CatalogTemplateVersionType = "catalogTemplateVersion" - CatalogTemplateVersionFieldAnnotations = "annotations" - CatalogTemplateVersionFieldAppReadme = "appReadme" - CatalogTemplateVersionFieldCreated = "created" - CatalogTemplateVersionFieldCreatorID = "creatorId" - CatalogTemplateVersionFieldDigest = "digest" - CatalogTemplateVersionFieldExternalID = "externalId" - CatalogTemplateVersionFieldFiles = "files" - CatalogTemplateVersionFieldKubeVersion = "kubeVersion" - CatalogTemplateVersionFieldLabels = "labels" - CatalogTemplateVersionFieldName = "name" - CatalogTemplateVersionFieldOwnerReferences = "ownerReferences" - CatalogTemplateVersionFieldQuestions = "questions" - CatalogTemplateVersionFieldRancherMaxVersion = "rancherMaxVersion" - CatalogTemplateVersionFieldRancherMinVersion = "rancherMinVersion" - CatalogTemplateVersionFieldRancherVersion = "rancherVersion" - CatalogTemplateVersionFieldReadme = "readme" - CatalogTemplateVersionFieldRemoved = "removed" - CatalogTemplateVersionFieldRequiredNamespace = "requiredNamespace" - CatalogTemplateVersionFieldState = "state" - CatalogTemplateVersionFieldStatus = "status" - CatalogTemplateVersionFieldTransitioning = "transitioning" - CatalogTemplateVersionFieldTransitioningMessage = "transitioningMessage" - CatalogTemplateVersionFieldUUID = "uuid" - CatalogTemplateVersionFieldUpgradeVersionLinks = "upgradeVersionLinks" - CatalogTemplateVersionFieldVersion = "version" - CatalogTemplateVersionFieldVersionDir = "versionDir" - CatalogTemplateVersionFieldVersionName = "versionName" - CatalogTemplateVersionFieldVersionURLs = "versionUrls" -) - -type CatalogTemplateVersion struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AppReadme string `json:"appReadme,omitempty" yaml:"appReadme,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - Files map[string]string `json:"files,omitempty" yaml:"files,omitempty"` - KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - RancherMaxVersion string `json:"rancherMaxVersion,omitempty" yaml:"rancherMaxVersion,omitempty"` - RancherMinVersion string `json:"rancherMinVersion,omitempty" yaml:"rancherMinVersion,omitempty"` - RancherVersion string `json:"rancherVersion,omitempty" yaml:"rancherVersion,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RequiredNamespace string `json:"requiredNamespace,omitempty" yaml:"requiredNamespace,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateVersionStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty" yaml:"upgradeVersionLinks,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - VersionDir string `json:"versionDir,omitempty" yaml:"versionDir,omitempty"` - VersionName string `json:"versionName,omitempty" yaml:"versionName,omitempty"` - VersionURLs []string `json:"versionUrls,omitempty" yaml:"versionUrls,omitempty"` -} - -type CatalogTemplateVersionCollection struct { - types.Collection - Data []CatalogTemplateVersion `json:"data,omitempty"` - client *CatalogTemplateVersionClient -} - -type CatalogTemplateVersionClient struct { - apiClient *Client -} - -type CatalogTemplateVersionOperations interface { - List(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) - ListAll(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) - Create(opts *CatalogTemplateVersion) (*CatalogTemplateVersion, error) - Update(existing *CatalogTemplateVersion, updates interface{}) (*CatalogTemplateVersion, error) - Replace(existing *CatalogTemplateVersion) (*CatalogTemplateVersion, error) - ByID(id string) (*CatalogTemplateVersion, error) - Delete(container *CatalogTemplateVersion) error -} - -func newCatalogTemplateVersionClient(apiClient *Client) *CatalogTemplateVersionClient { - return &CatalogTemplateVersionClient{ - apiClient: apiClient, - } -} - -func (c *CatalogTemplateVersionClient) Create(container *CatalogTemplateVersion) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoCreate(CatalogTemplateVersionType, container, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) Update(existing *CatalogTemplateVersion, updates interface{}) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoUpdate(CatalogTemplateVersionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) Replace(obj *CatalogTemplateVersion) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoReplace(CatalogTemplateVersionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) List(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) { - resp := &CatalogTemplateVersionCollection{} - err := c.apiClient.Ops.DoList(CatalogTemplateVersionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *CatalogTemplateVersionClient) ListAll(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) { - resp := &CatalogTemplateVersionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *CatalogTemplateVersionCollection) Next() (*CatalogTemplateVersionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogTemplateVersionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogTemplateVersionClient) ByID(id string) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoByID(CatalogTemplateVersionType, id, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) Delete(container *CatalogTemplateVersion) error { - return c.apiClient.Ops.DoResourceDelete(CatalogTemplateVersionType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ceph_fsvolume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ceph_fsvolume_source.go deleted file mode 100644 index 363ba5eb09a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ceph_fsvolume_source.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - CephFSVolumeSourceType = "cephFSVolumeSource" - CephFSVolumeSourceFieldMonitors = "monitors" - CephFSVolumeSourceFieldPath = "path" - CephFSVolumeSourceFieldReadOnly = "readOnly" - CephFSVolumeSourceFieldSecretFile = "secretFile" - CephFSVolumeSourceFieldSecretRef = "secretRef" - CephFSVolumeSourceFieldUser = "user" -) - -type CephFSVolumeSource struct { - Monitors []string `json:"monitors,omitempty" yaml:"monitors,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SecretFile string `json:"secretFile,omitempty" yaml:"secretFile,omitempty"` - SecretRef *LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cert_expiration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cert_expiration.go deleted file mode 100644 index 0b05b4652a6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cert_expiration.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CertExpirationType = "certExpiration" - CertExpirationFieldExpirationDate = "expirationDate" -) - -type CertExpiration struct { - ExpirationDate string `json:"expirationDate,omitempty" yaml:"expirationDate,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_change_password_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_change_password_input.go deleted file mode 100644 index e3a12085f30..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_change_password_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ChangePasswordInputType = "changePasswordInput" - ChangePasswordInputFieldCurrentPassword = "currentPassword" - ChangePasswordInputFieldNewPassword = "newPassword" -) - -type ChangePasswordInput struct { - CurrentPassword string `json:"currentPassword,omitempty" yaml:"currentPassword,omitempty"` - NewPassword string `json:"newPassword,omitempty" yaml:"newPassword,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cinder_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cinder_volume_source.go deleted file mode 100644 index ac0a6211e93..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cinder_volume_source.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - CinderVolumeSourceType = "cinderVolumeSource" - CinderVolumeSourceFieldFSType = "fsType" - CinderVolumeSourceFieldReadOnly = "readOnly" - CinderVolumeSourceFieldSecretRef = "secretRef" - CinderVolumeSourceFieldVolumeID = "volumeID" -) - -type CinderVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SecretRef *LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` - VolumeID string `json:"volumeID,omitempty" yaml:"volumeID,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_client.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_client.go deleted file mode 100644 index aa96df7e1da..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_client.go +++ /dev/null @@ -1,150 +0,0 @@ -package client - -import ( - "github.com/rancher/rancher/tests/framework/pkg/clientbase" -) - -type Client struct { - clientbase.APIBaseClient - - NodePool NodePoolOperations - Node NodeOperations - NodeDriver NodeDriverOperations - NodeTemplate NodeTemplateOperations - Project ProjectOperations - GlobalRole GlobalRoleOperations - GlobalRoleBinding GlobalRoleBindingOperations - RoleTemplate RoleTemplateOperations - PodSecurityPolicyTemplate PodSecurityPolicyTemplateOperations - PodSecurityPolicyTemplateProjectBinding PodSecurityPolicyTemplateProjectBindingOperations - ClusterRoleTemplateBinding ClusterRoleTemplateBindingOperations - ProjectRoleTemplateBinding ProjectRoleTemplateBindingOperations - Cluster ClusterOperations - ClusterRegistrationToken ClusterRegistrationTokenOperations - Catalog CatalogOperations - Template TemplateOperations - CatalogTemplate CatalogTemplateOperations - CatalogTemplateVersion CatalogTemplateVersionOperations - TemplateVersion TemplateVersionOperations - TemplateContent TemplateContentOperations - Group GroupOperations - GroupMember GroupMemberOperations - SamlToken SamlTokenOperations - Principal PrincipalOperations - User UserOperations - AuthConfig AuthConfigOperations - LdapConfig LdapConfigOperations - Token TokenOperations - DynamicSchema DynamicSchemaOperations - Preference PreferenceOperations - ProjectNetworkPolicy ProjectNetworkPolicyOperations - ClusterLogging ClusterLoggingOperations - ProjectLogging ProjectLoggingOperations - Setting SettingOperations - Feature FeatureOperations - ClusterAlert ClusterAlertOperations - ProjectAlert ProjectAlertOperations - Notifier NotifierOperations - ClusterAlertGroup ClusterAlertGroupOperations - ProjectAlertGroup ProjectAlertGroupOperations - ClusterAlertRule ClusterAlertRuleOperations - ProjectAlertRule ProjectAlertRuleOperations - ComposeConfig ComposeConfigOperations - ProjectCatalog ProjectCatalogOperations - ClusterCatalog ClusterCatalogOperations - MultiClusterApp MultiClusterAppOperations - MultiClusterAppRevision MultiClusterAppRevisionOperations - GlobalDns GlobalDnsOperations - GlobalDnsProvider GlobalDnsProviderOperations - KontainerDriver KontainerDriverOperations - EtcdBackup EtcdBackupOperations - MonitorMetric MonitorMetricOperations - ClusterMonitorGraph ClusterMonitorGraphOperations - ProjectMonitorGraph ProjectMonitorGraphOperations - CloudCredential CloudCredentialOperations - ManagementSecret ManagementSecretOperations - ClusterTemplate ClusterTemplateOperations - ClusterTemplateRevision ClusterTemplateRevisionOperations - RkeK8sSystemImage RkeK8sSystemImageOperations - RkeK8sServiceOption RkeK8sServiceOptionOperations - RkeAddon RkeAddonOperations - FleetWorkspace FleetWorkspaceOperations - RancherUserNotification RancherUserNotificationOperations -} - -func NewClient(opts *clientbase.ClientOpts) (*Client, error) { - baseClient, err := clientbase.NewAPIClient(opts) - if err != nil { - return nil, err - } - - client := &Client{ - APIBaseClient: baseClient, - } - - client.NodePool = newNodePoolClient(client) - client.Node = newNodeClient(client) - client.NodeDriver = newNodeDriverClient(client) - client.NodeTemplate = newNodeTemplateClient(client) - client.Project = newProjectClient(client) - client.GlobalRole = newGlobalRoleClient(client) - client.GlobalRoleBinding = newGlobalRoleBindingClient(client) - client.RoleTemplate = newRoleTemplateClient(client) - client.PodSecurityPolicyTemplate = newPodSecurityPolicyTemplateClient(client) - client.PodSecurityPolicyTemplateProjectBinding = newPodSecurityPolicyTemplateProjectBindingClient(client) - client.ClusterRoleTemplateBinding = newClusterRoleTemplateBindingClient(client) - client.ProjectRoleTemplateBinding = newProjectRoleTemplateBindingClient(client) - client.Cluster = newClusterClient(client) - client.ClusterRegistrationToken = newClusterRegistrationTokenClient(client) - client.Catalog = newCatalogClient(client) - client.Template = newTemplateClient(client) - client.CatalogTemplate = newCatalogTemplateClient(client) - client.CatalogTemplateVersion = newCatalogTemplateVersionClient(client) - client.TemplateVersion = newTemplateVersionClient(client) - client.TemplateContent = newTemplateContentClient(client) - client.Group = newGroupClient(client) - client.GroupMember = newGroupMemberClient(client) - client.SamlToken = newSamlTokenClient(client) - client.Principal = newPrincipalClient(client) - client.User = newUserClient(client) - client.AuthConfig = newAuthConfigClient(client) - client.LdapConfig = newLdapConfigClient(client) - client.Token = newTokenClient(client) - client.DynamicSchema = newDynamicSchemaClient(client) - client.Preference = newPreferenceClient(client) - client.ProjectNetworkPolicy = newProjectNetworkPolicyClient(client) - client.ClusterLogging = newClusterLoggingClient(client) - client.ProjectLogging = newProjectLoggingClient(client) - client.Setting = newSettingClient(client) - client.Feature = newFeatureClient(client) - client.ClusterAlert = newClusterAlertClient(client) - client.ProjectAlert = newProjectAlertClient(client) - client.Notifier = newNotifierClient(client) - client.ClusterAlertGroup = newClusterAlertGroupClient(client) - client.ProjectAlertGroup = newProjectAlertGroupClient(client) - client.ClusterAlertRule = newClusterAlertRuleClient(client) - client.ProjectAlertRule = newProjectAlertRuleClient(client) - client.ComposeConfig = newComposeConfigClient(client) - client.ProjectCatalog = newProjectCatalogClient(client) - client.ClusterCatalog = newClusterCatalogClient(client) - client.MultiClusterApp = newMultiClusterAppClient(client) - client.MultiClusterAppRevision = newMultiClusterAppRevisionClient(client) - client.GlobalDns = newGlobalDnsClient(client) - client.GlobalDnsProvider = newGlobalDnsProviderClient(client) - client.KontainerDriver = newKontainerDriverClient(client) - client.EtcdBackup = newEtcdBackupClient(client) - client.MonitorMetric = newMonitorMetricClient(client) - client.ClusterMonitorGraph = newClusterMonitorGraphClient(client) - client.ProjectMonitorGraph = newProjectMonitorGraphClient(client) - client.CloudCredential = newCloudCredentialClient(client) - client.ManagementSecret = newManagementSecretClient(client) - client.ClusterTemplate = newClusterTemplateClient(client) - client.ClusterTemplateRevision = newClusterTemplateRevisionClient(client) - client.RkeK8sSystemImage = newRkeK8sSystemImageClient(client) - client.RkeK8sServiceOption = newRkeK8sServiceOptionClient(client) - client.RkeAddon = newRkeAddonClient(client) - client.FleetWorkspace = newFleetWorkspaceClient(client) - client.RancherUserNotification = newRancherUserNotificationClient(client) - - return client, nil -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential.go deleted file mode 100644 index 9381da31230..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential.go +++ /dev/null @@ -1,122 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - CloudCredentialType = "cloudCredential" - CloudCredentialFieldAnnotations = "annotations" - CloudCredentialFieldCreated = "created" - CloudCredentialFieldCreatorID = "creatorId" - CloudCredentialFieldDescription = "description" - CloudCredentialFieldLabels = "labels" - CloudCredentialFieldName = "name" - CloudCredentialFieldOwnerReferences = "ownerReferences" - CloudCredentialFieldRemoved = "removed" - CloudCredentialFieldS3CredentialConfig = "s3credentialConfig" - CloudCredentialFieldUUID = "uuid" -) - -type CloudCredential struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - S3CredentialConfig *S3CredentialConfig `json:"s3credentialConfig,omitempty" yaml:"s3credentialConfig,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type CloudCredentialCollection struct { - types.Collection - Data []CloudCredential `json:"data,omitempty"` - client *CloudCredentialClient -} - -type CloudCredentialClient struct { - apiClient *Client -} - -type CloudCredentialOperations interface { - List(opts *types.ListOpts) (*CloudCredentialCollection, error) - ListAll(opts *types.ListOpts) (*CloudCredentialCollection, error) - Create(opts *CloudCredential) (*CloudCredential, error) - Update(existing *CloudCredential, updates interface{}) (*CloudCredential, error) - Replace(existing *CloudCredential) (*CloudCredential, error) - ByID(id string) (*CloudCredential, error) - Delete(container *CloudCredential) error -} - -func newCloudCredentialClient(apiClient *Client) *CloudCredentialClient { - return &CloudCredentialClient{ - apiClient: apiClient, - } -} - -func (c *CloudCredentialClient) Create(container *CloudCredential) (*CloudCredential, error) { - resp := &CloudCredential{} - err := c.apiClient.Ops.DoCreate(CloudCredentialType, container, resp) - return resp, err -} - -func (c *CloudCredentialClient) Update(existing *CloudCredential, updates interface{}) (*CloudCredential, error) { - resp := &CloudCredential{} - err := c.apiClient.Ops.DoUpdate(CloudCredentialType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CloudCredentialClient) Replace(obj *CloudCredential) (*CloudCredential, error) { - resp := &CloudCredential{} - err := c.apiClient.Ops.DoReplace(CloudCredentialType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *CloudCredentialClient) List(opts *types.ListOpts) (*CloudCredentialCollection, error) { - resp := &CloudCredentialCollection{} - err := c.apiClient.Ops.DoList(CloudCredentialType, opts, resp) - resp.client = c - return resp, err -} - -func (c *CloudCredentialClient) ListAll(opts *types.ListOpts) (*CloudCredentialCollection, error) { - resp := &CloudCredentialCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *CloudCredentialCollection) Next() (*CloudCredentialCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CloudCredentialCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CloudCredentialClient) ByID(id string) (*CloudCredential, error) { - resp := &CloudCredential{} - err := c.apiClient.Ops.DoByID(CloudCredentialType, id, resp) - return resp, err -} - -func (c *CloudCredentialClient) Delete(container *CloudCredential) error { - return c.apiClient.Ops.DoResourceDelete(CloudCredentialType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential_spec.go deleted file mode 100644 index c726919801d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_credential_spec.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - CloudCredentialSpecType = "cloudCredentialSpec" - CloudCredentialSpecFieldDescription = "description" - CloudCredentialSpecFieldDisplayName = "displayName" - CloudCredentialSpecFieldS3CredentialConfig = "s3credentialConfig" -) - -type CloudCredentialSpec struct { - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - S3CredentialConfig *S3CredentialConfig `json:"s3credentialConfig,omitempty" yaml:"s3credentialConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_provider.go deleted file mode 100644 index 6300e6fc37e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloud_provider.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - CloudProviderType = "cloudProvider" - CloudProviderFieldAWSCloudProvider = "awsCloudProvider" - CloudProviderFieldAzureCloudProvider = "azureCloudProvider" - CloudProviderFieldCustomCloudProvider = "customCloudProvider" - CloudProviderFieldHarvesterCloudProvider = "harvesterCloudProvider" - CloudProviderFieldName = "name" - CloudProviderFieldOpenstackCloudProvider = "openstackCloudProvider" - CloudProviderFieldUseInstanceMetadataHostname = "useInstanceMetadataHostname" - CloudProviderFieldVsphereCloudProvider = "vsphereCloudProvider" -) - -type CloudProvider struct { - AWSCloudProvider *AWSCloudProvider `json:"awsCloudProvider,omitempty" yaml:"awsCloudProvider,omitempty"` - AzureCloudProvider *AzureCloudProvider `json:"azureCloudProvider,omitempty" yaml:"azureCloudProvider,omitempty"` - CustomCloudProvider string `json:"customCloudProvider,omitempty" yaml:"customCloudProvider,omitempty"` - HarvesterCloudProvider *HarvesterCloudProvider `json:"harvesterCloudProvider,omitempty" yaml:"harvesterCloudProvider,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OpenstackCloudProvider *OpenstackCloudProvider `json:"openstackCloudProvider,omitempty" yaml:"openstackCloudProvider,omitempty"` - UseInstanceMetadataHostname *bool `json:"useInstanceMetadataHostname,omitempty" yaml:"useInstanceMetadataHostname,omitempty"` - VsphereCloudProvider *VsphereCloudProvider `json:"vsphereCloudProvider,omitempty" yaml:"vsphereCloudProvider,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloudflare_provider_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloudflare_provider_config.go deleted file mode 100644 index 98ed97243ee..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cloudflare_provider_config.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - CloudflareProviderConfigType = "cloudflareProviderConfig" - CloudflareProviderConfigFieldAPIEmail = "apiEmail" - CloudflareProviderConfigFieldAPIKey = "apiKey" - CloudflareProviderConfigFieldAdditionalOptions = "additionalOptions" - CloudflareProviderConfigFieldProxySetting = "proxySetting" -) - -type CloudflareProviderConfig struct { - APIEmail string `json:"apiEmail,omitempty" yaml:"apiEmail,omitempty"` - APIKey string `json:"apiKey,omitempty" yaml:"apiKey,omitempty"` - AdditionalOptions map[string]string `json:"additionalOptions,omitempty" yaml:"additionalOptions,omitempty"` - ProxySetting *bool `json:"proxySetting,omitempty" yaml:"proxySetting,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster.go deleted file mode 100644 index 5ee016d8a89..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster.go +++ /dev/null @@ -1,357 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterType = "cluster" - ClusterFieldAADClientCertSecret = "aadClientCertSecret" - ClusterFieldAADClientSecret = "aadClientSecret" - ClusterFieldAKSConfig = "aksConfig" - ClusterFieldAKSStatus = "aksStatus" - ClusterFieldAPIEndpoint = "apiEndpoint" - ClusterFieldAgentEnvVars = "agentEnvVars" - ClusterFieldAgentFeatures = "agentFeatures" - ClusterFieldAgentImage = "agentImage" - ClusterFieldAgentImageOverride = "agentImageOverride" - ClusterFieldAllocatable = "allocatable" - ClusterFieldAnnotations = "annotations" - ClusterFieldAppliedAgentEnvVars = "appliedAgentEnvVars" - ClusterFieldAppliedClusterAgentDeploymentCustomization = "appliedClusterAgentDeploymentCustomization" - ClusterFieldAppliedEnableNetworkPolicy = "appliedEnableNetworkPolicy" - ClusterFieldAppliedPodSecurityPolicyTemplateName = "appliedPodSecurityPolicyTemplateId" - ClusterFieldAppliedSpec = "appliedSpec" - ClusterFieldAuthImage = "authImage" - ClusterFieldCACert = "caCert" - ClusterFieldCapabilities = "capabilities" - ClusterFieldCapacity = "capacity" - ClusterFieldCertificatesExpiration = "certificatesExpiration" - ClusterFieldClusterAgentDeploymentCustomization = "clusterAgentDeploymentCustomization" - ClusterFieldClusterSecrets = "clusterSecrets" - ClusterFieldClusterTemplateAnswers = "answers" - ClusterFieldClusterTemplateID = "clusterTemplateId" - ClusterFieldClusterTemplateQuestions = "questions" - ClusterFieldClusterTemplateRevisionID = "clusterTemplateRevisionId" - ClusterFieldComponentStatuses = "componentStatuses" - ClusterFieldConditions = "conditions" - ClusterFieldCreated = "created" - ClusterFieldCreatorID = "creatorId" - ClusterFieldCurrentCisRunName = "currentCisRunName" - ClusterFieldDefaultClusterRoleForProjectMembers = "defaultClusterRoleForProjectMembers" - ClusterFieldDefaultPodSecurityAdmissionConfigurationTemplateName = "defaultPodSecurityAdmissionConfigurationTemplateName" - ClusterFieldDefaultPodSecurityPolicyTemplateID = "defaultPodSecurityPolicyTemplateId" - ClusterFieldDescription = "description" - ClusterFieldDesiredAgentImage = "desiredAgentImage" - ClusterFieldDesiredAuthImage = "desiredAuthImage" - ClusterFieldDockerRootDir = "dockerRootDir" - ClusterFieldDriver = "driver" - ClusterFieldEKSConfig = "eksConfig" - ClusterFieldEKSStatus = "eksStatus" - ClusterFieldEnableClusterAlerting = "enableClusterAlerting" - ClusterFieldEnableClusterMonitoring = "enableClusterMonitoring" - ClusterFieldEnableNetworkPolicy = "enableNetworkPolicy" - ClusterFieldFailedSpec = "failedSpec" - ClusterFieldFleetAgentDeploymentCustomization = "fleetAgentDeploymentCustomization" - ClusterFieldFleetWorkspaceName = "fleetWorkspaceName" - ClusterFieldGKEConfig = "gkeConfig" - ClusterFieldGKEStatus = "gkeStatus" - ClusterFieldImportedConfig = "importedConfig" - ClusterFieldInternal = "internal" - ClusterFieldIstioEnabled = "istioEnabled" - ClusterFieldK3sConfig = "k3sConfig" - ClusterFieldLabels = "labels" - ClusterFieldLimits = "limits" - ClusterFieldLinuxWorkerCount = "linuxWorkerCount" - ClusterFieldLocalClusterAuthEndpoint = "localClusterAuthEndpoint" - ClusterFieldMonitoringStatus = "monitoringStatus" - ClusterFieldName = "name" - ClusterFieldNodeCount = "nodeCount" - ClusterFieldNodeVersion = "nodeVersion" - ClusterFieldOpenStackSecret = "openStackSecret" - ClusterFieldOwnerReferences = "ownerReferences" - ClusterFieldPrivateRegistrySecret = "privateRegistrySecret" - ClusterFieldProvider = "provider" - ClusterFieldRancherKubernetesEngineConfig = "rancherKubernetesEngineConfig" - ClusterFieldRemoved = "removed" - ClusterFieldRequested = "requested" - ClusterFieldRke2Config = "rke2Config" - ClusterFieldS3CredentialSecret = "s3CredentialSecret" - ClusterFieldServiceAccountTokenSecret = "serviceAccountTokenSecret" - ClusterFieldState = "state" - ClusterFieldTransitioning = "transitioning" - ClusterFieldTransitioningMessage = "transitioningMessage" - ClusterFieldUUID = "uuid" - ClusterFieldVersion = "version" - ClusterFieldVirtualCenterSecret = "virtualCenterSecret" - ClusterFieldVsphereSecret = "vsphereSecret" - ClusterFieldWeavePasswordSecret = "weavePasswordSecret" - ClusterFieldWindowsPreferedCluster = "windowsPreferedCluster" - ClusterFieldWindowsWorkerCount = "windowsWorkerCount" -) - -type Cluster struct { - types.Resource - AADClientCertSecret string `json:"aadClientCertSecret,omitempty" yaml:"aadClientCertSecret,omitempty"` - AADClientSecret string `json:"aadClientSecret,omitempty" yaml:"aadClientSecret,omitempty"` - AKSConfig *AKSClusterConfigSpec `json:"aksConfig,omitempty" yaml:"aksConfig,omitempty"` - AKSStatus *AKSStatus `json:"aksStatus,omitempty" yaml:"aksStatus,omitempty"` - APIEndpoint string `json:"apiEndpoint,omitempty" yaml:"apiEndpoint,omitempty"` - AgentEnvVars []EnvVar `json:"agentEnvVars,omitempty" yaml:"agentEnvVars,omitempty"` - AgentFeatures map[string]bool `json:"agentFeatures,omitempty" yaml:"agentFeatures,omitempty"` - AgentImage string `json:"agentImage,omitempty" yaml:"agentImage,omitempty"` - AgentImageOverride string `json:"agentImageOverride,omitempty" yaml:"agentImageOverride,omitempty"` - Allocatable map[string]string `json:"allocatable,omitempty" yaml:"allocatable,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AppliedAgentEnvVars []EnvVar `json:"appliedAgentEnvVars,omitempty" yaml:"appliedAgentEnvVars,omitempty"` - AppliedClusterAgentDeploymentCustomization *AgentDeploymentCustomization `json:"appliedClusterAgentDeploymentCustomization,omitempty" yaml:"appliedClusterAgentDeploymentCustomization,omitempty"` - AppliedEnableNetworkPolicy bool `json:"appliedEnableNetworkPolicy,omitempty" yaml:"appliedEnableNetworkPolicy,omitempty"` - AppliedPodSecurityPolicyTemplateName string `json:"appliedPodSecurityPolicyTemplateId,omitempty" yaml:"appliedPodSecurityPolicyTemplateId,omitempty"` - AppliedSpec *ClusterSpec `json:"appliedSpec,omitempty" yaml:"appliedSpec,omitempty"` - AuthImage string `json:"authImage,omitempty" yaml:"authImage,omitempty"` - CACert string `json:"caCert,omitempty" yaml:"caCert,omitempty"` - Capabilities *Capabilities `json:"capabilities,omitempty" yaml:"capabilities,omitempty"` - Capacity map[string]string `json:"capacity,omitempty" yaml:"capacity,omitempty"` - CertificatesExpiration map[string]CertExpiration `json:"certificatesExpiration,omitempty" yaml:"certificatesExpiration,omitempty"` - ClusterAgentDeploymentCustomization *AgentDeploymentCustomization `json:"clusterAgentDeploymentCustomization,omitempty" yaml:"clusterAgentDeploymentCustomization,omitempty"` - ClusterSecrets *ClusterSecrets `json:"clusterSecrets,omitempty" yaml:"clusterSecrets,omitempty"` - ClusterTemplateAnswers *Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - ClusterTemplateID string `json:"clusterTemplateId,omitempty" yaml:"clusterTemplateId,omitempty"` - ClusterTemplateQuestions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - ClusterTemplateRevisionID string `json:"clusterTemplateRevisionId,omitempty" yaml:"clusterTemplateRevisionId,omitempty"` - ComponentStatuses []ClusterComponentStatus `json:"componentStatuses,omitempty" yaml:"componentStatuses,omitempty"` - Conditions []ClusterCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CurrentCisRunName string `json:"currentCisRunName,omitempty" yaml:"currentCisRunName,omitempty"` - DefaultClusterRoleForProjectMembers string `json:"defaultClusterRoleForProjectMembers,omitempty" yaml:"defaultClusterRoleForProjectMembers,omitempty"` - DefaultPodSecurityAdmissionConfigurationTemplateName string `json:"defaultPodSecurityAdmissionConfigurationTemplateName,omitempty" yaml:"defaultPodSecurityAdmissionConfigurationTemplateName,omitempty"` - DefaultPodSecurityPolicyTemplateID string `json:"defaultPodSecurityPolicyTemplateId,omitempty" yaml:"defaultPodSecurityPolicyTemplateId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DesiredAgentImage string `json:"desiredAgentImage,omitempty" yaml:"desiredAgentImage,omitempty"` - DesiredAuthImage string `json:"desiredAuthImage,omitempty" yaml:"desiredAuthImage,omitempty"` - DockerRootDir string `json:"dockerRootDir,omitempty" yaml:"dockerRootDir,omitempty"` - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - EKSConfig *EKSClusterConfigSpec `json:"eksConfig,omitempty" yaml:"eksConfig,omitempty"` - EKSStatus *EKSStatus `json:"eksStatus,omitempty" yaml:"eksStatus,omitempty"` - EnableClusterAlerting bool `json:"enableClusterAlerting,omitempty" yaml:"enableClusterAlerting,omitempty"` - EnableClusterMonitoring bool `json:"enableClusterMonitoring,omitempty" yaml:"enableClusterMonitoring,omitempty"` - EnableNetworkPolicy *bool `json:"enableNetworkPolicy,omitempty" yaml:"enableNetworkPolicy,omitempty"` - FailedSpec *ClusterSpec `json:"failedSpec,omitempty" yaml:"failedSpec,omitempty"` - FleetAgentDeploymentCustomization *AgentDeploymentCustomization `json:"fleetAgentDeploymentCustomization,omitempty" yaml:"fleetAgentDeploymentCustomization,omitempty"` - FleetWorkspaceName string `json:"fleetWorkspaceName,omitempty" yaml:"fleetWorkspaceName,omitempty"` - GKEConfig *GKEClusterConfigSpec `json:"gkeConfig,omitempty" yaml:"gkeConfig,omitempty"` - GKEStatus *GKEStatus `json:"gkeStatus,omitempty" yaml:"gkeStatus,omitempty"` - ImportedConfig *ImportedConfig `json:"importedConfig,omitempty" yaml:"importedConfig,omitempty"` - Internal bool `json:"internal,omitempty" yaml:"internal,omitempty"` - IstioEnabled bool `json:"istioEnabled,omitempty" yaml:"istioEnabled,omitempty"` - K3sConfig *K3sConfig `json:"k3sConfig,omitempty" yaml:"k3sConfig,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Limits map[string]string `json:"limits,omitempty" yaml:"limits,omitempty"` - LinuxWorkerCount int64 `json:"linuxWorkerCount,omitempty" yaml:"linuxWorkerCount,omitempty"` - LocalClusterAuthEndpoint *LocalClusterAuthEndpoint `json:"localClusterAuthEndpoint,omitempty" yaml:"localClusterAuthEndpoint,omitempty"` - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty" yaml:"monitoringStatus,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NodeCount int64 `json:"nodeCount,omitempty" yaml:"nodeCount,omitempty"` - NodeVersion int64 `json:"nodeVersion,omitempty" yaml:"nodeVersion,omitempty"` - OpenStackSecret string `json:"openStackSecret,omitempty" yaml:"openStackSecret,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PrivateRegistrySecret string `json:"privateRegistrySecret,omitempty" yaml:"privateRegistrySecret,omitempty"` - Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` - RancherKubernetesEngineConfig *RancherKubernetesEngineConfig `json:"rancherKubernetesEngineConfig,omitempty" yaml:"rancherKubernetesEngineConfig,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Requested map[string]string `json:"requested,omitempty" yaml:"requested,omitempty"` - Rke2Config *Rke2Config `json:"rke2Config,omitempty" yaml:"rke2Config,omitempty"` - S3CredentialSecret string `json:"s3CredentialSecret,omitempty" yaml:"s3CredentialSecret,omitempty"` - ServiceAccountTokenSecret string `json:"serviceAccountTokenSecret,omitempty" yaml:"serviceAccountTokenSecret,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Version *Info `json:"version,omitempty" yaml:"version,omitempty"` - VirtualCenterSecret string `json:"virtualCenterSecret,omitempty" yaml:"virtualCenterSecret,omitempty"` - VsphereSecret string `json:"vsphereSecret,omitempty" yaml:"vsphereSecret,omitempty"` - WeavePasswordSecret string `json:"weavePasswordSecret,omitempty" yaml:"weavePasswordSecret,omitempty"` - WindowsPreferedCluster bool `json:"windowsPreferedCluster,omitempty" yaml:"windowsPreferedCluster,omitempty"` - WindowsWorkerCount int64 `json:"windowsWorkerCount,omitempty" yaml:"windowsWorkerCount,omitempty"` -} - -type ClusterCollection struct { - types.Collection - Data []Cluster `json:"data,omitempty"` - client *ClusterClient -} - -type ClusterClient struct { - apiClient *Client -} - -type ClusterOperations interface { - List(opts *types.ListOpts) (*ClusterCollection, error) - ListAll(opts *types.ListOpts) (*ClusterCollection, error) - Create(opts *Cluster) (*Cluster, error) - Update(existing *Cluster, updates interface{}) (*Cluster, error) - Replace(existing *Cluster) (*Cluster, error) - ByID(id string) (*Cluster, error) - Delete(container *Cluster) error - - ActionBackupEtcd(resource *Cluster) error - - ActionDisableMonitoring(resource *Cluster) error - - ActionEditMonitoring(resource *Cluster, input *MonitoringInput) error - - ActionEnableMonitoring(resource *Cluster, input *MonitoringInput) error - - ActionExportYaml(resource *Cluster) (*ExportOutput, error) - - ActionGenerateKubeconfig(resource *Cluster) (*GenerateKubeConfigOutput, error) - - ActionImportYaml(resource *Cluster, input *ImportClusterYamlInput) (*ImportYamlOutput, error) - - ActionRestoreFromEtcdBackup(resource *Cluster, input *RestoreFromEtcdBackupInput) error - - ActionRotateCertificates(resource *Cluster, input *RotateCertificateInput) (*RotateCertificateOutput, error) - - ActionRotateEncryptionKey(resource *Cluster) (*RotateEncryptionKeyOutput, error) - - ActionSaveAsTemplate(resource *Cluster, input *SaveAsTemplateInput) (*SaveAsTemplateOutput, error) - - ActionViewMonitoring(resource *Cluster) (*MonitoringOutput, error) -} - -func newClusterClient(apiClient *Client) *ClusterClient { - return &ClusterClient{ - apiClient: apiClient, - } -} - -func (c *ClusterClient) Create(container *Cluster) (*Cluster, error) { - resp := &Cluster{} - err := c.apiClient.Ops.DoCreate(ClusterType, container, resp) - return resp, err -} - -func (c *ClusterClient) Update(existing *Cluster, updates interface{}) (*Cluster, error) { - resp := &Cluster{} - err := c.apiClient.Ops.DoUpdate(ClusterType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterClient) Replace(obj *Cluster) (*Cluster, error) { - resp := &Cluster{} - err := c.apiClient.Ops.DoReplace(ClusterType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterClient) List(opts *types.ListOpts) (*ClusterCollection, error) { - resp := &ClusterCollection{} - err := c.apiClient.Ops.DoList(ClusterType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterClient) ListAll(opts *types.ListOpts) (*ClusterCollection, error) { - resp := &ClusterCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterCollection) Next() (*ClusterCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterClient) ByID(id string) (*Cluster, error) { - resp := &Cluster{} - err := c.apiClient.Ops.DoByID(ClusterType, id, resp) - return resp, err -} - -func (c *ClusterClient) Delete(container *Cluster) error { - return c.apiClient.Ops.DoResourceDelete(ClusterType, &container.Resource) -} - -func (c *ClusterClient) ActionBackupEtcd(resource *Cluster) error { - err := c.apiClient.Ops.DoAction(ClusterType, "backupEtcd", &resource.Resource, nil, nil) - return err -} - -func (c *ClusterClient) ActionDisableMonitoring(resource *Cluster) error { - err := c.apiClient.Ops.DoAction(ClusterType, "disableMonitoring", &resource.Resource, nil, nil) - return err -} - -func (c *ClusterClient) ActionEditMonitoring(resource *Cluster, input *MonitoringInput) error { - err := c.apiClient.Ops.DoAction(ClusterType, "editMonitoring", &resource.Resource, input, nil) - return err -} - -func (c *ClusterClient) ActionEnableMonitoring(resource *Cluster, input *MonitoringInput) error { - err := c.apiClient.Ops.DoAction(ClusterType, "enableMonitoring", &resource.Resource, input, nil) - return err -} - -func (c *ClusterClient) ActionExportYaml(resource *Cluster) (*ExportOutput, error) { - resp := &ExportOutput{} - err := c.apiClient.Ops.DoAction(ClusterType, "exportYaml", &resource.Resource, nil, resp) - return resp, err -} - -func (c *ClusterClient) ActionGenerateKubeconfig(resource *Cluster) (*GenerateKubeConfigOutput, error) { - resp := &GenerateKubeConfigOutput{} - err := c.apiClient.Ops.DoAction(ClusterType, "generateKubeconfig", &resource.Resource, nil, resp) - return resp, err -} - -func (c *ClusterClient) ActionImportYaml(resource *Cluster, input *ImportClusterYamlInput) (*ImportYamlOutput, error) { - resp := &ImportYamlOutput{} - err := c.apiClient.Ops.DoAction(ClusterType, "importYaml", &resource.Resource, input, resp) - return resp, err -} - -func (c *ClusterClient) ActionRestoreFromEtcdBackup(resource *Cluster, input *RestoreFromEtcdBackupInput) error { - err := c.apiClient.Ops.DoAction(ClusterType, "restoreFromEtcdBackup", &resource.Resource, input, nil) - return err -} - -func (c *ClusterClient) ActionRotateCertificates(resource *Cluster, input *RotateCertificateInput) (*RotateCertificateOutput, error) { - resp := &RotateCertificateOutput{} - err := c.apiClient.Ops.DoAction(ClusterType, "rotateCertificates", &resource.Resource, input, resp) - return resp, err -} - -func (c *ClusterClient) ActionRotateEncryptionKey(resource *Cluster) (*RotateEncryptionKeyOutput, error) { - resp := &RotateEncryptionKeyOutput{} - err := c.apiClient.Ops.DoAction(ClusterType, "rotateEncryptionKey", &resource.Resource, nil, resp) - return resp, err -} - -func (c *ClusterClient) ActionSaveAsTemplate(resource *Cluster, input *SaveAsTemplateInput) (*SaveAsTemplateOutput, error) { - resp := &SaveAsTemplateOutput{} - err := c.apiClient.Ops.DoAction(ClusterType, "saveAsTemplate", &resource.Resource, input, resp) - return resp, err -} - -func (c *ClusterClient) ActionViewMonitoring(resource *Cluster) (*MonitoringOutput, error) { - resp := &MonitoringOutput{} - err := c.apiClient.Ops.DoAction(ClusterType, "viewMonitoring", &resource.Resource, nil, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert.go deleted file mode 100644 index 2fcd30af32e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert.go +++ /dev/null @@ -1,148 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterAlertType = "clusterAlert" - ClusterAlertFieldAnnotations = "annotations" - ClusterAlertFieldClusterID = "clusterId" - ClusterAlertFieldCreated = "created" - ClusterAlertFieldCreatorID = "creatorId" - ClusterAlertFieldDescription = "description" - ClusterAlertFieldDisplayName = "displayName" - ClusterAlertFieldInitialWaitSeconds = "initialWaitSeconds" - ClusterAlertFieldLabels = "labels" - ClusterAlertFieldName = "name" - ClusterAlertFieldNamespaceId = "namespaceId" - ClusterAlertFieldOwnerReferences = "ownerReferences" - ClusterAlertFieldRecipients = "recipients" - ClusterAlertFieldRemoved = "removed" - ClusterAlertFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ClusterAlertFieldSeverity = "severity" - ClusterAlertFieldState = "state" - ClusterAlertFieldStatus = "status" - ClusterAlertFieldTargetEvent = "targetEvent" - ClusterAlertFieldTargetNode = "targetNode" - ClusterAlertFieldTargetSystemService = "targetSystemService" - ClusterAlertFieldTransitioning = "transitioning" - ClusterAlertFieldTransitioningMessage = "transitioningMessage" - ClusterAlertFieldUUID = "uuid" -) - -type ClusterAlert struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - InitialWaitSeconds int64 `json:"initialWaitSeconds,omitempty" yaml:"initialWaitSeconds,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *AlertStatus `json:"status,omitempty" yaml:"status,omitempty"` - TargetEvent *TargetEvent `json:"targetEvent,omitempty" yaml:"targetEvent,omitempty"` - TargetNode *TargetNode `json:"targetNode,omitempty" yaml:"targetNode,omitempty"` - TargetSystemService *TargetSystemService `json:"targetSystemService,omitempty" yaml:"targetSystemService,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterAlertCollection struct { - types.Collection - Data []ClusterAlert `json:"data,omitempty"` - client *ClusterAlertClient -} - -type ClusterAlertClient struct { - apiClient *Client -} - -type ClusterAlertOperations interface { - List(opts *types.ListOpts) (*ClusterAlertCollection, error) - ListAll(opts *types.ListOpts) (*ClusterAlertCollection, error) - Create(opts *ClusterAlert) (*ClusterAlert, error) - Update(existing *ClusterAlert, updates interface{}) (*ClusterAlert, error) - Replace(existing *ClusterAlert) (*ClusterAlert, error) - ByID(id string) (*ClusterAlert, error) - Delete(container *ClusterAlert) error -} - -func newClusterAlertClient(apiClient *Client) *ClusterAlertClient { - return &ClusterAlertClient{ - apiClient: apiClient, - } -} - -func (c *ClusterAlertClient) Create(container *ClusterAlert) (*ClusterAlert, error) { - resp := &ClusterAlert{} - err := c.apiClient.Ops.DoCreate(ClusterAlertType, container, resp) - return resp, err -} - -func (c *ClusterAlertClient) Update(existing *ClusterAlert, updates interface{}) (*ClusterAlert, error) { - resp := &ClusterAlert{} - err := c.apiClient.Ops.DoUpdate(ClusterAlertType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterAlertClient) Replace(obj *ClusterAlert) (*ClusterAlert, error) { - resp := &ClusterAlert{} - err := c.apiClient.Ops.DoReplace(ClusterAlertType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterAlertClient) List(opts *types.ListOpts) (*ClusterAlertCollection, error) { - resp := &ClusterAlertCollection{} - err := c.apiClient.Ops.DoList(ClusterAlertType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterAlertClient) ListAll(opts *types.ListOpts) (*ClusterAlertCollection, error) { - resp := &ClusterAlertCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterAlertCollection) Next() (*ClusterAlertCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterAlertCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterAlertClient) ByID(id string) (*ClusterAlert, error) { - resp := &ClusterAlert{} - err := c.apiClient.Ops.DoByID(ClusterAlertType, id, resp) - return resp, err -} - -func (c *ClusterAlertClient) Delete(container *ClusterAlert) error { - return c.apiClient.Ops.DoResourceDelete(ClusterAlertType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_group.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_group.go deleted file mode 100644 index 058e9908870..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_group.go +++ /dev/null @@ -1,140 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterAlertGroupType = "clusterAlertGroup" - ClusterAlertGroupFieldAlertState = "alertState" - ClusterAlertGroupFieldAnnotations = "annotations" - ClusterAlertGroupFieldClusterID = "clusterId" - ClusterAlertGroupFieldCreated = "created" - ClusterAlertGroupFieldCreatorID = "creatorId" - ClusterAlertGroupFieldDescription = "description" - ClusterAlertGroupFieldGroupIntervalSeconds = "groupIntervalSeconds" - ClusterAlertGroupFieldGroupWaitSeconds = "groupWaitSeconds" - ClusterAlertGroupFieldLabels = "labels" - ClusterAlertGroupFieldName = "name" - ClusterAlertGroupFieldNamespaceId = "namespaceId" - ClusterAlertGroupFieldOwnerReferences = "ownerReferences" - ClusterAlertGroupFieldRecipients = "recipients" - ClusterAlertGroupFieldRemoved = "removed" - ClusterAlertGroupFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ClusterAlertGroupFieldState = "state" - ClusterAlertGroupFieldTransitioning = "transitioning" - ClusterAlertGroupFieldTransitioningMessage = "transitioningMessage" - ClusterAlertGroupFieldUUID = "uuid" -) - -type ClusterAlertGroup struct { - types.Resource - AlertState string `json:"alertState,omitempty" yaml:"alertState,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterAlertGroupCollection struct { - types.Collection - Data []ClusterAlertGroup `json:"data,omitempty"` - client *ClusterAlertGroupClient -} - -type ClusterAlertGroupClient struct { - apiClient *Client -} - -type ClusterAlertGroupOperations interface { - List(opts *types.ListOpts) (*ClusterAlertGroupCollection, error) - ListAll(opts *types.ListOpts) (*ClusterAlertGroupCollection, error) - Create(opts *ClusterAlertGroup) (*ClusterAlertGroup, error) - Update(existing *ClusterAlertGroup, updates interface{}) (*ClusterAlertGroup, error) - Replace(existing *ClusterAlertGroup) (*ClusterAlertGroup, error) - ByID(id string) (*ClusterAlertGroup, error) - Delete(container *ClusterAlertGroup) error -} - -func newClusterAlertGroupClient(apiClient *Client) *ClusterAlertGroupClient { - return &ClusterAlertGroupClient{ - apiClient: apiClient, - } -} - -func (c *ClusterAlertGroupClient) Create(container *ClusterAlertGroup) (*ClusterAlertGroup, error) { - resp := &ClusterAlertGroup{} - err := c.apiClient.Ops.DoCreate(ClusterAlertGroupType, container, resp) - return resp, err -} - -func (c *ClusterAlertGroupClient) Update(existing *ClusterAlertGroup, updates interface{}) (*ClusterAlertGroup, error) { - resp := &ClusterAlertGroup{} - err := c.apiClient.Ops.DoUpdate(ClusterAlertGroupType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterAlertGroupClient) Replace(obj *ClusterAlertGroup) (*ClusterAlertGroup, error) { - resp := &ClusterAlertGroup{} - err := c.apiClient.Ops.DoReplace(ClusterAlertGroupType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterAlertGroupClient) List(opts *types.ListOpts) (*ClusterAlertGroupCollection, error) { - resp := &ClusterAlertGroupCollection{} - err := c.apiClient.Ops.DoList(ClusterAlertGroupType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterAlertGroupClient) ListAll(opts *types.ListOpts) (*ClusterAlertGroupCollection, error) { - resp := &ClusterAlertGroupCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterAlertGroupCollection) Next() (*ClusterAlertGroupCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterAlertGroupCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterAlertGroupClient) ByID(id string) (*ClusterAlertGroup, error) { - resp := &ClusterAlertGroup{} - err := c.apiClient.Ops.DoByID(ClusterAlertGroupType, id, resp) - return resp, err -} - -func (c *ClusterAlertGroupClient) Delete(container *ClusterAlertGroup) error { - return c.apiClient.Ops.DoResourceDelete(ClusterAlertGroupType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule.go deleted file mode 100644 index 6c3502ada72..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule.go +++ /dev/null @@ -1,180 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterAlertRuleType = "clusterAlertRule" - ClusterAlertRuleFieldAlertState = "alertState" - ClusterAlertRuleFieldAnnotations = "annotations" - ClusterAlertRuleFieldClusterID = "clusterId" - ClusterAlertRuleFieldClusterScanRule = "clusterScanRule" - ClusterAlertRuleFieldCreated = "created" - ClusterAlertRuleFieldCreatorID = "creatorId" - ClusterAlertRuleFieldEventRule = "eventRule" - ClusterAlertRuleFieldGroupID = "groupId" - ClusterAlertRuleFieldGroupIntervalSeconds = "groupIntervalSeconds" - ClusterAlertRuleFieldGroupWaitSeconds = "groupWaitSeconds" - ClusterAlertRuleFieldInherited = "inherited" - ClusterAlertRuleFieldLabels = "labels" - ClusterAlertRuleFieldMetricRule = "metricRule" - ClusterAlertRuleFieldName = "name" - ClusterAlertRuleFieldNamespaceId = "namespaceId" - ClusterAlertRuleFieldNodeRule = "nodeRule" - ClusterAlertRuleFieldOwnerReferences = "ownerReferences" - ClusterAlertRuleFieldRemoved = "removed" - ClusterAlertRuleFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ClusterAlertRuleFieldSeverity = "severity" - ClusterAlertRuleFieldState = "state" - ClusterAlertRuleFieldSystemServiceRule = "systemServiceRule" - ClusterAlertRuleFieldTransitioning = "transitioning" - ClusterAlertRuleFieldTransitioningMessage = "transitioningMessage" - ClusterAlertRuleFieldUUID = "uuid" -) - -type ClusterAlertRule struct { - types.Resource - AlertState string `json:"alertState,omitempty" yaml:"alertState,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - ClusterScanRule *ClusterScanRule `json:"clusterScanRule,omitempty" yaml:"clusterScanRule,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - EventRule *EventRule `json:"eventRule,omitempty" yaml:"eventRule,omitempty"` - GroupID string `json:"groupId,omitempty" yaml:"groupId,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - Inherited *bool `json:"inherited,omitempty" yaml:"inherited,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - MetricRule *MetricRule `json:"metricRule,omitempty" yaml:"metricRule,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - NodeRule *NodeRule `json:"nodeRule,omitempty" yaml:"nodeRule,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - SystemServiceRule *SystemServiceRule `json:"systemServiceRule,omitempty" yaml:"systemServiceRule,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterAlertRuleCollection struct { - types.Collection - Data []ClusterAlertRule `json:"data,omitempty"` - client *ClusterAlertRuleClient -} - -type ClusterAlertRuleClient struct { - apiClient *Client -} - -type ClusterAlertRuleOperations interface { - List(opts *types.ListOpts) (*ClusterAlertRuleCollection, error) - ListAll(opts *types.ListOpts) (*ClusterAlertRuleCollection, error) - Create(opts *ClusterAlertRule) (*ClusterAlertRule, error) - Update(existing *ClusterAlertRule, updates interface{}) (*ClusterAlertRule, error) - Replace(existing *ClusterAlertRule) (*ClusterAlertRule, error) - ByID(id string) (*ClusterAlertRule, error) - Delete(container *ClusterAlertRule) error - - ActionActivate(resource *ClusterAlertRule) error - - ActionDeactivate(resource *ClusterAlertRule) error - - ActionMute(resource *ClusterAlertRule) error - - ActionUnmute(resource *ClusterAlertRule) error -} - -func newClusterAlertRuleClient(apiClient *Client) *ClusterAlertRuleClient { - return &ClusterAlertRuleClient{ - apiClient: apiClient, - } -} - -func (c *ClusterAlertRuleClient) Create(container *ClusterAlertRule) (*ClusterAlertRule, error) { - resp := &ClusterAlertRule{} - err := c.apiClient.Ops.DoCreate(ClusterAlertRuleType, container, resp) - return resp, err -} - -func (c *ClusterAlertRuleClient) Update(existing *ClusterAlertRule, updates interface{}) (*ClusterAlertRule, error) { - resp := &ClusterAlertRule{} - err := c.apiClient.Ops.DoUpdate(ClusterAlertRuleType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterAlertRuleClient) Replace(obj *ClusterAlertRule) (*ClusterAlertRule, error) { - resp := &ClusterAlertRule{} - err := c.apiClient.Ops.DoReplace(ClusterAlertRuleType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterAlertRuleClient) List(opts *types.ListOpts) (*ClusterAlertRuleCollection, error) { - resp := &ClusterAlertRuleCollection{} - err := c.apiClient.Ops.DoList(ClusterAlertRuleType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterAlertRuleClient) ListAll(opts *types.ListOpts) (*ClusterAlertRuleCollection, error) { - resp := &ClusterAlertRuleCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterAlertRuleCollection) Next() (*ClusterAlertRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterAlertRuleCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterAlertRuleClient) ByID(id string) (*ClusterAlertRule, error) { - resp := &ClusterAlertRule{} - err := c.apiClient.Ops.DoByID(ClusterAlertRuleType, id, resp) - return resp, err -} - -func (c *ClusterAlertRuleClient) Delete(container *ClusterAlertRule) error { - return c.apiClient.Ops.DoResourceDelete(ClusterAlertRuleType, &container.Resource) -} - -func (c *ClusterAlertRuleClient) ActionActivate(resource *ClusterAlertRule) error { - err := c.apiClient.Ops.DoAction(ClusterAlertRuleType, "activate", &resource.Resource, nil, nil) - return err -} - -func (c *ClusterAlertRuleClient) ActionDeactivate(resource *ClusterAlertRule) error { - err := c.apiClient.Ops.DoAction(ClusterAlertRuleType, "deactivate", &resource.Resource, nil, nil) - return err -} - -func (c *ClusterAlertRuleClient) ActionMute(resource *ClusterAlertRule) error { - err := c.apiClient.Ops.DoAction(ClusterAlertRuleType, "mute", &resource.Resource, nil, nil) - return err -} - -func (c *ClusterAlertRuleClient) ActionUnmute(resource *ClusterAlertRule) error { - err := c.apiClient.Ops.DoAction(ClusterAlertRuleType, "unmute", &resource.Resource, nil, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule_spec.go deleted file mode 100644 index dfbc2ec08a4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_rule_spec.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -const ( - ClusterAlertRuleSpecType = "clusterAlertRuleSpec" - ClusterAlertRuleSpecFieldClusterID = "clusterId" - ClusterAlertRuleSpecFieldClusterScanRule = "clusterScanRule" - ClusterAlertRuleSpecFieldDisplayName = "displayName" - ClusterAlertRuleSpecFieldEventRule = "eventRule" - ClusterAlertRuleSpecFieldGroupID = "groupId" - ClusterAlertRuleSpecFieldGroupIntervalSeconds = "groupIntervalSeconds" - ClusterAlertRuleSpecFieldGroupWaitSeconds = "groupWaitSeconds" - ClusterAlertRuleSpecFieldInherited = "inherited" - ClusterAlertRuleSpecFieldMetricRule = "metricRule" - ClusterAlertRuleSpecFieldNodeRule = "nodeRule" - ClusterAlertRuleSpecFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ClusterAlertRuleSpecFieldSeverity = "severity" - ClusterAlertRuleSpecFieldSystemServiceRule = "systemServiceRule" -) - -type ClusterAlertRuleSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - ClusterScanRule *ClusterScanRule `json:"clusterScanRule,omitempty" yaml:"clusterScanRule,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - EventRule *EventRule `json:"eventRule,omitempty" yaml:"eventRule,omitempty"` - GroupID string `json:"groupId,omitempty" yaml:"groupId,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - Inherited *bool `json:"inherited,omitempty" yaml:"inherited,omitempty"` - MetricRule *MetricRule `json:"metricRule,omitempty" yaml:"metricRule,omitempty"` - NodeRule *NodeRule `json:"nodeRule,omitempty" yaml:"nodeRule,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - SystemServiceRule *SystemServiceRule `json:"systemServiceRule,omitempty" yaml:"systemServiceRule,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_spec.go deleted file mode 100644 index 4ca1668a319..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_alert_spec.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - ClusterAlertSpecType = "clusterAlertSpec" - ClusterAlertSpecFieldClusterID = "clusterId" - ClusterAlertSpecFieldDescription = "description" - ClusterAlertSpecFieldDisplayName = "displayName" - ClusterAlertSpecFieldInitialWaitSeconds = "initialWaitSeconds" - ClusterAlertSpecFieldRecipients = "recipients" - ClusterAlertSpecFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ClusterAlertSpecFieldSeverity = "severity" - ClusterAlertSpecFieldTargetEvent = "targetEvent" - ClusterAlertSpecFieldTargetNode = "targetNode" - ClusterAlertSpecFieldTargetSystemService = "targetSystemService" -) - -type ClusterAlertSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - InitialWaitSeconds int64 `json:"initialWaitSeconds,omitempty" yaml:"initialWaitSeconds,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - TargetEvent *TargetEvent `json:"targetEvent,omitempty" yaml:"targetEvent,omitempty"` - TargetNode *TargetNode `json:"targetNode,omitempty" yaml:"targetNode,omitempty"` - TargetSystemService *TargetSystemService `json:"targetSystemService,omitempty" yaml:"targetSystemService,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_catalog.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_catalog.go deleted file mode 100644 index d555f2bf0ee..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_catalog.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterCatalogType = "clusterCatalog" - ClusterCatalogFieldAnnotations = "annotations" - ClusterCatalogFieldBranch = "branch" - ClusterCatalogFieldCatalogSecrets = "catalogSecrets" - ClusterCatalogFieldClusterID = "clusterId" - ClusterCatalogFieldCommit = "commit" - ClusterCatalogFieldConditions = "conditions" - ClusterCatalogFieldCreated = "created" - ClusterCatalogFieldCreatorID = "creatorId" - ClusterCatalogFieldCredentialSecret = "credentialSecret" - ClusterCatalogFieldDescription = "description" - ClusterCatalogFieldHelmVersion = "helmVersion" - ClusterCatalogFieldKind = "kind" - ClusterCatalogFieldLabels = "labels" - ClusterCatalogFieldLastRefreshTimestamp = "lastRefreshTimestamp" - ClusterCatalogFieldName = "name" - ClusterCatalogFieldNamespaceId = "namespaceId" - ClusterCatalogFieldOwnerReferences = "ownerReferences" - ClusterCatalogFieldPassword = "password" - ClusterCatalogFieldRemoved = "removed" - ClusterCatalogFieldState = "state" - ClusterCatalogFieldTransitioning = "transitioning" - ClusterCatalogFieldTransitioningMessage = "transitioningMessage" - ClusterCatalogFieldURL = "url" - ClusterCatalogFieldUUID = "uuid" - ClusterCatalogFieldUsername = "username" -) - -type ClusterCatalog struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type ClusterCatalogCollection struct { - types.Collection - Data []ClusterCatalog `json:"data,omitempty"` - client *ClusterCatalogClient -} - -type ClusterCatalogClient struct { - apiClient *Client -} - -type ClusterCatalogOperations interface { - List(opts *types.ListOpts) (*ClusterCatalogCollection, error) - ListAll(opts *types.ListOpts) (*ClusterCatalogCollection, error) - Create(opts *ClusterCatalog) (*ClusterCatalog, error) - Update(existing *ClusterCatalog, updates interface{}) (*ClusterCatalog, error) - Replace(existing *ClusterCatalog) (*ClusterCatalog, error) - ByID(id string) (*ClusterCatalog, error) - Delete(container *ClusterCatalog) error - - ActionRefresh(resource *ClusterCatalog) (*CatalogRefresh, error) - - CollectionActionRefresh(resource *ClusterCatalogCollection) (*CatalogRefresh, error) -} - -func newClusterCatalogClient(apiClient *Client) *ClusterCatalogClient { - return &ClusterCatalogClient{ - apiClient: apiClient, - } -} - -func (c *ClusterCatalogClient) Create(container *ClusterCatalog) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoCreate(ClusterCatalogType, container, resp) - return resp, err -} - -func (c *ClusterCatalogClient) Update(existing *ClusterCatalog, updates interface{}) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoUpdate(ClusterCatalogType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterCatalogClient) Replace(obj *ClusterCatalog) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoReplace(ClusterCatalogType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterCatalogClient) List(opts *types.ListOpts) (*ClusterCatalogCollection, error) { - resp := &ClusterCatalogCollection{} - err := c.apiClient.Ops.DoList(ClusterCatalogType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterCatalogClient) ListAll(opts *types.ListOpts) (*ClusterCatalogCollection, error) { - resp := &ClusterCatalogCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterCatalogCollection) Next() (*ClusterCatalogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterCatalogCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterCatalogClient) ByID(id string) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoByID(ClusterCatalogType, id, resp) - return resp, err -} - -func (c *ClusterCatalogClient) Delete(container *ClusterCatalog) error { - return c.apiClient.Ops.DoResourceDelete(ClusterCatalogType, &container.Resource) -} - -func (c *ClusterCatalogClient) ActionRefresh(resource *ClusterCatalog) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoAction(ClusterCatalogType, "refresh", &resource.Resource, nil, resp) - return resp, err -} - -func (c *ClusterCatalogClient) CollectionActionRefresh(resource *ClusterCatalogCollection) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoCollectionAction(ClusterCatalogType, "refresh", &resource.Collection, nil, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_component_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_component_status.go deleted file mode 100644 index 9955ee880bd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_component_status.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ClusterComponentStatusType = "clusterComponentStatus" - ClusterComponentStatusFieldConditions = "conditions" - ClusterComponentStatusFieldName = "name" -) - -type ClusterComponentStatus struct { - Conditions []ComponentCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_condition.go deleted file mode 100644 index 1ecf2ee45d3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - ClusterConditionType = "clusterCondition" - ClusterConditionFieldLastTransitionTime = "lastTransitionTime" - ClusterConditionFieldLastUpdateTime = "lastUpdateTime" - ClusterConditionFieldMessage = "message" - ClusterConditionFieldReason = "reason" - ClusterConditionFieldStatus = "status" - ClusterConditionFieldType = "type" -) - -type ClusterCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_group_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_group_spec.go deleted file mode 100644 index db154a9b986..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_group_spec.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - ClusterGroupSpecType = "clusterGroupSpec" - ClusterGroupSpecFieldClusterID = "clusterId" - ClusterGroupSpecFieldDescription = "description" - ClusterGroupSpecFieldDisplayName = "displayName" - ClusterGroupSpecFieldGroupIntervalSeconds = "groupIntervalSeconds" - ClusterGroupSpecFieldGroupWaitSeconds = "groupWaitSeconds" - ClusterGroupSpecFieldRecipients = "recipients" - ClusterGroupSpecFieldRepeatIntervalSeconds = "repeatIntervalSeconds" -) - -type ClusterGroupSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging.go deleted file mode 100644 index d25310a8497..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterLoggingType = "clusterLogging" - ClusterLoggingFieldAnnotations = "annotations" - ClusterLoggingFieldAppliedSpec = "appliedSpec" - ClusterLoggingFieldClusterID = "clusterId" - ClusterLoggingFieldConditions = "conditions" - ClusterLoggingFieldCreated = "created" - ClusterLoggingFieldCreatorID = "creatorId" - ClusterLoggingFieldCustomTargetConfig = "customTargetConfig" - ClusterLoggingFieldElasticsearchConfig = "elasticsearchConfig" - ClusterLoggingFieldEnableJSONParsing = "enableJSONParsing" - ClusterLoggingFieldFailedSpec = "failedSpec" - ClusterLoggingFieldFluentForwarderConfig = "fluentForwarderConfig" - ClusterLoggingFieldIncludeSystemComponent = "includeSystemComponent" - ClusterLoggingFieldKafkaConfig = "kafkaConfig" - ClusterLoggingFieldLabels = "labels" - ClusterLoggingFieldName = "name" - ClusterLoggingFieldNamespaceId = "namespaceId" - ClusterLoggingFieldOutputFlushInterval = "outputFlushInterval" - ClusterLoggingFieldOutputTags = "outputTags" - ClusterLoggingFieldOwnerReferences = "ownerReferences" - ClusterLoggingFieldRemoved = "removed" - ClusterLoggingFieldSplunkConfig = "splunkConfig" - ClusterLoggingFieldState = "state" - ClusterLoggingFieldSyslogConfig = "syslogConfig" - ClusterLoggingFieldTransitioning = "transitioning" - ClusterLoggingFieldTransitioningMessage = "transitioningMessage" - ClusterLoggingFieldUUID = "uuid" -) - -type ClusterLogging struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AppliedSpec *ClusterLoggingSpec `json:"appliedSpec,omitempty" yaml:"appliedSpec,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Conditions []LoggingCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CustomTargetConfig *CustomTargetConfig `json:"customTargetConfig,omitempty" yaml:"customTargetConfig,omitempty"` - ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty" yaml:"elasticsearchConfig,omitempty"` - EnableJSONParsing bool `json:"enableJSONParsing,omitempty" yaml:"enableJSONParsing,omitempty"` - FailedSpec *ClusterLoggingSpec `json:"failedSpec,omitempty" yaml:"failedSpec,omitempty"` - FluentForwarderConfig *FluentForwarderConfig `json:"fluentForwarderConfig,omitempty" yaml:"fluentForwarderConfig,omitempty"` - IncludeSystemComponent *bool `json:"includeSystemComponent,omitempty" yaml:"includeSystemComponent,omitempty"` - KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty" yaml:"kafkaConfig,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OutputFlushInterval int64 `json:"outputFlushInterval,omitempty" yaml:"outputFlushInterval,omitempty"` - OutputTags map[string]string `json:"outputTags,omitempty" yaml:"outputTags,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty" yaml:"splunkConfig,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty" yaml:"syslogConfig,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterLoggingCollection struct { - types.Collection - Data []ClusterLogging `json:"data,omitempty"` - client *ClusterLoggingClient -} - -type ClusterLoggingClient struct { - apiClient *Client -} - -type ClusterLoggingOperations interface { - List(opts *types.ListOpts) (*ClusterLoggingCollection, error) - ListAll(opts *types.ListOpts) (*ClusterLoggingCollection, error) - Create(opts *ClusterLogging) (*ClusterLogging, error) - Update(existing *ClusterLogging, updates interface{}) (*ClusterLogging, error) - Replace(existing *ClusterLogging) (*ClusterLogging, error) - ByID(id string) (*ClusterLogging, error) - Delete(container *ClusterLogging) error - - CollectionActionDryRun(resource *ClusterLoggingCollection, input *ClusterTestInput) error - - CollectionActionTest(resource *ClusterLoggingCollection, input *ClusterTestInput) error -} - -func newClusterLoggingClient(apiClient *Client) *ClusterLoggingClient { - return &ClusterLoggingClient{ - apiClient: apiClient, - } -} - -func (c *ClusterLoggingClient) Create(container *ClusterLogging) (*ClusterLogging, error) { - resp := &ClusterLogging{} - err := c.apiClient.Ops.DoCreate(ClusterLoggingType, container, resp) - return resp, err -} - -func (c *ClusterLoggingClient) Update(existing *ClusterLogging, updates interface{}) (*ClusterLogging, error) { - resp := &ClusterLogging{} - err := c.apiClient.Ops.DoUpdate(ClusterLoggingType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterLoggingClient) Replace(obj *ClusterLogging) (*ClusterLogging, error) { - resp := &ClusterLogging{} - err := c.apiClient.Ops.DoReplace(ClusterLoggingType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterLoggingClient) List(opts *types.ListOpts) (*ClusterLoggingCollection, error) { - resp := &ClusterLoggingCollection{} - err := c.apiClient.Ops.DoList(ClusterLoggingType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterLoggingClient) ListAll(opts *types.ListOpts) (*ClusterLoggingCollection, error) { - resp := &ClusterLoggingCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterLoggingCollection) Next() (*ClusterLoggingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterLoggingCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterLoggingClient) ByID(id string) (*ClusterLogging, error) { - resp := &ClusterLogging{} - err := c.apiClient.Ops.DoByID(ClusterLoggingType, id, resp) - return resp, err -} - -func (c *ClusterLoggingClient) Delete(container *ClusterLogging) error { - return c.apiClient.Ops.DoResourceDelete(ClusterLoggingType, &container.Resource) -} - -func (c *ClusterLoggingClient) CollectionActionDryRun(resource *ClusterLoggingCollection, input *ClusterTestInput) error { - err := c.apiClient.Ops.DoCollectionAction(ClusterLoggingType, "dryRun", &resource.Collection, input, nil) - return err -} - -func (c *ClusterLoggingClient) CollectionActionTest(resource *ClusterLoggingCollection, input *ClusterTestInput) error { - err := c.apiClient.Ops.DoCollectionAction(ClusterLoggingType, "test", &resource.Collection, input, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_spec.go deleted file mode 100644 index f086a4a16d0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_spec.go +++ /dev/null @@ -1,32 +0,0 @@ -package client - -const ( - ClusterLoggingSpecType = "clusterLoggingSpec" - ClusterLoggingSpecFieldClusterID = "clusterId" - ClusterLoggingSpecFieldCustomTargetConfig = "customTargetConfig" - ClusterLoggingSpecFieldDisplayName = "displayName" - ClusterLoggingSpecFieldElasticsearchConfig = "elasticsearchConfig" - ClusterLoggingSpecFieldEnableJSONParsing = "enableJSONParsing" - ClusterLoggingSpecFieldFluentForwarderConfig = "fluentForwarderConfig" - ClusterLoggingSpecFieldIncludeSystemComponent = "includeSystemComponent" - ClusterLoggingSpecFieldKafkaConfig = "kafkaConfig" - ClusterLoggingSpecFieldOutputFlushInterval = "outputFlushInterval" - ClusterLoggingSpecFieldOutputTags = "outputTags" - ClusterLoggingSpecFieldSplunkConfig = "splunkConfig" - ClusterLoggingSpecFieldSyslogConfig = "syslogConfig" -) - -type ClusterLoggingSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - CustomTargetConfig *CustomTargetConfig `json:"customTargetConfig,omitempty" yaml:"customTargetConfig,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty" yaml:"elasticsearchConfig,omitempty"` - EnableJSONParsing bool `json:"enableJSONParsing,omitempty" yaml:"enableJSONParsing,omitempty"` - FluentForwarderConfig *FluentForwarderConfig `json:"fluentForwarderConfig,omitempty" yaml:"fluentForwarderConfig,omitempty"` - IncludeSystemComponent *bool `json:"includeSystemComponent,omitempty" yaml:"includeSystemComponent,omitempty"` - KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty" yaml:"kafkaConfig,omitempty"` - OutputFlushInterval int64 `json:"outputFlushInterval,omitempty" yaml:"outputFlushInterval,omitempty"` - OutputTags map[string]string `json:"outputTags,omitempty" yaml:"outputTags,omitempty"` - SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty" yaml:"splunkConfig,omitempty"` - SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty" yaml:"syslogConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_status.go deleted file mode 100644 index a43b36a31ff..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_logging_status.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ClusterLoggingStatusType = "clusterLoggingStatus" - ClusterLoggingStatusFieldAppliedSpec = "appliedSpec" - ClusterLoggingStatusFieldConditions = "conditions" - ClusterLoggingStatusFieldFailedSpec = "failedSpec" -) - -type ClusterLoggingStatus struct { - AppliedSpec *ClusterLoggingSpec `json:"appliedSpec,omitempty" yaml:"appliedSpec,omitempty"` - Conditions []LoggingCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - FailedSpec *ClusterLoggingSpec `json:"failedSpec,omitempty" yaml:"failedSpec,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_metric_names_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_metric_names_input.go deleted file mode 100644 index e31a8242c86..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_metric_names_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ClusterMetricNamesInputType = "clusterMetricNamesInput" - ClusterMetricNamesInputFieldClusterName = "clusterId" -) - -type ClusterMetricNamesInput struct { - ClusterName string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph.go deleted file mode 100644 index 145c9c46256..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph.go +++ /dev/null @@ -1,146 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterMonitorGraphType = "clusterMonitorGraph" - ClusterMonitorGraphFieldAnnotations = "annotations" - ClusterMonitorGraphFieldClusterID = "clusterId" - ClusterMonitorGraphFieldCreated = "created" - ClusterMonitorGraphFieldCreatorID = "creatorId" - ClusterMonitorGraphFieldDescription = "description" - ClusterMonitorGraphFieldDetailsMetricsSelector = "detailsMetricsSelector" - ClusterMonitorGraphFieldDisplayResourceType = "displayResourceType" - ClusterMonitorGraphFieldGraphType = "graphType" - ClusterMonitorGraphFieldLabels = "labels" - ClusterMonitorGraphFieldMetricsSelector = "metricsSelector" - ClusterMonitorGraphFieldName = "name" - ClusterMonitorGraphFieldNamespaceId = "namespaceId" - ClusterMonitorGraphFieldOwnerReferences = "ownerReferences" - ClusterMonitorGraphFieldPriority = "priority" - ClusterMonitorGraphFieldRemoved = "removed" - ClusterMonitorGraphFieldResourceType = "resourceType" - ClusterMonitorGraphFieldUUID = "uuid" - ClusterMonitorGraphFieldYAxis = "yAxis" -) - -type ClusterMonitorGraph struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DetailsMetricsSelector map[string]string `json:"detailsMetricsSelector,omitempty" yaml:"detailsMetricsSelector,omitempty"` - DisplayResourceType string `json:"displayResourceType,omitempty" yaml:"displayResourceType,omitempty"` - GraphType string `json:"graphType,omitempty" yaml:"graphType,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - MetricsSelector map[string]string `json:"metricsSelector,omitempty" yaml:"metricsSelector,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ResourceType string `json:"resourceType,omitempty" yaml:"resourceType,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - YAxis *YAxis `json:"yAxis,omitempty" yaml:"yAxis,omitempty"` -} - -type ClusterMonitorGraphCollection struct { - types.Collection - Data []ClusterMonitorGraph `json:"data,omitempty"` - client *ClusterMonitorGraphClient -} - -type ClusterMonitorGraphClient struct { - apiClient *Client -} - -type ClusterMonitorGraphOperations interface { - List(opts *types.ListOpts) (*ClusterMonitorGraphCollection, error) - ListAll(opts *types.ListOpts) (*ClusterMonitorGraphCollection, error) - Create(opts *ClusterMonitorGraph) (*ClusterMonitorGraph, error) - Update(existing *ClusterMonitorGraph, updates interface{}) (*ClusterMonitorGraph, error) - Replace(existing *ClusterMonitorGraph) (*ClusterMonitorGraph, error) - ByID(id string) (*ClusterMonitorGraph, error) - Delete(container *ClusterMonitorGraph) error - - CollectionActionQuery(resource *ClusterMonitorGraphCollection, input *QueryGraphInput) (*QueryClusterGraphOutput, error) -} - -func newClusterMonitorGraphClient(apiClient *Client) *ClusterMonitorGraphClient { - return &ClusterMonitorGraphClient{ - apiClient: apiClient, - } -} - -func (c *ClusterMonitorGraphClient) Create(container *ClusterMonitorGraph) (*ClusterMonitorGraph, error) { - resp := &ClusterMonitorGraph{} - err := c.apiClient.Ops.DoCreate(ClusterMonitorGraphType, container, resp) - return resp, err -} - -func (c *ClusterMonitorGraphClient) Update(existing *ClusterMonitorGraph, updates interface{}) (*ClusterMonitorGraph, error) { - resp := &ClusterMonitorGraph{} - err := c.apiClient.Ops.DoUpdate(ClusterMonitorGraphType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterMonitorGraphClient) Replace(obj *ClusterMonitorGraph) (*ClusterMonitorGraph, error) { - resp := &ClusterMonitorGraph{} - err := c.apiClient.Ops.DoReplace(ClusterMonitorGraphType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterMonitorGraphClient) List(opts *types.ListOpts) (*ClusterMonitorGraphCollection, error) { - resp := &ClusterMonitorGraphCollection{} - err := c.apiClient.Ops.DoList(ClusterMonitorGraphType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterMonitorGraphClient) ListAll(opts *types.ListOpts) (*ClusterMonitorGraphCollection, error) { - resp := &ClusterMonitorGraphCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterMonitorGraphCollection) Next() (*ClusterMonitorGraphCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterMonitorGraphCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterMonitorGraphClient) ByID(id string) (*ClusterMonitorGraph, error) { - resp := &ClusterMonitorGraph{} - err := c.apiClient.Ops.DoByID(ClusterMonitorGraphType, id, resp) - return resp, err -} - -func (c *ClusterMonitorGraphClient) Delete(container *ClusterMonitorGraph) error { - return c.apiClient.Ops.DoResourceDelete(ClusterMonitorGraphType, &container.Resource) -} - -func (c *ClusterMonitorGraphClient) CollectionActionQuery(resource *ClusterMonitorGraphCollection, input *QueryGraphInput) (*QueryClusterGraphOutput, error) { - resp := &QueryClusterGraphOutput{} - err := c.apiClient.Ops.DoCollectionAction(ClusterMonitorGraphType, "query", &resource.Collection, input, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph_spec.go deleted file mode 100644 index 79c730e2dc4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_monitor_graph_spec.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - ClusterMonitorGraphSpecType = "clusterMonitorGraphSpec" - ClusterMonitorGraphSpecFieldClusterID = "clusterId" - ClusterMonitorGraphSpecFieldDescription = "description" - ClusterMonitorGraphSpecFieldDetailsMetricsSelector = "detailsMetricsSelector" - ClusterMonitorGraphSpecFieldDisplayResourceType = "displayResourceType" - ClusterMonitorGraphSpecFieldGraphType = "graphType" - ClusterMonitorGraphSpecFieldMetricsSelector = "metricsSelector" - ClusterMonitorGraphSpecFieldPriority = "priority" - ClusterMonitorGraphSpecFieldResourceType = "resourceType" - ClusterMonitorGraphSpecFieldYAxis = "yAxis" -) - -type ClusterMonitorGraphSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DetailsMetricsSelector map[string]string `json:"detailsMetricsSelector,omitempty" yaml:"detailsMetricsSelector,omitempty"` - DisplayResourceType string `json:"displayResourceType,omitempty" yaml:"displayResourceType,omitempty"` - GraphType string `json:"graphType,omitempty" yaml:"graphType,omitempty"` - MetricsSelector map[string]string `json:"metricsSelector,omitempty" yaml:"metricsSelector,omitempty"` - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - ResourceType string `json:"resourceType,omitempty" yaml:"resourceType,omitempty"` - YAxis *YAxis `json:"yAxis,omitempty" yaml:"yAxis,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token.go deleted file mode 100644 index 2b0e191f123..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token.go +++ /dev/null @@ -1,144 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterRegistrationTokenType = "clusterRegistrationToken" - ClusterRegistrationTokenFieldAnnotations = "annotations" - ClusterRegistrationTokenFieldClusterID = "clusterId" - ClusterRegistrationTokenFieldCommand = "command" - ClusterRegistrationTokenFieldCreated = "created" - ClusterRegistrationTokenFieldCreatorID = "creatorId" - ClusterRegistrationTokenFieldInsecureCommand = "insecureCommand" - ClusterRegistrationTokenFieldInsecureNodeCommand = "insecureNodeCommand" - ClusterRegistrationTokenFieldInsecureWindowsNodeCommand = "insecureWindowsNodeCommand" - ClusterRegistrationTokenFieldLabels = "labels" - ClusterRegistrationTokenFieldManifestURL = "manifestUrl" - ClusterRegistrationTokenFieldName = "name" - ClusterRegistrationTokenFieldNamespaceId = "namespaceId" - ClusterRegistrationTokenFieldNodeCommand = "nodeCommand" - ClusterRegistrationTokenFieldOwnerReferences = "ownerReferences" - ClusterRegistrationTokenFieldRemoved = "removed" - ClusterRegistrationTokenFieldState = "state" - ClusterRegistrationTokenFieldToken = "token" - ClusterRegistrationTokenFieldTransitioning = "transitioning" - ClusterRegistrationTokenFieldTransitioningMessage = "transitioningMessage" - ClusterRegistrationTokenFieldUUID = "uuid" - ClusterRegistrationTokenFieldWindowsNodeCommand = "windowsNodeCommand" -) - -type ClusterRegistrationToken struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Command string `json:"command,omitempty" yaml:"command,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - InsecureCommand string `json:"insecureCommand,omitempty" yaml:"insecureCommand,omitempty"` - InsecureNodeCommand string `json:"insecureNodeCommand,omitempty" yaml:"insecureNodeCommand,omitempty"` - InsecureWindowsNodeCommand string `json:"insecureWindowsNodeCommand,omitempty" yaml:"insecureWindowsNodeCommand,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - ManifestURL string `json:"manifestUrl,omitempty" yaml:"manifestUrl,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - NodeCommand string `json:"nodeCommand,omitempty" yaml:"nodeCommand,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - WindowsNodeCommand string `json:"windowsNodeCommand,omitempty" yaml:"windowsNodeCommand,omitempty"` -} - -type ClusterRegistrationTokenCollection struct { - types.Collection - Data []ClusterRegistrationToken `json:"data,omitempty"` - client *ClusterRegistrationTokenClient -} - -type ClusterRegistrationTokenClient struct { - apiClient *Client -} - -type ClusterRegistrationTokenOperations interface { - List(opts *types.ListOpts) (*ClusterRegistrationTokenCollection, error) - ListAll(opts *types.ListOpts) (*ClusterRegistrationTokenCollection, error) - Create(opts *ClusterRegistrationToken) (*ClusterRegistrationToken, error) - Update(existing *ClusterRegistrationToken, updates interface{}) (*ClusterRegistrationToken, error) - Replace(existing *ClusterRegistrationToken) (*ClusterRegistrationToken, error) - ByID(id string) (*ClusterRegistrationToken, error) - Delete(container *ClusterRegistrationToken) error -} - -func newClusterRegistrationTokenClient(apiClient *Client) *ClusterRegistrationTokenClient { - return &ClusterRegistrationTokenClient{ - apiClient: apiClient, - } -} - -func (c *ClusterRegistrationTokenClient) Create(container *ClusterRegistrationToken) (*ClusterRegistrationToken, error) { - resp := &ClusterRegistrationToken{} - err := c.apiClient.Ops.DoCreate(ClusterRegistrationTokenType, container, resp) - return resp, err -} - -func (c *ClusterRegistrationTokenClient) Update(existing *ClusterRegistrationToken, updates interface{}) (*ClusterRegistrationToken, error) { - resp := &ClusterRegistrationToken{} - err := c.apiClient.Ops.DoUpdate(ClusterRegistrationTokenType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterRegistrationTokenClient) Replace(obj *ClusterRegistrationToken) (*ClusterRegistrationToken, error) { - resp := &ClusterRegistrationToken{} - err := c.apiClient.Ops.DoReplace(ClusterRegistrationTokenType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterRegistrationTokenClient) List(opts *types.ListOpts) (*ClusterRegistrationTokenCollection, error) { - resp := &ClusterRegistrationTokenCollection{} - err := c.apiClient.Ops.DoList(ClusterRegistrationTokenType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterRegistrationTokenClient) ListAll(opts *types.ListOpts) (*ClusterRegistrationTokenCollection, error) { - resp := &ClusterRegistrationTokenCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterRegistrationTokenCollection) Next() (*ClusterRegistrationTokenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterRegistrationTokenCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterRegistrationTokenClient) ByID(id string) (*ClusterRegistrationToken, error) { - resp := &ClusterRegistrationToken{} - err := c.apiClient.Ops.DoByID(ClusterRegistrationTokenType, id, resp) - return resp, err -} - -func (c *ClusterRegistrationTokenClient) Delete(container *ClusterRegistrationToken) error { - return c.apiClient.Ops.DoResourceDelete(ClusterRegistrationTokenType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_spec.go deleted file mode 100644 index 9a0fd3f2500..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_spec.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ClusterRegistrationTokenSpecType = "clusterRegistrationTokenSpec" - ClusterRegistrationTokenSpecFieldClusterID = "clusterId" -) - -type ClusterRegistrationTokenSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_status.go deleted file mode 100644 index 1e51b105451..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_registration_token_status.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - ClusterRegistrationTokenStatusType = "clusterRegistrationTokenStatus" - ClusterRegistrationTokenStatusFieldCommand = "command" - ClusterRegistrationTokenStatusFieldInsecureCommand = "insecureCommand" - ClusterRegistrationTokenStatusFieldInsecureNodeCommand = "insecureNodeCommand" - ClusterRegistrationTokenStatusFieldInsecureWindowsNodeCommand = "insecureWindowsNodeCommand" - ClusterRegistrationTokenStatusFieldManifestURL = "manifestUrl" - ClusterRegistrationTokenStatusFieldNodeCommand = "nodeCommand" - ClusterRegistrationTokenStatusFieldToken = "token" - ClusterRegistrationTokenStatusFieldWindowsNodeCommand = "windowsNodeCommand" -) - -type ClusterRegistrationTokenStatus struct { - Command string `json:"command,omitempty" yaml:"command,omitempty"` - InsecureCommand string `json:"insecureCommand,omitempty" yaml:"insecureCommand,omitempty"` - InsecureNodeCommand string `json:"insecureNodeCommand,omitempty" yaml:"insecureNodeCommand,omitempty"` - InsecureWindowsNodeCommand string `json:"insecureWindowsNodeCommand,omitempty" yaml:"insecureWindowsNodeCommand,omitempty"` - ManifestURL string `json:"manifestUrl,omitempty" yaml:"manifestUrl,omitempty"` - NodeCommand string `json:"nodeCommand,omitempty" yaml:"nodeCommand,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` - WindowsNodeCommand string `json:"windowsNodeCommand,omitempty" yaml:"windowsNodeCommand,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_role_template_binding.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_role_template_binding.go deleted file mode 100644 index e4301c214bb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_role_template_binding.go +++ /dev/null @@ -1,132 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterRoleTemplateBindingType = "clusterRoleTemplateBinding" - ClusterRoleTemplateBindingFieldAnnotations = "annotations" - ClusterRoleTemplateBindingFieldClusterID = "clusterId" - ClusterRoleTemplateBindingFieldCreated = "created" - ClusterRoleTemplateBindingFieldCreatorID = "creatorId" - ClusterRoleTemplateBindingFieldGroupID = "groupId" - ClusterRoleTemplateBindingFieldGroupPrincipalID = "groupPrincipalId" - ClusterRoleTemplateBindingFieldLabels = "labels" - ClusterRoleTemplateBindingFieldName = "name" - ClusterRoleTemplateBindingFieldNamespaceId = "namespaceId" - ClusterRoleTemplateBindingFieldOwnerReferences = "ownerReferences" - ClusterRoleTemplateBindingFieldRemoved = "removed" - ClusterRoleTemplateBindingFieldRoleTemplateID = "roleTemplateId" - ClusterRoleTemplateBindingFieldUUID = "uuid" - ClusterRoleTemplateBindingFieldUserID = "userId" - ClusterRoleTemplateBindingFieldUserPrincipalID = "userPrincipalId" -) - -type ClusterRoleTemplateBinding struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - GroupID string `json:"groupId,omitempty" yaml:"groupId,omitempty"` - GroupPrincipalID string `json:"groupPrincipalId,omitempty" yaml:"groupPrincipalId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RoleTemplateID string `json:"roleTemplateId,omitempty" yaml:"roleTemplateId,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserID string `json:"userId,omitempty" yaml:"userId,omitempty"` - UserPrincipalID string `json:"userPrincipalId,omitempty" yaml:"userPrincipalId,omitempty"` -} - -type ClusterRoleTemplateBindingCollection struct { - types.Collection - Data []ClusterRoleTemplateBinding `json:"data,omitempty"` - client *ClusterRoleTemplateBindingClient -} - -type ClusterRoleTemplateBindingClient struct { - apiClient *Client -} - -type ClusterRoleTemplateBindingOperations interface { - List(opts *types.ListOpts) (*ClusterRoleTemplateBindingCollection, error) - ListAll(opts *types.ListOpts) (*ClusterRoleTemplateBindingCollection, error) - Create(opts *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) - Update(existing *ClusterRoleTemplateBinding, updates interface{}) (*ClusterRoleTemplateBinding, error) - Replace(existing *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) - ByID(id string) (*ClusterRoleTemplateBinding, error) - Delete(container *ClusterRoleTemplateBinding) error -} - -func newClusterRoleTemplateBindingClient(apiClient *Client) *ClusterRoleTemplateBindingClient { - return &ClusterRoleTemplateBindingClient{ - apiClient: apiClient, - } -} - -func (c *ClusterRoleTemplateBindingClient) Create(container *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) { - resp := &ClusterRoleTemplateBinding{} - err := c.apiClient.Ops.DoCreate(ClusterRoleTemplateBindingType, container, resp) - return resp, err -} - -func (c *ClusterRoleTemplateBindingClient) Update(existing *ClusterRoleTemplateBinding, updates interface{}) (*ClusterRoleTemplateBinding, error) { - resp := &ClusterRoleTemplateBinding{} - err := c.apiClient.Ops.DoUpdate(ClusterRoleTemplateBindingType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterRoleTemplateBindingClient) Replace(obj *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) { - resp := &ClusterRoleTemplateBinding{} - err := c.apiClient.Ops.DoReplace(ClusterRoleTemplateBindingType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterRoleTemplateBindingClient) List(opts *types.ListOpts) (*ClusterRoleTemplateBindingCollection, error) { - resp := &ClusterRoleTemplateBindingCollection{} - err := c.apiClient.Ops.DoList(ClusterRoleTemplateBindingType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterRoleTemplateBindingClient) ListAll(opts *types.ListOpts) (*ClusterRoleTemplateBindingCollection, error) { - resp := &ClusterRoleTemplateBindingCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterRoleTemplateBindingCollection) Next() (*ClusterRoleTemplateBindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterRoleTemplateBindingCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterRoleTemplateBindingClient) ByID(id string) (*ClusterRoleTemplateBinding, error) { - resp := &ClusterRoleTemplateBinding{} - err := c.apiClient.Ops.DoByID(ClusterRoleTemplateBindingType, id, resp) - return resp, err -} - -func (c *ClusterRoleTemplateBindingClient) Delete(container *ClusterRoleTemplateBinding) error { - return c.apiClient.Ops.DoResourceDelete(ClusterRoleTemplateBindingType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_scan_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_scan_rule.go deleted file mode 100644 index ed5670e81d3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_scan_rule.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ClusterScanRuleType = "clusterScanRule" - ClusterScanRuleFieldFailuresOnly = "failuresOnly" - ClusterScanRuleFieldScanRunType = "scanRunType" -) - -type ClusterScanRule struct { - FailuresOnly bool `json:"failuresOnly,omitempty" yaml:"failuresOnly,omitempty"` - ScanRunType string `json:"scanRunType,omitempty" yaml:"scanRunType,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_secrets.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_secrets.go deleted file mode 100644 index 6f5cc764370..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_secrets.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -const ( - ClusterSecretsType = "clusterSecrets" - ClusterSecretsFieldAADClientCertSecret = "aadClientCertSecret" - ClusterSecretsFieldAADClientSecret = "aadClientSecret" - ClusterSecretsFieldACIAPICUserKeySecret = "aciAPICUserKeySecret" - ClusterSecretsFieldACIKafkaClientKeySecret = "aciKafkaClientKeySecret" - ClusterSecretsFieldACITokenSecret = "aciTokenSecret" - ClusterSecretsFieldBastionHostSSHKeySecret = "bastionHostSSHKeySecret" - ClusterSecretsFieldKubeletExtraEnvSecret = "kubeletExtraEnvSecret" - ClusterSecretsFieldOpenStackSecret = "openStackSecret" - ClusterSecretsFieldPrivateRegistryECRSecret = "privateRegistryECRSecret" - ClusterSecretsFieldPrivateRegistrySecret = "privateRegistrySecret" - ClusterSecretsFieldPrivateRegistryURL = "privateRegistryURL" - ClusterSecretsFieldS3CredentialSecret = "s3CredentialSecret" - ClusterSecretsFieldSecretsEncryptionProvidersSecret = "secretsEncryptionProvidersSecret" - ClusterSecretsFieldVirtualCenterSecret = "virtualCenterSecret" - ClusterSecretsFieldVsphereSecret = "vsphereSecret" - ClusterSecretsFieldWeavePasswordSecret = "weavePasswordSecret" -) - -type ClusterSecrets struct { - AADClientCertSecret string `json:"aadClientCertSecret,omitempty" yaml:"aadClientCertSecret,omitempty"` - AADClientSecret string `json:"aadClientSecret,omitempty" yaml:"aadClientSecret,omitempty"` - ACIAPICUserKeySecret string `json:"aciAPICUserKeySecret,omitempty" yaml:"aciAPICUserKeySecret,omitempty"` - ACIKafkaClientKeySecret string `json:"aciKafkaClientKeySecret,omitempty" yaml:"aciKafkaClientKeySecret,omitempty"` - ACITokenSecret string `json:"aciTokenSecret,omitempty" yaml:"aciTokenSecret,omitempty"` - BastionHostSSHKeySecret string `json:"bastionHostSSHKeySecret,omitempty" yaml:"bastionHostSSHKeySecret,omitempty"` - KubeletExtraEnvSecret string `json:"kubeletExtraEnvSecret,omitempty" yaml:"kubeletExtraEnvSecret,omitempty"` - OpenStackSecret string `json:"openStackSecret,omitempty" yaml:"openStackSecret,omitempty"` - PrivateRegistryECRSecret string `json:"privateRegistryECRSecret,omitempty" yaml:"privateRegistryECRSecret,omitempty"` - PrivateRegistrySecret string `json:"privateRegistrySecret,omitempty" yaml:"privateRegistrySecret,omitempty"` - PrivateRegistryURL string `json:"privateRegistryURL,omitempty" yaml:"privateRegistryURL,omitempty"` - S3CredentialSecret string `json:"s3CredentialSecret,omitempty" yaml:"s3CredentialSecret,omitempty"` - SecretsEncryptionProvidersSecret string `json:"secretsEncryptionProvidersSecret,omitempty" yaml:"secretsEncryptionProvidersSecret,omitempty"` - VirtualCenterSecret string `json:"virtualCenterSecret,omitempty" yaml:"virtualCenterSecret,omitempty"` - VsphereSecret string `json:"vsphereSecret,omitempty" yaml:"vsphereSecret,omitempty"` - WeavePasswordSecret string `json:"weavePasswordSecret,omitempty" yaml:"weavePasswordSecret,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec.go deleted file mode 100644 index 4c0c135dcca..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec.go +++ /dev/null @@ -1,78 +0,0 @@ -package client - -const ( - ClusterSpecType = "clusterSpec" - ClusterSpecFieldAKSConfig = "aksConfig" - ClusterSpecFieldAgentEnvVars = "agentEnvVars" - ClusterSpecFieldAgentImageOverride = "agentImageOverride" - ClusterSpecFieldAmazonElasticContainerServiceConfig = "amazonElasticContainerServiceConfig" - ClusterSpecFieldAzureKubernetesServiceConfig = "azureKubernetesServiceConfig" - ClusterSpecFieldClusterAgentDeploymentCustomization = "clusterAgentDeploymentCustomization" - ClusterSpecFieldClusterSecrets = "clusterSecrets" - ClusterSpecFieldClusterTemplateAnswers = "answers" - ClusterSpecFieldClusterTemplateID = "clusterTemplateId" - ClusterSpecFieldClusterTemplateQuestions = "questions" - ClusterSpecFieldClusterTemplateRevisionID = "clusterTemplateRevisionId" - ClusterSpecFieldDefaultClusterRoleForProjectMembers = "defaultClusterRoleForProjectMembers" - ClusterSpecFieldDefaultPodSecurityAdmissionConfigurationTemplateName = "defaultPodSecurityAdmissionConfigurationTemplateName" - ClusterSpecFieldDefaultPodSecurityPolicyTemplateID = "defaultPodSecurityPolicyTemplateId" - ClusterSpecFieldDescription = "description" - ClusterSpecFieldDesiredAgentImage = "desiredAgentImage" - ClusterSpecFieldDesiredAuthImage = "desiredAuthImage" - ClusterSpecFieldDisplayName = "displayName" - ClusterSpecFieldDockerRootDir = "dockerRootDir" - ClusterSpecFieldEKSConfig = "eksConfig" - ClusterSpecFieldEnableClusterAlerting = "enableClusterAlerting" - ClusterSpecFieldEnableClusterMonitoring = "enableClusterMonitoring" - ClusterSpecFieldEnableNetworkPolicy = "enableNetworkPolicy" - ClusterSpecFieldFleetAgentDeploymentCustomization = "fleetAgentDeploymentCustomization" - ClusterSpecFieldFleetWorkspaceName = "fleetWorkspaceName" - ClusterSpecFieldGKEConfig = "gkeConfig" - ClusterSpecFieldGenericEngineConfig = "genericEngineConfig" - ClusterSpecFieldGoogleKubernetesEngineConfig = "googleKubernetesEngineConfig" - ClusterSpecFieldImportedConfig = "importedConfig" - ClusterSpecFieldInternal = "internal" - ClusterSpecFieldK3sConfig = "k3sConfig" - ClusterSpecFieldLocalClusterAuthEndpoint = "localClusterAuthEndpoint" - ClusterSpecFieldRancherKubernetesEngineConfig = "rancherKubernetesEngineConfig" - ClusterSpecFieldRke2Config = "rke2Config" - ClusterSpecFieldWindowsPreferedCluster = "windowsPreferedCluster" -) - -type ClusterSpec struct { - AKSConfig *AKSClusterConfigSpec `json:"aksConfig,omitempty" yaml:"aksConfig,omitempty"` - AgentEnvVars []EnvVar `json:"agentEnvVars,omitempty" yaml:"agentEnvVars,omitempty"` - AgentImageOverride string `json:"agentImageOverride,omitempty" yaml:"agentImageOverride,omitempty"` - AmazonElasticContainerServiceConfig map[string]interface{} `json:"amazonElasticContainerServiceConfig,omitempty" yaml:"amazonElasticContainerServiceConfig,omitempty"` - AzureKubernetesServiceConfig map[string]interface{} `json:"azureKubernetesServiceConfig,omitempty" yaml:"azureKubernetesServiceConfig,omitempty"` - ClusterAgentDeploymentCustomization *AgentDeploymentCustomization `json:"clusterAgentDeploymentCustomization,omitempty" yaml:"clusterAgentDeploymentCustomization,omitempty"` - ClusterSecrets *ClusterSecrets `json:"clusterSecrets,omitempty" yaml:"clusterSecrets,omitempty"` - ClusterTemplateAnswers *Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - ClusterTemplateID string `json:"clusterTemplateId,omitempty" yaml:"clusterTemplateId,omitempty"` - ClusterTemplateQuestions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - ClusterTemplateRevisionID string `json:"clusterTemplateRevisionId,omitempty" yaml:"clusterTemplateRevisionId,omitempty"` - DefaultClusterRoleForProjectMembers string `json:"defaultClusterRoleForProjectMembers,omitempty" yaml:"defaultClusterRoleForProjectMembers,omitempty"` - DefaultPodSecurityAdmissionConfigurationTemplateName string `json:"defaultPodSecurityAdmissionConfigurationTemplateName,omitempty" yaml:"defaultPodSecurityAdmissionConfigurationTemplateName,omitempty"` - DefaultPodSecurityPolicyTemplateID string `json:"defaultPodSecurityPolicyTemplateId,omitempty" yaml:"defaultPodSecurityPolicyTemplateId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DesiredAgentImage string `json:"desiredAgentImage,omitempty" yaml:"desiredAgentImage,omitempty"` - DesiredAuthImage string `json:"desiredAuthImage,omitempty" yaml:"desiredAuthImage,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - DockerRootDir string `json:"dockerRootDir,omitempty" yaml:"dockerRootDir,omitempty"` - EKSConfig *EKSClusterConfigSpec `json:"eksConfig,omitempty" yaml:"eksConfig,omitempty"` - EnableClusterAlerting bool `json:"enableClusterAlerting,omitempty" yaml:"enableClusterAlerting,omitempty"` - EnableClusterMonitoring bool `json:"enableClusterMonitoring,omitempty" yaml:"enableClusterMonitoring,omitempty"` - EnableNetworkPolicy *bool `json:"enableNetworkPolicy,omitempty" yaml:"enableNetworkPolicy,omitempty"` - FleetAgentDeploymentCustomization *AgentDeploymentCustomization `json:"fleetAgentDeploymentCustomization,omitempty" yaml:"fleetAgentDeploymentCustomization,omitempty"` - FleetWorkspaceName string `json:"fleetWorkspaceName,omitempty" yaml:"fleetWorkspaceName,omitempty"` - GKEConfig *GKEClusterConfigSpec `json:"gkeConfig,omitempty" yaml:"gkeConfig,omitempty"` - GenericEngineConfig map[string]interface{} `json:"genericEngineConfig,omitempty" yaml:"genericEngineConfig,omitempty"` - GoogleKubernetesEngineConfig map[string]interface{} `json:"googleKubernetesEngineConfig,omitempty" yaml:"googleKubernetesEngineConfig,omitempty"` - ImportedConfig *ImportedConfig `json:"importedConfig,omitempty" yaml:"importedConfig,omitempty"` - Internal bool `json:"internal,omitempty" yaml:"internal,omitempty"` - K3sConfig *K3sConfig `json:"k3sConfig,omitempty" yaml:"k3sConfig,omitempty"` - LocalClusterAuthEndpoint *LocalClusterAuthEndpoint `json:"localClusterAuthEndpoint,omitempty" yaml:"localClusterAuthEndpoint,omitempty"` - RancherKubernetesEngineConfig *RancherKubernetesEngineConfig `json:"rancherKubernetesEngineConfig,omitempty" yaml:"rancherKubernetesEngineConfig,omitempty"` - Rke2Config *Rke2Config `json:"rke2Config,omitempty" yaml:"rke2Config,omitempty"` - WindowsPreferedCluster bool `json:"windowsPreferedCluster,omitempty" yaml:"windowsPreferedCluster,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec_base.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec_base.go deleted file mode 100644 index 8ef79b37cc3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_spec_base.go +++ /dev/null @@ -1,42 +0,0 @@ -package client - -const ( - ClusterSpecBaseType = "clusterSpecBase" - ClusterSpecBaseFieldAgentEnvVars = "agentEnvVars" - ClusterSpecBaseFieldAgentImageOverride = "agentImageOverride" - ClusterSpecBaseFieldClusterAgentDeploymentCustomization = "clusterAgentDeploymentCustomization" - ClusterSpecBaseFieldClusterSecrets = "clusterSecrets" - ClusterSpecBaseFieldDefaultClusterRoleForProjectMembers = "defaultClusterRoleForProjectMembers" - ClusterSpecBaseFieldDefaultPodSecurityAdmissionConfigurationTemplateName = "defaultPodSecurityAdmissionConfigurationTemplateName" - ClusterSpecBaseFieldDefaultPodSecurityPolicyTemplateID = "defaultPodSecurityPolicyTemplateId" - ClusterSpecBaseFieldDesiredAgentImage = "desiredAgentImage" - ClusterSpecBaseFieldDesiredAuthImage = "desiredAuthImage" - ClusterSpecBaseFieldDockerRootDir = "dockerRootDir" - ClusterSpecBaseFieldEnableClusterAlerting = "enableClusterAlerting" - ClusterSpecBaseFieldEnableClusterMonitoring = "enableClusterMonitoring" - ClusterSpecBaseFieldEnableNetworkPolicy = "enableNetworkPolicy" - ClusterSpecBaseFieldFleetAgentDeploymentCustomization = "fleetAgentDeploymentCustomization" - ClusterSpecBaseFieldLocalClusterAuthEndpoint = "localClusterAuthEndpoint" - ClusterSpecBaseFieldRancherKubernetesEngineConfig = "rancherKubernetesEngineConfig" - ClusterSpecBaseFieldWindowsPreferedCluster = "windowsPreferedCluster" -) - -type ClusterSpecBase struct { - AgentEnvVars []EnvVar `json:"agentEnvVars,omitempty" yaml:"agentEnvVars,omitempty"` - AgentImageOverride string `json:"agentImageOverride,omitempty" yaml:"agentImageOverride,omitempty"` - ClusterAgentDeploymentCustomization *AgentDeploymentCustomization `json:"clusterAgentDeploymentCustomization,omitempty" yaml:"clusterAgentDeploymentCustomization,omitempty"` - ClusterSecrets *ClusterSecrets `json:"clusterSecrets,omitempty" yaml:"clusterSecrets,omitempty"` - DefaultClusterRoleForProjectMembers string `json:"defaultClusterRoleForProjectMembers,omitempty" yaml:"defaultClusterRoleForProjectMembers,omitempty"` - DefaultPodSecurityAdmissionConfigurationTemplateName string `json:"defaultPodSecurityAdmissionConfigurationTemplateName,omitempty" yaml:"defaultPodSecurityAdmissionConfigurationTemplateName,omitempty"` - DefaultPodSecurityPolicyTemplateID string `json:"defaultPodSecurityPolicyTemplateId,omitempty" yaml:"defaultPodSecurityPolicyTemplateId,omitempty"` - DesiredAgentImage string `json:"desiredAgentImage,omitempty" yaml:"desiredAgentImage,omitempty"` - DesiredAuthImage string `json:"desiredAuthImage,omitempty" yaml:"desiredAuthImage,omitempty"` - DockerRootDir string `json:"dockerRootDir,omitempty" yaml:"dockerRootDir,omitempty"` - EnableClusterAlerting bool `json:"enableClusterAlerting,omitempty" yaml:"enableClusterAlerting,omitempty"` - EnableClusterMonitoring bool `json:"enableClusterMonitoring,omitempty" yaml:"enableClusterMonitoring,omitempty"` - EnableNetworkPolicy *bool `json:"enableNetworkPolicy,omitempty" yaml:"enableNetworkPolicy,omitempty"` - FleetAgentDeploymentCustomization *AgentDeploymentCustomization `json:"fleetAgentDeploymentCustomization,omitempty" yaml:"fleetAgentDeploymentCustomization,omitempty"` - LocalClusterAuthEndpoint *LocalClusterAuthEndpoint `json:"localClusterAuthEndpoint,omitempty" yaml:"localClusterAuthEndpoint,omitempty"` - RancherKubernetesEngineConfig *RancherKubernetesEngineConfig `json:"rancherKubernetesEngineConfig,omitempty" yaml:"rancherKubernetesEngineConfig,omitempty"` - WindowsPreferedCluster bool `json:"windowsPreferedCluster,omitempty" yaml:"windowsPreferedCluster,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_status.go deleted file mode 100644 index d3bfae84692..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_status.go +++ /dev/null @@ -1,90 +0,0 @@ -package client - -const ( - ClusterStatusType = "clusterStatus" - ClusterStatusFieldAADClientCertSecret = "aadClientCertSecret" - ClusterStatusFieldAADClientSecret = "aadClientSecret" - ClusterStatusFieldAKSStatus = "aksStatus" - ClusterStatusFieldAPIEndpoint = "apiEndpoint" - ClusterStatusFieldAgentFeatures = "agentFeatures" - ClusterStatusFieldAgentImage = "agentImage" - ClusterStatusFieldAllocatable = "allocatable" - ClusterStatusFieldAppliedAgentEnvVars = "appliedAgentEnvVars" - ClusterStatusFieldAppliedClusterAgentDeploymentCustomization = "appliedClusterAgentDeploymentCustomization" - ClusterStatusFieldAppliedEnableNetworkPolicy = "appliedEnableNetworkPolicy" - ClusterStatusFieldAppliedPodSecurityPolicyTemplateName = "appliedPodSecurityPolicyTemplateId" - ClusterStatusFieldAppliedSpec = "appliedSpec" - ClusterStatusFieldAuthImage = "authImage" - ClusterStatusFieldCACert = "caCert" - ClusterStatusFieldCapabilities = "capabilities" - ClusterStatusFieldCapacity = "capacity" - ClusterStatusFieldCertificatesExpiration = "certificatesExpiration" - ClusterStatusFieldComponentStatuses = "componentStatuses" - ClusterStatusFieldConditions = "conditions" - ClusterStatusFieldCurrentCisRunName = "currentCisRunName" - ClusterStatusFieldDriver = "driver" - ClusterStatusFieldEKSStatus = "eksStatus" - ClusterStatusFieldFailedSpec = "failedSpec" - ClusterStatusFieldGKEStatus = "gkeStatus" - ClusterStatusFieldIstioEnabled = "istioEnabled" - ClusterStatusFieldLimits = "limits" - ClusterStatusFieldLinuxWorkerCount = "linuxWorkerCount" - ClusterStatusFieldMonitoringStatus = "monitoringStatus" - ClusterStatusFieldNodeCount = "nodeCount" - ClusterStatusFieldNodeVersion = "nodeVersion" - ClusterStatusFieldOpenStackSecret = "openStackSecret" - ClusterStatusFieldPrivateRegistrySecret = "privateRegistrySecret" - ClusterStatusFieldProvider = "provider" - ClusterStatusFieldRequested = "requested" - ClusterStatusFieldS3CredentialSecret = "s3CredentialSecret" - ClusterStatusFieldServiceAccountTokenSecret = "serviceAccountTokenSecret" - ClusterStatusFieldVersion = "version" - ClusterStatusFieldVirtualCenterSecret = "virtualCenterSecret" - ClusterStatusFieldVsphereSecret = "vsphereSecret" - ClusterStatusFieldWeavePasswordSecret = "weavePasswordSecret" - ClusterStatusFieldWindowsWorkerCount = "windowsWorkerCount" -) - -type ClusterStatus struct { - AADClientCertSecret string `json:"aadClientCertSecret,omitempty" yaml:"aadClientCertSecret,omitempty"` - AADClientSecret string `json:"aadClientSecret,omitempty" yaml:"aadClientSecret,omitempty"` - AKSStatus *AKSStatus `json:"aksStatus,omitempty" yaml:"aksStatus,omitempty"` - APIEndpoint string `json:"apiEndpoint,omitempty" yaml:"apiEndpoint,omitempty"` - AgentFeatures map[string]bool `json:"agentFeatures,omitempty" yaml:"agentFeatures,omitempty"` - AgentImage string `json:"agentImage,omitempty" yaml:"agentImage,omitempty"` - Allocatable map[string]string `json:"allocatable,omitempty" yaml:"allocatable,omitempty"` - AppliedAgentEnvVars []EnvVar `json:"appliedAgentEnvVars,omitempty" yaml:"appliedAgentEnvVars,omitempty"` - AppliedClusterAgentDeploymentCustomization *AgentDeploymentCustomization `json:"appliedClusterAgentDeploymentCustomization,omitempty" yaml:"appliedClusterAgentDeploymentCustomization,omitempty"` - AppliedEnableNetworkPolicy bool `json:"appliedEnableNetworkPolicy,omitempty" yaml:"appliedEnableNetworkPolicy,omitempty"` - AppliedPodSecurityPolicyTemplateName string `json:"appliedPodSecurityPolicyTemplateId,omitempty" yaml:"appliedPodSecurityPolicyTemplateId,omitempty"` - AppliedSpec *ClusterSpec `json:"appliedSpec,omitempty" yaml:"appliedSpec,omitempty"` - AuthImage string `json:"authImage,omitempty" yaml:"authImage,omitempty"` - CACert string `json:"caCert,omitempty" yaml:"caCert,omitempty"` - Capabilities *Capabilities `json:"capabilities,omitempty" yaml:"capabilities,omitempty"` - Capacity map[string]string `json:"capacity,omitempty" yaml:"capacity,omitempty"` - CertificatesExpiration map[string]CertExpiration `json:"certificatesExpiration,omitempty" yaml:"certificatesExpiration,omitempty"` - ComponentStatuses []ClusterComponentStatus `json:"componentStatuses,omitempty" yaml:"componentStatuses,omitempty"` - Conditions []ClusterCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - CurrentCisRunName string `json:"currentCisRunName,omitempty" yaml:"currentCisRunName,omitempty"` - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - EKSStatus *EKSStatus `json:"eksStatus,omitempty" yaml:"eksStatus,omitempty"` - FailedSpec *ClusterSpec `json:"failedSpec,omitempty" yaml:"failedSpec,omitempty"` - GKEStatus *GKEStatus `json:"gkeStatus,omitempty" yaml:"gkeStatus,omitempty"` - IstioEnabled bool `json:"istioEnabled,omitempty" yaml:"istioEnabled,omitempty"` - Limits map[string]string `json:"limits,omitempty" yaml:"limits,omitempty"` - LinuxWorkerCount int64 `json:"linuxWorkerCount,omitempty" yaml:"linuxWorkerCount,omitempty"` - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty" yaml:"monitoringStatus,omitempty"` - NodeCount int64 `json:"nodeCount,omitempty" yaml:"nodeCount,omitempty"` - NodeVersion int64 `json:"nodeVersion,omitempty" yaml:"nodeVersion,omitempty"` - OpenStackSecret string `json:"openStackSecret,omitempty" yaml:"openStackSecret,omitempty"` - PrivateRegistrySecret string `json:"privateRegistrySecret,omitempty" yaml:"privateRegistrySecret,omitempty"` - Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` - Requested map[string]string `json:"requested,omitempty" yaml:"requested,omitempty"` - S3CredentialSecret string `json:"s3CredentialSecret,omitempty" yaml:"s3CredentialSecret,omitempty"` - ServiceAccountTokenSecret string `json:"serviceAccountTokenSecret,omitempty" yaml:"serviceAccountTokenSecret,omitempty"` - Version *Info `json:"version,omitempty" yaml:"version,omitempty"` - VirtualCenterSecret string `json:"virtualCenterSecret,omitempty" yaml:"virtualCenterSecret,omitempty"` - VsphereSecret string `json:"vsphereSecret,omitempty" yaml:"vsphereSecret,omitempty"` - WeavePasswordSecret string `json:"weavePasswordSecret,omitempty" yaml:"weavePasswordSecret,omitempty"` - WindowsWorkerCount int64 `json:"windowsWorkerCount,omitempty" yaml:"windowsWorkerCount,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template.go deleted file mode 100644 index 63fcdb4d5bd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template.go +++ /dev/null @@ -1,124 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterTemplateType = "clusterTemplate" - ClusterTemplateFieldAnnotations = "annotations" - ClusterTemplateFieldCreated = "created" - ClusterTemplateFieldCreatorID = "creatorId" - ClusterTemplateFieldDefaultRevisionID = "defaultRevisionId" - ClusterTemplateFieldDescription = "description" - ClusterTemplateFieldLabels = "labels" - ClusterTemplateFieldMembers = "members" - ClusterTemplateFieldName = "name" - ClusterTemplateFieldOwnerReferences = "ownerReferences" - ClusterTemplateFieldRemoved = "removed" - ClusterTemplateFieldUUID = "uuid" -) - -type ClusterTemplate struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DefaultRevisionID string `json:"defaultRevisionId,omitempty" yaml:"defaultRevisionId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterTemplateCollection struct { - types.Collection - Data []ClusterTemplate `json:"data,omitempty"` - client *ClusterTemplateClient -} - -type ClusterTemplateClient struct { - apiClient *Client -} - -type ClusterTemplateOperations interface { - List(opts *types.ListOpts) (*ClusterTemplateCollection, error) - ListAll(opts *types.ListOpts) (*ClusterTemplateCollection, error) - Create(opts *ClusterTemplate) (*ClusterTemplate, error) - Update(existing *ClusterTemplate, updates interface{}) (*ClusterTemplate, error) - Replace(existing *ClusterTemplate) (*ClusterTemplate, error) - ByID(id string) (*ClusterTemplate, error) - Delete(container *ClusterTemplate) error -} - -func newClusterTemplateClient(apiClient *Client) *ClusterTemplateClient { - return &ClusterTemplateClient{ - apiClient: apiClient, - } -} - -func (c *ClusterTemplateClient) Create(container *ClusterTemplate) (*ClusterTemplate, error) { - resp := &ClusterTemplate{} - err := c.apiClient.Ops.DoCreate(ClusterTemplateType, container, resp) - return resp, err -} - -func (c *ClusterTemplateClient) Update(existing *ClusterTemplate, updates interface{}) (*ClusterTemplate, error) { - resp := &ClusterTemplate{} - err := c.apiClient.Ops.DoUpdate(ClusterTemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterTemplateClient) Replace(obj *ClusterTemplate) (*ClusterTemplate, error) { - resp := &ClusterTemplate{} - err := c.apiClient.Ops.DoReplace(ClusterTemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterTemplateClient) List(opts *types.ListOpts) (*ClusterTemplateCollection, error) { - resp := &ClusterTemplateCollection{} - err := c.apiClient.Ops.DoList(ClusterTemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterTemplateClient) ListAll(opts *types.ListOpts) (*ClusterTemplateCollection, error) { - resp := &ClusterTemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterTemplateCollection) Next() (*ClusterTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterTemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterTemplateClient) ByID(id string) (*ClusterTemplate, error) { - resp := &ClusterTemplate{} - err := c.apiClient.Ops.DoByID(ClusterTemplateType, id, resp) - return resp, err -} - -func (c *ClusterTemplateClient) Delete(container *ClusterTemplate) error { - return c.apiClient.Ops.DoResourceDelete(ClusterTemplateType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_questions_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_questions_output.go deleted file mode 100644 index 2de3399092b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_questions_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ClusterTemplateQuestionsOutputType = "clusterTemplateQuestionsOutput" - ClusterTemplateQuestionsOutputFieldQuestions = "questions" -) - -type ClusterTemplateQuestionsOutput struct { - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision.go deleted file mode 100644 index 6986d4e393a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision.go +++ /dev/null @@ -1,186 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterTemplateRevisionType = "clusterTemplateRevision" - ClusterTemplateRevisionFieldAADClientCertSecret = "aadClientCertSecret" - ClusterTemplateRevisionFieldAADClientSecret = "aadClientSecret" - ClusterTemplateRevisionFieldACIAPICUserKeySecret = "aciAPICUserKeySecret" - ClusterTemplateRevisionFieldACIKafkaClientKeySecret = "aciKafkaClientKeySecret" - ClusterTemplateRevisionFieldACITokenSecret = "aciTokenSecret" - ClusterTemplateRevisionFieldAnnotations = "annotations" - ClusterTemplateRevisionFieldBastionHostSSHKeySecret = "bastionHostSSHKeySecret" - ClusterTemplateRevisionFieldClusterConfig = "clusterConfig" - ClusterTemplateRevisionFieldClusterTemplateID = "clusterTemplateId" - ClusterTemplateRevisionFieldConditions = "conditions" - ClusterTemplateRevisionFieldCreated = "created" - ClusterTemplateRevisionFieldCreatorID = "creatorId" - ClusterTemplateRevisionFieldEnabled = "enabled" - ClusterTemplateRevisionFieldKubeletExtraEnvSecret = "kubeletExtraEnvSecret" - ClusterTemplateRevisionFieldLabels = "labels" - ClusterTemplateRevisionFieldName = "name" - ClusterTemplateRevisionFieldOpenStackSecret = "openStackSecret" - ClusterTemplateRevisionFieldOwnerReferences = "ownerReferences" - ClusterTemplateRevisionFieldPrivateRegistryECRSecret = "privateRegistryECRSecret" - ClusterTemplateRevisionFieldPrivateRegistrySecret = "privateRegistrySecret" - ClusterTemplateRevisionFieldQuestions = "questions" - ClusterTemplateRevisionFieldRemoved = "removed" - ClusterTemplateRevisionFieldS3CredentialSecret = "s3CredentialSecret" - ClusterTemplateRevisionFieldSecretsEncryptionProvidersSecret = "secretsEncryptionProvidersSecret" - ClusterTemplateRevisionFieldState = "state" - ClusterTemplateRevisionFieldTransitioning = "transitioning" - ClusterTemplateRevisionFieldTransitioningMessage = "transitioningMessage" - ClusterTemplateRevisionFieldUUID = "uuid" - ClusterTemplateRevisionFieldVirtualCenterSecret = "virtualCenterSecret" - ClusterTemplateRevisionFieldVsphereSecret = "vsphereSecret" - ClusterTemplateRevisionFieldWeavePasswordSecret = "weavePasswordSecret" -) - -type ClusterTemplateRevision struct { - types.Resource - AADClientCertSecret string `json:"aadClientCertSecret,omitempty" yaml:"aadClientCertSecret,omitempty"` - AADClientSecret string `json:"aadClientSecret,omitempty" yaml:"aadClientSecret,omitempty"` - ACIAPICUserKeySecret string `json:"aciAPICUserKeySecret,omitempty" yaml:"aciAPICUserKeySecret,omitempty"` - ACIKafkaClientKeySecret string `json:"aciKafkaClientKeySecret,omitempty" yaml:"aciKafkaClientKeySecret,omitempty"` - ACITokenSecret string `json:"aciTokenSecret,omitempty" yaml:"aciTokenSecret,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - BastionHostSSHKeySecret string `json:"bastionHostSSHKeySecret,omitempty" yaml:"bastionHostSSHKeySecret,omitempty"` - ClusterConfig *ClusterSpecBase `json:"clusterConfig,omitempty" yaml:"clusterConfig,omitempty"` - ClusterTemplateID string `json:"clusterTemplateId,omitempty" yaml:"clusterTemplateId,omitempty"` - Conditions []ClusterTemplateRevisionCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - KubeletExtraEnvSecret string `json:"kubeletExtraEnvSecret,omitempty" yaml:"kubeletExtraEnvSecret,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OpenStackSecret string `json:"openStackSecret,omitempty" yaml:"openStackSecret,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PrivateRegistryECRSecret string `json:"privateRegistryECRSecret,omitempty" yaml:"privateRegistryECRSecret,omitempty"` - PrivateRegistrySecret string `json:"privateRegistrySecret,omitempty" yaml:"privateRegistrySecret,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - S3CredentialSecret string `json:"s3CredentialSecret,omitempty" yaml:"s3CredentialSecret,omitempty"` - SecretsEncryptionProvidersSecret string `json:"secretsEncryptionProvidersSecret,omitempty" yaml:"secretsEncryptionProvidersSecret,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - VirtualCenterSecret string `json:"virtualCenterSecret,omitempty" yaml:"virtualCenterSecret,omitempty"` - VsphereSecret string `json:"vsphereSecret,omitempty" yaml:"vsphereSecret,omitempty"` - WeavePasswordSecret string `json:"weavePasswordSecret,omitempty" yaml:"weavePasswordSecret,omitempty"` -} - -type ClusterTemplateRevisionCollection struct { - types.Collection - Data []ClusterTemplateRevision `json:"data,omitempty"` - client *ClusterTemplateRevisionClient -} - -type ClusterTemplateRevisionClient struct { - apiClient *Client -} - -type ClusterTemplateRevisionOperations interface { - List(opts *types.ListOpts) (*ClusterTemplateRevisionCollection, error) - ListAll(opts *types.ListOpts) (*ClusterTemplateRevisionCollection, error) - Create(opts *ClusterTemplateRevision) (*ClusterTemplateRevision, error) - Update(existing *ClusterTemplateRevision, updates interface{}) (*ClusterTemplateRevision, error) - Replace(existing *ClusterTemplateRevision) (*ClusterTemplateRevision, error) - ByID(id string) (*ClusterTemplateRevision, error) - Delete(container *ClusterTemplateRevision) error - - ActionDisable(resource *ClusterTemplateRevision) error - - ActionEnable(resource *ClusterTemplateRevision) error - - CollectionActionListquestions(resource *ClusterTemplateRevisionCollection) (*ClusterTemplateQuestionsOutput, error) -} - -func newClusterTemplateRevisionClient(apiClient *Client) *ClusterTemplateRevisionClient { - return &ClusterTemplateRevisionClient{ - apiClient: apiClient, - } -} - -func (c *ClusterTemplateRevisionClient) Create(container *ClusterTemplateRevision) (*ClusterTemplateRevision, error) { - resp := &ClusterTemplateRevision{} - err := c.apiClient.Ops.DoCreate(ClusterTemplateRevisionType, container, resp) - return resp, err -} - -func (c *ClusterTemplateRevisionClient) Update(existing *ClusterTemplateRevision, updates interface{}) (*ClusterTemplateRevision, error) { - resp := &ClusterTemplateRevision{} - err := c.apiClient.Ops.DoUpdate(ClusterTemplateRevisionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterTemplateRevisionClient) Replace(obj *ClusterTemplateRevision) (*ClusterTemplateRevision, error) { - resp := &ClusterTemplateRevision{} - err := c.apiClient.Ops.DoReplace(ClusterTemplateRevisionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterTemplateRevisionClient) List(opts *types.ListOpts) (*ClusterTemplateRevisionCollection, error) { - resp := &ClusterTemplateRevisionCollection{} - err := c.apiClient.Ops.DoList(ClusterTemplateRevisionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterTemplateRevisionClient) ListAll(opts *types.ListOpts) (*ClusterTemplateRevisionCollection, error) { - resp := &ClusterTemplateRevisionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterTemplateRevisionCollection) Next() (*ClusterTemplateRevisionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterTemplateRevisionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterTemplateRevisionClient) ByID(id string) (*ClusterTemplateRevision, error) { - resp := &ClusterTemplateRevision{} - err := c.apiClient.Ops.DoByID(ClusterTemplateRevisionType, id, resp) - return resp, err -} - -func (c *ClusterTemplateRevisionClient) Delete(container *ClusterTemplateRevision) error { - return c.apiClient.Ops.DoResourceDelete(ClusterTemplateRevisionType, &container.Resource) -} - -func (c *ClusterTemplateRevisionClient) ActionDisable(resource *ClusterTemplateRevision) error { - err := c.apiClient.Ops.DoAction(ClusterTemplateRevisionType, "disable", &resource.Resource, nil, nil) - return err -} - -func (c *ClusterTemplateRevisionClient) ActionEnable(resource *ClusterTemplateRevision) error { - err := c.apiClient.Ops.DoAction(ClusterTemplateRevisionType, "enable", &resource.Resource, nil, nil) - return err -} - -func (c *ClusterTemplateRevisionClient) CollectionActionListquestions(resource *ClusterTemplateRevisionCollection) (*ClusterTemplateQuestionsOutput, error) { - resp := &ClusterTemplateQuestionsOutput{} - err := c.apiClient.Ops.DoCollectionAction(ClusterTemplateRevisionType, "listquestions", &resource.Collection, nil, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_condition.go deleted file mode 100644 index 114d52be1e8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - ClusterTemplateRevisionConditionType = "clusterTemplateRevisionCondition" - ClusterTemplateRevisionConditionFieldLastTransitionTime = "lastTransitionTime" - ClusterTemplateRevisionConditionFieldLastUpdateTime = "lastUpdateTime" - ClusterTemplateRevisionConditionFieldMessage = "message" - ClusterTemplateRevisionConditionFieldReason = "reason" - ClusterTemplateRevisionConditionFieldStatus = "status" - ClusterTemplateRevisionConditionFieldType = "type" -) - -type ClusterTemplateRevisionCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_spec.go deleted file mode 100644 index 72a46d6c993..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_spec.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - ClusterTemplateRevisionSpecType = "clusterTemplateRevisionSpec" - ClusterTemplateRevisionSpecFieldClusterConfig = "clusterConfig" - ClusterTemplateRevisionSpecFieldClusterTemplateID = "clusterTemplateId" - ClusterTemplateRevisionSpecFieldDisplayName = "displayName" - ClusterTemplateRevisionSpecFieldEnabled = "enabled" - ClusterTemplateRevisionSpecFieldQuestions = "questions" -) - -type ClusterTemplateRevisionSpec struct { - ClusterConfig *ClusterSpecBase `json:"clusterConfig,omitempty" yaml:"clusterConfig,omitempty"` - ClusterTemplateID string `json:"clusterTemplateId,omitempty" yaml:"clusterTemplateId,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_status.go deleted file mode 100644 index 1aa56ea24eb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_revision_status.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -const ( - ClusterTemplateRevisionStatusType = "clusterTemplateRevisionStatus" - ClusterTemplateRevisionStatusFieldAADClientCertSecret = "aadClientCertSecret" - ClusterTemplateRevisionStatusFieldAADClientSecret = "aadClientSecret" - ClusterTemplateRevisionStatusFieldACIAPICUserKeySecret = "aciAPICUserKeySecret" - ClusterTemplateRevisionStatusFieldACIKafkaClientKeySecret = "aciKafkaClientKeySecret" - ClusterTemplateRevisionStatusFieldACITokenSecret = "aciTokenSecret" - ClusterTemplateRevisionStatusFieldBastionHostSSHKeySecret = "bastionHostSSHKeySecret" - ClusterTemplateRevisionStatusFieldConditions = "conditions" - ClusterTemplateRevisionStatusFieldKubeletExtraEnvSecret = "kubeletExtraEnvSecret" - ClusterTemplateRevisionStatusFieldOpenStackSecret = "openStackSecret" - ClusterTemplateRevisionStatusFieldPrivateRegistryECRSecret = "privateRegistryECRSecret" - ClusterTemplateRevisionStatusFieldPrivateRegistrySecret = "privateRegistrySecret" - ClusterTemplateRevisionStatusFieldS3CredentialSecret = "s3CredentialSecret" - ClusterTemplateRevisionStatusFieldSecretsEncryptionProvidersSecret = "secretsEncryptionProvidersSecret" - ClusterTemplateRevisionStatusFieldVirtualCenterSecret = "virtualCenterSecret" - ClusterTemplateRevisionStatusFieldVsphereSecret = "vsphereSecret" - ClusterTemplateRevisionStatusFieldWeavePasswordSecret = "weavePasswordSecret" -) - -type ClusterTemplateRevisionStatus struct { - AADClientCertSecret string `json:"aadClientCertSecret,omitempty" yaml:"aadClientCertSecret,omitempty"` - AADClientSecret string `json:"aadClientSecret,omitempty" yaml:"aadClientSecret,omitempty"` - ACIAPICUserKeySecret string `json:"aciAPICUserKeySecret,omitempty" yaml:"aciAPICUserKeySecret,omitempty"` - ACIKafkaClientKeySecret string `json:"aciKafkaClientKeySecret,omitempty" yaml:"aciKafkaClientKeySecret,omitempty"` - ACITokenSecret string `json:"aciTokenSecret,omitempty" yaml:"aciTokenSecret,omitempty"` - BastionHostSSHKeySecret string `json:"bastionHostSSHKeySecret,omitempty" yaml:"bastionHostSSHKeySecret,omitempty"` - Conditions []ClusterTemplateRevisionCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - KubeletExtraEnvSecret string `json:"kubeletExtraEnvSecret,omitempty" yaml:"kubeletExtraEnvSecret,omitempty"` - OpenStackSecret string `json:"openStackSecret,omitempty" yaml:"openStackSecret,omitempty"` - PrivateRegistryECRSecret string `json:"privateRegistryECRSecret,omitempty" yaml:"privateRegistryECRSecret,omitempty"` - PrivateRegistrySecret string `json:"privateRegistrySecret,omitempty" yaml:"privateRegistrySecret,omitempty"` - S3CredentialSecret string `json:"s3CredentialSecret,omitempty" yaml:"s3CredentialSecret,omitempty"` - SecretsEncryptionProvidersSecret string `json:"secretsEncryptionProvidersSecret,omitempty" yaml:"secretsEncryptionProvidersSecret,omitempty"` - VirtualCenterSecret string `json:"virtualCenterSecret,omitempty" yaml:"virtualCenterSecret,omitempty"` - VsphereSecret string `json:"vsphereSecret,omitempty" yaml:"vsphereSecret,omitempty"` - WeavePasswordSecret string `json:"weavePasswordSecret,omitempty" yaml:"weavePasswordSecret,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_spec.go deleted file mode 100644 index 6d0270f5b7a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_template_spec.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ClusterTemplateSpecType = "clusterTemplateSpec" - ClusterTemplateSpecFieldDefaultRevisionID = "defaultRevisionId" - ClusterTemplateSpecFieldDescription = "description" - ClusterTemplateSpecFieldDisplayName = "displayName" - ClusterTemplateSpecFieldMembers = "members" -) - -type ClusterTemplateSpec struct { - DefaultRevisionID string `json:"defaultRevisionId,omitempty" yaml:"defaultRevisionId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_test_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_test_input.go deleted file mode 100644 index 14c25264b79..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_test_input.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - ClusterTestInputType = "clusterTestInput" - ClusterTestInputFieldClusterName = "clusterId" - ClusterTestInputFieldCustomTargetConfig = "customTargetConfig" - ClusterTestInputFieldElasticsearchConfig = "elasticsearchConfig" - ClusterTestInputFieldFluentForwarderConfig = "fluentForwarderConfig" - ClusterTestInputFieldKafkaConfig = "kafkaConfig" - ClusterTestInputFieldOutputTags = "outputTags" - ClusterTestInputFieldSplunkConfig = "splunkConfig" - ClusterTestInputFieldSyslogConfig = "syslogConfig" -) - -type ClusterTestInput struct { - ClusterName string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - CustomTargetConfig *CustomTargetConfig `json:"customTargetConfig,omitempty" yaml:"customTargetConfig,omitempty"` - ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty" yaml:"elasticsearchConfig,omitempty"` - FluentForwarderConfig *FluentForwarderConfig `json:"fluentForwarderConfig,omitempty" yaml:"fluentForwarderConfig,omitempty"` - KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty" yaml:"kafkaConfig,omitempty"` - OutputTags map[string]string `json:"outputTags,omitempty" yaml:"outputTags,omitempty"` - SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty" yaml:"splunkConfig,omitempty"` - SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty" yaml:"syslogConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_upgrade_strategy.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_upgrade_strategy.go deleted file mode 100644 index c5081078441..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cluster_upgrade_strategy.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ClusterUpgradeStrategyType = "clusterUpgradeStrategy" - ClusterUpgradeStrategyFieldDrainServerNodes = "drainServerNodes" - ClusterUpgradeStrategyFieldDrainWorkerNodes = "drainWorkerNodes" - ClusterUpgradeStrategyFieldServerConcurrency = "serverConcurrency" - ClusterUpgradeStrategyFieldWorkerConcurrency = "workerConcurrency" -) - -type ClusterUpgradeStrategy struct { - DrainServerNodes bool `json:"drainServerNodes,omitempty" yaml:"drainServerNodes,omitempty"` - DrainWorkerNodes bool `json:"drainWorkerNodes,omitempty" yaml:"drainWorkerNodes,omitempty"` - ServerConcurrency int64 `json:"serverConcurrency,omitempty" yaml:"serverConcurrency,omitempty"` - WorkerConcurrency int64 `json:"workerConcurrency,omitempty" yaml:"workerConcurrency,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_component_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_component_condition.go deleted file mode 100644 index ac2357941c1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_component_condition.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ComponentConditionType = "componentCondition" - ComponentConditionFieldError = "error" - ComponentConditionFieldMessage = "message" - ComponentConditionFieldStatus = "status" - ComponentConditionFieldType = "type" -) - -type ComponentCondition struct { - Error string `json:"error,omitempty" yaml:"error,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_condition.go deleted file mode 100644 index e2b5a1ec4c6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - ComposeConditionType = "composeCondition" - ComposeConditionFieldLastTransitionTime = "lastTransitionTime" - ComposeConditionFieldLastUpdateTime = "lastUpdateTime" - ComposeConditionFieldMessage = "message" - ComposeConditionFieldReason = "reason" - ComposeConditionFieldStatus = "status" - ComposeConditionFieldType = "type" -) - -type ComposeCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_config.go deleted file mode 100644 index 7b926c8d546..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_config.go +++ /dev/null @@ -1,128 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ComposeConfigType = "composeConfig" - ComposeConfigFieldAnnotations = "annotations" - ComposeConfigFieldCreated = "created" - ComposeConfigFieldCreatorID = "creatorId" - ComposeConfigFieldLabels = "labels" - ComposeConfigFieldName = "name" - ComposeConfigFieldOwnerReferences = "ownerReferences" - ComposeConfigFieldRancherCompose = "rancherCompose" - ComposeConfigFieldRemoved = "removed" - ComposeConfigFieldState = "state" - ComposeConfigFieldStatus = "status" - ComposeConfigFieldTransitioning = "transitioning" - ComposeConfigFieldTransitioningMessage = "transitioningMessage" - ComposeConfigFieldUUID = "uuid" -) - -type ComposeConfig struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *ComposeStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ComposeConfigCollection struct { - types.Collection - Data []ComposeConfig `json:"data,omitempty"` - client *ComposeConfigClient -} - -type ComposeConfigClient struct { - apiClient *Client -} - -type ComposeConfigOperations interface { - List(opts *types.ListOpts) (*ComposeConfigCollection, error) - ListAll(opts *types.ListOpts) (*ComposeConfigCollection, error) - Create(opts *ComposeConfig) (*ComposeConfig, error) - Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) - Replace(existing *ComposeConfig) (*ComposeConfig, error) - ByID(id string) (*ComposeConfig, error) - Delete(container *ComposeConfig) error -} - -func newComposeConfigClient(apiClient *Client) *ComposeConfigClient { - return &ComposeConfigClient{ - apiClient: apiClient, - } -} - -func (c *ComposeConfigClient) Create(container *ComposeConfig) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.apiClient.Ops.DoCreate(ComposeConfigType, container, resp) - return resp, err -} - -func (c *ComposeConfigClient) Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.apiClient.Ops.DoUpdate(ComposeConfigType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeConfigClient) Replace(obj *ComposeConfig) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.apiClient.Ops.DoReplace(ComposeConfigType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ComposeConfigClient) List(opts *types.ListOpts) (*ComposeConfigCollection, error) { - resp := &ComposeConfigCollection{} - err := c.apiClient.Ops.DoList(ComposeConfigType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ComposeConfigClient) ListAll(opts *types.ListOpts) (*ComposeConfigCollection, error) { - resp := &ComposeConfigCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ComposeConfigCollection) Next() (*ComposeConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeConfigCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeConfigClient) ByID(id string) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.apiClient.Ops.DoByID(ComposeConfigType, id, resp) - return resp, err -} - -func (c *ComposeConfigClient) Delete(container *ComposeConfig) error { - return c.apiClient.Ops.DoResourceDelete(ComposeConfigType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_spec.go deleted file mode 100644 index 6477b002ba6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_spec.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ComposeSpecType = "composeSpec" - ComposeSpecFieldRancherCompose = "rancherCompose" -) - -type ComposeSpec struct { - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_status.go deleted file mode 100644 index 53138f03d17..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_compose_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ComposeStatusType = "composeStatus" - ComposeStatusFieldConditions = "conditions" -) - -type ComposeStatus struct { - Conditions []ComposeCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_condition.go deleted file mode 100644 index 7f502043455..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - ConditionType = "condition" - ConditionFieldLastTransitionTime = "lastTransitionTime" - ConditionFieldLastUpdateTime = "lastUpdateTime" - ConditionFieldMessage = "message" - ConditionFieldReason = "reason" - ConditionFieldStatus = "status" - ConditionFieldType = "type" -) - -type Condition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_key_selector.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_key_selector.go deleted file mode 100644 index e1b599115d5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_key_selector.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ConfigMapKeySelectorType = "configMapKeySelector" - ConfigMapKeySelectorFieldKey = "key" - ConfigMapKeySelectorFieldName = "name" - ConfigMapKeySelectorFieldOptional = "optional" -) - -type ConfigMapKeySelector struct { - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_node_config_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_node_config_source.go deleted file mode 100644 index 1f6d09001b3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_node_config_source.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - ConfigMapNodeConfigSourceType = "configMapNodeConfigSource" - ConfigMapNodeConfigSourceFieldKubeletConfigKey = "kubeletConfigKey" - ConfigMapNodeConfigSourceFieldName = "name" - ConfigMapNodeConfigSourceFieldNamespace = "namespace" - ConfigMapNodeConfigSourceFieldResourceVersion = "resourceVersion" - ConfigMapNodeConfigSourceFieldUID = "uid" -) - -type ConfigMapNodeConfigSource struct { - KubeletConfigKey string `json:"kubeletConfigKey,omitempty" yaml:"kubeletConfigKey,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` - ResourceVersion string `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"` - UID string `json:"uid,omitempty" yaml:"uid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_projection.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_projection.go deleted file mode 100644 index 94388a5086e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_projection.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ConfigMapProjectionType = "configMapProjection" - ConfigMapProjectionFieldItems = "items" - ConfigMapProjectionFieldName = "name" - ConfigMapProjectionFieldOptional = "optional" -) - -type ConfigMapProjection struct { - Items []KeyToPath `json:"items,omitempty" yaml:"items,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_volume_source.go deleted file mode 100644 index 4de7b8ad37d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_config_map_volume_source.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ConfigMapVolumeSourceType = "configMapVolumeSource" - ConfigMapVolumeSourceFieldDefaultMode = "defaultMode" - ConfigMapVolumeSourceFieldItems = "items" - ConfigMapVolumeSourceFieldName = "name" - ConfigMapVolumeSourceFieldOptional = "optional" -) - -type ConfigMapVolumeSource struct { - DefaultMode *int64 `json:"defaultMode,omitempty" yaml:"defaultMode,omitempty"` - Items []KeyToPath `json:"items,omitempty" yaml:"items,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_container_image.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_container_image.go deleted file mode 100644 index 5f141974045..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_container_image.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ContainerImageType = "containerImage" - ContainerImageFieldNames = "names" - ContainerImageFieldSizeBytes = "sizeBytes" -) - -type ContainerImage struct { - Names []string `json:"names,omitempty" yaml:"names,omitempty"` - SizeBytes int64 `json:"sizeBytes,omitempty" yaml:"sizeBytes,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_container_resource_limit.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_container_resource_limit.go deleted file mode 100644 index b36a49929e6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_container_resource_limit.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ContainerResourceLimitType = "containerResourceLimit" - ContainerResourceLimitFieldLimitsCPU = "limitsCpu" - ContainerResourceLimitFieldLimitsMemory = "limitsMemory" - ContainerResourceLimitFieldRequestsCPU = "requestsCpu" - ContainerResourceLimitFieldRequestsMemory = "requestsMemory" -) - -type ContainerResourceLimit struct { - LimitsCPU string `json:"limitsCpu,omitempty" yaml:"limitsCpu,omitempty"` - LimitsMemory string `json:"limitsMemory,omitempty" yaml:"limitsMemory,omitempty"` - RequestsCPU string `json:"requestsCpu,omitempty" yaml:"requestsCpu,omitempty"` - RequestsMemory string `json:"requestsMemory,omitempty" yaml:"requestsMemory,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cpu_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_cpu_info.go deleted file mode 100644 index 08764a5e5c4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_cpu_info.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CPUInfoType = "cpuInfo" - CPUInfoFieldCount = "count" -) - -type CPUInfo struct { - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_csi_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_csi_volume_source.go deleted file mode 100644 index f341d530057..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_csi_volume_source.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - CSIVolumeSourceType = "csiVolumeSource" - CSIVolumeSourceFieldDriver = "driver" - CSIVolumeSourceFieldFSType = "fsType" - CSIVolumeSourceFieldNodePublishSecretRef = "nodePublishSecretRef" - CSIVolumeSourceFieldReadOnly = "readOnly" - CSIVolumeSourceFieldVolumeAttributes = "volumeAttributes" -) - -type CSIVolumeSource struct { - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - NodePublishSecretRef *LocalObjectReference `json:"nodePublishSecretRef,omitempty" yaml:"nodePublishSecretRef,omitempty"` - ReadOnly *bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - VolumeAttributes map[string]string `json:"volumeAttributes,omitempty" yaml:"volumeAttributes,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_config.go deleted file mode 100644 index 677392bb50d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_config.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - CustomConfigType = "customConfig" - CustomConfigFieldAddress = "address" - CustomConfigFieldDockerSocket = "dockerSocket" - CustomConfigFieldInternalAddress = "internalAddress" - CustomConfigFieldLabel = "label" - CustomConfigFieldSSHCert = "sshCert" - CustomConfigFieldSSHKey = "sshKey" - CustomConfigFieldTaints = "taints" - CustomConfigFieldUser = "user" -) - -type CustomConfig struct { - Address string `json:"address,omitempty" yaml:"address,omitempty"` - DockerSocket string `json:"dockerSocket,omitempty" yaml:"dockerSocket,omitempty"` - InternalAddress string `json:"internalAddress,omitempty" yaml:"internalAddress,omitempty"` - Label map[string]string `json:"label,omitempty" yaml:"label,omitempty"` - SSHCert string `json:"sshCert,omitempty" yaml:"sshCert,omitempty"` - SSHKey string `json:"sshKey,omitempty" yaml:"sshKey,omitempty"` - Taints []string `json:"taints,omitempty" yaml:"taints,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_target_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_target_config.go deleted file mode 100644 index 265747db50d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_custom_target_config.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - CustomTargetConfigType = "customTargetConfig" - CustomTargetConfigFieldCertificate = "certificate" - CustomTargetConfigFieldClientCert = "clientCert" - CustomTargetConfigFieldClientKey = "clientKey" - CustomTargetConfigFieldContent = "content" -) - -type CustomTargetConfig struct { - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty" yaml:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty" yaml:"clientKey,omitempty"` - Content string `json:"content,omitempty" yaml:"content,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_endpoint.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_endpoint.go deleted file mode 100644 index 88cefc764c9..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_endpoint.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - DaemonEndpointType = "daemonEndpoint" - DaemonEndpointFieldPort = "Port" -) - -type DaemonEndpoint struct { - Port int64 `json:"Port,omitempty" yaml:"Port,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_set_update_strategy.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_set_update_strategy.go deleted file mode 100644 index 775007ecdc1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_daemon_set_update_strategy.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - DaemonSetUpdateStrategyType = "daemonSetUpdateStrategy" - DaemonSetUpdateStrategyFieldRollingUpdate = "rollingUpdate" - DaemonSetUpdateStrategyFieldStrategy = "strategy" -) - -type DaemonSetUpdateStrategy struct { - RollingUpdate *RollingUpdateDaemonSet `json:"rollingUpdate,omitempty" yaml:"rollingUpdate,omitempty"` - Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_deployment_strategy.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_deployment_strategy.go deleted file mode 100644 index 69c4b91bf62..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_deployment_strategy.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - DeploymentStrategyType = "deploymentStrategy" - DeploymentStrategyFieldRollingUpdate = "rollingUpdate" - DeploymentStrategyFieldStrategy = "strategy" -) - -type DeploymentStrategy struct { - RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty" yaml:"rollingUpdate,omitempty"` - Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dingtalk_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_dingtalk_config.go deleted file mode 100644 index 646c98f1966..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dingtalk_config.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - DingtalkConfigType = "dingtalkConfig" - DingtalkConfigFieldProxyURL = "proxyUrl" - DingtalkConfigFieldSecret = "secret" - DingtalkConfigFieldURL = "url" -) - -type DingtalkConfig struct { - ProxyURL string `json:"proxyUrl,omitempty" yaml:"proxyUrl,omitempty"` - Secret string `json:"secret,omitempty" yaml:"secret,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_disk_vsphere_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_disk_vsphere_opts.go deleted file mode 100644 index d3db88aeecd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_disk_vsphere_opts.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - DiskVsphereOptsType = "diskVsphereOpts" - DiskVsphereOptsFieldSCSIControllerType = "scsicontrollertype" -) - -type DiskVsphereOpts struct { - SCSIControllerType string `json:"scsicontrollertype,omitempty" yaml:"scsicontrollertype,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dns_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_dns_config.go deleted file mode 100644 index d7a5630b45a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dns_config.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - DNSConfigType = "dnsConfig" - DNSConfigFieldLinearAutoscalerParams = "linearAutoscalerParams" - DNSConfigFieldNodeSelector = "nodeSelector" - DNSConfigFieldNodelocal = "nodelocal" - DNSConfigFieldOptions = "options" - DNSConfigFieldProvider = "provider" - DNSConfigFieldReverseCIDRs = "reversecidrs" - DNSConfigFieldStubDomains = "stubdomains" - DNSConfigFieldTolerations = "tolerations" - DNSConfigFieldUpdateStrategy = "updateStrategy" - DNSConfigFieldUpstreamNameservers = "upstreamnameservers" -) - -type DNSConfig struct { - LinearAutoscalerParams *LinearAutoscalerParams `json:"linearAutoscalerParams,omitempty" yaml:"linearAutoscalerParams,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"` - Nodelocal *Nodelocal `json:"nodelocal,omitempty" yaml:"nodelocal,omitempty"` - Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"` - Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` - ReverseCIDRs []string `json:"reversecidrs,omitempty" yaml:"reversecidrs,omitempty"` - StubDomains map[string][]string `json:"stubdomains,omitempty" yaml:"stubdomains,omitempty"` - Tolerations []Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"` - UpdateStrategy *DeploymentStrategy `json:"updateStrategy,omitempty" yaml:"updateStrategy,omitempty"` - UpstreamNameservers []string `json:"upstreamnameservers,omitempty" yaml:"upstreamnameservers,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_docker_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_docker_info.go deleted file mode 100644 index 1b66e628458..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_docker_info.go +++ /dev/null @@ -1,48 +0,0 @@ -package client - -const ( - DockerInfoType = "dockerInfo" - DockerInfoFieldArchitecture = "architecture" - DockerInfoFieldCgroupDriver = "cgroupDriver" - DockerInfoFieldDebug = "debug" - DockerInfoFieldDockerRootDir = "dockerRootDir" - DockerInfoFieldDriver = "driver" - DockerInfoFieldExperimentalBuild = "experimentalBuild" - DockerInfoFieldHTTPProxy = "httpProxy" - DockerInfoFieldHTTPSProxy = "httpsProxy" - DockerInfoFieldID = "id" - DockerInfoFieldIndexServerAddress = "indexServerAddress" - DockerInfoFieldInitBinary = "initBinary" - DockerInfoFieldKernelVersion = "kernelVersion" - DockerInfoFieldLabels = "labels" - DockerInfoFieldLoggingDriver = "loggingDriver" - DockerInfoFieldName = "name" - DockerInfoFieldNoProxy = "noProxy" - DockerInfoFieldOSType = "osType" - DockerInfoFieldOperatingSystem = "operatingSystem" - DockerInfoFieldSecurityOptions = "securityOptions" - DockerInfoFieldServerVersion = "serverVersion" -) - -type DockerInfo struct { - Architecture string `json:"architecture,omitempty" yaml:"architecture,omitempty"` - CgroupDriver string `json:"cgroupDriver,omitempty" yaml:"cgroupDriver,omitempty"` - Debug bool `json:"debug,omitempty" yaml:"debug,omitempty"` - DockerRootDir string `json:"dockerRootDir,omitempty" yaml:"dockerRootDir,omitempty"` - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - ExperimentalBuild bool `json:"experimentalBuild,omitempty" yaml:"experimentalBuild,omitempty"` - HTTPProxy string `json:"httpProxy,omitempty" yaml:"httpProxy,omitempty"` - HTTPSProxy string `json:"httpsProxy,omitempty" yaml:"httpsProxy,omitempty"` - ID string `json:"id,omitempty" yaml:"id,omitempty"` - IndexServerAddress string `json:"indexServerAddress,omitempty" yaml:"indexServerAddress,omitempty"` - InitBinary string `json:"initBinary,omitempty" yaml:"initBinary,omitempty"` - KernelVersion string `json:"kernelVersion,omitempty" yaml:"kernelVersion,omitempty"` - Labels []string `json:"labels,omitempty" yaml:"labels,omitempty"` - LoggingDriver string `json:"loggingDriver,omitempty" yaml:"loggingDriver,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NoProxy string `json:"noProxy,omitempty" yaml:"noProxy,omitempty"` - OSType string `json:"osType,omitempty" yaml:"osType,omitempty"` - OperatingSystem string `json:"operatingSystem,omitempty" yaml:"operatingSystem,omitempty"` - SecurityOptions []string `json:"securityOptions,omitempty" yaml:"securityOptions,omitempty"` - ServerVersion string `json:"serverVersion,omitempty" yaml:"serverVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apiprojection.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apiprojection.go deleted file mode 100644 index ca02c4ddf60..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apiprojection.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - DownwardAPIProjectionType = "downwardAPIProjection" - DownwardAPIProjectionFieldItems = "items" -) - -type DownwardAPIProjection struct { - Items []DownwardAPIVolumeFile `json:"items,omitempty" yaml:"items,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_file.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_file.go deleted file mode 100644 index c8f8bc2b790..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_file.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - DownwardAPIVolumeFileType = "downwardAPIVolumeFile" - DownwardAPIVolumeFileFieldFieldRef = "fieldRef" - DownwardAPIVolumeFileFieldMode = "mode" - DownwardAPIVolumeFileFieldPath = "path" - DownwardAPIVolumeFileFieldResourceFieldRef = "resourceFieldRef" -) - -type DownwardAPIVolumeFile struct { - FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" yaml:"fieldRef,omitempty"` - Mode *int64 `json:"mode,omitempty" yaml:"mode,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" yaml:"resourceFieldRef,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_source.go deleted file mode 100644 index f6be194473c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_downward_apivolume_source.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - DownwardAPIVolumeSourceType = "downwardAPIVolumeSource" - DownwardAPIVolumeSourceFieldDefaultMode = "defaultMode" - DownwardAPIVolumeSourceFieldItems = "items" -) - -type DownwardAPIVolumeSource struct { - DefaultMode *int64 `json:"defaultMode,omitempty" yaml:"defaultMode,omitempty"` - Items []DownwardAPIVolumeFile `json:"items,omitempty" yaml:"items,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_duration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_duration.go deleted file mode 100644 index cf0920cf5eb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_duration.go +++ /dev/null @@ -1,8 +0,0 @@ -package client - -const ( - DurationType = "duration" -) - -type Duration struct { -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema.go deleted file mode 100644 index 080dcb417c5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema.go +++ /dev/null @@ -1,152 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - DynamicSchemaType = "dynamicSchema" - DynamicSchemaFieldAnnotations = "annotations" - DynamicSchemaFieldCollectionActions = "collectionActions" - DynamicSchemaFieldCollectionFields = "collectionFields" - DynamicSchemaFieldCollectionFilters = "collectionFilters" - DynamicSchemaFieldCollectionMethods = "collectionMethods" - DynamicSchemaFieldCreated = "created" - DynamicSchemaFieldCreatorID = "creatorId" - DynamicSchemaFieldDynamicSchemaVersion = "dynamicSchemaVersion" - DynamicSchemaFieldEmbed = "embed" - DynamicSchemaFieldEmbedType = "embedType" - DynamicSchemaFieldIncludeableLinks = "includeableLinks" - DynamicSchemaFieldLabels = "labels" - DynamicSchemaFieldName = "name" - DynamicSchemaFieldOwnerReferences = "ownerReferences" - DynamicSchemaFieldPluralName = "pluralName" - DynamicSchemaFieldRemoved = "removed" - DynamicSchemaFieldResourceActions = "resourceActions" - DynamicSchemaFieldResourceFields = "resourceFields" - DynamicSchemaFieldResourceMethods = "resourceMethods" - DynamicSchemaFieldSchemaName = "schemaName" - DynamicSchemaFieldState = "state" - DynamicSchemaFieldStatus = "status" - DynamicSchemaFieldTransitioning = "transitioning" - DynamicSchemaFieldTransitioningMessage = "transitioningMessage" - DynamicSchemaFieldUUID = "uuid" -) - -type DynamicSchema struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - CollectionActions map[string]Action `json:"collectionActions,omitempty" yaml:"collectionActions,omitempty"` - CollectionFields map[string]Field `json:"collectionFields,omitempty" yaml:"collectionFields,omitempty"` - CollectionFilters map[string]Filter `json:"collectionFilters,omitempty" yaml:"collectionFilters,omitempty"` - CollectionMethods []string `json:"collectionMethods,omitempty" yaml:"collectionMethods,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DynamicSchemaVersion string `json:"dynamicSchemaVersion,omitempty" yaml:"dynamicSchemaVersion,omitempty"` - Embed bool `json:"embed,omitempty" yaml:"embed,omitempty"` - EmbedType string `json:"embedType,omitempty" yaml:"embedType,omitempty"` - IncludeableLinks []string `json:"includeableLinks,omitempty" yaml:"includeableLinks,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PluralName string `json:"pluralName,omitempty" yaml:"pluralName,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ResourceActions map[string]Action `json:"resourceActions,omitempty" yaml:"resourceActions,omitempty"` - ResourceFields map[string]Field `json:"resourceFields,omitempty" yaml:"resourceFields,omitempty"` - ResourceMethods []string `json:"resourceMethods,omitempty" yaml:"resourceMethods,omitempty"` - SchemaName string `json:"schemaName,omitempty" yaml:"schemaName,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *DynamicSchemaStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type DynamicSchemaCollection struct { - types.Collection - Data []DynamicSchema `json:"data,omitempty"` - client *DynamicSchemaClient -} - -type DynamicSchemaClient struct { - apiClient *Client -} - -type DynamicSchemaOperations interface { - List(opts *types.ListOpts) (*DynamicSchemaCollection, error) - ListAll(opts *types.ListOpts) (*DynamicSchemaCollection, error) - Create(opts *DynamicSchema) (*DynamicSchema, error) - Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) - Replace(existing *DynamicSchema) (*DynamicSchema, error) - ByID(id string) (*DynamicSchema, error) - Delete(container *DynamicSchema) error -} - -func newDynamicSchemaClient(apiClient *Client) *DynamicSchemaClient { - return &DynamicSchemaClient{ - apiClient: apiClient, - } -} - -func (c *DynamicSchemaClient) Create(container *DynamicSchema) (*DynamicSchema, error) { - resp := &DynamicSchema{} - err := c.apiClient.Ops.DoCreate(DynamicSchemaType, container, resp) - return resp, err -} - -func (c *DynamicSchemaClient) Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) { - resp := &DynamicSchema{} - err := c.apiClient.Ops.DoUpdate(DynamicSchemaType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DynamicSchemaClient) Replace(obj *DynamicSchema) (*DynamicSchema, error) { - resp := &DynamicSchema{} - err := c.apiClient.Ops.DoReplace(DynamicSchemaType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *DynamicSchemaClient) List(opts *types.ListOpts) (*DynamicSchemaCollection, error) { - resp := &DynamicSchemaCollection{} - err := c.apiClient.Ops.DoList(DynamicSchemaType, opts, resp) - resp.client = c - return resp, err -} - -func (c *DynamicSchemaClient) ListAll(opts *types.ListOpts) (*DynamicSchemaCollection, error) { - resp := &DynamicSchemaCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *DynamicSchemaCollection) Next() (*DynamicSchemaCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DynamicSchemaCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DynamicSchemaClient) ByID(id string) (*DynamicSchema, error) { - resp := &DynamicSchema{} - err := c.apiClient.Ops.DoByID(DynamicSchemaType, id, resp) - return resp, err -} - -func (c *DynamicSchemaClient) Delete(container *DynamicSchema) error { - return c.apiClient.Ops.DoResourceDelete(DynamicSchemaType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_spec.go deleted file mode 100644 index db9b5440d22..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_spec.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -const ( - DynamicSchemaSpecType = "dynamicSchemaSpec" - DynamicSchemaSpecFieldCollectionActions = "collectionActions" - DynamicSchemaSpecFieldCollectionFields = "collectionFields" - DynamicSchemaSpecFieldCollectionFilters = "collectionFilters" - DynamicSchemaSpecFieldCollectionMethods = "collectionMethods" - DynamicSchemaSpecFieldDynamicSchemaVersion = "dynamicSchemaVersion" - DynamicSchemaSpecFieldEmbed = "embed" - DynamicSchemaSpecFieldEmbedType = "embedType" - DynamicSchemaSpecFieldIncludeableLinks = "includeableLinks" - DynamicSchemaSpecFieldPluralName = "pluralName" - DynamicSchemaSpecFieldResourceActions = "resourceActions" - DynamicSchemaSpecFieldResourceFields = "resourceFields" - DynamicSchemaSpecFieldResourceMethods = "resourceMethods" - DynamicSchemaSpecFieldSchemaName = "schemaName" -) - -type DynamicSchemaSpec struct { - CollectionActions map[string]Action `json:"collectionActions,omitempty" yaml:"collectionActions,omitempty"` - CollectionFields map[string]Field `json:"collectionFields,omitempty" yaml:"collectionFields,omitempty"` - CollectionFilters map[string]Filter `json:"collectionFilters,omitempty" yaml:"collectionFilters,omitempty"` - CollectionMethods []string `json:"collectionMethods,omitempty" yaml:"collectionMethods,omitempty"` - DynamicSchemaVersion string `json:"dynamicSchemaVersion,omitempty" yaml:"dynamicSchemaVersion,omitempty"` - Embed bool `json:"embed,omitempty" yaml:"embed,omitempty"` - EmbedType string `json:"embedType,omitempty" yaml:"embedType,omitempty"` - IncludeableLinks []string `json:"includeableLinks,omitempty" yaml:"includeableLinks,omitempty"` - PluralName string `json:"pluralName,omitempty" yaml:"pluralName,omitempty"` - ResourceActions map[string]Action `json:"resourceActions,omitempty" yaml:"resourceActions,omitempty"` - ResourceFields map[string]Field `json:"resourceFields,omitempty" yaml:"resourceFields,omitempty"` - ResourceMethods []string `json:"resourceMethods,omitempty" yaml:"resourceMethods,omitempty"` - SchemaName string `json:"schemaName,omitempty" yaml:"schemaName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_status.go deleted file mode 100644 index 014783e6431..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_dynamic_schema_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - DynamicSchemaStatusType = "dynamicSchemaStatus" - DynamicSchemaStatusFieldFake = "fake" -) - -type DynamicSchemaStatus struct { - Fake string `json:"fake,omitempty" yaml:"fake,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ecr_credential_plugin.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ecr_credential_plugin.go deleted file mode 100644 index f4e0ae48028..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ecr_credential_plugin.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ECRCredentialPluginType = "ecrCredentialPlugin" - ECRCredentialPluginFieldAwsAccessKeyID = "awsAccessKeyId" - ECRCredentialPluginFieldAwsSecretAccessKey = "awsSecretAccessKey" - ECRCredentialPluginFieldAwsSessionToken = "awsAccessToken" -) - -type ECRCredentialPlugin struct { - AwsAccessKeyID string `json:"awsAccessKeyId,omitempty" yaml:"awsAccessKeyId,omitempty"` - AwsSecretAccessKey string `json:"awsSecretAccessKey,omitempty" yaml:"awsSecretAccessKey,omitempty"` - AwsSessionToken string `json:"awsAccessToken,omitempty" yaml:"awsAccessToken,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_cluster_config_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_cluster_config_spec.go deleted file mode 100644 index d51b1e1c1f1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_cluster_config_spec.go +++ /dev/null @@ -1,42 +0,0 @@ -package client - -const ( - EKSClusterConfigSpecType = "eksClusterConfigSpec" - EKSClusterConfigSpecFieldAmazonCredentialSecret = "amazonCredentialSecret" - EKSClusterConfigSpecFieldDisplayName = "displayName" - EKSClusterConfigSpecFieldEBSCSIDriver = "ebsCSIDriver" - EKSClusterConfigSpecFieldImported = "imported" - EKSClusterConfigSpecFieldKmsKey = "kmsKey" - EKSClusterConfigSpecFieldKubernetesVersion = "kubernetesVersion" - EKSClusterConfigSpecFieldLoggingTypes = "loggingTypes" - EKSClusterConfigSpecFieldNodeGroups = "nodeGroups" - EKSClusterConfigSpecFieldPrivateAccess = "privateAccess" - EKSClusterConfigSpecFieldPublicAccess = "publicAccess" - EKSClusterConfigSpecFieldPublicAccessSources = "publicAccessSources" - EKSClusterConfigSpecFieldRegion = "region" - EKSClusterConfigSpecFieldSecretsEncryption = "secretsEncryption" - EKSClusterConfigSpecFieldSecurityGroups = "securityGroups" - EKSClusterConfigSpecFieldServiceRole = "serviceRole" - EKSClusterConfigSpecFieldSubnets = "subnets" - EKSClusterConfigSpecFieldTags = "tags" -) - -type EKSClusterConfigSpec struct { - AmazonCredentialSecret string `json:"amazonCredentialSecret,omitempty" yaml:"amazonCredentialSecret,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - EBSCSIDriver *bool `json:"ebsCSIDriver,omitempty" yaml:"ebsCSIDriver,omitempty"` - Imported bool `json:"imported,omitempty" yaml:"imported,omitempty"` - KmsKey *string `json:"kmsKey,omitempty" yaml:"kmsKey,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` - LoggingTypes *[]string `json:"loggingTypes,omitempty" yaml:"loggingTypes,omitempty"` - NodeGroups []NodeGroup `json:"nodeGroups,omitempty" yaml:"nodeGroups,omitempty"` - PrivateAccess *bool `json:"privateAccess,omitempty" yaml:"privateAccess,omitempty"` - PublicAccess *bool `json:"publicAccess,omitempty" yaml:"publicAccess,omitempty"` - PublicAccessSources *[]string `json:"publicAccessSources,omitempty" yaml:"publicAccessSources,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - SecretsEncryption *bool `json:"secretsEncryption,omitempty" yaml:"secretsEncryption,omitempty"` - SecurityGroups *[]string `json:"securityGroups,omitempty" yaml:"securityGroups,omitempty"` - ServiceRole *string `json:"serviceRole,omitempty" yaml:"serviceRole,omitempty"` - Subnets *[]string `json:"subnets,omitempty" yaml:"subnets,omitempty"` - Tags *map[string]string `json:"tags,omitempty" yaml:"tags,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_status.go deleted file mode 100644 index 54127aac08f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_eks_status.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - EKSStatusType = "eksStatus" - EKSStatusFieldGeneratedNodeRole = "generatedNodeRole" - EKSStatusFieldManagedLaunchTemplateID = "managedLaunchTemplateID" - EKSStatusFieldManagedLaunchTemplateVersions = "managedLaunchTemplateVersions" - EKSStatusFieldPrivateRequiresTunnel = "privateRequiresTunnel" - EKSStatusFieldSecurityGroups = "securityGroups" - EKSStatusFieldSubnets = "subnets" - EKSStatusFieldUpstreamSpec = "upstreamSpec" - EKSStatusFieldVirtualNetwork = "virtualNetwork" -) - -type EKSStatus struct { - GeneratedNodeRole string `json:"generatedNodeRole,omitempty" yaml:"generatedNodeRole,omitempty"` - ManagedLaunchTemplateID string `json:"managedLaunchTemplateID,omitempty" yaml:"managedLaunchTemplateID,omitempty"` - ManagedLaunchTemplateVersions map[string]string `json:"managedLaunchTemplateVersions,omitempty" yaml:"managedLaunchTemplateVersions,omitempty"` - PrivateRequiresTunnel *bool `json:"privateRequiresTunnel,omitempty" yaml:"privateRequiresTunnel,omitempty"` - SecurityGroups []string `json:"securityGroups,omitempty" yaml:"securityGroups,omitempty"` - Subnets []string `json:"subnets,omitempty" yaml:"subnets,omitempty"` - UpstreamSpec *EKSClusterConfigSpec `json:"upstreamSpec,omitempty" yaml:"upstreamSpec,omitempty"` - VirtualNetwork string `json:"virtualNetwork,omitempty" yaml:"virtualNetwork,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_elasticsearch_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_elasticsearch_config.go deleted file mode 100644 index de968693b39..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_elasticsearch_config.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - ElasticsearchConfigType = "elasticsearchConfig" - ElasticsearchConfigFieldAuthPassword = "authPassword" - ElasticsearchConfigFieldAuthUserName = "authUsername" - ElasticsearchConfigFieldCertificate = "certificate" - ElasticsearchConfigFieldClientCert = "clientCert" - ElasticsearchConfigFieldClientKey = "clientKey" - ElasticsearchConfigFieldClientKeyPass = "clientKeyPass" - ElasticsearchConfigFieldDateFormat = "dateFormat" - ElasticsearchConfigFieldEndpoint = "endpoint" - ElasticsearchConfigFieldIndexPrefix = "indexPrefix" - ElasticsearchConfigFieldSSLVerify = "sslVerify" - ElasticsearchConfigFieldSSLVersion = "sslVersion" -) - -type ElasticsearchConfig struct { - AuthPassword string `json:"authPassword,omitempty" yaml:"authPassword,omitempty"` - AuthUserName string `json:"authUsername,omitempty" yaml:"authUsername,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty" yaml:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty" yaml:"clientKey,omitempty"` - ClientKeyPass string `json:"clientKeyPass,omitempty" yaml:"clientKeyPass,omitempty"` - DateFormat string `json:"dateFormat,omitempty" yaml:"dateFormat,omitempty"` - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - IndexPrefix string `json:"indexPrefix,omitempty" yaml:"indexPrefix,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty" yaml:"sslVerify,omitempty"` - SSLVersion string `json:"sslVersion,omitempty" yaml:"sslVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_empty_dir_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_empty_dir_volume_source.go deleted file mode 100644 index c4856f332c4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_empty_dir_volume_source.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - EmptyDirVolumeSourceType = "emptyDirVolumeSource" - EmptyDirVolumeSourceFieldMedium = "medium" - EmptyDirVolumeSourceFieldSizeLimit = "sizeLimit" -) - -type EmptyDirVolumeSource struct { - Medium string `json:"medium,omitempty" yaml:"medium,omitempty"` - SizeLimit string `json:"sizeLimit,omitempty" yaml:"sizeLimit,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_encryption_configuration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_encryption_configuration.go deleted file mode 100644 index 8cc644dd267..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_encryption_configuration.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - EncryptionConfigurationType = "encryptionConfiguration" - EncryptionConfigurationFieldAPIVersion = "apiVersion" - EncryptionConfigurationFieldKind = "kind" - EncryptionConfigurationFieldResources = "resources" -) - -type EncryptionConfiguration struct { - APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Resources []ResourceConfiguration `json:"resources,omitempty" yaml:"resources,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var.go deleted file mode 100644 index 35ccda3f860..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - EnvVarType = "envVar" - EnvVarFieldName = "name" - EnvVarFieldValue = "value" - EnvVarFieldValueFrom = "valueFrom" -) - -type EnvVar struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` - ValueFrom *EnvVarSource `json:"valueFrom,omitempty" yaml:"valueFrom,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var_source.go deleted file mode 100644 index 390a033e53e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_env_var_source.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - EnvVarSourceType = "envVarSource" - EnvVarSourceFieldConfigMapKeyRef = "configMapKeyRef" - EnvVarSourceFieldFieldRef = "fieldRef" - EnvVarSourceFieldResourceFieldRef = "resourceFieldRef" - EnvVarSourceFieldSecretKeyRef = "secretKeyRef" -) - -type EnvVarSource struct { - ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty" yaml:"configMapKeyRef,omitempty"` - FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" yaml:"fieldRef,omitempty"` - ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" yaml:"resourceFieldRef,omitempty"` - SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty" yaml:"secretKeyRef,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ephemeral_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ephemeral_volume_source.go deleted file mode 100644 index fc7f09e54fc..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ephemeral_volume_source.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - EphemeralVolumeSourceType = "ephemeralVolumeSource" - EphemeralVolumeSourceFieldVolumeClaimTemplate = "volumeClaimTemplate" -) - -type EphemeralVolumeSource struct { - VolumeClaimTemplate *PersistentVolumeClaimTemplate `json:"volumeClaimTemplate,omitempty" yaml:"volumeClaimTemplate,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup.go deleted file mode 100644 index 74cdd40c38b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup.go +++ /dev/null @@ -1,136 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - EtcdBackupType = "etcdBackup" - EtcdBackupFieldAnnotations = "annotations" - EtcdBackupFieldBackupConfig = "backupConfig" - EtcdBackupFieldClusterID = "clusterId" - EtcdBackupFieldCreated = "created" - EtcdBackupFieldCreatorID = "creatorId" - EtcdBackupFieldFilename = "filename" - EtcdBackupFieldLabels = "labels" - EtcdBackupFieldManual = "manual" - EtcdBackupFieldName = "name" - EtcdBackupFieldNamespaceId = "namespaceId" - EtcdBackupFieldOwnerReferences = "ownerReferences" - EtcdBackupFieldRemoved = "removed" - EtcdBackupFieldState = "state" - EtcdBackupFieldStatus = "status" - EtcdBackupFieldTransitioning = "transitioning" - EtcdBackupFieldTransitioningMessage = "transitioningMessage" - EtcdBackupFieldUUID = "uuid" -) - -type EtcdBackup struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - BackupConfig *BackupConfig `json:"backupConfig,omitempty" yaml:"backupConfig,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Filename string `json:"filename,omitempty" yaml:"filename,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Manual bool `json:"manual,omitempty" yaml:"manual,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *EtcdBackupStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type EtcdBackupCollection struct { - types.Collection - Data []EtcdBackup `json:"data,omitempty"` - client *EtcdBackupClient -} - -type EtcdBackupClient struct { - apiClient *Client -} - -type EtcdBackupOperations interface { - List(opts *types.ListOpts) (*EtcdBackupCollection, error) - ListAll(opts *types.ListOpts) (*EtcdBackupCollection, error) - Create(opts *EtcdBackup) (*EtcdBackup, error) - Update(existing *EtcdBackup, updates interface{}) (*EtcdBackup, error) - Replace(existing *EtcdBackup) (*EtcdBackup, error) - ByID(id string) (*EtcdBackup, error) - Delete(container *EtcdBackup) error -} - -func newEtcdBackupClient(apiClient *Client) *EtcdBackupClient { - return &EtcdBackupClient{ - apiClient: apiClient, - } -} - -func (c *EtcdBackupClient) Create(container *EtcdBackup) (*EtcdBackup, error) { - resp := &EtcdBackup{} - err := c.apiClient.Ops.DoCreate(EtcdBackupType, container, resp) - return resp, err -} - -func (c *EtcdBackupClient) Update(existing *EtcdBackup, updates interface{}) (*EtcdBackup, error) { - resp := &EtcdBackup{} - err := c.apiClient.Ops.DoUpdate(EtcdBackupType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *EtcdBackupClient) Replace(obj *EtcdBackup) (*EtcdBackup, error) { - resp := &EtcdBackup{} - err := c.apiClient.Ops.DoReplace(EtcdBackupType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *EtcdBackupClient) List(opts *types.ListOpts) (*EtcdBackupCollection, error) { - resp := &EtcdBackupCollection{} - err := c.apiClient.Ops.DoList(EtcdBackupType, opts, resp) - resp.client = c - return resp, err -} - -func (c *EtcdBackupClient) ListAll(opts *types.ListOpts) (*EtcdBackupCollection, error) { - resp := &EtcdBackupCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *EtcdBackupCollection) Next() (*EtcdBackupCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &EtcdBackupCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *EtcdBackupClient) ByID(id string) (*EtcdBackup, error) { - resp := &EtcdBackup{} - err := c.apiClient.Ops.DoByID(EtcdBackupType, id, resp) - return resp, err -} - -func (c *EtcdBackupClient) Delete(container *EtcdBackup) error { - return c.apiClient.Ops.DoResourceDelete(EtcdBackupType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_condition.go deleted file mode 100644 index bfae753010c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - EtcdBackupConditionType = "etcdBackupCondition" - EtcdBackupConditionFieldLastTransitionTime = "lastTransitionTime" - EtcdBackupConditionFieldLastUpdateTime = "lastUpdateTime" - EtcdBackupConditionFieldMessage = "message" - EtcdBackupConditionFieldReason = "reason" - EtcdBackupConditionFieldStatus = "status" - EtcdBackupConditionFieldType = "type" -) - -type EtcdBackupCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_spec.go deleted file mode 100644 index f78b2276602..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_spec.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - EtcdBackupSpecType = "etcdBackupSpec" - EtcdBackupSpecFieldBackupConfig = "backupConfig" - EtcdBackupSpecFieldClusterID = "clusterId" - EtcdBackupSpecFieldFilename = "filename" - EtcdBackupSpecFieldManual = "manual" -) - -type EtcdBackupSpec struct { - BackupConfig *BackupConfig `json:"backupConfig,omitempty" yaml:"backupConfig,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Filename string `json:"filename,omitempty" yaml:"filename,omitempty"` - Manual bool `json:"manual,omitempty" yaml:"manual,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_status.go deleted file mode 100644 index 57b48ef7275..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_backup_status.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - EtcdBackupStatusType = "etcdBackupStatus" - EtcdBackupStatusFieldClusterObject = "clusterObject" - EtcdBackupStatusFieldConditions = "conditions" - EtcdBackupStatusFieldKubernetesVersion = "kubernetesVersion" -) - -type EtcdBackupStatus struct { - ClusterObject string `json:"clusterObject,omitempty" yaml:"clusterObject,omitempty"` - Conditions []EtcdBackupCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - KubernetesVersion string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_service.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_service.go deleted file mode 100644 index 6c174992114..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_etcd_service.go +++ /dev/null @@ -1,48 +0,0 @@ -package client - -const ( - ETCDServiceType = "etcdService" - ETCDServiceFieldBackupConfig = "backupConfig" - ETCDServiceFieldCACert = "caCert" - ETCDServiceFieldCert = "cert" - ETCDServiceFieldCreation = "creation" - ETCDServiceFieldExternalURLs = "externalUrls" - ETCDServiceFieldExtraArgs = "extraArgs" - ETCDServiceFieldExtraArgsArray = "extraArgsArray" - ETCDServiceFieldExtraBinds = "extraBinds" - ETCDServiceFieldExtraEnv = "extraEnv" - ETCDServiceFieldGID = "gid" - ETCDServiceFieldImage = "image" - ETCDServiceFieldKey = "key" - ETCDServiceFieldPath = "path" - ETCDServiceFieldRetention = "retention" - ETCDServiceFieldSnapshot = "snapshot" - ETCDServiceFieldUID = "uid" - ETCDServiceFieldWindowsExtraArgs = "winExtraArgs" - ETCDServiceFieldWindowsExtraArgsArray = "winExtraArgsArray" - ETCDServiceFieldWindowsExtraBinds = "winExtraBinds" - ETCDServiceFieldWindowsExtraEnv = "winExtraEnv" -) - -type ETCDService struct { - BackupConfig *BackupConfig `json:"backupConfig,omitempty" yaml:"backupConfig,omitempty"` - CACert string `json:"caCert,omitempty" yaml:"caCert,omitempty"` - Cert string `json:"cert,omitempty" yaml:"cert,omitempty"` - Creation string `json:"creation,omitempty" yaml:"creation,omitempty"` - ExternalURLs []string `json:"externalUrls,omitempty" yaml:"externalUrls,omitempty"` - ExtraArgs map[string]string `json:"extraArgs,omitempty" yaml:"extraArgs,omitempty"` - ExtraArgsArray map[string][]string `json:"extraArgsArray,omitempty" yaml:"extraArgsArray,omitempty"` - ExtraBinds []string `json:"extraBinds,omitempty" yaml:"extraBinds,omitempty"` - ExtraEnv []string `json:"extraEnv,omitempty" yaml:"extraEnv,omitempty"` - GID int64 `json:"gid,omitempty" yaml:"gid,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - Retention string `json:"retention,omitempty" yaml:"retention,omitempty"` - Snapshot *bool `json:"snapshot,omitempty" yaml:"snapshot,omitempty"` - UID int64 `json:"uid,omitempty" yaml:"uid,omitempty"` - WindowsExtraArgs map[string]string `json:"winExtraArgs,omitempty" yaml:"winExtraArgs,omitempty"` - WindowsExtraArgsArray map[string][]string `json:"winExtraArgsArray,omitempty" yaml:"winExtraArgsArray,omitempty"` - WindowsExtraBinds []string `json:"winExtraBinds,omitempty" yaml:"winExtraBinds,omitempty"` - WindowsExtraEnv []string `json:"winExtraEnv,omitempty" yaml:"winExtraEnv,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rate_limit.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rate_limit.go deleted file mode 100644 index 6ba3b86d164..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rate_limit.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - EventRateLimitType = "eventRateLimit" - EventRateLimitFieldConfiguration = "configuration" - EventRateLimitFieldEnabled = "enabled" -) - -type EventRateLimit struct { - Configuration map[string]interface{} `json:"configuration,omitempty" yaml:"configuration,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rule.go deleted file mode 100644 index 03df6bd548a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_event_rule.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - EventRuleType = "eventRule" - EventRuleFieldEventType = "eventType" - EventRuleFieldResourceKind = "resourceKind" -) - -type EventRule struct { - EventType string `json:"eventType,omitempty" yaml:"eventType,omitempty"` - ResourceKind string `json:"resourceKind,omitempty" yaml:"resourceKind,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_export_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_export_output.go deleted file mode 100644 index cf2559bc91c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_export_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ExportOutputType = "exportOutput" - ExportOutputFieldYAMLOutput = "yamlOutput" -) - -type ExportOutput struct { - YAMLOutput string `json:"yamlOutput,omitempty" yaml:"yamlOutput,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_env.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_env.go deleted file mode 100644 index 96a3ece2cf4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_env.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ExtraEnvType = "extraEnv" - ExtraEnvFieldName = "name" - ExtraEnvFieldValue = "value" - ExtraEnvFieldValueFrom = "valueFrom" -) - -type ExtraEnv struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` - ValueFrom *EnvVarSource `json:"valueFrom,omitempty" yaml:"valueFrom,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume.go deleted file mode 100644 index cd629ef5dc1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume.go +++ /dev/null @@ -1,68 +0,0 @@ -package client - -const ( - ExtraVolumeType = "extraVolume" - ExtraVolumeFieldAWSElasticBlockStore = "awsElasticBlockStore" - ExtraVolumeFieldAzureDisk = "azureDisk" - ExtraVolumeFieldAzureFile = "azureFile" - ExtraVolumeFieldCSI = "csi" - ExtraVolumeFieldCephFS = "cephfs" - ExtraVolumeFieldCinder = "cinder" - ExtraVolumeFieldConfigMap = "configMap" - ExtraVolumeFieldDownwardAPI = "downwardAPI" - ExtraVolumeFieldEmptyDir = "emptyDir" - ExtraVolumeFieldEphemeral = "ephemeral" - ExtraVolumeFieldFC = "fc" - ExtraVolumeFieldFlexVolume = "flexVolume" - ExtraVolumeFieldFlocker = "flocker" - ExtraVolumeFieldGCEPersistentDisk = "gcePersistentDisk" - ExtraVolumeFieldGitRepo = "gitRepo" - ExtraVolumeFieldGlusterfs = "glusterfs" - ExtraVolumeFieldHostPath = "hostPath" - ExtraVolumeFieldISCSI = "iscsi" - ExtraVolumeFieldNFS = "nfs" - ExtraVolumeFieldName = "name" - ExtraVolumeFieldPersistentVolumeClaim = "persistentVolumeClaim" - ExtraVolumeFieldPhotonPersistentDisk = "photonPersistentDisk" - ExtraVolumeFieldPortworxVolume = "portworxVolume" - ExtraVolumeFieldProjected = "projected" - ExtraVolumeFieldQuobyte = "quobyte" - ExtraVolumeFieldRBD = "rbd" - ExtraVolumeFieldScaleIO = "scaleIO" - ExtraVolumeFieldSecret = "secret" - ExtraVolumeFieldStorageOS = "storageos" - ExtraVolumeFieldVsphereVolume = "vsphereVolume" -) - -type ExtraVolume struct { - AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" yaml:"awsElasticBlockStore,omitempty"` - AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" yaml:"azureDisk,omitempty"` - AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty" yaml:"azureFile,omitempty"` - CSI *CSIVolumeSource `json:"csi,omitempty" yaml:"csi,omitempty"` - CephFS *CephFSVolumeSource `json:"cephfs,omitempty" yaml:"cephfs,omitempty"` - Cinder *CinderVolumeSource `json:"cinder,omitempty" yaml:"cinder,omitempty"` - ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty" yaml:"configMap,omitempty"` - DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty" yaml:"downwardAPI,omitempty"` - EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" yaml:"emptyDir,omitempty"` - Ephemeral *EphemeralVolumeSource `json:"ephemeral,omitempty" yaml:"ephemeral,omitempty"` - FC *FCVolumeSource `json:"fc,omitempty" yaml:"fc,omitempty"` - FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty" yaml:"flexVolume,omitempty"` - Flocker *FlockerVolumeSource `json:"flocker,omitempty" yaml:"flocker,omitempty"` - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" yaml:"gcePersistentDisk,omitempty"` - GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty" yaml:"gitRepo,omitempty"` - Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" yaml:"glusterfs,omitempty"` - HostPath *HostPathVolumeSource `json:"hostPath,omitempty" yaml:"hostPath,omitempty"` - ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" yaml:"iscsi,omitempty"` - NFS *NFSVolumeSource `json:"nfs,omitempty" yaml:"nfs,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" yaml:"persistentVolumeClaim,omitempty"` - PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" yaml:"photonPersistentDisk,omitempty"` - PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" yaml:"portworxVolume,omitempty"` - Projected *ProjectedVolumeSource `json:"projected,omitempty" yaml:"projected,omitempty"` - Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" yaml:"quobyte,omitempty"` - RBD *RBDVolumeSource `json:"rbd,omitempty" yaml:"rbd,omitempty"` - ScaleIO *ScaleIOVolumeSource `json:"scaleIO,omitempty" yaml:"scaleIO,omitempty"` - Secret *SecretVolumeSource `json:"secret,omitempty" yaml:"secret,omitempty"` - StorageOS *StorageOSVolumeSource `json:"storageos,omitempty" yaml:"storageos,omitempty"` - VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" yaml:"vsphereVolume,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume_mount.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume_mount.go deleted file mode 100644 index e57141846c5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_extra_volume_mount.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - ExtraVolumeMountType = "extraVolumeMount" - ExtraVolumeMountFieldMountPath = "mountPath" - ExtraVolumeMountFieldMountPropagation = "mountPropagation" - ExtraVolumeMountFieldName = "name" - ExtraVolumeMountFieldReadOnly = "readOnly" - ExtraVolumeMountFieldSubPath = "subPath" - ExtraVolumeMountFieldSubPathExpr = "subPathExpr" -) - -type ExtraVolumeMount struct { - MountPath string `json:"mountPath,omitempty" yaml:"mountPath,omitempty"` - MountPropagation string `json:"mountPropagation,omitempty" yaml:"mountPropagation,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SubPath string `json:"subPath,omitempty" yaml:"subPath,omitempty"` - SubPathExpr string `json:"subPathExpr,omitempty" yaml:"subPathExpr,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fc_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_fc_volume_source.go deleted file mode 100644 index ebc0b63ff10..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fc_volume_source.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - FCVolumeSourceType = "fcVolumeSource" - FCVolumeSourceFieldFSType = "fsType" - FCVolumeSourceFieldLun = "lun" - FCVolumeSourceFieldReadOnly = "readOnly" - FCVolumeSourceFieldTargetWWNs = "targetWWNs" - FCVolumeSourceFieldWWIDs = "wwids" -) - -type FCVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - Lun *int64 `json:"lun,omitempty" yaml:"lun,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - TargetWWNs []string `json:"targetWWNs,omitempty" yaml:"targetWWNs,omitempty"` - WWIDs []string `json:"wwids,omitempty" yaml:"wwids,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature.go deleted file mode 100644 index a8d17862ef0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature.go +++ /dev/null @@ -1,128 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - FeatureType = "feature" - FeatureFieldAnnotations = "annotations" - FeatureFieldCreated = "created" - FeatureFieldCreatorID = "creatorId" - FeatureFieldLabels = "labels" - FeatureFieldName = "name" - FeatureFieldOwnerReferences = "ownerReferences" - FeatureFieldRemoved = "removed" - FeatureFieldState = "state" - FeatureFieldStatus = "status" - FeatureFieldTransitioning = "transitioning" - FeatureFieldTransitioningMessage = "transitioningMessage" - FeatureFieldUUID = "uuid" - FeatureFieldValue = "value" -) - -type Feature struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *FeatureStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Value *bool `json:"value,omitempty" yaml:"value,omitempty"` -} - -type FeatureCollection struct { - types.Collection - Data []Feature `json:"data,omitempty"` - client *FeatureClient -} - -type FeatureClient struct { - apiClient *Client -} - -type FeatureOperations interface { - List(opts *types.ListOpts) (*FeatureCollection, error) - ListAll(opts *types.ListOpts) (*FeatureCollection, error) - Create(opts *Feature) (*Feature, error) - Update(existing *Feature, updates interface{}) (*Feature, error) - Replace(existing *Feature) (*Feature, error) - ByID(id string) (*Feature, error) - Delete(container *Feature) error -} - -func newFeatureClient(apiClient *Client) *FeatureClient { - return &FeatureClient{ - apiClient: apiClient, - } -} - -func (c *FeatureClient) Create(container *Feature) (*Feature, error) { - resp := &Feature{} - err := c.apiClient.Ops.DoCreate(FeatureType, container, resp) - return resp, err -} - -func (c *FeatureClient) Update(existing *Feature, updates interface{}) (*Feature, error) { - resp := &Feature{} - err := c.apiClient.Ops.DoUpdate(FeatureType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *FeatureClient) Replace(obj *Feature) (*Feature, error) { - resp := &Feature{} - err := c.apiClient.Ops.DoReplace(FeatureType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *FeatureClient) List(opts *types.ListOpts) (*FeatureCollection, error) { - resp := &FeatureCollection{} - err := c.apiClient.Ops.DoList(FeatureType, opts, resp) - resp.client = c - return resp, err -} - -func (c *FeatureClient) ListAll(opts *types.ListOpts) (*FeatureCollection, error) { - resp := &FeatureCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *FeatureCollection) Next() (*FeatureCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &FeatureCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *FeatureClient) ByID(id string) (*Feature, error) { - resp := &Feature{} - err := c.apiClient.Ops.DoByID(FeatureType, id, resp) - return resp, err -} - -func (c *FeatureClient) Delete(container *Feature) error { - return c.apiClient.Ops.DoResourceDelete(FeatureType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_spec.go deleted file mode 100644 index 95c50292cb5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_spec.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - FeatureSpecType = "featureSpec" - FeatureSpecFieldValue = "value" -) - -type FeatureSpec struct { - Value *bool `json:"value,omitempty" yaml:"value,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_status.go deleted file mode 100644 index be4799a9a10..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_feature_status.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - FeatureStatusType = "featureStatus" - FeatureStatusFieldDefault = "default" - FeatureStatusFieldDescription = "description" - FeatureStatusFieldDynamic = "dynamic" - FeatureStatusFieldLockedValue = "lockedValue" -) - -type FeatureStatus struct { - Default bool `json:"default,omitempty" yaml:"default,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Dynamic bool `json:"dynamic,omitempty" yaml:"dynamic,omitempty"` - LockedValue *bool `json:"lockedValue,omitempty" yaml:"lockedValue,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_field.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_field.go deleted file mode 100644 index 9f13a3ac5fe..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_field.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -const ( - FieldType = "field" - FieldFieldCreate = "create" - FieldFieldDefault = "default" - FieldFieldDescription = "description" - FieldFieldDynamicField = "dynamicField" - FieldFieldInvalidChars = "invalidChars" - FieldFieldMax = "max" - FieldFieldMaxLength = "maxLength" - FieldFieldMin = "min" - FieldFieldMinLength = "minLength" - FieldFieldNullable = "nullable" - FieldFieldOptions = "options" - FieldFieldRequired = "required" - FieldFieldType = "type" - FieldFieldUnique = "unique" - FieldFieldUpdate = "update" - FieldFieldValidChars = "validChars" -) - -type Field struct { - Create bool `json:"create,omitempty" yaml:"create,omitempty"` - Default *Values `json:"default,omitempty" yaml:"default,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DynamicField bool `json:"dynamicField,omitempty" yaml:"dynamicField,omitempty"` - InvalidChars string `json:"invalidChars,omitempty" yaml:"invalidChars,omitempty"` - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - MaxLength int64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"` - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` - MinLength int64 `json:"minLength,omitempty" yaml:"minLength,omitempty"` - Nullable bool `json:"nullable,omitempty" yaml:"nullable,omitempty"` - Options []string `json:"options,omitempty" yaml:"options,omitempty"` - Required bool `json:"required,omitempty" yaml:"required,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - Unique bool `json:"unique,omitempty" yaml:"unique,omitempty"` - Update bool `json:"update,omitempty" yaml:"update,omitempty"` - ValidChars string `json:"validChars,omitempty" yaml:"validChars,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_file.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_file.go deleted file mode 100644 index 18d80cc77b6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_file.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - FileType = "file" - FileFieldContents = "contents" - FileFieldName = "name" -) - -type File struct { - Contents string `json:"contents,omitempty" yaml:"contents,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_filter.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_filter.go deleted file mode 100644 index 8bb3f714247..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_filter.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - FilterType = "filter" - FilterFieldModifiers = "modifiers" -) - -type Filter struct { - Modifiers []string `json:"modifiers,omitempty" yaml:"modifiers,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_flannel_network_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_flannel_network_provider.go deleted file mode 100644 index 088fe6bb35f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_flannel_network_provider.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - FlannelNetworkProviderType = "flannelNetworkProvider" - FlannelNetworkProviderFieldIface = "iface" -) - -type FlannelNetworkProvider struct { - Iface string `json:"iface,omitempty" yaml:"iface,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace.go deleted file mode 100644 index 963b286ca68..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace.go +++ /dev/null @@ -1,120 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - FleetWorkspaceType = "fleetWorkspace" - FleetWorkspaceFieldAnnotations = "annotations" - FleetWorkspaceFieldCreated = "created" - FleetWorkspaceFieldCreatorID = "creatorId" - FleetWorkspaceFieldLabels = "labels" - FleetWorkspaceFieldName = "name" - FleetWorkspaceFieldOwnerReferences = "ownerReferences" - FleetWorkspaceFieldRemoved = "removed" - FleetWorkspaceFieldStatus = "status" - FleetWorkspaceFieldUUID = "uuid" -) - -type FleetWorkspace struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Status *FleetWorkspaceStatus `json:"status,omitempty" yaml:"status,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type FleetWorkspaceCollection struct { - types.Collection - Data []FleetWorkspace `json:"data,omitempty"` - client *FleetWorkspaceClient -} - -type FleetWorkspaceClient struct { - apiClient *Client -} - -type FleetWorkspaceOperations interface { - List(opts *types.ListOpts) (*FleetWorkspaceCollection, error) - ListAll(opts *types.ListOpts) (*FleetWorkspaceCollection, error) - Create(opts *FleetWorkspace) (*FleetWorkspace, error) - Update(existing *FleetWorkspace, updates interface{}) (*FleetWorkspace, error) - Replace(existing *FleetWorkspace) (*FleetWorkspace, error) - ByID(id string) (*FleetWorkspace, error) - Delete(container *FleetWorkspace) error -} - -func newFleetWorkspaceClient(apiClient *Client) *FleetWorkspaceClient { - return &FleetWorkspaceClient{ - apiClient: apiClient, - } -} - -func (c *FleetWorkspaceClient) Create(container *FleetWorkspace) (*FleetWorkspace, error) { - resp := &FleetWorkspace{} - err := c.apiClient.Ops.DoCreate(FleetWorkspaceType, container, resp) - return resp, err -} - -func (c *FleetWorkspaceClient) Update(existing *FleetWorkspace, updates interface{}) (*FleetWorkspace, error) { - resp := &FleetWorkspace{} - err := c.apiClient.Ops.DoUpdate(FleetWorkspaceType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *FleetWorkspaceClient) Replace(obj *FleetWorkspace) (*FleetWorkspace, error) { - resp := &FleetWorkspace{} - err := c.apiClient.Ops.DoReplace(FleetWorkspaceType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *FleetWorkspaceClient) List(opts *types.ListOpts) (*FleetWorkspaceCollection, error) { - resp := &FleetWorkspaceCollection{} - err := c.apiClient.Ops.DoList(FleetWorkspaceType, opts, resp) - resp.client = c - return resp, err -} - -func (c *FleetWorkspaceClient) ListAll(opts *types.ListOpts) (*FleetWorkspaceCollection, error) { - resp := &FleetWorkspaceCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *FleetWorkspaceCollection) Next() (*FleetWorkspaceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &FleetWorkspaceCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *FleetWorkspaceClient) ByID(id string) (*FleetWorkspace, error) { - resp := &FleetWorkspace{} - err := c.apiClient.Ops.DoByID(FleetWorkspaceType, id, resp) - return resp, err -} - -func (c *FleetWorkspaceClient) Delete(container *FleetWorkspace) error { - return c.apiClient.Ops.DoResourceDelete(FleetWorkspaceType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace_status.go deleted file mode 100644 index aa5db188f87..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fleet_workspace_status.go +++ /dev/null @@ -1,8 +0,0 @@ -package client - -const ( - FleetWorkspaceStatusType = "fleetWorkspaceStatus" -) - -type FleetWorkspaceStatus struct { -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_flex_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_flex_volume_source.go deleted file mode 100644 index d2e942b927c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_flex_volume_source.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - FlexVolumeSourceType = "flexVolumeSource" - FlexVolumeSourceFieldDriver = "driver" - FlexVolumeSourceFieldFSType = "fsType" - FlexVolumeSourceFieldOptions = "options" - FlexVolumeSourceFieldReadOnly = "readOnly" - FlexVolumeSourceFieldSecretRef = "secretRef" -) - -type FlexVolumeSource struct { - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SecretRef *LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_flocker_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_flocker_volume_source.go deleted file mode 100644 index 802b77ff2d2..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_flocker_volume_source.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - FlockerVolumeSourceType = "flockerVolumeSource" - FlockerVolumeSourceFieldDatasetName = "datasetName" - FlockerVolumeSourceFieldDatasetUUID = "datasetUUID" -) - -type FlockerVolumeSource struct { - DatasetName string `json:"datasetName,omitempty" yaml:"datasetName,omitempty"` - DatasetUUID string `json:"datasetUUID,omitempty" yaml:"datasetUUID,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_forwarder_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_forwarder_config.go deleted file mode 100644 index ac13f5708f1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_forwarder_config.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - FluentForwarderConfigType = "fluentForwarderConfig" - FluentForwarderConfigFieldCertificate = "certificate" - FluentForwarderConfigFieldClientCert = "clientCert" - FluentForwarderConfigFieldClientKey = "clientKey" - FluentForwarderConfigFieldClientKeyPass = "clientKeyPass" - FluentForwarderConfigFieldCompress = "compress" - FluentForwarderConfigFieldEnableTLS = "enableTls" - FluentForwarderConfigFieldFluentServers = "fluentServers" - FluentForwarderConfigFieldSSLVerify = "sslVerify" -) - -type FluentForwarderConfig struct { - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty" yaml:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty" yaml:"clientKey,omitempty"` - ClientKeyPass string `json:"clientKeyPass,omitempty" yaml:"clientKeyPass,omitempty"` - Compress *bool `json:"compress,omitempty" yaml:"compress,omitempty"` - EnableTLS bool `json:"enableTls,omitempty" yaml:"enableTls,omitempty"` - FluentServers []FluentServer `json:"fluentServers,omitempty" yaml:"fluentServers,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty" yaml:"sslVerify,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_server.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_server.go deleted file mode 100644 index 60ffca089b0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fluent_server.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - FluentServerType = "fluentServer" - FluentServerFieldEndpoint = "endpoint" - FluentServerFieldHostname = "hostname" - FluentServerFieldPassword = "password" - FluentServerFieldSharedKey = "sharedKey" - FluentServerFieldStandby = "standby" - FluentServerFieldUsername = "username" - FluentServerFieldWeight = "weight" -) - -type FluentServer struct { - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - SharedKey string `json:"sharedKey,omitempty" yaml:"sharedKey,omitempty"` - Standby bool `json:"standby,omitempty" yaml:"standby,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` - Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_config.go deleted file mode 100644 index 750de6132c5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_config.go +++ /dev/null @@ -1,84 +0,0 @@ -package client - -const ( - FreeIpaConfigType = "freeIpaConfig" - FreeIpaConfigFieldAccessMode = "accessMode" - FreeIpaConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - FreeIpaConfigFieldAnnotations = "annotations" - FreeIpaConfigFieldCertificate = "certificate" - FreeIpaConfigFieldConnectionTimeout = "connectionTimeout" - FreeIpaConfigFieldCreated = "created" - FreeIpaConfigFieldCreatorID = "creatorId" - FreeIpaConfigFieldEnabled = "enabled" - FreeIpaConfigFieldGroupDNAttribute = "groupDNAttribute" - FreeIpaConfigFieldGroupMemberMappingAttribute = "groupMemberMappingAttribute" - FreeIpaConfigFieldGroupMemberUserAttribute = "groupMemberUserAttribute" - FreeIpaConfigFieldGroupNameAttribute = "groupNameAttribute" - FreeIpaConfigFieldGroupObjectClass = "groupObjectClass" - FreeIpaConfigFieldGroupSearchAttribute = "groupSearchAttribute" - FreeIpaConfigFieldGroupSearchBase = "groupSearchBase" - FreeIpaConfigFieldGroupSearchFilter = "groupSearchFilter" - FreeIpaConfigFieldLabels = "labels" - FreeIpaConfigFieldName = "name" - FreeIpaConfigFieldOwnerReferences = "ownerReferences" - FreeIpaConfigFieldPort = "port" - FreeIpaConfigFieldRemoved = "removed" - FreeIpaConfigFieldServers = "servers" - FreeIpaConfigFieldServiceAccountDistinguishedName = "serviceAccountDistinguishedName" - FreeIpaConfigFieldServiceAccountPassword = "serviceAccountPassword" - FreeIpaConfigFieldStartTLS = "starttls" - FreeIpaConfigFieldStatus = "status" - FreeIpaConfigFieldTLS = "tls" - FreeIpaConfigFieldType = "type" - FreeIpaConfigFieldUUID = "uuid" - FreeIpaConfigFieldUserDisabledBitMask = "userDisabledBitMask" - FreeIpaConfigFieldUserEnabledAttribute = "userEnabledAttribute" - FreeIpaConfigFieldUserLoginAttribute = "userLoginAttribute" - FreeIpaConfigFieldUserMemberAttribute = "userMemberAttribute" - FreeIpaConfigFieldUserNameAttribute = "userNameAttribute" - FreeIpaConfigFieldUserObjectClass = "userObjectClass" - FreeIpaConfigFieldUserSearchAttribute = "userSearchAttribute" - FreeIpaConfigFieldUserSearchBase = "userSearchBase" - FreeIpaConfigFieldUserSearchFilter = "userSearchFilter" -) - -type FreeIpaConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connectionTimeout,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GroupDNAttribute string `json:"groupDNAttribute,omitempty" yaml:"groupDNAttribute,omitempty"` - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"groupMemberMappingAttribute,omitempty"` - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"groupMemberUserAttribute,omitempty"` - GroupNameAttribute string `json:"groupNameAttribute,omitempty" yaml:"groupNameAttribute,omitempty"` - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"groupObjectClass,omitempty"` - GroupSearchAttribute string `json:"groupSearchAttribute,omitempty" yaml:"groupSearchAttribute,omitempty"` - GroupSearchBase string `json:"groupSearchBase,omitempty" yaml:"groupSearchBase,omitempty"` - GroupSearchFilter string `json:"groupSearchFilter,omitempty" yaml:"groupSearchFilter,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Servers []string `json:"servers,omitempty" yaml:"servers,omitempty"` - ServiceAccountDistinguishedName string `json:"serviceAccountDistinguishedName,omitempty" yaml:"serviceAccountDistinguishedName,omitempty"` - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"serviceAccountPassword,omitempty"` - StartTLS bool `json:"starttls,omitempty" yaml:"starttls,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"userDisabledBitMask,omitempty"` - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"userEnabledAttribute,omitempty"` - UserLoginAttribute string `json:"userLoginAttribute,omitempty" yaml:"userLoginAttribute,omitempty"` - UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"userMemberAttribute,omitempty"` - UserNameAttribute string `json:"userNameAttribute,omitempty" yaml:"userNameAttribute,omitempty"` - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"userObjectClass,omitempty"` - UserSearchAttribute string `json:"userSearchAttribute,omitempty" yaml:"userSearchAttribute,omitempty"` - UserSearchBase string `json:"userSearchBase,omitempty" yaml:"userSearchBase,omitempty"` - UserSearchFilter string `json:"userSearchFilter,omitempty" yaml:"userSearchFilter,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_test_and_apply_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_test_and_apply_input.go deleted file mode 100644 index ad27c5914cd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_free_ipa_test_and_apply_input.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - FreeIpaTestAndApplyInputType = "freeIpaTestAndApplyInput" - FreeIpaTestAndApplyInputFieldLdapConfig = "ldapConfig" - FreeIpaTestAndApplyInputFieldPassword = "password" - FreeIpaTestAndApplyInputFieldUsername = "username" -) - -type FreeIpaTestAndApplyInput struct { - LdapConfig *LdapConfig `json:"ldapConfig,omitempty" yaml:"ldapConfig,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fs_group_strategy_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_fs_group_strategy_options.go deleted file mode 100644 index d8bbec05316..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_fs_group_strategy_options.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - FSGroupStrategyOptionsType = "fsGroupStrategyOptions" - FSGroupStrategyOptionsFieldRanges = "ranges" - FSGroupStrategyOptionsFieldRule = "rule" -) - -type FSGroupStrategyOptions struct { - Ranges []IDRange `json:"ranges,omitempty" yaml:"ranges,omitempty"` - Rule string `json:"rule,omitempty" yaml:"rule,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gce_persistent_disk_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gce_persistent_disk_volume_source.go deleted file mode 100644 index 726a44839bf..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gce_persistent_disk_volume_source.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - GCEPersistentDiskVolumeSourceType = "gcePersistentDiskVolumeSource" - GCEPersistentDiskVolumeSourceFieldFSType = "fsType" - GCEPersistentDiskVolumeSourceFieldPDName = "pdName" - GCEPersistentDiskVolumeSourceFieldPartition = "partition" - GCEPersistentDiskVolumeSourceFieldReadOnly = "readOnly" -) - -type GCEPersistentDiskVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - PDName string `json:"pdName,omitempty" yaml:"pdName,omitempty"` - Partition int64 `json:"partition,omitempty" yaml:"partition,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_generate_kube_config_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_generate_kube_config_output.go deleted file mode 100644 index 2603f41c7d8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_generate_kube_config_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - GenerateKubeConfigOutputType = "generateKubeConfigOutput" - GenerateKubeConfigOutputFieldConfig = "config" -) - -type GenerateKubeConfigOutput struct { - Config string `json:"config,omitempty" yaml:"config,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_git_repo_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_git_repo_volume_source.go deleted file mode 100644 index 102d08fd0c6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_git_repo_volume_source.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GitRepoVolumeSourceType = "gitRepoVolumeSource" - GitRepoVolumeSourceFieldDirectory = "directory" - GitRepoVolumeSourceFieldRepository = "repository" - GitRepoVolumeSourceFieldRevision = "revision" -) - -type GitRepoVolumeSource struct { - Directory string `json:"directory,omitempty" yaml:"directory,omitempty"` - Repository string `json:"repository,omitempty" yaml:"repository,omitempty"` - Revision string `json:"revision,omitempty" yaml:"revision,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config.go deleted file mode 100644 index 04dc45315d1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -const ( - GithubConfigType = "githubConfig" - GithubConfigFieldAccessMode = "accessMode" - GithubConfigFieldAdditionalClientIDs = "additionalClientIds" - GithubConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - GithubConfigFieldAnnotations = "annotations" - GithubConfigFieldClientID = "clientId" - GithubConfigFieldClientSecret = "clientSecret" - GithubConfigFieldCreated = "created" - GithubConfigFieldCreatorID = "creatorId" - GithubConfigFieldEnabled = "enabled" - GithubConfigFieldHostname = "hostname" - GithubConfigFieldHostnameToClientID = "hostnameToClientId" - GithubConfigFieldLabels = "labels" - GithubConfigFieldName = "name" - GithubConfigFieldOwnerReferences = "ownerReferences" - GithubConfigFieldRemoved = "removed" - GithubConfigFieldStatus = "status" - GithubConfigFieldTLS = "tls" - GithubConfigFieldType = "type" - GithubConfigFieldUUID = "uuid" -) - -type GithubConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AdditionalClientIDs map[string]string `json:"additionalClientIds,omitempty" yaml:"additionalClientIds,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClientID string `json:"clientId,omitempty" yaml:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - HostnameToClientID map[string]string `json:"hostnameToClientId,omitempty" yaml:"hostnameToClientId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_apply_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_apply_input.go deleted file mode 100644 index af9cae872b1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_apply_input.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GithubConfigApplyInputType = "githubConfigApplyInput" - GithubConfigApplyInputFieldCode = "code" - GithubConfigApplyInputFieldEnabled = "enabled" - GithubConfigApplyInputFieldGithubConfig = "githubConfig" -) - -type GithubConfigApplyInput struct { - Code string `json:"code,omitempty" yaml:"code,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GithubConfig *GithubConfig `json:"githubConfig,omitempty" yaml:"githubConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_test_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_test_output.go deleted file mode 100644 index d7eaf8861a9..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_github_config_test_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - GithubConfigTestOutputType = "githubConfigTestOutput" - GithubConfigTestOutputFieldRedirectURL = "redirectUrl" -) - -type GithubConfigTestOutput struct { - RedirectURL string `json:"redirectUrl,omitempty" yaml:"redirectUrl,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cidr_block.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cidr_block.go deleted file mode 100644 index d89fa3eac25..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cidr_block.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - GKECidrBlockType = "gkeCidrBlock" - GKECidrBlockFieldCidrBlock = "cidrBlock" - GKECidrBlockFieldDisplayName = "displayName" -) - -type GKECidrBlock struct { - CidrBlock string `json:"cidrBlock,omitempty" yaml:"cidrBlock,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_addons.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_addons.go deleted file mode 100644 index 8cbf23c7904..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_addons.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GKEClusterAddonsType = "gkeClusterAddons" - GKEClusterAddonsFieldHTTPLoadBalancing = "httpLoadBalancing" - GKEClusterAddonsFieldHorizontalPodAutoscaling = "horizontalPodAutoscaling" - GKEClusterAddonsFieldNetworkPolicyConfig = "networkPolicyConfig" -) - -type GKEClusterAddons struct { - HTTPLoadBalancing bool `json:"httpLoadBalancing,omitempty" yaml:"httpLoadBalancing,omitempty"` - HorizontalPodAutoscaling bool `json:"horizontalPodAutoscaling,omitempty" yaml:"horizontalPodAutoscaling,omitempty"` - NetworkPolicyConfig bool `json:"networkPolicyConfig,omitempty" yaml:"networkPolicyConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_config_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_config_spec.go deleted file mode 100644 index 5c9b3708412..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_cluster_config_spec.go +++ /dev/null @@ -1,54 +0,0 @@ -package client - -const ( - GKEClusterConfigSpecType = "gkeClusterConfigSpec" - GKEClusterConfigSpecFieldClusterAddons = "clusterAddons" - GKEClusterConfigSpecFieldClusterIpv4CidrBlock = "clusterIpv4Cidr" - GKEClusterConfigSpecFieldClusterName = "clusterName" - GKEClusterConfigSpecFieldDescription = "description" - GKEClusterConfigSpecFieldEnableKubernetesAlpha = "enableKubernetesAlpha" - GKEClusterConfigSpecFieldGoogleCredentialSecret = "googleCredentialSecret" - GKEClusterConfigSpecFieldIPAllocationPolicy = "ipAllocationPolicy" - GKEClusterConfigSpecFieldImported = "imported" - GKEClusterConfigSpecFieldKubernetesVersion = "kubernetesVersion" - GKEClusterConfigSpecFieldLabels = "labels" - GKEClusterConfigSpecFieldLocations = "locations" - GKEClusterConfigSpecFieldLoggingService = "loggingService" - GKEClusterConfigSpecFieldMaintenanceWindow = "maintenanceWindow" - GKEClusterConfigSpecFieldMasterAuthorizedNetworksConfig = "masterAuthorizedNetworks" - GKEClusterConfigSpecFieldMonitoringService = "monitoringService" - GKEClusterConfigSpecFieldNetwork = "network" - GKEClusterConfigSpecFieldNetworkPolicyEnabled = "networkPolicyEnabled" - GKEClusterConfigSpecFieldNodePools = "nodePools" - GKEClusterConfigSpecFieldPrivateClusterConfig = "privateClusterConfig" - GKEClusterConfigSpecFieldProjectID = "projectID" - GKEClusterConfigSpecFieldRegion = "region" - GKEClusterConfigSpecFieldSubnetwork = "subnetwork" - GKEClusterConfigSpecFieldZone = "zone" -) - -type GKEClusterConfigSpec struct { - ClusterAddons *GKEClusterAddons `json:"clusterAddons,omitempty" yaml:"clusterAddons,omitempty"` - ClusterIpv4CidrBlock *string `json:"clusterIpv4Cidr,omitempty" yaml:"clusterIpv4Cidr,omitempty"` - ClusterName string `json:"clusterName,omitempty" yaml:"clusterName,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnableKubernetesAlpha *bool `json:"enableKubernetesAlpha,omitempty" yaml:"enableKubernetesAlpha,omitempty"` - GoogleCredentialSecret string `json:"googleCredentialSecret,omitempty" yaml:"googleCredentialSecret,omitempty"` - IPAllocationPolicy *GKEIPAllocationPolicy `json:"ipAllocationPolicy,omitempty" yaml:"ipAllocationPolicy,omitempty"` - Imported bool `json:"imported,omitempty" yaml:"imported,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` - Labels *map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Locations *[]string `json:"locations,omitempty" yaml:"locations,omitempty"` - LoggingService *string `json:"loggingService,omitempty" yaml:"loggingService,omitempty"` - MaintenanceWindow *string `json:"maintenanceWindow,omitempty" yaml:"maintenanceWindow,omitempty"` - MasterAuthorizedNetworksConfig *GKEMasterAuthorizedNetworksConfig `json:"masterAuthorizedNetworks,omitempty" yaml:"masterAuthorizedNetworks,omitempty"` - MonitoringService *string `json:"monitoringService,omitempty" yaml:"monitoringService,omitempty"` - Network *string `json:"network,omitempty" yaml:"network,omitempty"` - NetworkPolicyEnabled *bool `json:"networkPolicyEnabled,omitempty" yaml:"networkPolicyEnabled,omitempty"` - NodePools []GKENodePoolConfig `json:"nodePools,omitempty" yaml:"nodePools,omitempty"` - PrivateClusterConfig *GKEPrivateClusterConfig `json:"privateClusterConfig,omitempty" yaml:"privateClusterConfig,omitempty"` - ProjectID string `json:"projectID,omitempty" yaml:"projectID,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - Subnetwork *string `json:"subnetwork,omitempty" yaml:"subnetwork,omitempty"` - Zone string `json:"zone,omitempty" yaml:"zone,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_master_authorized_networks_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_master_authorized_networks_config.go deleted file mode 100644 index 0eb9371a735..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_master_authorized_networks_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - GKEMasterAuthorizedNetworksConfigType = "gkeMasterAuthorizedNetworksConfig" - GKEMasterAuthorizedNetworksConfigFieldCidrBlocks = "cidrBlocks" - GKEMasterAuthorizedNetworksConfigFieldEnabled = "enabled" -) - -type GKEMasterAuthorizedNetworksConfig struct { - CidrBlocks []GKECidrBlock `json:"cidrBlocks,omitempty" yaml:"cidrBlocks,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_config.go deleted file mode 100644 index ad4f23d9166..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_config.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - GKENodeConfigType = "gkeNodeConfig" - GKENodeConfigFieldDiskSizeGb = "diskSizeGb" - GKENodeConfigFieldDiskType = "diskType" - GKENodeConfigFieldImageType = "imageType" - GKENodeConfigFieldLabels = "labels" - GKENodeConfigFieldLocalSsdCount = "localSsdCount" - GKENodeConfigFieldMachineType = "machineType" - GKENodeConfigFieldOauthScopes = "oauthScopes" - GKENodeConfigFieldPreemptible = "preemptible" - GKENodeConfigFieldTags = "tags" - GKENodeConfigFieldTaints = "taints" -) - -type GKENodeConfig struct { - DiskSizeGb int64 `json:"diskSizeGb,omitempty" yaml:"diskSizeGb,omitempty"` - DiskType string `json:"diskType,omitempty" yaml:"diskType,omitempty"` - ImageType string `json:"imageType,omitempty" yaml:"imageType,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LocalSsdCount int64 `json:"localSsdCount,omitempty" yaml:"localSsdCount,omitempty"` - MachineType string `json:"machineType,omitempty" yaml:"machineType,omitempty"` - OauthScopes []string `json:"oauthScopes,omitempty" yaml:"oauthScopes,omitempty"` - Preemptible bool `json:"preemptible,omitempty" yaml:"preemptible,omitempty"` - Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"` - Taints []GKENodeTaintConfig `json:"taints,omitempty" yaml:"taints,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_autoscaling.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_autoscaling.go deleted file mode 100644 index 7be64fc9fe3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_autoscaling.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GKENodePoolAutoscalingType = "gkeNodePoolAutoscaling" - GKENodePoolAutoscalingFieldEnabled = "enabled" - GKENodePoolAutoscalingFieldMaxNodeCount = "maxNodeCount" - GKENodePoolAutoscalingFieldMinNodeCount = "minNodeCount" -) - -type GKENodePoolAutoscaling struct { - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - MaxNodeCount int64 `json:"maxNodeCount,omitempty" yaml:"maxNodeCount,omitempty"` - MinNodeCount int64 `json:"minNodeCount,omitempty" yaml:"minNodeCount,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_config.go deleted file mode 100644 index 30bf77072c8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_config.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - GKENodePoolConfigType = "gkeNodePoolConfig" - GKENodePoolConfigFieldAutoscaling = "autoscaling" - GKENodePoolConfigFieldConfig = "config" - GKENodePoolConfigFieldInitialNodeCount = "initialNodeCount" - GKENodePoolConfigFieldManagement = "management" - GKENodePoolConfigFieldMaxPodsConstraint = "maxPodsConstraint" - GKENodePoolConfigFieldName = "name" - GKENodePoolConfigFieldVersion = "version" -) - -type GKENodePoolConfig struct { - Autoscaling *GKENodePoolAutoscaling `json:"autoscaling,omitempty" yaml:"autoscaling,omitempty"` - Config *GKENodeConfig `json:"config,omitempty" yaml:"config,omitempty"` - InitialNodeCount *int64 `json:"initialNodeCount,omitempty" yaml:"initialNodeCount,omitempty"` - Management *GKENodePoolManagement `json:"management,omitempty" yaml:"management,omitempty"` - MaxPodsConstraint *int64 `json:"maxPodsConstraint,omitempty" yaml:"maxPodsConstraint,omitempty"` - Name *string `json:"name,omitempty" yaml:"name,omitempty"` - Version *string `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_management.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_management.go deleted file mode 100644 index de37c5a1642..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_pool_management.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - GKENodePoolManagementType = "gkeNodePoolManagement" - GKENodePoolManagementFieldAutoRepair = "autoRepair" - GKENodePoolManagementFieldAutoUpgrade = "autoUpgrade" -) - -type GKENodePoolManagement struct { - AutoRepair bool `json:"autoRepair,omitempty" yaml:"autoRepair,omitempty"` - AutoUpgrade bool `json:"autoUpgrade,omitempty" yaml:"autoUpgrade,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_taint_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_taint_config.go deleted file mode 100644 index f9fd1e9b335..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_node_taint_config.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GKENodeTaintConfigType = "gkeNodeTaintConfig" - GKENodeTaintConfigFieldEffect = "effect" - GKENodeTaintConfigFieldKey = "key" - GKENodeTaintConfigFieldValue = "value" -) - -type GKENodeTaintConfig struct { - Effect string `json:"effect,omitempty" yaml:"effect,omitempty"` - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_private_cluster_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_private_cluster_config.go deleted file mode 100644 index 7607cbe61e3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_private_cluster_config.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GKEPrivateClusterConfigType = "gkePrivateClusterConfig" - GKEPrivateClusterConfigFieldEnablePrivateEndpoint = "enablePrivateEndpoint" - GKEPrivateClusterConfigFieldEnablePrivateNodes = "enablePrivateNodes" - GKEPrivateClusterConfigFieldMasterIpv4CidrBlock = "masterIpv4CidrBlock" -) - -type GKEPrivateClusterConfig struct { - EnablePrivateEndpoint bool `json:"enablePrivateEndpoint,omitempty" yaml:"enablePrivateEndpoint,omitempty"` - EnablePrivateNodes bool `json:"enablePrivateNodes,omitempty" yaml:"enablePrivateNodes,omitempty"` - MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty" yaml:"masterIpv4CidrBlock,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_status.go deleted file mode 100644 index 3c943906bd8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gke_status.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - GKEStatusType = "gkeStatus" - GKEStatusFieldPrivateRequiresTunnel = "privateRequiresTunnel" - GKEStatusFieldUpstreamSpec = "upstreamSpec" -) - -type GKEStatus struct { - PrivateRequiresTunnel *bool `json:"privateRequiresTunnel,omitempty" yaml:"privateRequiresTunnel,omitempty"` - UpstreamSpec *GKEClusterConfigSpec `json:"upstreamSpec,omitempty" yaml:"upstreamSpec,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gkeip_allocation_policy.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_gkeip_allocation_policy.go deleted file mode 100644 index 140bd42a3ce..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_gkeip_allocation_policy.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - GKEIPAllocationPolicyType = "gkeipAllocationPolicy" - GKEIPAllocationPolicyFieldClusterIpv4CidrBlock = "clusterIpv4CidrBlock" - GKEIPAllocationPolicyFieldClusterSecondaryRangeName = "clusterSecondaryRangeName" - GKEIPAllocationPolicyFieldCreateSubnetwork = "createSubnetwork" - GKEIPAllocationPolicyFieldNodeIpv4CidrBlock = "nodeIpv4CidrBlock" - GKEIPAllocationPolicyFieldServicesIpv4CidrBlock = "servicesIpv4CidrBlock" - GKEIPAllocationPolicyFieldServicesSecondaryRangeName = "servicesSecondaryRangeName" - GKEIPAllocationPolicyFieldSubnetworkName = "subnetworkName" - GKEIPAllocationPolicyFieldUseIPAliases = "useIpAliases" -) - -type GKEIPAllocationPolicy struct { - ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty" yaml:"clusterIpv4CidrBlock,omitempty"` - ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty" yaml:"clusterSecondaryRangeName,omitempty"` - CreateSubnetwork bool `json:"createSubnetwork,omitempty" yaml:"createSubnetwork,omitempty"` - NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock,omitempty" yaml:"nodeIpv4CidrBlock,omitempty"` - ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty" yaml:"servicesIpv4CidrBlock,omitempty"` - ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty" yaml:"servicesSecondaryRangeName,omitempty"` - SubnetworkName string `json:"subnetworkName,omitempty" yaml:"subnetworkName,omitempty"` - UseIPAliases bool `json:"useIpAliases,omitempty" yaml:"useIpAliases,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_aws_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_aws_opts.go deleted file mode 100644 index 61965de73ab..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_aws_opts.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - GlobalAwsOptsType = "globalAwsOpts" - GlobalAwsOptsFieldDisableSecurityGroupIngress = "disable-security-group-ingress" - GlobalAwsOptsFieldDisableStrictZoneCheck = "disable-strict-zone-check" - GlobalAwsOptsFieldElbSecurityGroup = "elb-security-group" - GlobalAwsOptsFieldKubernetesClusterID = "kubernetes-cluster-id" - GlobalAwsOptsFieldKubernetesClusterTag = "kubernetes-cluster-tag" - GlobalAwsOptsFieldRoleARN = "role-arn" - GlobalAwsOptsFieldRouteTableID = "routetable-id" - GlobalAwsOptsFieldSubnetID = "subnet-id" - GlobalAwsOptsFieldVPC = "vpc" - GlobalAwsOptsFieldZone = "zone" -) - -type GlobalAwsOpts struct { - DisableSecurityGroupIngress bool `json:"disable-security-group-ingress,omitempty" yaml:"disable-security-group-ingress,omitempty"` - DisableStrictZoneCheck bool `json:"disable-strict-zone-check,omitempty" yaml:"disable-strict-zone-check,omitempty"` - ElbSecurityGroup string `json:"elb-security-group,omitempty" yaml:"elb-security-group,omitempty"` - KubernetesClusterID string `json:"kubernetes-cluster-id,omitempty" yaml:"kubernetes-cluster-id,omitempty"` - KubernetesClusterTag string `json:"kubernetes-cluster-tag,omitempty" yaml:"kubernetes-cluster-tag,omitempty"` - RoleARN string `json:"role-arn,omitempty" yaml:"role-arn,omitempty"` - RouteTableID string `json:"routetable-id,omitempty" yaml:"routetable-id,omitempty"` - SubnetID string `json:"subnet-id,omitempty" yaml:"subnet-id,omitempty"` - VPC string `json:"vpc,omitempty" yaml:"vpc,omitempty"` - Zone string `json:"zone,omitempty" yaml:"zone,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns.go deleted file mode 100644 index 2de8450e388..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns.go +++ /dev/null @@ -1,152 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - GlobalDnsType = "globalDns" - GlobalDnsFieldAnnotations = "annotations" - GlobalDnsFieldCreated = "created" - GlobalDnsFieldCreatorID = "creatorId" - GlobalDnsFieldFQDN = "fqdn" - GlobalDnsFieldLabels = "labels" - GlobalDnsFieldMembers = "members" - GlobalDnsFieldMultiClusterAppID = "multiClusterAppId" - GlobalDnsFieldName = "name" - GlobalDnsFieldOwnerReferences = "ownerReferences" - GlobalDnsFieldProjectIDs = "projectIds" - GlobalDnsFieldProviderID = "providerId" - GlobalDnsFieldRemoved = "removed" - GlobalDnsFieldState = "state" - GlobalDnsFieldStatus = "status" - GlobalDnsFieldTTL = "ttl" - GlobalDnsFieldTransitioning = "transitioning" - GlobalDnsFieldTransitioningMessage = "transitioningMessage" - GlobalDnsFieldUUID = "uuid" -) - -type GlobalDns struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - FQDN string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - MultiClusterAppID string `json:"multiClusterAppId,omitempty" yaml:"multiClusterAppId,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProjectIDs []string `json:"projectIds,omitempty" yaml:"projectIds,omitempty"` - ProviderID string `json:"providerId,omitempty" yaml:"providerId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *GlobalDNSStatus `json:"status,omitempty" yaml:"status,omitempty"` - TTL int64 `json:"ttl,omitempty" yaml:"ttl,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GlobalDnsCollection struct { - types.Collection - Data []GlobalDns `json:"data,omitempty"` - client *GlobalDnsClient -} - -type GlobalDnsClient struct { - apiClient *Client -} - -type GlobalDnsOperations interface { - List(opts *types.ListOpts) (*GlobalDnsCollection, error) - ListAll(opts *types.ListOpts) (*GlobalDnsCollection, error) - Create(opts *GlobalDns) (*GlobalDns, error) - Update(existing *GlobalDns, updates interface{}) (*GlobalDns, error) - Replace(existing *GlobalDns) (*GlobalDns, error) - ByID(id string) (*GlobalDns, error) - Delete(container *GlobalDns) error - - ActionAddProjects(resource *GlobalDns, input *UpdateGlobalDNSTargetsInput) error - - ActionRemoveProjects(resource *GlobalDns, input *UpdateGlobalDNSTargetsInput) error -} - -func newGlobalDnsClient(apiClient *Client) *GlobalDnsClient { - return &GlobalDnsClient{ - apiClient: apiClient, - } -} - -func (c *GlobalDnsClient) Create(container *GlobalDns) (*GlobalDns, error) { - resp := &GlobalDns{} - err := c.apiClient.Ops.DoCreate(GlobalDnsType, container, resp) - return resp, err -} - -func (c *GlobalDnsClient) Update(existing *GlobalDns, updates interface{}) (*GlobalDns, error) { - resp := &GlobalDns{} - err := c.apiClient.Ops.DoUpdate(GlobalDnsType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GlobalDnsClient) Replace(obj *GlobalDns) (*GlobalDns, error) { - resp := &GlobalDns{} - err := c.apiClient.Ops.DoReplace(GlobalDnsType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *GlobalDnsClient) List(opts *types.ListOpts) (*GlobalDnsCollection, error) { - resp := &GlobalDnsCollection{} - err := c.apiClient.Ops.DoList(GlobalDnsType, opts, resp) - resp.client = c - return resp, err -} - -func (c *GlobalDnsClient) ListAll(opts *types.ListOpts) (*GlobalDnsCollection, error) { - resp := &GlobalDnsCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *GlobalDnsCollection) Next() (*GlobalDnsCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GlobalDnsCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GlobalDnsClient) ByID(id string) (*GlobalDns, error) { - resp := &GlobalDns{} - err := c.apiClient.Ops.DoByID(GlobalDnsType, id, resp) - return resp, err -} - -func (c *GlobalDnsClient) Delete(container *GlobalDns) error { - return c.apiClient.Ops.DoResourceDelete(GlobalDnsType, &container.Resource) -} - -func (c *GlobalDnsClient) ActionAddProjects(resource *GlobalDns, input *UpdateGlobalDNSTargetsInput) error { - err := c.apiClient.Ops.DoAction(GlobalDnsType, "addProjects", &resource.Resource, input, nil) - return err -} - -func (c *GlobalDnsClient) ActionRemoveProjects(resource *GlobalDns, input *UpdateGlobalDNSTargetsInput) error { - err := c.apiClient.Ops.DoAction(GlobalDnsType, "removeProjects", &resource.Resource, input, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider.go deleted file mode 100644 index 951b2284715..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider.go +++ /dev/null @@ -1,128 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - GlobalDnsProviderType = "globalDnsProvider" - GlobalDnsProviderFieldAlidnsProviderConfig = "alidnsProviderConfig" - GlobalDnsProviderFieldAnnotations = "annotations" - GlobalDnsProviderFieldCloudflareProviderConfig = "cloudflareProviderConfig" - GlobalDnsProviderFieldCreated = "created" - GlobalDnsProviderFieldCreatorID = "creatorId" - GlobalDnsProviderFieldLabels = "labels" - GlobalDnsProviderFieldMembers = "members" - GlobalDnsProviderFieldName = "name" - GlobalDnsProviderFieldOwnerReferences = "ownerReferences" - GlobalDnsProviderFieldRemoved = "removed" - GlobalDnsProviderFieldRootDomain = "rootDomain" - GlobalDnsProviderFieldRoute53ProviderConfig = "route53ProviderConfig" - GlobalDnsProviderFieldUUID = "uuid" -) - -type GlobalDnsProvider struct { - types.Resource - AlidnsProviderConfig *AlidnsProviderConfig `json:"alidnsProviderConfig,omitempty" yaml:"alidnsProviderConfig,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - CloudflareProviderConfig *CloudflareProviderConfig `json:"cloudflareProviderConfig,omitempty" yaml:"cloudflareProviderConfig,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RootDomain string `json:"rootDomain,omitempty" yaml:"rootDomain,omitempty"` - Route53ProviderConfig *Route53ProviderConfig `json:"route53ProviderConfig,omitempty" yaml:"route53ProviderConfig,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GlobalDnsProviderCollection struct { - types.Collection - Data []GlobalDnsProvider `json:"data,omitempty"` - client *GlobalDnsProviderClient -} - -type GlobalDnsProviderClient struct { - apiClient *Client -} - -type GlobalDnsProviderOperations interface { - List(opts *types.ListOpts) (*GlobalDnsProviderCollection, error) - ListAll(opts *types.ListOpts) (*GlobalDnsProviderCollection, error) - Create(opts *GlobalDnsProvider) (*GlobalDnsProvider, error) - Update(existing *GlobalDnsProvider, updates interface{}) (*GlobalDnsProvider, error) - Replace(existing *GlobalDnsProvider) (*GlobalDnsProvider, error) - ByID(id string) (*GlobalDnsProvider, error) - Delete(container *GlobalDnsProvider) error -} - -func newGlobalDnsProviderClient(apiClient *Client) *GlobalDnsProviderClient { - return &GlobalDnsProviderClient{ - apiClient: apiClient, - } -} - -func (c *GlobalDnsProviderClient) Create(container *GlobalDnsProvider) (*GlobalDnsProvider, error) { - resp := &GlobalDnsProvider{} - err := c.apiClient.Ops.DoCreate(GlobalDnsProviderType, container, resp) - return resp, err -} - -func (c *GlobalDnsProviderClient) Update(existing *GlobalDnsProvider, updates interface{}) (*GlobalDnsProvider, error) { - resp := &GlobalDnsProvider{} - err := c.apiClient.Ops.DoUpdate(GlobalDnsProviderType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GlobalDnsProviderClient) Replace(obj *GlobalDnsProvider) (*GlobalDnsProvider, error) { - resp := &GlobalDnsProvider{} - err := c.apiClient.Ops.DoReplace(GlobalDnsProviderType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *GlobalDnsProviderClient) List(opts *types.ListOpts) (*GlobalDnsProviderCollection, error) { - resp := &GlobalDnsProviderCollection{} - err := c.apiClient.Ops.DoList(GlobalDnsProviderType, opts, resp) - resp.client = c - return resp, err -} - -func (c *GlobalDnsProviderClient) ListAll(opts *types.ListOpts) (*GlobalDnsProviderCollection, error) { - resp := &GlobalDnsProviderCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *GlobalDnsProviderCollection) Next() (*GlobalDnsProviderCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GlobalDnsProviderCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GlobalDnsProviderClient) ByID(id string) (*GlobalDnsProvider, error) { - resp := &GlobalDnsProvider{} - err := c.apiClient.Ops.DoByID(GlobalDnsProviderType, id, resp) - return resp, err -} - -func (c *GlobalDnsProviderClient) Delete(container *GlobalDnsProvider) error { - return c.apiClient.Ops.DoResourceDelete(GlobalDnsProviderType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider_spec.go deleted file mode 100644 index b5f1157a0f2..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_provider_spec.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - GlobalDNSProviderSpecType = "globalDnsProviderSpec" - GlobalDNSProviderSpecFieldAlidnsProviderConfig = "alidnsProviderConfig" - GlobalDNSProviderSpecFieldCloudflareProviderConfig = "cloudflareProviderConfig" - GlobalDNSProviderSpecFieldMembers = "members" - GlobalDNSProviderSpecFieldRootDomain = "rootDomain" - GlobalDNSProviderSpecFieldRoute53ProviderConfig = "route53ProviderConfig" -) - -type GlobalDNSProviderSpec struct { - AlidnsProviderConfig *AlidnsProviderConfig `json:"alidnsProviderConfig,omitempty" yaml:"alidnsProviderConfig,omitempty"` - CloudflareProviderConfig *CloudflareProviderConfig `json:"cloudflareProviderConfig,omitempty" yaml:"cloudflareProviderConfig,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - RootDomain string `json:"rootDomain,omitempty" yaml:"rootDomain,omitempty"` - Route53ProviderConfig *Route53ProviderConfig `json:"route53ProviderConfig,omitempty" yaml:"route53ProviderConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_spec.go deleted file mode 100644 index 3f22ef29974..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_spec.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - GlobalDNSSpecType = "globalDnsSpec" - GlobalDNSSpecFieldFQDN = "fqdn" - GlobalDNSSpecFieldMembers = "members" - GlobalDNSSpecFieldMultiClusterAppID = "multiClusterAppId" - GlobalDNSSpecFieldProjectIDs = "projectIds" - GlobalDNSSpecFieldProviderID = "providerId" - GlobalDNSSpecFieldTTL = "ttl" -) - -type GlobalDNSSpec struct { - FQDN string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - MultiClusterAppID string `json:"multiClusterAppId,omitempty" yaml:"multiClusterAppId,omitempty"` - ProjectIDs []string `json:"projectIds,omitempty" yaml:"projectIds,omitempty"` - ProviderID string `json:"providerId,omitempty" yaml:"providerId,omitempty"` - TTL int64 `json:"ttl,omitempty" yaml:"ttl,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_status.go deleted file mode 100644 index d37181ae694..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_dns_status.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - GlobalDNSStatusType = "globalDnsStatus" - GlobalDNSStatusFieldClusterEndpoints = "clusterEndpoints" - GlobalDNSStatusFieldEndpoints = "endpoints" -) - -type GlobalDNSStatus struct { - ClusterEndpoints map[string][]string `json:"clusterEndpoints,omitempty" yaml:"clusterEndpoints,omitempty"` - Endpoints []string `json:"endpoints,omitempty" yaml:"endpoints,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_openstack_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_openstack_opts.go deleted file mode 100644 index 7db5e17e248..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_openstack_opts.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - GlobalOpenstackOptsType = "globalOpenstackOpts" - GlobalOpenstackOptsFieldAuthURL = "auth-url" - GlobalOpenstackOptsFieldCAFile = "ca-file" - GlobalOpenstackOptsFieldDomainID = "domain-id" - GlobalOpenstackOptsFieldDomainName = "domain-name" - GlobalOpenstackOptsFieldPassword = "password" - GlobalOpenstackOptsFieldRegion = "region" - GlobalOpenstackOptsFieldTenantID = "tenant-id" - GlobalOpenstackOptsFieldTenantName = "tenant-name" - GlobalOpenstackOptsFieldTrustID = "trust-id" - GlobalOpenstackOptsFieldUserID = "user-id" - GlobalOpenstackOptsFieldUsername = "username" -) - -type GlobalOpenstackOpts struct { - AuthURL string `json:"auth-url,omitempty" yaml:"auth-url,omitempty"` - CAFile string `json:"ca-file,omitempty" yaml:"ca-file,omitempty"` - DomainID string `json:"domain-id,omitempty" yaml:"domain-id,omitempty"` - DomainName string `json:"domain-name,omitempty" yaml:"domain-name,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - TenantID string `json:"tenant-id,omitempty" yaml:"tenant-id,omitempty"` - TenantName string `json:"tenant-name,omitempty" yaml:"tenant-name,omitempty"` - TrustID string `json:"trust-id,omitempty" yaml:"trust-id,omitempty"` - UserID string `json:"user-id,omitempty" yaml:"user-id,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role.go deleted file mode 100644 index f5159dd5235..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role.go +++ /dev/null @@ -1,126 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - GlobalRoleType = "globalRole" - GlobalRoleFieldAnnotations = "annotations" - GlobalRoleFieldBuiltin = "builtin" - GlobalRoleFieldCreated = "created" - GlobalRoleFieldCreatorID = "creatorId" - GlobalRoleFieldDescription = "description" - GlobalRoleFieldLabels = "labels" - GlobalRoleFieldName = "name" - GlobalRoleFieldNewUserDefault = "newUserDefault" - GlobalRoleFieldOwnerReferences = "ownerReferences" - GlobalRoleFieldRemoved = "removed" - GlobalRoleFieldRules = "rules" - GlobalRoleFieldUUID = "uuid" -) - -type GlobalRole struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NewUserDefault bool `json:"newUserDefault,omitempty" yaml:"newUserDefault,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Rules []PolicyRule `json:"rules,omitempty" yaml:"rules,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GlobalRoleCollection struct { - types.Collection - Data []GlobalRole `json:"data,omitempty"` - client *GlobalRoleClient -} - -type GlobalRoleClient struct { - apiClient *Client -} - -type GlobalRoleOperations interface { - List(opts *types.ListOpts) (*GlobalRoleCollection, error) - ListAll(opts *types.ListOpts) (*GlobalRoleCollection, error) - Create(opts *GlobalRole) (*GlobalRole, error) - Update(existing *GlobalRole, updates interface{}) (*GlobalRole, error) - Replace(existing *GlobalRole) (*GlobalRole, error) - ByID(id string) (*GlobalRole, error) - Delete(container *GlobalRole) error -} - -func newGlobalRoleClient(apiClient *Client) *GlobalRoleClient { - return &GlobalRoleClient{ - apiClient: apiClient, - } -} - -func (c *GlobalRoleClient) Create(container *GlobalRole) (*GlobalRole, error) { - resp := &GlobalRole{} - err := c.apiClient.Ops.DoCreate(GlobalRoleType, container, resp) - return resp, err -} - -func (c *GlobalRoleClient) Update(existing *GlobalRole, updates interface{}) (*GlobalRole, error) { - resp := &GlobalRole{} - err := c.apiClient.Ops.DoUpdate(GlobalRoleType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GlobalRoleClient) Replace(obj *GlobalRole) (*GlobalRole, error) { - resp := &GlobalRole{} - err := c.apiClient.Ops.DoReplace(GlobalRoleType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *GlobalRoleClient) List(opts *types.ListOpts) (*GlobalRoleCollection, error) { - resp := &GlobalRoleCollection{} - err := c.apiClient.Ops.DoList(GlobalRoleType, opts, resp) - resp.client = c - return resp, err -} - -func (c *GlobalRoleClient) ListAll(opts *types.ListOpts) (*GlobalRoleCollection, error) { - resp := &GlobalRoleCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *GlobalRoleCollection) Next() (*GlobalRoleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GlobalRoleCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GlobalRoleClient) ByID(id string) (*GlobalRole, error) { - resp := &GlobalRole{} - err := c.apiClient.Ops.DoByID(GlobalRoleType, id, resp) - return resp, err -} - -func (c *GlobalRoleClient) Delete(container *GlobalRole) error { - return c.apiClient.Ops.DoResourceDelete(GlobalRoleType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role_binding.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role_binding.go deleted file mode 100644 index 0d447d01fd7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_role_binding.go +++ /dev/null @@ -1,124 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - GlobalRoleBindingType = "globalRoleBinding" - GlobalRoleBindingFieldAnnotations = "annotations" - GlobalRoleBindingFieldCreated = "created" - GlobalRoleBindingFieldCreatorID = "creatorId" - GlobalRoleBindingFieldGlobalRoleID = "globalRoleId" - GlobalRoleBindingFieldGroupPrincipalID = "groupPrincipalId" - GlobalRoleBindingFieldLabels = "labels" - GlobalRoleBindingFieldName = "name" - GlobalRoleBindingFieldOwnerReferences = "ownerReferences" - GlobalRoleBindingFieldRemoved = "removed" - GlobalRoleBindingFieldUUID = "uuid" - GlobalRoleBindingFieldUserID = "userId" -) - -type GlobalRoleBinding struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - GlobalRoleID string `json:"globalRoleId,omitempty" yaml:"globalRoleId,omitempty"` - GroupPrincipalID string `json:"groupPrincipalId,omitempty" yaml:"groupPrincipalId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserID string `json:"userId,omitempty" yaml:"userId,omitempty"` -} - -type GlobalRoleBindingCollection struct { - types.Collection - Data []GlobalRoleBinding `json:"data,omitempty"` - client *GlobalRoleBindingClient -} - -type GlobalRoleBindingClient struct { - apiClient *Client -} - -type GlobalRoleBindingOperations interface { - List(opts *types.ListOpts) (*GlobalRoleBindingCollection, error) - ListAll(opts *types.ListOpts) (*GlobalRoleBindingCollection, error) - Create(opts *GlobalRoleBinding) (*GlobalRoleBinding, error) - Update(existing *GlobalRoleBinding, updates interface{}) (*GlobalRoleBinding, error) - Replace(existing *GlobalRoleBinding) (*GlobalRoleBinding, error) - ByID(id string) (*GlobalRoleBinding, error) - Delete(container *GlobalRoleBinding) error -} - -func newGlobalRoleBindingClient(apiClient *Client) *GlobalRoleBindingClient { - return &GlobalRoleBindingClient{ - apiClient: apiClient, - } -} - -func (c *GlobalRoleBindingClient) Create(container *GlobalRoleBinding) (*GlobalRoleBinding, error) { - resp := &GlobalRoleBinding{} - err := c.apiClient.Ops.DoCreate(GlobalRoleBindingType, container, resp) - return resp, err -} - -func (c *GlobalRoleBindingClient) Update(existing *GlobalRoleBinding, updates interface{}) (*GlobalRoleBinding, error) { - resp := &GlobalRoleBinding{} - err := c.apiClient.Ops.DoUpdate(GlobalRoleBindingType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GlobalRoleBindingClient) Replace(obj *GlobalRoleBinding) (*GlobalRoleBinding, error) { - resp := &GlobalRoleBinding{} - err := c.apiClient.Ops.DoReplace(GlobalRoleBindingType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *GlobalRoleBindingClient) List(opts *types.ListOpts) (*GlobalRoleBindingCollection, error) { - resp := &GlobalRoleBindingCollection{} - err := c.apiClient.Ops.DoList(GlobalRoleBindingType, opts, resp) - resp.client = c - return resp, err -} - -func (c *GlobalRoleBindingClient) ListAll(opts *types.ListOpts) (*GlobalRoleBindingCollection, error) { - resp := &GlobalRoleBindingCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *GlobalRoleBindingCollection) Next() (*GlobalRoleBindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GlobalRoleBindingCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GlobalRoleBindingClient) ByID(id string) (*GlobalRoleBinding, error) { - resp := &GlobalRoleBinding{} - err := c.apiClient.Ops.DoByID(GlobalRoleBindingType, id, resp) - return resp, err -} - -func (c *GlobalRoleBindingClient) Delete(container *GlobalRoleBinding) error { - return c.apiClient.Ops.DoResourceDelete(GlobalRoleBindingType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_vsphere_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_vsphere_opts.go deleted file mode 100644 index 3b515a06f5b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_global_vsphere_opts.go +++ /dev/null @@ -1,32 +0,0 @@ -package client - -const ( - GlobalVsphereOptsType = "globalVsphereOpts" - GlobalVsphereOptsFieldDatacenter = "datacenter" - GlobalVsphereOptsFieldDatacenters = "datacenters" - GlobalVsphereOptsFieldDefaultDatastore = "datastore" - GlobalVsphereOptsFieldInsecureFlag = "insecure-flag" - GlobalVsphereOptsFieldPassword = "password" - GlobalVsphereOptsFieldRoundTripperCount = "soap-roundtrip-count" - GlobalVsphereOptsFieldUser = "user" - GlobalVsphereOptsFieldVCenterIP = "server" - GlobalVsphereOptsFieldVCenterPort = "port" - GlobalVsphereOptsFieldVMName = "vm-name" - GlobalVsphereOptsFieldVMUUID = "vm-uuid" - GlobalVsphereOptsFieldWorkingDir = "working-dir" -) - -type GlobalVsphereOpts struct { - Datacenter string `json:"datacenter,omitempty" yaml:"datacenter,omitempty"` - Datacenters string `json:"datacenters,omitempty" yaml:"datacenters,omitempty"` - DefaultDatastore string `json:"datastore,omitempty" yaml:"datastore,omitempty"` - InsecureFlag bool `json:"insecure-flag,omitempty" yaml:"insecure-flag,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - RoundTripperCount int64 `json:"soap-roundtrip-count,omitempty" yaml:"soap-roundtrip-count,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` - VCenterIP string `json:"server,omitempty" yaml:"server,omitempty"` - VCenterPort string `json:"port,omitempty" yaml:"port,omitempty"` - VMName string `json:"vm-name,omitempty" yaml:"vm-name,omitempty"` - VMUUID string `json:"vm-uuid,omitempty" yaml:"vm-uuid,omitempty"` - WorkingDir string `json:"working-dir,omitempty" yaml:"working-dir,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_glusterfs_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_glusterfs_volume_source.go deleted file mode 100644 index fa5900b3fc6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_glusterfs_volume_source.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GlusterfsVolumeSourceType = "glusterfsVolumeSource" - GlusterfsVolumeSourceFieldEndpointsName = "endpoints" - GlusterfsVolumeSourceFieldPath = "path" - GlusterfsVolumeSourceFieldReadOnly = "readOnly" -) - -type GlusterfsVolumeSource struct { - EndpointsName string `json:"endpoints,omitempty" yaml:"endpoints,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config.go deleted file mode 100644 index f44142293a8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -const ( - GoogleOauthConfigType = "googleOauthConfig" - GoogleOauthConfigFieldAccessMode = "accessMode" - GoogleOauthConfigFieldAdminEmail = "adminEmail" - GoogleOauthConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - GoogleOauthConfigFieldAnnotations = "annotations" - GoogleOauthConfigFieldCreated = "created" - GoogleOauthConfigFieldCreatorID = "creatorId" - GoogleOauthConfigFieldEnabled = "enabled" - GoogleOauthConfigFieldHostname = "hostname" - GoogleOauthConfigFieldLabels = "labels" - GoogleOauthConfigFieldName = "name" - GoogleOauthConfigFieldNestedGroupMembershipEnabled = "nestedGroupMembershipEnabled" - GoogleOauthConfigFieldOauthCredential = "oauthCredential" - GoogleOauthConfigFieldOwnerReferences = "ownerReferences" - GoogleOauthConfigFieldRemoved = "removed" - GoogleOauthConfigFieldServiceAccountCredential = "serviceAccountCredential" - GoogleOauthConfigFieldStatus = "status" - GoogleOauthConfigFieldType = "type" - GoogleOauthConfigFieldUUID = "uuid" - GoogleOauthConfigFieldUserInfoEndpoint = "userInfoEndpoint" -) - -type GoogleOauthConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AdminEmail string `json:"adminEmail,omitempty" yaml:"adminEmail,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NestedGroupMembershipEnabled bool `json:"nestedGroupMembershipEnabled,omitempty" yaml:"nestedGroupMembershipEnabled,omitempty"` - OauthCredential string `json:"oauthCredential,omitempty" yaml:"oauthCredential,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ServiceAccountCredential string `json:"serviceAccountCredential,omitempty" yaml:"serviceAccountCredential,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserInfoEndpoint string `json:"userInfoEndpoint,omitempty" yaml:"userInfoEndpoint,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_apply_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_apply_input.go deleted file mode 100644 index 9b5d8c586c4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_apply_input.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - GoogleOauthConfigApplyInputType = "googleOauthConfigApplyInput" - GoogleOauthConfigApplyInputFieldCode = "code" - GoogleOauthConfigApplyInputFieldEnabled = "enabled" - GoogleOauthConfigApplyInputFieldGoogleOauthConfig = "googleOauthConfig" -) - -type GoogleOauthConfigApplyInput struct { - Code string `json:"code,omitempty" yaml:"code,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GoogleOauthConfig *GoogleOauthConfig `json:"googleOauthConfig,omitempty" yaml:"googleOauthConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_test_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_test_output.go deleted file mode 100644 index 941108c06a2..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_google_oauth_config_test_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - GoogleOauthConfigTestOutputType = "googleOauthConfigTestOutput" - GoogleOauthConfigTestOutputFieldRedirectURL = "redirectUrl" -) - -type GoogleOauthConfigTestOutput struct { - RedirectURL string `json:"redirectUrl,omitempty" yaml:"redirectUrl,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_group.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_group.go deleted file mode 100644 index f14da72bcaf..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_group.go +++ /dev/null @@ -1,118 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - GroupType = "group" - GroupFieldAnnotations = "annotations" - GroupFieldCreated = "created" - GroupFieldCreatorID = "creatorId" - GroupFieldLabels = "labels" - GroupFieldName = "name" - GroupFieldOwnerReferences = "ownerReferences" - GroupFieldRemoved = "removed" - GroupFieldUUID = "uuid" -) - -type Group struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GroupCollection struct { - types.Collection - Data []Group `json:"data,omitempty"` - client *GroupClient -} - -type GroupClient struct { - apiClient *Client -} - -type GroupOperations interface { - List(opts *types.ListOpts) (*GroupCollection, error) - ListAll(opts *types.ListOpts) (*GroupCollection, error) - Create(opts *Group) (*Group, error) - Update(existing *Group, updates interface{}) (*Group, error) - Replace(existing *Group) (*Group, error) - ByID(id string) (*Group, error) - Delete(container *Group) error -} - -func newGroupClient(apiClient *Client) *GroupClient { - return &GroupClient{ - apiClient: apiClient, - } -} - -func (c *GroupClient) Create(container *Group) (*Group, error) { - resp := &Group{} - err := c.apiClient.Ops.DoCreate(GroupType, container, resp) - return resp, err -} - -func (c *GroupClient) Update(existing *Group, updates interface{}) (*Group, error) { - resp := &Group{} - err := c.apiClient.Ops.DoUpdate(GroupType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GroupClient) Replace(obj *Group) (*Group, error) { - resp := &Group{} - err := c.apiClient.Ops.DoReplace(GroupType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *GroupClient) List(opts *types.ListOpts) (*GroupCollection, error) { - resp := &GroupCollection{} - err := c.apiClient.Ops.DoList(GroupType, opts, resp) - resp.client = c - return resp, err -} - -func (c *GroupClient) ListAll(opts *types.ListOpts) (*GroupCollection, error) { - resp := &GroupCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *GroupCollection) Next() (*GroupCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GroupCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GroupClient) ByID(id string) (*Group, error) { - resp := &Group{} - err := c.apiClient.Ops.DoByID(GroupType, id, resp) - return resp, err -} - -func (c *GroupClient) Delete(container *Group) error { - return c.apiClient.Ops.DoResourceDelete(GroupType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_group_member.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_group_member.go deleted file mode 100644 index bbcfe3466c3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_group_member.go +++ /dev/null @@ -1,122 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - GroupMemberType = "groupMember" - GroupMemberFieldAnnotations = "annotations" - GroupMemberFieldCreated = "created" - GroupMemberFieldCreatorID = "creatorId" - GroupMemberFieldGroupID = "groupId" - GroupMemberFieldLabels = "labels" - GroupMemberFieldName = "name" - GroupMemberFieldOwnerReferences = "ownerReferences" - GroupMemberFieldPrincipalID = "principalId" - GroupMemberFieldRemoved = "removed" - GroupMemberFieldUUID = "uuid" -) - -type GroupMember struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - GroupID string `json:"groupId,omitempty" yaml:"groupId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PrincipalID string `json:"principalId,omitempty" yaml:"principalId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GroupMemberCollection struct { - types.Collection - Data []GroupMember `json:"data,omitempty"` - client *GroupMemberClient -} - -type GroupMemberClient struct { - apiClient *Client -} - -type GroupMemberOperations interface { - List(opts *types.ListOpts) (*GroupMemberCollection, error) - ListAll(opts *types.ListOpts) (*GroupMemberCollection, error) - Create(opts *GroupMember) (*GroupMember, error) - Update(existing *GroupMember, updates interface{}) (*GroupMember, error) - Replace(existing *GroupMember) (*GroupMember, error) - ByID(id string) (*GroupMember, error) - Delete(container *GroupMember) error -} - -func newGroupMemberClient(apiClient *Client) *GroupMemberClient { - return &GroupMemberClient{ - apiClient: apiClient, - } -} - -func (c *GroupMemberClient) Create(container *GroupMember) (*GroupMember, error) { - resp := &GroupMember{} - err := c.apiClient.Ops.DoCreate(GroupMemberType, container, resp) - return resp, err -} - -func (c *GroupMemberClient) Update(existing *GroupMember, updates interface{}) (*GroupMember, error) { - resp := &GroupMember{} - err := c.apiClient.Ops.DoUpdate(GroupMemberType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GroupMemberClient) Replace(obj *GroupMember) (*GroupMember, error) { - resp := &GroupMember{} - err := c.apiClient.Ops.DoReplace(GroupMemberType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *GroupMemberClient) List(opts *types.ListOpts) (*GroupMemberCollection, error) { - resp := &GroupMemberCollection{} - err := c.apiClient.Ops.DoList(GroupMemberType, opts, resp) - resp.client = c - return resp, err -} - -func (c *GroupMemberClient) ListAll(opts *types.ListOpts) (*GroupMemberCollection, error) { - resp := &GroupMemberCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *GroupMemberCollection) Next() (*GroupMemberCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GroupMemberCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GroupMemberClient) ByID(id string) (*GroupMember, error) { - resp := &GroupMember{} - err := c.apiClient.Ops.DoByID(GroupMemberType, id, resp) - return resp, err -} - -func (c *GroupMemberClient) Delete(container *GroupMember) error { - return c.apiClient.Ops.DoResourceDelete(GroupMemberType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_harvester_cloud_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_harvester_cloud_provider.go deleted file mode 100644 index 4075744a5b9..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_harvester_cloud_provider.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - HarvesterCloudProviderType = "harvesterCloudProvider" - HarvesterCloudProviderFieldCloudConfig = "cloudConfig" -) - -type HarvesterCloudProvider struct { - CloudConfig string `json:"cloudConfig,omitempty" yaml:"cloudConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_health_check.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_health_check.go deleted file mode 100644 index b7e8e5b6f98..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_health_check.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - HealthCheckType = "healthCheck" - HealthCheckFieldURL = "url" -) - -type HealthCheck struct { - URL string `json:"url,omitempty" yaml:"url,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_host_path_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_host_path_volume_source.go deleted file mode 100644 index cbeffd33615..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_host_path_volume_source.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - HostPathVolumeSourceType = "hostPathVolumeSource" - HostPathVolumeSourceFieldPath = "path" - HostPathVolumeSourceFieldType = "type" -) - -type HostPathVolumeSource struct { - Path string `json:"path,omitempty" yaml:"path,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_host_port_range.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_host_port_range.go deleted file mode 100644 index 2fb10f1d85f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_host_port_range.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - HostPortRangeType = "hostPortRange" - HostPortRangeFieldMax = "max" - HostPortRangeFieldMin = "min" -) - -type HostPortRange struct { - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_id_range.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_id_range.go deleted file mode 100644 index 5dcf08e7276..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_id_range.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - IDRangeType = "idRange" - IDRangeFieldMax = "max" - IDRangeFieldMin = "min" -) - -type IDRange struct { - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_identity_configuration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_identity_configuration.go deleted file mode 100644 index 1cc371d3f5e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_identity_configuration.go +++ /dev/null @@ -1,8 +0,0 @@ -package client - -const ( - IdentityConfigurationType = "identityConfiguration" -) - -type IdentityConfiguration struct { -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_import_cluster_yaml_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_import_cluster_yaml_input.go deleted file mode 100644 index 4bc36257f80..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_import_cluster_yaml_input.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ImportClusterYamlInputType = "importClusterYamlInput" - ImportClusterYamlInputFieldDefaultNamespace = "defaultNamespace" - ImportClusterYamlInputFieldNamespace = "namespace" - ImportClusterYamlInputFieldProjectID = "projectId" - ImportClusterYamlInputFieldYAML = "yaml" -) - -type ImportClusterYamlInput struct { - DefaultNamespace string `json:"defaultNamespace,omitempty" yaml:"defaultNamespace,omitempty"` - Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - YAML string `json:"yaml,omitempty" yaml:"yaml,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_import_yaml_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_import_yaml_output.go deleted file mode 100644 index 7b4a2852acc..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_import_yaml_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ImportYamlOutputType = "importYamlOutput" - ImportYamlOutputFieldMessage = "message" -) - -type ImportYamlOutput struct { - Message string `json:"message,omitempty" yaml:"message,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_imported_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_imported_config.go deleted file mode 100644 index b3a9699cc56..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_imported_config.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ImportedConfigType = "importedConfig" - ImportedConfigFieldKubeConfig = "kubeConfig" -) - -type ImportedConfig struct { - KubeConfig string `json:"kubeConfig,omitempty" yaml:"kubeConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_info.go deleted file mode 100644 index 1f371517929..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_info.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - InfoType = "info" - InfoFieldBuildDate = "buildDate" - InfoFieldCompiler = "compiler" - InfoFieldGitCommit = "gitCommit" - InfoFieldGitTreeState = "gitTreeState" - InfoFieldGitVersion = "gitVersion" - InfoFieldGoVersion = "goVersion" - InfoFieldMajor = "major" - InfoFieldMinor = "minor" - InfoFieldPlatform = "platform" -) - -type Info struct { - BuildDate string `json:"buildDate,omitempty" yaml:"buildDate,omitempty"` - Compiler string `json:"compiler,omitempty" yaml:"compiler,omitempty"` - GitCommit string `json:"gitCommit,omitempty" yaml:"gitCommit,omitempty"` - GitTreeState string `json:"gitTreeState,omitempty" yaml:"gitTreeState,omitempty"` - GitVersion string `json:"gitVersion,omitempty" yaml:"gitVersion,omitempty"` - GoVersion string `json:"goVersion,omitempty" yaml:"goVersion,omitempty"` - Major string `json:"major,omitempty" yaml:"major,omitempty"` - Minor string `json:"minor,omitempty" yaml:"minor,omitempty"` - Platform string `json:"platform,omitempty" yaml:"platform,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_capabilities.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_capabilities.go deleted file mode 100644 index ff678cd70ed..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_capabilities.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - IngressCapabilitiesType = "ingressCapabilities" - IngressCapabilitiesFieldCustomDefaultBackend = "customDefaultBackend" - IngressCapabilitiesFieldIngressProvider = "ingressProvider" -) - -type IngressCapabilities struct { - CustomDefaultBackend *bool `json:"customDefaultBackend,omitempty" yaml:"customDefaultBackend,omitempty"` - IngressProvider string `json:"ingressProvider,omitempty" yaml:"ingressProvider,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_config.go deleted file mode 100644 index ac10579878b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ingress_config.go +++ /dev/null @@ -1,42 +0,0 @@ -package client - -const ( - IngressConfigType = "ingressConfig" - IngressConfigFieldDNSPolicy = "dnsPolicy" - IngressConfigFieldDefaultBackend = "defaultBackend" - IngressConfigFieldDefaultHTTPBackendPriorityClassName = "defaultHttpBackendPriorityClassName" - IngressConfigFieldDefaultIngressClass = "defaultIngressClass" - IngressConfigFieldExtraArgs = "extraArgs" - IngressConfigFieldExtraEnvs = "extraEnvs" - IngressConfigFieldExtraVolumeMounts = "extraVolumeMounts" - IngressConfigFieldExtraVolumes = "extraVolumes" - IngressConfigFieldHTTPPort = "httpPort" - IngressConfigFieldHTTPSPort = "httpsPort" - IngressConfigFieldNetworkMode = "networkMode" - IngressConfigFieldNginxIngressControllerPriorityClassName = "nginxIngressControllerPriorityClassName" - IngressConfigFieldNodeSelector = "nodeSelector" - IngressConfigFieldOptions = "options" - IngressConfigFieldProvider = "provider" - IngressConfigFieldTolerations = "tolerations" - IngressConfigFieldUpdateStrategy = "updateStrategy" -) - -type IngressConfig struct { - DNSPolicy string `json:"dnsPolicy,omitempty" yaml:"dnsPolicy,omitempty"` - DefaultBackend *bool `json:"defaultBackend,omitempty" yaml:"defaultBackend,omitempty"` - DefaultHTTPBackendPriorityClassName string `json:"defaultHttpBackendPriorityClassName,omitempty" yaml:"defaultHttpBackendPriorityClassName,omitempty"` - DefaultIngressClass *bool `json:"defaultIngressClass,omitempty" yaml:"defaultIngressClass,omitempty"` - ExtraArgs map[string]string `json:"extraArgs,omitempty" yaml:"extraArgs,omitempty"` - ExtraEnvs []interface{} `json:"extraEnvs,omitempty" yaml:"extraEnvs,omitempty"` - ExtraVolumeMounts []interface{} `json:"extraVolumeMounts,omitempty" yaml:"extraVolumeMounts,omitempty"` - ExtraVolumes []interface{} `json:"extraVolumes,omitempty" yaml:"extraVolumes,omitempty"` - HTTPPort int64 `json:"httpPort,omitempty" yaml:"httpPort,omitempty"` - HTTPSPort int64 `json:"httpsPort,omitempty" yaml:"httpsPort,omitempty"` - NetworkMode string `json:"networkMode,omitempty" yaml:"networkMode,omitempty"` - NginxIngressControllerPriorityClassName string `json:"nginxIngressControllerPriorityClassName,omitempty" yaml:"nginxIngressControllerPriorityClassName,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"` - Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"` - Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` - Tolerations []Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"` - UpdateStrategy *DaemonSetUpdateStrategy `json:"updateStrategy,omitempty" yaml:"updateStrategy,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_spec.go deleted file mode 100644 index ced92343f1e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_spec.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - InternalNodeSpecType = "internalNodeSpec" - InternalNodeSpecFieldPodCidr = "podCidr" - InternalNodeSpecFieldPodCidrs = "podCidrs" - InternalNodeSpecFieldProviderId = "providerId" - InternalNodeSpecFieldTaints = "taints" - InternalNodeSpecFieldUnschedulable = "unschedulable" -) - -type InternalNodeSpec struct { - PodCidr string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"` - PodCidrs []string `json:"podCidrs,omitempty" yaml:"podCidrs,omitempty"` - ProviderId string `json:"providerId,omitempty" yaml:"providerId,omitempty"` - Taints []Taint `json:"taints,omitempty" yaml:"taints,omitempty"` - Unschedulable bool `json:"unschedulable,omitempty" yaml:"unschedulable,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_status.go deleted file mode 100644 index 963eefb23d5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_internal_node_status.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - InternalNodeStatusType = "internalNodeStatus" - InternalNodeStatusFieldAllocatable = "allocatable" - InternalNodeStatusFieldCapacity = "capacity" - InternalNodeStatusFieldConfig = "config" - InternalNodeStatusFieldExternalIPAddress = "externalIpAddress" - InternalNodeStatusFieldHostname = "hostname" - InternalNodeStatusFieldIPAddress = "ipAddress" - InternalNodeStatusFieldInfo = "info" - InternalNodeStatusFieldNodeConditions = "nodeConditions" - InternalNodeStatusFieldVolumesAttached = "volumesAttached" - InternalNodeStatusFieldVolumesInUse = "volumesInUse" -) - -type InternalNodeStatus struct { - Allocatable map[string]string `json:"allocatable,omitempty" yaml:"allocatable,omitempty"` - Capacity map[string]string `json:"capacity,omitempty" yaml:"capacity,omitempty"` - Config *NodeConfigStatus `json:"config,omitempty" yaml:"config,omitempty"` - ExternalIPAddress string `json:"externalIpAddress,omitempty" yaml:"externalIpAddress,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - IPAddress string `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"` - Info *NodeInfo `json:"info,omitempty" yaml:"info,omitempty"` - NodeConditions []NodeCondition `json:"nodeConditions,omitempty" yaml:"nodeConditions,omitempty"` - VolumesAttached map[string]AttachedVolume `json:"volumesAttached,omitempty" yaml:"volumesAttached,omitempty"` - VolumesInUse []string `json:"volumesInUse,omitempty" yaml:"volumesInUse,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_iscsi_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_iscsi_volume_source.go deleted file mode 100644 index ef076207083..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_iscsi_volume_source.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - ISCSIVolumeSourceType = "iscsiVolumeSource" - ISCSIVolumeSourceFieldDiscoveryCHAPAuth = "chapAuthDiscovery" - ISCSIVolumeSourceFieldFSType = "fsType" - ISCSIVolumeSourceFieldIQN = "iqn" - ISCSIVolumeSourceFieldISCSIInterface = "iscsiInterface" - ISCSIVolumeSourceFieldInitiatorName = "initiatorName" - ISCSIVolumeSourceFieldLun = "lun" - ISCSIVolumeSourceFieldPortals = "portals" - ISCSIVolumeSourceFieldReadOnly = "readOnly" - ISCSIVolumeSourceFieldSecretRef = "secretRef" - ISCSIVolumeSourceFieldSessionCHAPAuth = "chapAuthSession" - ISCSIVolumeSourceFieldTargetPortal = "targetPortal" -) - -type ISCSIVolumeSource struct { - DiscoveryCHAPAuth bool `json:"chapAuthDiscovery,omitempty" yaml:"chapAuthDiscovery,omitempty"` - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - IQN string `json:"iqn,omitempty" yaml:"iqn,omitempty"` - ISCSIInterface string `json:"iscsiInterface,omitempty" yaml:"iscsiInterface,omitempty"` - InitiatorName string `json:"initiatorName,omitempty" yaml:"initiatorName,omitempty"` - Lun int64 `json:"lun,omitempty" yaml:"lun,omitempty"` - Portals []string `json:"portals,omitempty" yaml:"portals,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SecretRef *LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` - SessionCHAPAuth bool `json:"chapAuthSession,omitempty" yaml:"chapAuthSession,omitempty"` - TargetPortal string `json:"targetPortal,omitempty" yaml:"targetPortal,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_k3s_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_k3s_config.go deleted file mode 100644 index 425cbd73f57..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_k3s_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - K3sConfigType = "k3sConfig" - K3sConfigFieldClusterUpgradeStrategy = "k3supgradeStrategy" - K3sConfigFieldVersion = "kubernetesVersion" -) - -type K3sConfig struct { - ClusterUpgradeStrategy *ClusterUpgradeStrategy `json:"k3supgradeStrategy,omitempty" yaml:"k3supgradeStrategy,omitempty"` - Version string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kafka_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kafka_config.go deleted file mode 100644 index c1b04dcd277..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kafka_config.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - KafkaConfigType = "kafkaConfig" - KafkaConfigFieldBrokerEndpoints = "brokerEndpoints" - KafkaConfigFieldCertificate = "certificate" - KafkaConfigFieldClientCert = "clientCert" - KafkaConfigFieldClientKey = "clientKey" - KafkaConfigFieldSaslPassword = "saslPassword" - KafkaConfigFieldSaslScramMechanism = "saslScramMechanism" - KafkaConfigFieldSaslType = "saslType" - KafkaConfigFieldSaslUsername = "saslUsername" - KafkaConfigFieldTopic = "topic" - KafkaConfigFieldZookeeperEndpoint = "zookeeperEndpoint" -) - -type KafkaConfig struct { - BrokerEndpoints []string `json:"brokerEndpoints,omitempty" yaml:"brokerEndpoints,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty" yaml:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty" yaml:"clientKey,omitempty"` - SaslPassword string `json:"saslPassword,omitempty" yaml:"saslPassword,omitempty"` - SaslScramMechanism string `json:"saslScramMechanism,omitempty" yaml:"saslScramMechanism,omitempty"` - SaslType string `json:"saslType,omitempty" yaml:"saslType,omitempty"` - SaslUsername string `json:"saslUsername,omitempty" yaml:"saslUsername,omitempty"` - Topic string `json:"topic,omitempty" yaml:"topic,omitempty"` - ZookeeperEndpoint string `json:"zookeeperEndpoint,omitempty" yaml:"zookeeperEndpoint,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_key.go deleted file mode 100644 index 0aa9ed6e75c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - KeyType = "key" - KeyFieldName = "name" - KeyFieldSecret = "secret" -) - -type Key struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Secret string `json:"secret,omitempty" yaml:"secret,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_config.go deleted file mode 100644 index 7a2b3925fb0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_config.go +++ /dev/null @@ -1,52 +0,0 @@ -package client - -const ( - KeyCloakConfigType = "keyCloakConfig" - KeyCloakConfigFieldAccessMode = "accessMode" - KeyCloakConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - KeyCloakConfigFieldAnnotations = "annotations" - KeyCloakConfigFieldCreated = "created" - KeyCloakConfigFieldCreatorID = "creatorId" - KeyCloakConfigFieldDisplayNameField = "displayNameField" - KeyCloakConfigFieldEnabled = "enabled" - KeyCloakConfigFieldEntityID = "entityID" - KeyCloakConfigFieldGroupsField = "groupsField" - KeyCloakConfigFieldIDPMetadataContent = "idpMetadataContent" - KeyCloakConfigFieldLabels = "labels" - KeyCloakConfigFieldName = "name" - KeyCloakConfigFieldOwnerReferences = "ownerReferences" - KeyCloakConfigFieldRancherAPIHost = "rancherApiHost" - KeyCloakConfigFieldRemoved = "removed" - KeyCloakConfigFieldSpCert = "spCert" - KeyCloakConfigFieldSpKey = "spKey" - KeyCloakConfigFieldStatus = "status" - KeyCloakConfigFieldType = "type" - KeyCloakConfigFieldUIDField = "uidField" - KeyCloakConfigFieldUUID = "uuid" - KeyCloakConfigFieldUserNameField = "userNameField" -) - -type KeyCloakConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DisplayNameField string `json:"displayNameField,omitempty" yaml:"displayNameField,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - EntityID string `json:"entityID,omitempty" yaml:"entityID,omitempty"` - GroupsField string `json:"groupsField,omitempty" yaml:"groupsField,omitempty"` - IDPMetadataContent string `json:"idpMetadataContent,omitempty" yaml:"idpMetadataContent,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - RancherAPIHost string `json:"rancherApiHost,omitempty" yaml:"rancherApiHost,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SpCert string `json:"spCert,omitempty" yaml:"spCert,omitempty"` - SpKey string `json:"spKey,omitempty" yaml:"spKey,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UIDField string `json:"uidField,omitempty" yaml:"uidField,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserNameField string `json:"userNameField,omitempty" yaml:"userNameField,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_oidcconfig.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_oidcconfig.go deleted file mode 100644 index 871fa63fa80..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_cloak_oidcconfig.go +++ /dev/null @@ -1,52 +0,0 @@ -package client - -const ( - KeyCloakOIDCConfigType = "keyCloakOIDCConfig" - KeyCloakOIDCConfigFieldAccessMode = "accessMode" - KeyCloakOIDCConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - KeyCloakOIDCConfigFieldAnnotations = "annotations" - KeyCloakOIDCConfigFieldAuthEndpoint = "authEndpoint" - KeyCloakOIDCConfigFieldCertificate = "certificate" - KeyCloakOIDCConfigFieldClientID = "clientId" - KeyCloakOIDCConfigFieldClientSecret = "clientSecret" - KeyCloakOIDCConfigFieldCreated = "created" - KeyCloakOIDCConfigFieldCreatorID = "creatorId" - KeyCloakOIDCConfigFieldEnabled = "enabled" - KeyCloakOIDCConfigFieldGroupSearchEnabled = "groupSearchEnabled" - KeyCloakOIDCConfigFieldIssuer = "issuer" - KeyCloakOIDCConfigFieldLabels = "labels" - KeyCloakOIDCConfigFieldName = "name" - KeyCloakOIDCConfigFieldOwnerReferences = "ownerReferences" - KeyCloakOIDCConfigFieldPrivateKey = "privateKey" - KeyCloakOIDCConfigFieldRancherURL = "rancherUrl" - KeyCloakOIDCConfigFieldRemoved = "removed" - KeyCloakOIDCConfigFieldScopes = "scope" - KeyCloakOIDCConfigFieldStatus = "status" - KeyCloakOIDCConfigFieldType = "type" - KeyCloakOIDCConfigFieldUUID = "uuid" -) - -type KeyCloakOIDCConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AuthEndpoint string `json:"authEndpoint,omitempty" yaml:"authEndpoint,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientID string `json:"clientId,omitempty" yaml:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GroupSearchEnabled *bool `json:"groupSearchEnabled,omitempty" yaml:"groupSearchEnabled,omitempty"` - Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PrivateKey string `json:"privateKey,omitempty" yaml:"privateKey,omitempty"` - RancherURL string `json:"rancherUrl,omitempty" yaml:"rancherUrl,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Scopes string `json:"scope,omitempty" yaml:"scope,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_to_path.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_to_path.go deleted file mode 100644 index de4ae607232..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_key_to_path.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - KeyToPathType = "keyToPath" - KeyToPathFieldKey = "key" - KeyToPathFieldMode = "mode" - KeyToPathFieldPath = "path" -) - -type KeyToPath struct { - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Mode *int64 `json:"mode,omitempty" yaml:"mode,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kms_configuration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kms_configuration.go deleted file mode 100644 index 74ea0ed127e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kms_configuration.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - KMSConfigurationType = "kmsConfiguration" - KMSConfigurationFieldAPIVersion = "apiVersion" - KMSConfigurationFieldCacheSize = "cachesize" - KMSConfigurationFieldEndpoint = "endpoint" - KMSConfigurationFieldName = "name" - KMSConfigurationFieldTimeout = "timeout" -) - -type KMSConfiguration struct { - APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"` - CacheSize *int64 `json:"cachesize,omitempty" yaml:"cachesize,omitempty"` - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Timeout *Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver.go deleted file mode 100644 index 319d68a0c91..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver.go +++ /dev/null @@ -1,163 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - KontainerDriverType = "kontainerDriver" - KontainerDriverFieldActive = "active" - KontainerDriverFieldActualURL = "actualUrl" - KontainerDriverFieldAnnotations = "annotations" - KontainerDriverFieldBuiltIn = "builtIn" - KontainerDriverFieldChecksum = "checksum" - KontainerDriverFieldConditions = "conditions" - KontainerDriverFieldCreated = "created" - KontainerDriverFieldCreatorID = "creatorId" - KontainerDriverFieldExecutablePath = "executablePath" - KontainerDriverFieldLabels = "labels" - KontainerDriverFieldName = "name" - KontainerDriverFieldOwnerReferences = "ownerReferences" - KontainerDriverFieldRemoved = "removed" - KontainerDriverFieldState = "state" - KontainerDriverFieldTransitioning = "transitioning" - KontainerDriverFieldTransitioningMessage = "transitioningMessage" - KontainerDriverFieldUIURL = "uiUrl" - KontainerDriverFieldURL = "url" - KontainerDriverFieldUUID = "uuid" - KontainerDriverFieldWhitelistDomains = "whitelistDomains" -) - -type KontainerDriver struct { - types.Resource - Active bool `json:"active,omitempty" yaml:"active,omitempty"` - ActualURL string `json:"actualUrl,omitempty" yaml:"actualUrl,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - BuiltIn bool `json:"builtIn,omitempty" yaml:"builtIn,omitempty"` - Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"` - Conditions []Condition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - ExecutablePath string `json:"executablePath,omitempty" yaml:"executablePath,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UIURL string `json:"uiUrl,omitempty" yaml:"uiUrl,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - WhitelistDomains []string `json:"whitelistDomains,omitempty" yaml:"whitelistDomains,omitempty"` -} - -type KontainerDriverCollection struct { - types.Collection - Data []KontainerDriver `json:"data,omitempty"` - client *KontainerDriverClient -} - -type KontainerDriverClient struct { - apiClient *Client -} - -type KontainerDriverOperations interface { - List(opts *types.ListOpts) (*KontainerDriverCollection, error) - ListAll(opts *types.ListOpts) (*KontainerDriverCollection, error) - Create(opts *KontainerDriver) (*KontainerDriver, error) - Update(existing *KontainerDriver, updates interface{}) (*KontainerDriver, error) - Replace(existing *KontainerDriver) (*KontainerDriver, error) - ByID(id string) (*KontainerDriver, error) - Delete(container *KontainerDriver) error - - ActionActivate(resource *KontainerDriver) error - - ActionDeactivate(resource *KontainerDriver) error - - CollectionActionRefresh(resource *KontainerDriverCollection) error -} - -func newKontainerDriverClient(apiClient *Client) *KontainerDriverClient { - return &KontainerDriverClient{ - apiClient: apiClient, - } -} - -func (c *KontainerDriverClient) Create(container *KontainerDriver) (*KontainerDriver, error) { - resp := &KontainerDriver{} - err := c.apiClient.Ops.DoCreate(KontainerDriverType, container, resp) - return resp, err -} - -func (c *KontainerDriverClient) Update(existing *KontainerDriver, updates interface{}) (*KontainerDriver, error) { - resp := &KontainerDriver{} - err := c.apiClient.Ops.DoUpdate(KontainerDriverType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *KontainerDriverClient) Replace(obj *KontainerDriver) (*KontainerDriver, error) { - resp := &KontainerDriver{} - err := c.apiClient.Ops.DoReplace(KontainerDriverType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *KontainerDriverClient) List(opts *types.ListOpts) (*KontainerDriverCollection, error) { - resp := &KontainerDriverCollection{} - err := c.apiClient.Ops.DoList(KontainerDriverType, opts, resp) - resp.client = c - return resp, err -} - -func (c *KontainerDriverClient) ListAll(opts *types.ListOpts) (*KontainerDriverCollection, error) { - resp := &KontainerDriverCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *KontainerDriverCollection) Next() (*KontainerDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &KontainerDriverCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *KontainerDriverClient) ByID(id string) (*KontainerDriver, error) { - resp := &KontainerDriver{} - err := c.apiClient.Ops.DoByID(KontainerDriverType, id, resp) - return resp, err -} - -func (c *KontainerDriverClient) Delete(container *KontainerDriver) error { - return c.apiClient.Ops.DoResourceDelete(KontainerDriverType, &container.Resource) -} - -func (c *KontainerDriverClient) ActionActivate(resource *KontainerDriver) error { - err := c.apiClient.Ops.DoAction(KontainerDriverType, "activate", &resource.Resource, nil, nil) - return err -} - -func (c *KontainerDriverClient) ActionDeactivate(resource *KontainerDriver) error { - err := c.apiClient.Ops.DoAction(KontainerDriverType, "deactivate", &resource.Resource, nil, nil) - return err -} - -func (c *KontainerDriverClient) CollectionActionRefresh(resource *KontainerDriverCollection) error { - err := c.apiClient.Ops.DoCollectionAction(KontainerDriverType, "refresh", &resource.Collection, nil, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_spec.go deleted file mode 100644 index 985f7d9811a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_spec.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - KontainerDriverSpecType = "kontainerDriverSpec" - KontainerDriverSpecFieldActive = "active" - KontainerDriverSpecFieldBuiltIn = "builtIn" - KontainerDriverSpecFieldChecksum = "checksum" - KontainerDriverSpecFieldUIURL = "uiUrl" - KontainerDriverSpecFieldURL = "url" - KontainerDriverSpecFieldWhitelistDomains = "whitelistDomains" -) - -type KontainerDriverSpec struct { - Active bool `json:"active,omitempty" yaml:"active,omitempty"` - BuiltIn bool `json:"builtIn,omitempty" yaml:"builtIn,omitempty"` - Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"` - UIURL string `json:"uiUrl,omitempty" yaml:"uiUrl,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - WhitelistDomains []string `json:"whitelistDomains,omitempty" yaml:"whitelistDomains,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_status.go deleted file mode 100644 index 9ea025d69d6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kontainer_driver_status.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - KontainerDriverStatusType = "kontainerDriverStatus" - KontainerDriverStatusFieldActualURL = "actualUrl" - KontainerDriverStatusFieldConditions = "conditions" - KontainerDriverStatusFieldDisplayName = "displayName" - KontainerDriverStatusFieldExecutablePath = "executablePath" -) - -type KontainerDriverStatus struct { - ActualURL string `json:"actualUrl,omitempty" yaml:"actualUrl,omitempty"` - Conditions []Condition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - ExecutablePath string `json:"executablePath,omitempty" yaml:"executablePath,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_apiservice.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_apiservice.go deleted file mode 100644 index 617f467bf60..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_apiservice.go +++ /dev/null @@ -1,44 +0,0 @@ -package client - -const ( - KubeAPIServiceType = "kubeAPIService" - KubeAPIServiceFieldAdmissionConfiguration = "admissionConfiguration" - KubeAPIServiceFieldAlwaysPullImages = "alwaysPullImages" - KubeAPIServiceFieldAuditLog = "auditLog" - KubeAPIServiceFieldEventRateLimit = "eventRateLimit" - KubeAPIServiceFieldExtraArgs = "extraArgs" - KubeAPIServiceFieldExtraArgsArray = "extraArgsArray" - KubeAPIServiceFieldExtraBinds = "extraBinds" - KubeAPIServiceFieldExtraEnv = "extraEnv" - KubeAPIServiceFieldImage = "image" - KubeAPIServiceFieldPodSecurityConfiguration = "podSecurityConfiguration" - KubeAPIServiceFieldPodSecurityPolicy = "podSecurityPolicy" - KubeAPIServiceFieldSecretsEncryptionConfig = "secretsEncryptionConfig" - KubeAPIServiceFieldServiceClusterIPRange = "serviceClusterIpRange" - KubeAPIServiceFieldServiceNodePortRange = "serviceNodePortRange" - KubeAPIServiceFieldWindowsExtraArgs = "winExtraArgs" - KubeAPIServiceFieldWindowsExtraArgsArray = "winExtraArgsArray" - KubeAPIServiceFieldWindowsExtraBinds = "winExtraBinds" - KubeAPIServiceFieldWindowsExtraEnv = "winExtraEnv" -) - -type KubeAPIService struct { - AdmissionConfiguration map[string]interface{} `json:"admissionConfiguration,omitempty" yaml:"admissionConfiguration,omitempty"` - AlwaysPullImages bool `json:"alwaysPullImages,omitempty" yaml:"alwaysPullImages,omitempty"` - AuditLog *AuditLog `json:"auditLog,omitempty" yaml:"auditLog,omitempty"` - EventRateLimit *EventRateLimit `json:"eventRateLimit,omitempty" yaml:"eventRateLimit,omitempty"` - ExtraArgs map[string]string `json:"extraArgs,omitempty" yaml:"extraArgs,omitempty"` - ExtraArgsArray map[string][]string `json:"extraArgsArray,omitempty" yaml:"extraArgsArray,omitempty"` - ExtraBinds []string `json:"extraBinds,omitempty" yaml:"extraBinds,omitempty"` - ExtraEnv []string `json:"extraEnv,omitempty" yaml:"extraEnv,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - PodSecurityConfiguration string `json:"podSecurityConfiguration,omitempty" yaml:"podSecurityConfiguration,omitempty"` - PodSecurityPolicy bool `json:"podSecurityPolicy,omitempty" yaml:"podSecurityPolicy,omitempty"` - SecretsEncryptionConfig *SecretsEncryptionConfig `json:"secretsEncryptionConfig,omitempty" yaml:"secretsEncryptionConfig,omitempty"` - ServiceClusterIPRange string `json:"serviceClusterIpRange,omitempty" yaml:"serviceClusterIpRange,omitempty"` - ServiceNodePortRange string `json:"serviceNodePortRange,omitempty" yaml:"serviceNodePortRange,omitempty"` - WindowsExtraArgs map[string]string `json:"winExtraArgs,omitempty" yaml:"winExtraArgs,omitempty"` - WindowsExtraArgsArray map[string][]string `json:"winExtraArgsArray,omitempty" yaml:"winExtraArgsArray,omitempty"` - WindowsExtraBinds []string `json:"winExtraBinds,omitempty" yaml:"winExtraBinds,omitempty"` - WindowsExtraEnv []string `json:"winExtraEnv,omitempty" yaml:"winExtraEnv,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_controller_service.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_controller_service.go deleted file mode 100644 index 304cecf8290..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kube_controller_service.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - KubeControllerServiceType = "kubeControllerService" - KubeControllerServiceFieldClusterCIDR = "clusterCidr" - KubeControllerServiceFieldExtraArgs = "extraArgs" - KubeControllerServiceFieldExtraArgsArray = "extraArgsArray" - KubeControllerServiceFieldExtraBinds = "extraBinds" - KubeControllerServiceFieldExtraEnv = "extraEnv" - KubeControllerServiceFieldImage = "image" - KubeControllerServiceFieldServiceClusterIPRange = "serviceClusterIpRange" - KubeControllerServiceFieldWindowsExtraArgs = "winExtraArgs" - KubeControllerServiceFieldWindowsExtraArgsArray = "winExtraArgsArray" - KubeControllerServiceFieldWindowsExtraBinds = "winExtraBinds" - KubeControllerServiceFieldWindowsExtraEnv = "winExtraEnv" -) - -type KubeControllerService struct { - ClusterCIDR string `json:"clusterCidr,omitempty" yaml:"clusterCidr,omitempty"` - ExtraArgs map[string]string `json:"extraArgs,omitempty" yaml:"extraArgs,omitempty"` - ExtraArgsArray map[string][]string `json:"extraArgsArray,omitempty" yaml:"extraArgsArray,omitempty"` - ExtraBinds []string `json:"extraBinds,omitempty" yaml:"extraBinds,omitempty"` - ExtraEnv []string `json:"extraEnv,omitempty" yaml:"extraEnv,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - ServiceClusterIPRange string `json:"serviceClusterIpRange,omitempty" yaml:"serviceClusterIpRange,omitempty"` - WindowsExtraArgs map[string]string `json:"winExtraArgs,omitempty" yaml:"winExtraArgs,omitempty"` - WindowsExtraArgsArray map[string][]string `json:"winExtraArgsArray,omitempty" yaml:"winExtraArgsArray,omitempty"` - WindowsExtraBinds []string `json:"winExtraBinds,omitempty" yaml:"winExtraBinds,omitempty"` - WindowsExtraEnv []string `json:"winExtraEnv,omitempty" yaml:"winExtraEnv,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubelet_service.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubelet_service.go deleted file mode 100644 index 7474a10d41e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubelet_service.go +++ /dev/null @@ -1,36 +0,0 @@ -package client - -const ( - KubeletServiceType = "kubeletService" - KubeletServiceFieldClusterDNSServer = "clusterDnsServer" - KubeletServiceFieldClusterDomain = "clusterDomain" - KubeletServiceFieldExtraArgs = "extraArgs" - KubeletServiceFieldExtraArgsArray = "extraArgsArray" - KubeletServiceFieldExtraBinds = "extraBinds" - KubeletServiceFieldExtraEnv = "extraEnv" - KubeletServiceFieldFailSwapOn = "failSwapOn" - KubeletServiceFieldGenerateServingCertificate = "generateServingCertificate" - KubeletServiceFieldImage = "image" - KubeletServiceFieldInfraContainerImage = "infraContainerImage" - KubeletServiceFieldWindowsExtraArgs = "winExtraArgs" - KubeletServiceFieldWindowsExtraArgsArray = "winExtraArgsArray" - KubeletServiceFieldWindowsExtraBinds = "winExtraBinds" - KubeletServiceFieldWindowsExtraEnv = "winExtraEnv" -) - -type KubeletService struct { - ClusterDNSServer string `json:"clusterDnsServer,omitempty" yaml:"clusterDnsServer,omitempty"` - ClusterDomain string `json:"clusterDomain,omitempty" yaml:"clusterDomain,omitempty"` - ExtraArgs map[string]string `json:"extraArgs,omitempty" yaml:"extraArgs,omitempty"` - ExtraArgsArray map[string][]string `json:"extraArgsArray,omitempty" yaml:"extraArgsArray,omitempty"` - ExtraBinds []string `json:"extraBinds,omitempty" yaml:"extraBinds,omitempty"` - ExtraEnv []string `json:"extraEnv,omitempty" yaml:"extraEnv,omitempty"` - FailSwapOn bool `json:"failSwapOn,omitempty" yaml:"failSwapOn,omitempty"` - GenerateServingCertificate bool `json:"generateServingCertificate,omitempty" yaml:"generateServingCertificate,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - InfraContainerImage string `json:"infraContainerImage,omitempty" yaml:"infraContainerImage,omitempty"` - WindowsExtraArgs map[string]string `json:"winExtraArgs,omitempty" yaml:"winExtraArgs,omitempty"` - WindowsExtraArgsArray map[string][]string `json:"winExtraArgsArray,omitempty" yaml:"winExtraArgsArray,omitempty"` - WindowsExtraBinds []string `json:"winExtraBinds,omitempty" yaml:"winExtraBinds,omitempty"` - WindowsExtraEnv []string `json:"winExtraEnv,omitempty" yaml:"winExtraEnv,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubeproxy_service.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubeproxy_service.go deleted file mode 100644 index 9159447ba1f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubeproxy_service.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - KubeproxyServiceType = "kubeproxyService" - KubeproxyServiceFieldExtraArgs = "extraArgs" - KubeproxyServiceFieldExtraArgsArray = "extraArgsArray" - KubeproxyServiceFieldExtraBinds = "extraBinds" - KubeproxyServiceFieldExtraEnv = "extraEnv" - KubeproxyServiceFieldImage = "image" - KubeproxyServiceFieldWindowsExtraArgs = "winExtraArgs" - KubeproxyServiceFieldWindowsExtraArgsArray = "winExtraArgsArray" - KubeproxyServiceFieldWindowsExtraBinds = "winExtraBinds" - KubeproxyServiceFieldWindowsExtraEnv = "winExtraEnv" -) - -type KubeproxyService struct { - ExtraArgs map[string]string `json:"extraArgs,omitempty" yaml:"extraArgs,omitempty"` - ExtraArgsArray map[string][]string `json:"extraArgsArray,omitempty" yaml:"extraArgsArray,omitempty"` - ExtraBinds []string `json:"extraBinds,omitempty" yaml:"extraBinds,omitempty"` - ExtraEnv []string `json:"extraEnv,omitempty" yaml:"extraEnv,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - WindowsExtraArgs map[string]string `json:"winExtraArgs,omitempty" yaml:"winExtraArgs,omitempty"` - WindowsExtraArgsArray map[string][]string `json:"winExtraArgsArray,omitempty" yaml:"winExtraArgsArray,omitempty"` - WindowsExtraBinds []string `json:"winExtraBinds,omitempty" yaml:"winExtraBinds,omitempty"` - WindowsExtraEnv []string `json:"winExtraEnv,omitempty" yaml:"winExtraEnv,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_info.go deleted file mode 100644 index 69aa0588c4d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_info.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - KubernetesInfoType = "kubernetesInfo" - KubernetesInfoFieldKubeProxyVersion = "kubeProxyVersion" - KubernetesInfoFieldKubeletVersion = "kubeletVersion" -) - -type KubernetesInfo struct { - KubeProxyVersion string `json:"kubeProxyVersion,omitempty" yaml:"kubeProxyVersion,omitempty"` - KubeletVersion string `json:"kubeletVersion,omitempty" yaml:"kubeletVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_services_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_services_options.go deleted file mode 100644 index b2fe33ceed7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_kubernetes_services_options.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - KubernetesServicesOptionsType = "kubernetesServicesOptions" - KubernetesServicesOptionsFieldEtcd = "etcd" - KubernetesServicesOptionsFieldKubeAPI = "kubeapi" - KubernetesServicesOptionsFieldKubeController = "kubeController" - KubernetesServicesOptionsFieldKubelet = "kubelet" - KubernetesServicesOptionsFieldKubeproxy = "kubeproxy" - KubernetesServicesOptionsFieldScheduler = "scheduler" -) - -type KubernetesServicesOptions struct { - Etcd map[string]string `json:"etcd,omitempty" yaml:"etcd,omitempty"` - KubeAPI map[string]string `json:"kubeapi,omitempty" yaml:"kubeapi,omitempty"` - KubeController map[string]string `json:"kubeController,omitempty" yaml:"kubeController,omitempty"` - Kubelet map[string]string `json:"kubelet,omitempty" yaml:"kubelet,omitempty"` - Kubeproxy map[string]string `json:"kubeproxy,omitempty" yaml:"kubeproxy,omitempty"` - Scheduler map[string]string `json:"scheduler,omitempty" yaml:"scheduler,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector.go deleted file mode 100644 index 27162cf2964..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - LabelSelectorType = "labelSelector" - LabelSelectorFieldMatchExpressions = "matchExpressions" - LabelSelectorFieldMatchLabels = "matchLabels" -) - -type LabelSelector struct { - MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" yaml:"matchExpressions,omitempty"` - MatchLabels map[string]string `json:"matchLabels,omitempty" yaml:"matchLabels,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector_requirement.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector_requirement.go deleted file mode 100644 index 3a875acbb62..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_label_selector_requirement.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - LabelSelectorRequirementType = "labelSelectorRequirement" - LabelSelectorRequirementFieldKey = "key" - LabelSelectorRequirementFieldOperator = "operator" - LabelSelectorRequirementFieldValues = "values" -) - -type LabelSelectorRequirement struct { - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Operator string `json:"operator,omitempty" yaml:"operator,omitempty"` - Values []string `json:"values,omitempty" yaml:"values,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_launch_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_launch_template.go deleted file mode 100644 index a5d4c84cbee..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_launch_template.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - LaunchTemplateType = "launchTemplate" - LaunchTemplateFieldID = "id" - LaunchTemplateFieldName = "name" - LaunchTemplateFieldVersion = "version" -) - -type LaunchTemplate struct { - ID *string `json:"id,omitempty" yaml:"id,omitempty"` - Name *string `json:"name,omitempty" yaml:"name,omitempty"` - Version *int64 `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_config.go deleted file mode 100644 index 73a21c5ef0e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_config.go +++ /dev/null @@ -1,180 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - LdapConfigType = "ldapConfig" - LdapConfigFieldAccessMode = "accessMode" - LdapConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - LdapConfigFieldAnnotations = "annotations" - LdapConfigFieldCertificate = "certificate" - LdapConfigFieldConnectionTimeout = "connectionTimeout" - LdapConfigFieldCreated = "created" - LdapConfigFieldCreatorID = "creatorId" - LdapConfigFieldEnabled = "enabled" - LdapConfigFieldGroupDNAttribute = "groupDNAttribute" - LdapConfigFieldGroupMemberMappingAttribute = "groupMemberMappingAttribute" - LdapConfigFieldGroupMemberUserAttribute = "groupMemberUserAttribute" - LdapConfigFieldGroupNameAttribute = "groupNameAttribute" - LdapConfigFieldGroupObjectClass = "groupObjectClass" - LdapConfigFieldGroupSearchAttribute = "groupSearchAttribute" - LdapConfigFieldGroupSearchBase = "groupSearchBase" - LdapConfigFieldGroupSearchFilter = "groupSearchFilter" - LdapConfigFieldLabels = "labels" - LdapConfigFieldName = "name" - LdapConfigFieldNestedGroupMembershipEnabled = "nestedGroupMembershipEnabled" - LdapConfigFieldOwnerReferences = "ownerReferences" - LdapConfigFieldPort = "port" - LdapConfigFieldRemoved = "removed" - LdapConfigFieldServers = "servers" - LdapConfigFieldServiceAccountDistinguishedName = "serviceAccountDistinguishedName" - LdapConfigFieldServiceAccountPassword = "serviceAccountPassword" - LdapConfigFieldStartTLS = "starttls" - LdapConfigFieldStatus = "status" - LdapConfigFieldTLS = "tls" - LdapConfigFieldType = "type" - LdapConfigFieldUUID = "uuid" - LdapConfigFieldUserDisabledBitMask = "userDisabledBitMask" - LdapConfigFieldUserEnabledAttribute = "userEnabledAttribute" - LdapConfigFieldUserLoginAttribute = "userLoginAttribute" - LdapConfigFieldUserMemberAttribute = "userMemberAttribute" - LdapConfigFieldUserNameAttribute = "userNameAttribute" - LdapConfigFieldUserObjectClass = "userObjectClass" - LdapConfigFieldUserSearchAttribute = "userSearchAttribute" - LdapConfigFieldUserSearchBase = "userSearchBase" - LdapConfigFieldUserSearchFilter = "userSearchFilter" -) - -type LdapConfig struct { - types.Resource - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connectionTimeout,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GroupDNAttribute string `json:"groupDNAttribute,omitempty" yaml:"groupDNAttribute,omitempty"` - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"groupMemberMappingAttribute,omitempty"` - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"groupMemberUserAttribute,omitempty"` - GroupNameAttribute string `json:"groupNameAttribute,omitempty" yaml:"groupNameAttribute,omitempty"` - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"groupObjectClass,omitempty"` - GroupSearchAttribute string `json:"groupSearchAttribute,omitempty" yaml:"groupSearchAttribute,omitempty"` - GroupSearchBase string `json:"groupSearchBase,omitempty" yaml:"groupSearchBase,omitempty"` - GroupSearchFilter string `json:"groupSearchFilter,omitempty" yaml:"groupSearchFilter,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NestedGroupMembershipEnabled bool `json:"nestedGroupMembershipEnabled,omitempty" yaml:"nestedGroupMembershipEnabled,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Servers []string `json:"servers,omitempty" yaml:"servers,omitempty"` - ServiceAccountDistinguishedName string `json:"serviceAccountDistinguishedName,omitempty" yaml:"serviceAccountDistinguishedName,omitempty"` - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"serviceAccountPassword,omitempty"` - StartTLS bool `json:"starttls,omitempty" yaml:"starttls,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"userDisabledBitMask,omitempty"` - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"userEnabledAttribute,omitempty"` - UserLoginAttribute string `json:"userLoginAttribute,omitempty" yaml:"userLoginAttribute,omitempty"` - UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"userMemberAttribute,omitempty"` - UserNameAttribute string `json:"userNameAttribute,omitempty" yaml:"userNameAttribute,omitempty"` - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"userObjectClass,omitempty"` - UserSearchAttribute string `json:"userSearchAttribute,omitempty" yaml:"userSearchAttribute,omitempty"` - UserSearchBase string `json:"userSearchBase,omitempty" yaml:"userSearchBase,omitempty"` - UserSearchFilter string `json:"userSearchFilter,omitempty" yaml:"userSearchFilter,omitempty"` -} - -type LdapConfigCollection struct { - types.Collection - Data []LdapConfig `json:"data,omitempty"` - client *LdapConfigClient -} - -type LdapConfigClient struct { - apiClient *Client -} - -type LdapConfigOperations interface { - List(opts *types.ListOpts) (*LdapConfigCollection, error) - ListAll(opts *types.ListOpts) (*LdapConfigCollection, error) - Create(opts *LdapConfig) (*LdapConfig, error) - Update(existing *LdapConfig, updates interface{}) (*LdapConfig, error) - Replace(existing *LdapConfig) (*LdapConfig, error) - ByID(id string) (*LdapConfig, error) - Delete(container *LdapConfig) error -} - -func newLdapConfigClient(apiClient *Client) *LdapConfigClient { - return &LdapConfigClient{ - apiClient: apiClient, - } -} - -func (c *LdapConfigClient) Create(container *LdapConfig) (*LdapConfig, error) { - resp := &LdapConfig{} - err := c.apiClient.Ops.DoCreate(LdapConfigType, container, resp) - return resp, err -} - -func (c *LdapConfigClient) Update(existing *LdapConfig, updates interface{}) (*LdapConfig, error) { - resp := &LdapConfig{} - err := c.apiClient.Ops.DoUpdate(LdapConfigType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LdapConfigClient) Replace(obj *LdapConfig) (*LdapConfig, error) { - resp := &LdapConfig{} - err := c.apiClient.Ops.DoReplace(LdapConfigType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *LdapConfigClient) List(opts *types.ListOpts) (*LdapConfigCollection, error) { - resp := &LdapConfigCollection{} - err := c.apiClient.Ops.DoList(LdapConfigType, opts, resp) - resp.client = c - return resp, err -} - -func (c *LdapConfigClient) ListAll(opts *types.ListOpts) (*LdapConfigCollection, error) { - resp := &LdapConfigCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *LdapConfigCollection) Next() (*LdapConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LdapConfigCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LdapConfigClient) ByID(id string) (*LdapConfig, error) { - resp := &LdapConfig{} - err := c.apiClient.Ops.DoByID(LdapConfigType, id, resp) - return resp, err -} - -func (c *LdapConfigClient) Delete(container *LdapConfig) error { - return c.apiClient.Ops.DoResourceDelete(LdapConfigType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_fields.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_fields.go deleted file mode 100644 index 7c342d1763c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ldap_fields.go +++ /dev/null @@ -1,60 +0,0 @@ -package client - -const ( - LdapFieldsType = "ldapFields" - LdapFieldsFieldCertificate = "certificate" - LdapFieldsFieldConnectionTimeout = "connectionTimeout" - LdapFieldsFieldGroupDNAttribute = "groupDNAttribute" - LdapFieldsFieldGroupMemberMappingAttribute = "groupMemberMappingAttribute" - LdapFieldsFieldGroupMemberUserAttribute = "groupMemberUserAttribute" - LdapFieldsFieldGroupNameAttribute = "groupNameAttribute" - LdapFieldsFieldGroupObjectClass = "groupObjectClass" - LdapFieldsFieldGroupSearchAttribute = "groupSearchAttribute" - LdapFieldsFieldGroupSearchBase = "groupSearchBase" - LdapFieldsFieldGroupSearchFilter = "groupSearchFilter" - LdapFieldsFieldNestedGroupMembershipEnabled = "nestedGroupMembershipEnabled" - LdapFieldsFieldPort = "port" - LdapFieldsFieldServers = "servers" - LdapFieldsFieldServiceAccountDistinguishedName = "serviceAccountDistinguishedName" - LdapFieldsFieldServiceAccountPassword = "serviceAccountPassword" - LdapFieldsFieldStartTLS = "starttls" - LdapFieldsFieldTLS = "tls" - LdapFieldsFieldUserDisabledBitMask = "userDisabledBitMask" - LdapFieldsFieldUserEnabledAttribute = "userEnabledAttribute" - LdapFieldsFieldUserLoginAttribute = "userLoginAttribute" - LdapFieldsFieldUserMemberAttribute = "userMemberAttribute" - LdapFieldsFieldUserNameAttribute = "userNameAttribute" - LdapFieldsFieldUserObjectClass = "userObjectClass" - LdapFieldsFieldUserSearchAttribute = "userSearchAttribute" - LdapFieldsFieldUserSearchBase = "userSearchBase" - LdapFieldsFieldUserSearchFilter = "userSearchFilter" -) - -type LdapFields struct { - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connectionTimeout,omitempty"` - GroupDNAttribute string `json:"groupDNAttribute,omitempty" yaml:"groupDNAttribute,omitempty"` - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"groupMemberMappingAttribute,omitempty"` - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"groupMemberUserAttribute,omitempty"` - GroupNameAttribute string `json:"groupNameAttribute,omitempty" yaml:"groupNameAttribute,omitempty"` - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"groupObjectClass,omitempty"` - GroupSearchAttribute string `json:"groupSearchAttribute,omitempty" yaml:"groupSearchAttribute,omitempty"` - GroupSearchBase string `json:"groupSearchBase,omitempty" yaml:"groupSearchBase,omitempty"` - GroupSearchFilter string `json:"groupSearchFilter,omitempty" yaml:"groupSearchFilter,omitempty"` - NestedGroupMembershipEnabled bool `json:"nestedGroupMembershipEnabled,omitempty" yaml:"nestedGroupMembershipEnabled,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Servers []string `json:"servers,omitempty" yaml:"servers,omitempty"` - ServiceAccountDistinguishedName string `json:"serviceAccountDistinguishedName,omitempty" yaml:"serviceAccountDistinguishedName,omitempty"` - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"serviceAccountPassword,omitempty"` - StartTLS bool `json:"starttls,omitempty" yaml:"starttls,omitempty"` - TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"` - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"userDisabledBitMask,omitempty"` - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"userEnabledAttribute,omitempty"` - UserLoginAttribute string `json:"userLoginAttribute,omitempty" yaml:"userLoginAttribute,omitempty"` - UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"userMemberAttribute,omitempty"` - UserNameAttribute string `json:"userNameAttribute,omitempty" yaml:"userNameAttribute,omitempty"` - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"userObjectClass,omitempty"` - UserSearchAttribute string `json:"userSearchAttribute,omitempty" yaml:"userSearchAttribute,omitempty"` - UserSearchBase string `json:"userSearchBase,omitempty" yaml:"userSearchBase,omitempty"` - UserSearchFilter string `json:"userSearchFilter,omitempty" yaml:"userSearchFilter,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_linear_autoscaler_params.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_linear_autoscaler_params.go deleted file mode 100644 index f9ed17d6e77..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_linear_autoscaler_params.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - LinearAutoscalerParamsType = "linearAutoscalerParams" - LinearAutoscalerParamsFieldCoresPerReplica = "coresPerReplica" - LinearAutoscalerParamsFieldMax = "max" - LinearAutoscalerParamsFieldMin = "min" - LinearAutoscalerParamsFieldNodesPerReplica = "nodesPerReplica" - LinearAutoscalerParamsFieldPreventSinglePointFailure = "preventSinglePointFailure" -) - -type LinearAutoscalerParams struct { - CoresPerReplica float64 `json:"coresPerReplica,omitempty" yaml:"coresPerReplica,omitempty"` - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` - NodesPerReplica float64 `json:"nodesPerReplica,omitempty" yaml:"nodesPerReplica,omitempty"` - PreventSinglePointFailure bool `json:"preventSinglePointFailure,omitempty" yaml:"preventSinglePointFailure,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_capabilities.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_capabilities.go deleted file mode 100644 index 6258b573d43..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_capabilities.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - LoadBalancerCapabilitiesType = "loadBalancerCapabilities" - LoadBalancerCapabilitiesFieldEnabled = "enabled" - LoadBalancerCapabilitiesFieldHealthCheckSupported = "healthCheckSupported" - LoadBalancerCapabilitiesFieldProtocolsSupported = "protocolsSupported" - LoadBalancerCapabilitiesFieldProvider = "provider" -) - -type LoadBalancerCapabilities struct { - Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - HealthCheckSupported bool `json:"healthCheckSupported,omitempty" yaml:"healthCheckSupported,omitempty"` - ProtocolsSupported []string `json:"protocolsSupported,omitempty" yaml:"protocolsSupported,omitempty"` - Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_openstack_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_openstack_opts.go deleted file mode 100644 index bd4f38686cd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_load_balancer_openstack_opts.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - LoadBalancerOpenstackOptsType = "loadBalancerOpenstackOpts" - LoadBalancerOpenstackOptsFieldCreateMonitor = "create-monitor" - LoadBalancerOpenstackOptsFieldFloatingNetworkID = "floating-network-id" - LoadBalancerOpenstackOptsFieldLBMethod = "lb-method" - LoadBalancerOpenstackOptsFieldLBProvider = "lb-provider" - LoadBalancerOpenstackOptsFieldLBVersion = "lb-version" - LoadBalancerOpenstackOptsFieldManageSecurityGroups = "manage-security-groups" - LoadBalancerOpenstackOptsFieldMonitorDelay = "monitor-delay" - LoadBalancerOpenstackOptsFieldMonitorMaxRetries = "monitor-max-retries" - LoadBalancerOpenstackOptsFieldMonitorTimeout = "monitor-timeout" - LoadBalancerOpenstackOptsFieldSubnetID = "subnet-id" - LoadBalancerOpenstackOptsFieldUseOctavia = "use-octavia" -) - -type LoadBalancerOpenstackOpts struct { - CreateMonitor bool `json:"create-monitor,omitempty" yaml:"create-monitor,omitempty"` - FloatingNetworkID string `json:"floating-network-id,omitempty" yaml:"floating-network-id,omitempty"` - LBMethod string `json:"lb-method,omitempty" yaml:"lb-method,omitempty"` - LBProvider string `json:"lb-provider,omitempty" yaml:"lb-provider,omitempty"` - LBVersion string `json:"lb-version,omitempty" yaml:"lb-version,omitempty"` - ManageSecurityGroups bool `json:"manage-security-groups,omitempty" yaml:"manage-security-groups,omitempty"` - MonitorDelay string `json:"monitor-delay,omitempty" yaml:"monitor-delay,omitempty"` - MonitorMaxRetries int64 `json:"monitor-max-retries,omitempty" yaml:"monitor-max-retries,omitempty"` - MonitorTimeout string `json:"monitor-timeout,omitempty" yaml:"monitor-timeout,omitempty"` - SubnetID string `json:"subnet-id,omitempty" yaml:"subnet-id,omitempty"` - UseOctavia bool `json:"use-octavia,omitempty" yaml:"use-octavia,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_cluster_auth_endpoint.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_cluster_auth_endpoint.go deleted file mode 100644 index 830583d4498..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_cluster_auth_endpoint.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - LocalClusterAuthEndpointType = "localClusterAuthEndpoint" - LocalClusterAuthEndpointFieldCACerts = "caCerts" - LocalClusterAuthEndpointFieldEnabled = "enabled" - LocalClusterAuthEndpointFieldFQDN = "fqdn" -) - -type LocalClusterAuthEndpoint struct { - CACerts string `json:"caCerts,omitempty" yaml:"caCerts,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - FQDN string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_config.go deleted file mode 100644 index ca4d5123d3b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_config.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -const ( - LocalConfigType = "localConfig" - LocalConfigFieldAccessMode = "accessMode" - LocalConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - LocalConfigFieldAnnotations = "annotations" - LocalConfigFieldCreated = "created" - LocalConfigFieldCreatorID = "creatorId" - LocalConfigFieldEnabled = "enabled" - LocalConfigFieldLabels = "labels" - LocalConfigFieldName = "name" - LocalConfigFieldOwnerReferences = "ownerReferences" - LocalConfigFieldRemoved = "removed" - LocalConfigFieldStatus = "status" - LocalConfigFieldType = "type" - LocalConfigFieldUUID = "uuid" -) - -type LocalConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_object_reference.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_object_reference.go deleted file mode 100644 index e4d3b50579d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_local_object_reference.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - LocalObjectReferenceType = "localObjectReference" - LocalObjectReferenceFieldName = "name" -) - -type LocalObjectReference struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_logging_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_logging_condition.go deleted file mode 100644 index 17e9c9b1a27..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_logging_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - LoggingConditionType = "loggingCondition" - LoggingConditionFieldLastTransitionTime = "lastTransitionTime" - LoggingConditionFieldLastUpdateTime = "lastUpdateTime" - LoggingConditionFieldMessage = "message" - LoggingConditionFieldReason = "reason" - LoggingConditionFieldStatus = "status" - LoggingConditionFieldType = "type" -) - -type LoggingCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_management_secret.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_management_secret.go deleted file mode 100644 index 4814ba4ebe7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_management_secret.go +++ /dev/null @@ -1,126 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ManagementSecretType = "managementSecret" - ManagementSecretFieldAnnotations = "annotations" - ManagementSecretFieldCreated = "created" - ManagementSecretFieldCreatorID = "creatorId" - ManagementSecretFieldData = "data" - ManagementSecretFieldImmutable = "immutable" - ManagementSecretFieldLabels = "labels" - ManagementSecretFieldName = "name" - ManagementSecretFieldOwnerReferences = "ownerReferences" - ManagementSecretFieldRemoved = "removed" - ManagementSecretFieldStringData = "stringData" - ManagementSecretFieldType = "type" - ManagementSecretFieldUUID = "uuid" -) - -type ManagementSecret struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Data map[string]string `json:"data,omitempty" yaml:"data,omitempty"` - Immutable *bool `json:"immutable,omitempty" yaml:"immutable,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - StringData map[string]string `json:"stringData,omitempty" yaml:"stringData,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ManagementSecretCollection struct { - types.Collection - Data []ManagementSecret `json:"data,omitempty"` - client *ManagementSecretClient -} - -type ManagementSecretClient struct { - apiClient *Client -} - -type ManagementSecretOperations interface { - List(opts *types.ListOpts) (*ManagementSecretCollection, error) - ListAll(opts *types.ListOpts) (*ManagementSecretCollection, error) - Create(opts *ManagementSecret) (*ManagementSecret, error) - Update(existing *ManagementSecret, updates interface{}) (*ManagementSecret, error) - Replace(existing *ManagementSecret) (*ManagementSecret, error) - ByID(id string) (*ManagementSecret, error) - Delete(container *ManagementSecret) error -} - -func newManagementSecretClient(apiClient *Client) *ManagementSecretClient { - return &ManagementSecretClient{ - apiClient: apiClient, - } -} - -func (c *ManagementSecretClient) Create(container *ManagementSecret) (*ManagementSecret, error) { - resp := &ManagementSecret{} - err := c.apiClient.Ops.DoCreate(ManagementSecretType, container, resp) - return resp, err -} - -func (c *ManagementSecretClient) Update(existing *ManagementSecret, updates interface{}) (*ManagementSecret, error) { - resp := &ManagementSecret{} - err := c.apiClient.Ops.DoUpdate(ManagementSecretType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ManagementSecretClient) Replace(obj *ManagementSecret) (*ManagementSecret, error) { - resp := &ManagementSecret{} - err := c.apiClient.Ops.DoReplace(ManagementSecretType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ManagementSecretClient) List(opts *types.ListOpts) (*ManagementSecretCollection, error) { - resp := &ManagementSecretCollection{} - err := c.apiClient.Ops.DoList(ManagementSecretType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ManagementSecretClient) ListAll(opts *types.ListOpts) (*ManagementSecretCollection, error) { - resp := &ManagementSecretCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ManagementSecretCollection) Next() (*ManagementSecretCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ManagementSecretCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ManagementSecretClient) ByID(id string) (*ManagementSecret, error) { - resp := &ManagementSecret{} - err := c.apiClient.Ops.DoByID(ManagementSecretType, id, resp) - return resp, err -} - -func (c *ManagementSecretClient) Delete(container *ManagementSecret) error { - return c.apiClient.Ops.DoResourceDelete(ManagementSecretType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_map_delta.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_map_delta.go deleted file mode 100644 index b6861818a4b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_map_delta.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - MapDeltaType = "mapDelta" - MapDeltaFieldAdd = "add" - MapDeltaFieldDelete = "delete" -) - -type MapDelta struct { - Add map[string]string `json:"add,omitempty" yaml:"add,omitempty"` - Delete map[string]bool `json:"delete,omitempty" yaml:"delete,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_member.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_member.go deleted file mode 100644 index 620e4607ce1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_member.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - MemberType = "member" - MemberFieldAccessType = "accessType" - MemberFieldGroupPrincipalID = "groupPrincipalId" - MemberFieldUserPrincipalID = "userPrincipalId" -) - -type Member struct { - AccessType string `json:"accessType,omitempty" yaml:"accessType,omitempty"` - GroupPrincipalID string `json:"groupPrincipalId,omitempty" yaml:"groupPrincipalId,omitempty"` - UserPrincipalID string `json:"userPrincipalId,omitempty" yaml:"userPrincipalId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_memory_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_memory_info.go deleted file mode 100644 index ecd1a17018b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_memory_info.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - MemoryInfoType = "memoryInfo" - MemoryInfoFieldMemTotalKiB = "memTotalKiB" -) - -type MemoryInfo struct { - MemTotalKiB int64 `json:"memTotalKiB,omitempty" yaml:"memTotalKiB,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_openstack_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_openstack_opts.go deleted file mode 100644 index 8a38e9326ed..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_openstack_opts.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - MetadataOpenstackOptsType = "metadataOpenstackOpts" - MetadataOpenstackOptsFieldRequestTimeout = "request-timeout" - MetadataOpenstackOptsFieldSearchOrder = "search-order" -) - -type MetadataOpenstackOpts struct { - RequestTimeout int64 `json:"request-timeout,omitempty" yaml:"request-timeout,omitempty"` - SearchOrder string `json:"search-order,omitempty" yaml:"search-order,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_update.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_update.go deleted file mode 100644 index 1d1f5b294f9..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metadata_update.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - MetadataUpdateType = "metadataUpdate" - MetadataUpdateFieldAnnotations = "annotations" - MetadataUpdateFieldLabels = "labels" -) - -type MetadataUpdate struct { - Annotations *MapDelta `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Labels *MapDelta `json:"labels,omitempty" yaml:"labels,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_names_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_names_output.go deleted file mode 100644 index 8af210486be..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_names_output.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - MetricNamesOutputType = "metricNamesOutput" - MetricNamesOutputFieldNames = "names" - MetricNamesOutputFieldType = "type" -) - -type MetricNamesOutput struct { - Names []string `json:"names,omitempty" yaml:"names,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_rule.go deleted file mode 100644 index ba66c97101a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_metric_rule.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - MetricRuleType = "metricRule" - MetricRuleFieldComparison = "comparison" - MetricRuleFieldDescription = "description" - MetricRuleFieldDuration = "duration" - MetricRuleFieldExpression = "expression" - MetricRuleFieldThresholdValue = "thresholdValue" -) - -type MetricRule struct { - Comparison string `json:"comparison,omitempty" yaml:"comparison,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Duration string `json:"duration,omitempty" yaml:"duration,omitempty"` - Expression string `json:"expression,omitempty" yaml:"expression,omitempty"` - ThresholdValue float64 `json:"thresholdValue,omitempty" yaml:"thresholdValue,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric.go deleted file mode 100644 index 110bde1886d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric.go +++ /dev/null @@ -1,158 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - MonitorMetricType = "monitorMetric" - MonitorMetricFieldAnnotations = "annotations" - MonitorMetricFieldCreated = "created" - MonitorMetricFieldCreatorID = "creatorId" - MonitorMetricFieldDescription = "description" - MonitorMetricFieldExpression = "expression" - MonitorMetricFieldLabels = "labels" - MonitorMetricFieldLegendFormat = "legendFormat" - MonitorMetricFieldName = "name" - MonitorMetricFieldNamespaceId = "namespaceId" - MonitorMetricFieldOwnerReferences = "ownerReferences" - MonitorMetricFieldRemoved = "removed" - MonitorMetricFieldUUID = "uuid" -) - -type MonitorMetric struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Expression string `json:"expression,omitempty" yaml:"expression,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LegendFormat string `json:"legendFormat,omitempty" yaml:"legendFormat,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type MonitorMetricCollection struct { - types.Collection - Data []MonitorMetric `json:"data,omitempty"` - client *MonitorMetricClient -} - -type MonitorMetricClient struct { - apiClient *Client -} - -type MonitorMetricOperations interface { - List(opts *types.ListOpts) (*MonitorMetricCollection, error) - ListAll(opts *types.ListOpts) (*MonitorMetricCollection, error) - Create(opts *MonitorMetric) (*MonitorMetric, error) - Update(existing *MonitorMetric, updates interface{}) (*MonitorMetric, error) - Replace(existing *MonitorMetric) (*MonitorMetric, error) - ByID(id string) (*MonitorMetric, error) - Delete(container *MonitorMetric) error - - CollectionActionListclustermetricname(resource *MonitorMetricCollection, input *ClusterMetricNamesInput) (*MetricNamesOutput, error) - - CollectionActionListprojectmetricname(resource *MonitorMetricCollection, input *ProjectMetricNamesInput) (*MetricNamesOutput, error) - - CollectionActionQuerycluster(resource *MonitorMetricCollection, input *QueryClusterMetricInput) (*QueryMetricOutput, error) - - CollectionActionQueryproject(resource *MonitorMetricCollection, input *QueryProjectMetricInput) (*QueryMetricOutput, error) -} - -func newMonitorMetricClient(apiClient *Client) *MonitorMetricClient { - return &MonitorMetricClient{ - apiClient: apiClient, - } -} - -func (c *MonitorMetricClient) Create(container *MonitorMetric) (*MonitorMetric, error) { - resp := &MonitorMetric{} - err := c.apiClient.Ops.DoCreate(MonitorMetricType, container, resp) - return resp, err -} - -func (c *MonitorMetricClient) Update(existing *MonitorMetric, updates interface{}) (*MonitorMetric, error) { - resp := &MonitorMetric{} - err := c.apiClient.Ops.DoUpdate(MonitorMetricType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MonitorMetricClient) Replace(obj *MonitorMetric) (*MonitorMetric, error) { - resp := &MonitorMetric{} - err := c.apiClient.Ops.DoReplace(MonitorMetricType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *MonitorMetricClient) List(opts *types.ListOpts) (*MonitorMetricCollection, error) { - resp := &MonitorMetricCollection{} - err := c.apiClient.Ops.DoList(MonitorMetricType, opts, resp) - resp.client = c - return resp, err -} - -func (c *MonitorMetricClient) ListAll(opts *types.ListOpts) (*MonitorMetricCollection, error) { - resp := &MonitorMetricCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *MonitorMetricCollection) Next() (*MonitorMetricCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MonitorMetricCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MonitorMetricClient) ByID(id string) (*MonitorMetric, error) { - resp := &MonitorMetric{} - err := c.apiClient.Ops.DoByID(MonitorMetricType, id, resp) - return resp, err -} - -func (c *MonitorMetricClient) Delete(container *MonitorMetric) error { - return c.apiClient.Ops.DoResourceDelete(MonitorMetricType, &container.Resource) -} - -func (c *MonitorMetricClient) CollectionActionListclustermetricname(resource *MonitorMetricCollection, input *ClusterMetricNamesInput) (*MetricNamesOutput, error) { - resp := &MetricNamesOutput{} - err := c.apiClient.Ops.DoCollectionAction(MonitorMetricType, "listclustermetricname", &resource.Collection, input, resp) - return resp, err -} - -func (c *MonitorMetricClient) CollectionActionListprojectmetricname(resource *MonitorMetricCollection, input *ProjectMetricNamesInput) (*MetricNamesOutput, error) { - resp := &MetricNamesOutput{} - err := c.apiClient.Ops.DoCollectionAction(MonitorMetricType, "listprojectmetricname", &resource.Collection, input, resp) - return resp, err -} - -func (c *MonitorMetricClient) CollectionActionQuerycluster(resource *MonitorMetricCollection, input *QueryClusterMetricInput) (*QueryMetricOutput, error) { - resp := &QueryMetricOutput{} - err := c.apiClient.Ops.DoCollectionAction(MonitorMetricType, "querycluster", &resource.Collection, input, resp) - return resp, err -} - -func (c *MonitorMetricClient) CollectionActionQueryproject(resource *MonitorMetricCollection, input *QueryProjectMetricInput) (*QueryMetricOutput, error) { - resp := &QueryMetricOutput{} - err := c.apiClient.Ops.DoCollectionAction(MonitorMetricType, "queryproject", &resource.Collection, input, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric_spec.go deleted file mode 100644 index f34a1d918eb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitor_metric_spec.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - MonitorMetricSpecType = "monitorMetricSpec" - MonitorMetricSpecFieldDescription = "description" - MonitorMetricSpecFieldExpression = "expression" - MonitorMetricSpecFieldLegendFormat = "legendFormat" -) - -type MonitorMetricSpec struct { - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Expression string `json:"expression,omitempty" yaml:"expression,omitempty"` - LegendFormat string `json:"legendFormat,omitempty" yaml:"legendFormat,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_condition.go deleted file mode 100644 index 40c4f34fbda..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - MonitoringConditionType = "monitoringCondition" - MonitoringConditionFieldLastTransitionTime = "lastTransitionTime" - MonitoringConditionFieldLastUpdateTime = "lastUpdateTime" - MonitoringConditionFieldMessage = "message" - MonitoringConditionFieldReason = "reason" - MonitoringConditionFieldStatus = "status" - MonitoringConditionFieldType = "type" -) - -type MonitoringCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_config.go deleted file mode 100644 index 3cb7049d59f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_config.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - MonitoringConfigType = "monitoringConfig" - MonitoringConfigFieldMetricsServerPriorityClassName = "metricsServerPriorityClassName" - MonitoringConfigFieldNodeSelector = "nodeSelector" - MonitoringConfigFieldOptions = "options" - MonitoringConfigFieldProvider = "provider" - MonitoringConfigFieldReplicas = "replicas" - MonitoringConfigFieldTolerations = "tolerations" - MonitoringConfigFieldUpdateStrategy = "updateStrategy" -) - -type MonitoringConfig struct { - MetricsServerPriorityClassName string `json:"metricsServerPriorityClassName,omitempty" yaml:"metricsServerPriorityClassName,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"` - Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"` - Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` - Replicas *int64 `json:"replicas,omitempty" yaml:"replicas,omitempty"` - Tolerations []Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"` - UpdateStrategy *DeploymentStrategy `json:"updateStrategy,omitempty" yaml:"updateStrategy,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_input.go deleted file mode 100644 index ae37d0163a3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_input.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - MonitoringInputType = "monitoringInput" - MonitoringInputFieldAnswers = "answers" - MonitoringInputFieldAnswersSetString = "answersSetString" - MonitoringInputFieldVersion = "version" -) - -type MonitoringInput struct { - Answers map[string]string `json:"answers,omitempty" yaml:"answers,omitempty"` - AnswersSetString map[string]string `json:"answersSetString,omitempty" yaml:"answersSetString,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_output.go deleted file mode 100644 index 85f419f8b8f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_output.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - MonitoringOutputType = "monitoringOutput" - MonitoringOutputFieldAnswers = "answers" - MonitoringOutputFieldAnswersSetString = "answersSetString" - MonitoringOutputFieldVersion = "version" -) - -type MonitoringOutput struct { - Answers map[string]string `json:"answers,omitempty" yaml:"answers,omitempty"` - AnswersSetString map[string]string `json:"answersSetString,omitempty" yaml:"answersSetString,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_status.go deleted file mode 100644 index 3c52c7f0012..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_monitoring_status.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - MonitoringStatusType = "monitoringStatus" - MonitoringStatusFieldConditions = "conditions" - MonitoringStatusFieldGrafanaEndpoint = "grafanaEndpoint" -) - -type MonitoringStatus struct { - Conditions []MonitoringCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - GrafanaEndpoint string `json:"grafanaEndpoint,omitempty" yaml:"grafanaEndpoint,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ms_teams_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ms_teams_config.go deleted file mode 100644 index 33e8e737526..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ms_teams_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - MSTeamsConfigType = "msTeamsConfig" - MSTeamsConfigFieldProxyURL = "proxyUrl" - MSTeamsConfigFieldURL = "url" -) - -type MSTeamsConfig struct { - ProxyURL string `json:"proxyUrl,omitempty" yaml:"proxyUrl,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app.go deleted file mode 100644 index 228b842b466..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app.go +++ /dev/null @@ -1,165 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - MultiClusterAppType = "multiClusterApp" - MultiClusterAppFieldAnnotations = "annotations" - MultiClusterAppFieldAnswers = "answers" - MultiClusterAppFieldCreated = "created" - MultiClusterAppFieldCreatorID = "creatorId" - MultiClusterAppFieldLabels = "labels" - MultiClusterAppFieldMembers = "members" - MultiClusterAppFieldName = "name" - MultiClusterAppFieldOwnerReferences = "ownerReferences" - MultiClusterAppFieldRemoved = "removed" - MultiClusterAppFieldRevisionHistoryLimit = "revisionHistoryLimit" - MultiClusterAppFieldRoles = "roles" - MultiClusterAppFieldState = "state" - MultiClusterAppFieldStatus = "status" - MultiClusterAppFieldTargets = "targets" - MultiClusterAppFieldTemplateVersionID = "templateVersionId" - MultiClusterAppFieldTimeout = "timeout" - MultiClusterAppFieldTransitioning = "transitioning" - MultiClusterAppFieldTransitioningMessage = "transitioningMessage" - MultiClusterAppFieldUUID = "uuid" - MultiClusterAppFieldUpgradeStrategy = "upgradeStrategy" - MultiClusterAppFieldWait = "wait" -) - -type MultiClusterApp struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RevisionHistoryLimit int64 `json:"revisionHistoryLimit,omitempty" yaml:"revisionHistoryLimit,omitempty"` - Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *MultiClusterAppStatus `json:"status,omitempty" yaml:"status,omitempty"` - Targets []Target `json:"targets,omitempty" yaml:"targets,omitempty"` - TemplateVersionID string `json:"templateVersionId,omitempty" yaml:"templateVersionId,omitempty"` - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeStrategy *UpgradeStrategy `json:"upgradeStrategy,omitempty" yaml:"upgradeStrategy,omitempty"` - Wait bool `json:"wait,omitempty" yaml:"wait,omitempty"` -} - -type MultiClusterAppCollection struct { - types.Collection - Data []MultiClusterApp `json:"data,omitempty"` - client *MultiClusterAppClient -} - -type MultiClusterAppClient struct { - apiClient *Client -} - -type MultiClusterAppOperations interface { - List(opts *types.ListOpts) (*MultiClusterAppCollection, error) - ListAll(opts *types.ListOpts) (*MultiClusterAppCollection, error) - Create(opts *MultiClusterApp) (*MultiClusterApp, error) - Update(existing *MultiClusterApp, updates interface{}) (*MultiClusterApp, error) - Replace(existing *MultiClusterApp) (*MultiClusterApp, error) - ByID(id string) (*MultiClusterApp, error) - Delete(container *MultiClusterApp) error - - ActionAddProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error - - ActionRemoveProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error - - ActionRollback(resource *MultiClusterApp, input *MultiClusterAppRollbackInput) error -} - -func newMultiClusterAppClient(apiClient *Client) *MultiClusterAppClient { - return &MultiClusterAppClient{ - apiClient: apiClient, - } -} - -func (c *MultiClusterAppClient) Create(container *MultiClusterApp) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoCreate(MultiClusterAppType, container, resp) - return resp, err -} - -func (c *MultiClusterAppClient) Update(existing *MultiClusterApp, updates interface{}) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoUpdate(MultiClusterAppType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MultiClusterAppClient) Replace(obj *MultiClusterApp) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoReplace(MultiClusterAppType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *MultiClusterAppClient) List(opts *types.ListOpts) (*MultiClusterAppCollection, error) { - resp := &MultiClusterAppCollection{} - err := c.apiClient.Ops.DoList(MultiClusterAppType, opts, resp) - resp.client = c - return resp, err -} - -func (c *MultiClusterAppClient) ListAll(opts *types.ListOpts) (*MultiClusterAppCollection, error) { - resp := &MultiClusterAppCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *MultiClusterAppCollection) Next() (*MultiClusterAppCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MultiClusterAppCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MultiClusterAppClient) ByID(id string) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoByID(MultiClusterAppType, id, resp) - return resp, err -} - -func (c *MultiClusterAppClient) Delete(container *MultiClusterApp) error { - return c.apiClient.Ops.DoResourceDelete(MultiClusterAppType, &container.Resource) -} - -func (c *MultiClusterAppClient) ActionAddProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error { - err := c.apiClient.Ops.DoAction(MultiClusterAppType, "addProjects", &resource.Resource, input, nil) - return err -} - -func (c *MultiClusterAppClient) ActionRemoveProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error { - err := c.apiClient.Ops.DoAction(MultiClusterAppType, "removeProjects", &resource.Resource, input, nil) - return err -} - -func (c *MultiClusterAppClient) ActionRollback(resource *MultiClusterApp, input *MultiClusterAppRollbackInput) error { - err := c.apiClient.Ops.DoAction(MultiClusterAppType, "rollback", &resource.Resource, input, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_revision.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_revision.go deleted file mode 100644 index a759036fce3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_revision.go +++ /dev/null @@ -1,122 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - MultiClusterAppRevisionType = "multiClusterAppRevision" - MultiClusterAppRevisionFieldAnnotations = "annotations" - MultiClusterAppRevisionFieldAnswers = "answers" - MultiClusterAppRevisionFieldCreated = "created" - MultiClusterAppRevisionFieldCreatorID = "creatorId" - MultiClusterAppRevisionFieldLabels = "labels" - MultiClusterAppRevisionFieldName = "name" - MultiClusterAppRevisionFieldOwnerReferences = "ownerReferences" - MultiClusterAppRevisionFieldRemoved = "removed" - MultiClusterAppRevisionFieldTemplateVersionID = "templateVersionId" - MultiClusterAppRevisionFieldUUID = "uuid" -) - -type MultiClusterAppRevision struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - TemplateVersionID string `json:"templateVersionId,omitempty" yaml:"templateVersionId,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type MultiClusterAppRevisionCollection struct { - types.Collection - Data []MultiClusterAppRevision `json:"data,omitempty"` - client *MultiClusterAppRevisionClient -} - -type MultiClusterAppRevisionClient struct { - apiClient *Client -} - -type MultiClusterAppRevisionOperations interface { - List(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) - ListAll(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) - Create(opts *MultiClusterAppRevision) (*MultiClusterAppRevision, error) - Update(existing *MultiClusterAppRevision, updates interface{}) (*MultiClusterAppRevision, error) - Replace(existing *MultiClusterAppRevision) (*MultiClusterAppRevision, error) - ByID(id string) (*MultiClusterAppRevision, error) - Delete(container *MultiClusterAppRevision) error -} - -func newMultiClusterAppRevisionClient(apiClient *Client) *MultiClusterAppRevisionClient { - return &MultiClusterAppRevisionClient{ - apiClient: apiClient, - } -} - -func (c *MultiClusterAppRevisionClient) Create(container *MultiClusterAppRevision) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoCreate(MultiClusterAppRevisionType, container, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) Update(existing *MultiClusterAppRevision, updates interface{}) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoUpdate(MultiClusterAppRevisionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) Replace(obj *MultiClusterAppRevision) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoReplace(MultiClusterAppRevisionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) List(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) { - resp := &MultiClusterAppRevisionCollection{} - err := c.apiClient.Ops.DoList(MultiClusterAppRevisionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *MultiClusterAppRevisionClient) ListAll(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) { - resp := &MultiClusterAppRevisionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *MultiClusterAppRevisionCollection) Next() (*MultiClusterAppRevisionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MultiClusterAppRevisionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MultiClusterAppRevisionClient) ByID(id string) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoByID(MultiClusterAppRevisionType, id, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) Delete(container *MultiClusterAppRevision) error { - return c.apiClient.Ops.DoResourceDelete(MultiClusterAppRevisionType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_rollback_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_rollback_input.go deleted file mode 100644 index 90a033eb100..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_rollback_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - MultiClusterAppRollbackInputType = "multiClusterAppRollbackInput" - MultiClusterAppRollbackInputFieldRevisionID = "revisionId" -) - -type MultiClusterAppRollbackInput struct { - RevisionID string `json:"revisionId,omitempty" yaml:"revisionId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_spec.go deleted file mode 100644 index c9d0b3800bb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_spec.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - MultiClusterAppSpecType = "multiClusterAppSpec" - MultiClusterAppSpecFieldAnswers = "answers" - MultiClusterAppSpecFieldMembers = "members" - MultiClusterAppSpecFieldRevisionHistoryLimit = "revisionHistoryLimit" - MultiClusterAppSpecFieldRoles = "roles" - MultiClusterAppSpecFieldTargets = "targets" - MultiClusterAppSpecFieldTemplateVersionID = "templateVersionId" - MultiClusterAppSpecFieldTimeout = "timeout" - MultiClusterAppSpecFieldUpgradeStrategy = "upgradeStrategy" - MultiClusterAppSpecFieldWait = "wait" -) - -type MultiClusterAppSpec struct { - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - RevisionHistoryLimit int64 `json:"revisionHistoryLimit,omitempty" yaml:"revisionHistoryLimit,omitempty"` - Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"` - Targets []Target `json:"targets,omitempty" yaml:"targets,omitempty"` - TemplateVersionID string `json:"templateVersionId,omitempty" yaml:"templateVersionId,omitempty"` - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` - UpgradeStrategy *UpgradeStrategy `json:"upgradeStrategy,omitempty" yaml:"upgradeStrategy,omitempty"` - Wait bool `json:"wait,omitempty" yaml:"wait,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_status.go deleted file mode 100644 index e84859c1753..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_status.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - MultiClusterAppStatusType = "multiClusterAppStatus" - MultiClusterAppStatusFieldConditions = "conditions" - MultiClusterAppStatusFieldHelmVersion = "helmVersion" - MultiClusterAppStatusFieldRevisionID = "revisionId" -) - -type MultiClusterAppStatus struct { - Conditions []AppCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - RevisionID string `json:"revisionId,omitempty" yaml:"revisionId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_namespace_resource_quota.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_namespace_resource_quota.go deleted file mode 100644 index b170bf5d211..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_namespace_resource_quota.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - NamespaceResourceQuotaType = "namespaceResourceQuota" - NamespaceResourceQuotaFieldLimit = "limit" -) - -type NamespaceResourceQuota struct { - Limit *ResourceQuotaLimit `json:"limit,omitempty" yaml:"limit,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_network_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_network_config.go deleted file mode 100644 index 4235298e449..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_network_config.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - NetworkConfigType = "networkConfig" - NetworkConfigFieldAciNetworkProvider = "aciNetworkProvider" - NetworkConfigFieldCalicoNetworkProvider = "calicoNetworkProvider" - NetworkConfigFieldCanalNetworkProvider = "canalNetworkProvider" - NetworkConfigFieldFlannelNetworkProvider = "flannelNetworkProvider" - NetworkConfigFieldMTU = "mtu" - NetworkConfigFieldNodeSelector = "nodeSelector" - NetworkConfigFieldOptions = "options" - NetworkConfigFieldPlugin = "plugin" - NetworkConfigFieldTolerations = "tolerations" - NetworkConfigFieldUpdateStrategy = "updateStrategy" - NetworkConfigFieldWeaveNetworkProvider = "weaveNetworkProvider" -) - -type NetworkConfig struct { - AciNetworkProvider *AciNetworkProvider `json:"aciNetworkProvider,omitempty" yaml:"aciNetworkProvider,omitempty"` - CalicoNetworkProvider *CalicoNetworkProvider `json:"calicoNetworkProvider,omitempty" yaml:"calicoNetworkProvider,omitempty"` - CanalNetworkProvider *CanalNetworkProvider `json:"canalNetworkProvider,omitempty" yaml:"canalNetworkProvider,omitempty"` - FlannelNetworkProvider *FlannelNetworkProvider `json:"flannelNetworkProvider,omitempty" yaml:"flannelNetworkProvider,omitempty"` - MTU int64 `json:"mtu,omitempty" yaml:"mtu,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"` - Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"` - Plugin string `json:"plugin,omitempty" yaml:"plugin,omitempty"` - Tolerations []Toleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty"` - UpdateStrategy *DaemonSetUpdateStrategy `json:"updateStrategy,omitempty" yaml:"updateStrategy,omitempty"` - WeaveNetworkProvider *WeaveNetworkProvider `json:"weaveNetworkProvider,omitempty" yaml:"weaveNetworkProvider,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_network_vshpere_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_network_vshpere_opts.go deleted file mode 100644 index ad27335a952..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_network_vshpere_opts.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - NetworkVshpereOptsType = "networkVshpereOpts" - NetworkVshpereOptsFieldPublicNetwork = "public-network" -) - -type NetworkVshpereOpts struct { - PublicNetwork string `json:"public-network,omitempty" yaml:"public-network,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_nfs_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_nfs_volume_source.go deleted file mode 100644 index bbaeecf9315..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_nfs_volume_source.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - NFSVolumeSourceType = "nfsVolumeSource" - NFSVolumeSourceFieldPath = "path" - NFSVolumeSourceFieldReadOnly = "readOnly" - NFSVolumeSourceFieldServer = "server" -) - -type NFSVolumeSource struct { - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - Server string `json:"server,omitempty" yaml:"server,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node.go deleted file mode 100644 index 7a82d8f5508..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node.go +++ /dev/null @@ -1,229 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - NodeType = "node" - NodeFieldAllocatable = "allocatable" - NodeFieldAnnotations = "annotations" - NodeFieldAppliedNodeVersion = "appliedNodeVersion" - NodeFieldCapacity = "capacity" - NodeFieldClusterID = "clusterId" - NodeFieldConditions = "conditions" - NodeFieldControlPlane = "controlPlane" - NodeFieldCreated = "created" - NodeFieldCreatorID = "creatorId" - NodeFieldCustomConfig = "customConfig" - NodeFieldDescription = "description" - NodeFieldDockerInfo = "dockerInfo" - NodeFieldEtcd = "etcd" - NodeFieldExternalIPAddress = "externalIpAddress" - NodeFieldHostname = "hostname" - NodeFieldIPAddress = "ipAddress" - NodeFieldImported = "imported" - NodeFieldInfo = "info" - NodeFieldLabels = "labels" - NodeFieldLimits = "limits" - NodeFieldName = "name" - NodeFieldNamespaceId = "namespaceId" - NodeFieldNodeName = "nodeName" - NodeFieldNodePlan = "nodePlan" - NodeFieldNodePoolID = "nodePoolId" - NodeFieldNodeTaints = "nodeTaints" - NodeFieldNodeTemplateID = "nodeTemplateId" - NodeFieldOwnerReferences = "ownerReferences" - NodeFieldPodCidr = "podCidr" - NodeFieldPodCidrs = "podCidrs" - NodeFieldProviderId = "providerId" - NodeFieldPublicEndpoints = "publicEndpoints" - NodeFieldRemoved = "removed" - NodeFieldRequested = "requested" - NodeFieldRequestedHostname = "requestedHostname" - NodeFieldScaledownTime = "scaledownTime" - NodeFieldSshUser = "sshUser" - NodeFieldState = "state" - NodeFieldTaints = "taints" - NodeFieldTransitioning = "transitioning" - NodeFieldTransitioningMessage = "transitioningMessage" - NodeFieldUUID = "uuid" - NodeFieldUnschedulable = "unschedulable" - NodeFieldVolumesAttached = "volumesAttached" - NodeFieldVolumesInUse = "volumesInUse" - NodeFieldWorker = "worker" -) - -type Node struct { - types.Resource - Allocatable map[string]string `json:"allocatable,omitempty" yaml:"allocatable,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AppliedNodeVersion int64 `json:"appliedNodeVersion,omitempty" yaml:"appliedNodeVersion,omitempty"` - Capacity map[string]string `json:"capacity,omitempty" yaml:"capacity,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Conditions []NodeCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - ControlPlane bool `json:"controlPlane,omitempty" yaml:"controlPlane,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CustomConfig *CustomConfig `json:"customConfig,omitempty" yaml:"customConfig,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DockerInfo *DockerInfo `json:"dockerInfo,omitempty" yaml:"dockerInfo,omitempty"` - Etcd bool `json:"etcd,omitempty" yaml:"etcd,omitempty"` - ExternalIPAddress string `json:"externalIpAddress,omitempty" yaml:"externalIpAddress,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - IPAddress string `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"` - Imported bool `json:"imported,omitempty" yaml:"imported,omitempty"` - Info *NodeInfo `json:"info,omitempty" yaml:"info,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Limits map[string]string `json:"limits,omitempty" yaml:"limits,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - NodeName string `json:"nodeName,omitempty" yaml:"nodeName,omitempty"` - NodePlan *NodePlan `json:"nodePlan,omitempty" yaml:"nodePlan,omitempty"` - NodePoolID string `json:"nodePoolId,omitempty" yaml:"nodePoolId,omitempty"` - NodeTaints []Taint `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - NodeTemplateID string `json:"nodeTemplateId,omitempty" yaml:"nodeTemplateId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PodCidr string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"` - PodCidrs []string `json:"podCidrs,omitempty" yaml:"podCidrs,omitempty"` - ProviderId string `json:"providerId,omitempty" yaml:"providerId,omitempty"` - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"publicEndpoints,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Requested map[string]string `json:"requested,omitempty" yaml:"requested,omitempty"` - RequestedHostname string `json:"requestedHostname,omitempty" yaml:"requestedHostname,omitempty"` - ScaledownTime string `json:"scaledownTime,omitempty" yaml:"scaledownTime,omitempty"` - SshUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Taints []Taint `json:"taints,omitempty" yaml:"taints,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Unschedulable bool `json:"unschedulable,omitempty" yaml:"unschedulable,omitempty"` - VolumesAttached map[string]AttachedVolume `json:"volumesAttached,omitempty" yaml:"volumesAttached,omitempty"` - VolumesInUse []string `json:"volumesInUse,omitempty" yaml:"volumesInUse,omitempty"` - Worker bool `json:"worker,omitempty" yaml:"worker,omitempty"` -} - -type NodeCollection struct { - types.Collection - Data []Node `json:"data,omitempty"` - client *NodeClient -} - -type NodeClient struct { - apiClient *Client -} - -type NodeOperations interface { - List(opts *types.ListOpts) (*NodeCollection, error) - ListAll(opts *types.ListOpts) (*NodeCollection, error) - Create(opts *Node) (*Node, error) - Update(existing *Node, updates interface{}) (*Node, error) - Replace(existing *Node) (*Node, error) - ByID(id string) (*Node, error) - Delete(container *Node) error - - ActionCordon(resource *Node) error - - ActionDrain(resource *Node, input *NodeDrainInput) error - - ActionScaledown(resource *Node) error - - ActionStopDrain(resource *Node) error - - ActionUncordon(resource *Node) error -} - -func newNodeClient(apiClient *Client) *NodeClient { - return &NodeClient{ - apiClient: apiClient, - } -} - -func (c *NodeClient) Create(container *Node) (*Node, error) { - resp := &Node{} - err := c.apiClient.Ops.DoCreate(NodeType, container, resp) - return resp, err -} - -func (c *NodeClient) Update(existing *Node, updates interface{}) (*Node, error) { - resp := &Node{} - err := c.apiClient.Ops.DoUpdate(NodeType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NodeClient) Replace(obj *Node) (*Node, error) { - resp := &Node{} - err := c.apiClient.Ops.DoReplace(NodeType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *NodeClient) List(opts *types.ListOpts) (*NodeCollection, error) { - resp := &NodeCollection{} - err := c.apiClient.Ops.DoList(NodeType, opts, resp) - resp.client = c - return resp, err -} - -func (c *NodeClient) ListAll(opts *types.ListOpts) (*NodeCollection, error) { - resp := &NodeCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *NodeCollection) Next() (*NodeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NodeCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NodeClient) ByID(id string) (*Node, error) { - resp := &Node{} - err := c.apiClient.Ops.DoByID(NodeType, id, resp) - return resp, err -} - -func (c *NodeClient) Delete(container *Node) error { - return c.apiClient.Ops.DoResourceDelete(NodeType, &container.Resource) -} - -func (c *NodeClient) ActionCordon(resource *Node) error { - err := c.apiClient.Ops.DoAction(NodeType, "cordon", &resource.Resource, nil, nil) - return err -} - -func (c *NodeClient) ActionDrain(resource *Node, input *NodeDrainInput) error { - err := c.apiClient.Ops.DoAction(NodeType, "drain", &resource.Resource, input, nil) - return err -} - -func (c *NodeClient) ActionScaledown(resource *Node) error { - err := c.apiClient.Ops.DoAction(NodeType, "scaledown", &resource.Resource, nil, nil) - return err -} - -func (c *NodeClient) ActionStopDrain(resource *Node) error { - err := c.apiClient.Ops.DoAction(NodeType, "stopDrain", &resource.Resource, nil, nil) - return err -} - -func (c *NodeClient) ActionUncordon(resource *Node) error { - err := c.apiClient.Ops.DoAction(NodeType, "uncordon", &resource.Resource, nil, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_address.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_address.go deleted file mode 100644 index 972c2480293..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_address.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - NodeAddressType = "nodeAddress" - NodeAddressFieldAddress = "address" - NodeAddressFieldType = "type" -) - -type NodeAddress struct { - Address string `json:"address,omitempty" yaml:"address,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_affinity.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_affinity.go deleted file mode 100644 index c1563fff1a1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_affinity.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - NodeAffinityType = "nodeAffinity" - NodeAffinityFieldPreferredDuringSchedulingIgnoredDuringExecution = "preferredDuringSchedulingIgnoredDuringExecution" - NodeAffinityFieldRequiredDuringSchedulingIgnoredDuringExecution = "requiredDuringSchedulingIgnoredDuringExecution" -) - -type NodeAffinity struct { - PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" yaml:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` - RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" yaml:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_condition.go deleted file mode 100644 index a07010acf6f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - NodeConditionType = "nodeCondition" - NodeConditionFieldLastHeartbeatTime = "lastHeartbeatTime" - NodeConditionFieldLastTransitionTime = "lastTransitionTime" - NodeConditionFieldMessage = "message" - NodeConditionFieldReason = "reason" - NodeConditionFieldStatus = "status" - NodeConditionFieldType = "type" -) - -type NodeCondition struct { - LastHeartbeatTime string `json:"lastHeartbeatTime,omitempty" yaml:"lastHeartbeatTime,omitempty"` - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_source.go deleted file mode 100644 index fc84f349356..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_source.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - NodeConfigSourceType = "nodeConfigSource" - NodeConfigSourceFieldConfigMap = "configMap" -) - -type NodeConfigSource struct { - ConfigMap *ConfigMapNodeConfigSource `json:"configMap,omitempty" yaml:"configMap,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_status.go deleted file mode 100644 index 919108f385c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_config_status.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - NodeConfigStatusType = "nodeConfigStatus" - NodeConfigStatusFieldActive = "active" - NodeConfigStatusFieldAssigned = "assigned" - NodeConfigStatusFieldError = "error" - NodeConfigStatusFieldLastKnownGood = "lastKnownGood" -) - -type NodeConfigStatus struct { - Active *NodeConfigSource `json:"active,omitempty" yaml:"active,omitempty"` - Assigned *NodeConfigSource `json:"assigned,omitempty" yaml:"assigned,omitempty"` - Error string `json:"error,omitempty" yaml:"error,omitempty"` - LastKnownGood *NodeConfigSource `json:"lastKnownGood,omitempty" yaml:"lastKnownGood,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_daemon_endpoints.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_daemon_endpoints.go deleted file mode 100644 index 57da90d5747..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_daemon_endpoints.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - NodeDaemonEndpointsType = "nodeDaemonEndpoints" - NodeDaemonEndpointsFieldKubeletEndpoint = "kubeletEndpoint" -) - -type NodeDaemonEndpoints struct { - KubeletEndpoint *DaemonEndpoint `json:"kubeletEndpoint,omitempty" yaml:"kubeletEndpoint,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_drain_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_drain_input.go deleted file mode 100644 index 974ac7e60cc..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_drain_input.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - NodeDrainInputType = "nodeDrainInput" - NodeDrainInputFieldDeleteLocalData = "deleteLocalData" - NodeDrainInputFieldForce = "force" - NodeDrainInputFieldGracePeriod = "gracePeriod" - NodeDrainInputFieldIgnoreDaemonSets = "ignoreDaemonSets" - NodeDrainInputFieldTimeout = "timeout" -) - -type NodeDrainInput struct { - DeleteLocalData bool `json:"deleteLocalData,omitempty" yaml:"deleteLocalData,omitempty"` - Force bool `json:"force,omitempty" yaml:"force,omitempty"` - GracePeriod int64 `json:"gracePeriod,omitempty" yaml:"gracePeriod,omitempty"` - IgnoreDaemonSets *bool `json:"ignoreDaemonSets,omitempty" yaml:"ignoreDaemonSets,omitempty"` - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver.go deleted file mode 100644 index 4e0cefd0f73..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver.go +++ /dev/null @@ -1,160 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - NodeDriverType = "nodeDriver" - NodeDriverFieldActive = "active" - NodeDriverFieldAddCloudCredential = "addCloudCredential" - NodeDriverFieldAnnotations = "annotations" - NodeDriverFieldBuiltin = "builtin" - NodeDriverFieldChecksum = "checksum" - NodeDriverFieldCreated = "created" - NodeDriverFieldCreatorID = "creatorId" - NodeDriverFieldDescription = "description" - NodeDriverFieldExternalID = "externalId" - NodeDriverFieldLabels = "labels" - NodeDriverFieldName = "name" - NodeDriverFieldOwnerReferences = "ownerReferences" - NodeDriverFieldRemoved = "removed" - NodeDriverFieldState = "state" - NodeDriverFieldStatus = "status" - NodeDriverFieldTransitioning = "transitioning" - NodeDriverFieldTransitioningMessage = "transitioningMessage" - NodeDriverFieldUIURL = "uiUrl" - NodeDriverFieldURL = "url" - NodeDriverFieldUUID = "uuid" - NodeDriverFieldWhitelistDomains = "whitelistDomains" -) - -type NodeDriver struct { - types.Resource - Active bool `json:"active,omitempty" yaml:"active,omitempty"` - AddCloudCredential bool `json:"addCloudCredential,omitempty" yaml:"addCloudCredential,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"` - Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *NodeDriverStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UIURL string `json:"uiUrl,omitempty" yaml:"uiUrl,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - WhitelistDomains []string `json:"whitelistDomains,omitempty" yaml:"whitelistDomains,omitempty"` -} - -type NodeDriverCollection struct { - types.Collection - Data []NodeDriver `json:"data,omitempty"` - client *NodeDriverClient -} - -type NodeDriverClient struct { - apiClient *Client -} - -type NodeDriverOperations interface { - List(opts *types.ListOpts) (*NodeDriverCollection, error) - ListAll(opts *types.ListOpts) (*NodeDriverCollection, error) - Create(opts *NodeDriver) (*NodeDriver, error) - Update(existing *NodeDriver, updates interface{}) (*NodeDriver, error) - Replace(existing *NodeDriver) (*NodeDriver, error) - ByID(id string) (*NodeDriver, error) - Delete(container *NodeDriver) error - - ActionActivate(resource *NodeDriver) (*NodeDriver, error) - - ActionDeactivate(resource *NodeDriver) (*NodeDriver, error) -} - -func newNodeDriverClient(apiClient *Client) *NodeDriverClient { - return &NodeDriverClient{ - apiClient: apiClient, - } -} - -func (c *NodeDriverClient) Create(container *NodeDriver) (*NodeDriver, error) { - resp := &NodeDriver{} - err := c.apiClient.Ops.DoCreate(NodeDriverType, container, resp) - return resp, err -} - -func (c *NodeDriverClient) Update(existing *NodeDriver, updates interface{}) (*NodeDriver, error) { - resp := &NodeDriver{} - err := c.apiClient.Ops.DoUpdate(NodeDriverType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NodeDriverClient) Replace(obj *NodeDriver) (*NodeDriver, error) { - resp := &NodeDriver{} - err := c.apiClient.Ops.DoReplace(NodeDriverType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *NodeDriverClient) List(opts *types.ListOpts) (*NodeDriverCollection, error) { - resp := &NodeDriverCollection{} - err := c.apiClient.Ops.DoList(NodeDriverType, opts, resp) - resp.client = c - return resp, err -} - -func (c *NodeDriverClient) ListAll(opts *types.ListOpts) (*NodeDriverCollection, error) { - resp := &NodeDriverCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *NodeDriverCollection) Next() (*NodeDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NodeDriverCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NodeDriverClient) ByID(id string) (*NodeDriver, error) { - resp := &NodeDriver{} - err := c.apiClient.Ops.DoByID(NodeDriverType, id, resp) - return resp, err -} - -func (c *NodeDriverClient) Delete(container *NodeDriver) error { - return c.apiClient.Ops.DoResourceDelete(NodeDriverType, &container.Resource) -} - -func (c *NodeDriverClient) ActionActivate(resource *NodeDriver) (*NodeDriver, error) { - resp := &NodeDriver{} - err := c.apiClient.Ops.DoAction(NodeDriverType, "activate", &resource.Resource, nil, resp) - return resp, err -} - -func (c *NodeDriverClient) ActionDeactivate(resource *NodeDriver) (*NodeDriver, error) { - resp := &NodeDriver{} - err := c.apiClient.Ops.DoAction(NodeDriverType, "deactivate", &resource.Resource, nil, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_spec.go deleted file mode 100644 index d8a64cb26ff..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_spec.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - NodeDriverSpecType = "nodeDriverSpec" - NodeDriverSpecFieldActive = "active" - NodeDriverSpecFieldAddCloudCredential = "addCloudCredential" - NodeDriverSpecFieldBuiltin = "builtin" - NodeDriverSpecFieldChecksum = "checksum" - NodeDriverSpecFieldDescription = "description" - NodeDriverSpecFieldDisplayName = "displayName" - NodeDriverSpecFieldExternalID = "externalId" - NodeDriverSpecFieldUIURL = "uiUrl" - NodeDriverSpecFieldURL = "url" - NodeDriverSpecFieldWhitelistDomains = "whitelistDomains" -) - -type NodeDriverSpec struct { - Active bool `json:"active,omitempty" yaml:"active,omitempty"` - AddCloudCredential bool `json:"addCloudCredential,omitempty" yaml:"addCloudCredential,omitempty"` - Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"` - Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - UIURL string `json:"uiUrl,omitempty" yaml:"uiUrl,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - WhitelistDomains []string `json:"whitelistDomains,omitempty" yaml:"whitelistDomains,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_status.go deleted file mode 100644 index 971f6bab76c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_driver_status.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - NodeDriverStatusType = "nodeDriverStatus" - NodeDriverStatusFieldAppliedChecksum = "appliedChecksum" - NodeDriverStatusFieldAppliedDockerMachineVersion = "appliedDockerMachineVersion" - NodeDriverStatusFieldAppliedURL = "appliedURL" - NodeDriverStatusFieldConditions = "conditions" -) - -type NodeDriverStatus struct { - AppliedChecksum string `json:"appliedChecksum,omitempty" yaml:"appliedChecksum,omitempty"` - AppliedDockerMachineVersion string `json:"appliedDockerMachineVersion,omitempty" yaml:"appliedDockerMachineVersion,omitempty"` - AppliedURL string `json:"appliedURL,omitempty" yaml:"appliedURL,omitempty"` - Conditions []Condition `json:"conditions,omitempty" yaml:"conditions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_group.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_group.go deleted file mode 100644 index c0e42eedf27..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_group.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -const ( - NodeGroupType = "nodeGroup" - NodeGroupFieldDesiredSize = "desiredSize" - NodeGroupFieldDiskSize = "diskSize" - NodeGroupFieldEc2SshKey = "ec2SshKey" - NodeGroupFieldGpu = "gpu" - NodeGroupFieldImageID = "imageId" - NodeGroupFieldInstanceType = "instanceType" - NodeGroupFieldLabels = "labels" - NodeGroupFieldLaunchTemplate = "launchTemplate" - NodeGroupFieldMaxSize = "maxSize" - NodeGroupFieldMinSize = "minSize" - NodeGroupFieldNodeRole = "nodeRole" - NodeGroupFieldNodegroupName = "nodegroupName" - NodeGroupFieldRequestSpotInstances = "requestSpotInstances" - NodeGroupFieldResourceTags = "resourceTags" - NodeGroupFieldSpotInstanceTypes = "spotInstanceTypes" - NodeGroupFieldSubnets = "subnets" - NodeGroupFieldTags = "tags" - NodeGroupFieldUserData = "userData" - NodeGroupFieldVersion = "version" -) - -type NodeGroup struct { - DesiredSize *int64 `json:"desiredSize,omitempty" yaml:"desiredSize,omitempty"` - DiskSize *int64 `json:"diskSize,omitempty" yaml:"diskSize,omitempty"` - Ec2SshKey *string `json:"ec2SshKey,omitempty" yaml:"ec2SshKey,omitempty"` - Gpu *bool `json:"gpu,omitempty" yaml:"gpu,omitempty"` - ImageID *string `json:"imageId,omitempty" yaml:"imageId,omitempty"` - InstanceType *string `json:"instanceType,omitempty" yaml:"instanceType,omitempty"` - Labels *map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LaunchTemplate *LaunchTemplate `json:"launchTemplate,omitempty" yaml:"launchTemplate,omitempty"` - MaxSize *int64 `json:"maxSize,omitempty" yaml:"maxSize,omitempty"` - MinSize *int64 `json:"minSize,omitempty" yaml:"minSize,omitempty"` - NodeRole *string `json:"nodeRole,omitempty" yaml:"nodeRole,omitempty"` - NodegroupName *string `json:"nodegroupName,omitempty" yaml:"nodegroupName,omitempty"` - RequestSpotInstances *bool `json:"requestSpotInstances,omitempty" yaml:"requestSpotInstances,omitempty"` - ResourceTags *map[string]string `json:"resourceTags,omitempty" yaml:"resourceTags,omitempty"` - SpotInstanceTypes *[]string `json:"spotInstanceTypes,omitempty" yaml:"spotInstanceTypes,omitempty"` - Subnets *[]string `json:"subnets,omitempty" yaml:"subnets,omitempty"` - Tags *map[string]string `json:"tags,omitempty" yaml:"tags,omitempty"` - UserData *string `json:"userData,omitempty" yaml:"userData,omitempty"` - Version *string `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_info.go deleted file mode 100644 index d3d8ac45703..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_info.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - NodeInfoType = "nodeInfo" - NodeInfoFieldCPU = "cpu" - NodeInfoFieldKubernetes = "kubernetes" - NodeInfoFieldMemory = "memory" - NodeInfoFieldOS = "os" -) - -type NodeInfo struct { - CPU *CPUInfo `json:"cpu,omitempty" yaml:"cpu,omitempty"` - Kubernetes *KubernetesInfo `json:"kubernetes,omitempty" yaml:"kubernetes,omitempty"` - Memory *MemoryInfo `json:"memory,omitempty" yaml:"memory,omitempty"` - OS *OSInfo `json:"os,omitempty" yaml:"os,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_plan.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_plan.go deleted file mode 100644 index 4bf3c78a7cc..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_plan.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - NodePlanType = "nodePlan" - NodePlanFieldAgentCheckInterval = "agentCheckInterval" - NodePlanFieldPlan = "plan" - NodePlanFieldVersion = "version" -) - -type NodePlan struct { - AgentCheckInterval int64 `json:"agentCheckInterval,omitempty" yaml:"agentCheckInterval,omitempty"` - Plan *RKEConfigNodePlan `json:"plan,omitempty" yaml:"plan,omitempty"` - Version int64 `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool.go deleted file mode 100644 index 345acd27a95..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool.go +++ /dev/null @@ -1,156 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - NodePoolType = "nodePool" - NodePoolFieldAnnotations = "annotations" - NodePoolFieldClusterID = "clusterId" - NodePoolFieldControlPlane = "controlPlane" - NodePoolFieldCreated = "created" - NodePoolFieldCreatorID = "creatorId" - NodePoolFieldDeleteNotReadyAfterSecs = "deleteNotReadyAfterSecs" - NodePoolFieldDisplayName = "displayName" - NodePoolFieldDrainBeforeDelete = "drainBeforeDelete" - NodePoolFieldDriver = "driver" - NodePoolFieldEtcd = "etcd" - NodePoolFieldHostnamePrefix = "hostnamePrefix" - NodePoolFieldLabels = "labels" - NodePoolFieldName = "name" - NodePoolFieldNamespaceId = "namespaceId" - NodePoolFieldNodeAnnotations = "nodeAnnotations" - NodePoolFieldNodeLabels = "nodeLabels" - NodePoolFieldNodeTaints = "nodeTaints" - NodePoolFieldNodeTemplateID = "nodeTemplateId" - NodePoolFieldOwnerReferences = "ownerReferences" - NodePoolFieldQuantity = "quantity" - NodePoolFieldRemoved = "removed" - NodePoolFieldState = "state" - NodePoolFieldStatus = "status" - NodePoolFieldTransitioning = "transitioning" - NodePoolFieldTransitioningMessage = "transitioningMessage" - NodePoolFieldUUID = "uuid" - NodePoolFieldWorker = "worker" -) - -type NodePool struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - ControlPlane bool `json:"controlPlane,omitempty" yaml:"controlPlane,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DeleteNotReadyAfterSecs int64 `json:"deleteNotReadyAfterSecs,omitempty" yaml:"deleteNotReadyAfterSecs,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - DrainBeforeDelete bool `json:"drainBeforeDelete,omitempty" yaml:"drainBeforeDelete,omitempty"` - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - Etcd bool `json:"etcd,omitempty" yaml:"etcd,omitempty"` - HostnamePrefix string `json:"hostnamePrefix,omitempty" yaml:"hostnamePrefix,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - NodeAnnotations map[string]string `json:"nodeAnnotations,omitempty" yaml:"nodeAnnotations,omitempty"` - NodeLabels map[string]string `json:"nodeLabels,omitempty" yaml:"nodeLabels,omitempty"` - NodeTaints []Taint `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - NodeTemplateID string `json:"nodeTemplateId,omitempty" yaml:"nodeTemplateId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Quantity int64 `json:"quantity,omitempty" yaml:"quantity,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *NodePoolStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Worker bool `json:"worker,omitempty" yaml:"worker,omitempty"` -} - -type NodePoolCollection struct { - types.Collection - Data []NodePool `json:"data,omitempty"` - client *NodePoolClient -} - -type NodePoolClient struct { - apiClient *Client -} - -type NodePoolOperations interface { - List(opts *types.ListOpts) (*NodePoolCollection, error) - ListAll(opts *types.ListOpts) (*NodePoolCollection, error) - Create(opts *NodePool) (*NodePool, error) - Update(existing *NodePool, updates interface{}) (*NodePool, error) - Replace(existing *NodePool) (*NodePool, error) - ByID(id string) (*NodePool, error) - Delete(container *NodePool) error -} - -func newNodePoolClient(apiClient *Client) *NodePoolClient { - return &NodePoolClient{ - apiClient: apiClient, - } -} - -func (c *NodePoolClient) Create(container *NodePool) (*NodePool, error) { - resp := &NodePool{} - err := c.apiClient.Ops.DoCreate(NodePoolType, container, resp) - return resp, err -} - -func (c *NodePoolClient) Update(existing *NodePool, updates interface{}) (*NodePool, error) { - resp := &NodePool{} - err := c.apiClient.Ops.DoUpdate(NodePoolType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NodePoolClient) Replace(obj *NodePool) (*NodePool, error) { - resp := &NodePool{} - err := c.apiClient.Ops.DoReplace(NodePoolType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *NodePoolClient) List(opts *types.ListOpts) (*NodePoolCollection, error) { - resp := &NodePoolCollection{} - err := c.apiClient.Ops.DoList(NodePoolType, opts, resp) - resp.client = c - return resp, err -} - -func (c *NodePoolClient) ListAll(opts *types.ListOpts) (*NodePoolCollection, error) { - resp := &NodePoolCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *NodePoolCollection) Next() (*NodePoolCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NodePoolCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NodePoolClient) ByID(id string) (*NodePool, error) { - resp := &NodePool{} - err := c.apiClient.Ops.DoByID(NodePoolType, id, resp) - return resp, err -} - -func (c *NodePoolClient) Delete(container *NodePool) error { - return c.apiClient.Ops.DoResourceDelete(NodePoolType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_spec.go deleted file mode 100644 index 408463fcd8e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_spec.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -const ( - NodePoolSpecType = "nodePoolSpec" - NodePoolSpecFieldClusterID = "clusterId" - NodePoolSpecFieldControlPlane = "controlPlane" - NodePoolSpecFieldDeleteNotReadyAfterSecs = "deleteNotReadyAfterSecs" - NodePoolSpecFieldDisplayName = "displayName" - NodePoolSpecFieldDrainBeforeDelete = "drainBeforeDelete" - NodePoolSpecFieldEtcd = "etcd" - NodePoolSpecFieldHostnamePrefix = "hostnamePrefix" - NodePoolSpecFieldNodeAnnotations = "nodeAnnotations" - NodePoolSpecFieldNodeLabels = "nodeLabels" - NodePoolSpecFieldNodeTaints = "nodeTaints" - NodePoolSpecFieldNodeTemplateID = "nodeTemplateId" - NodePoolSpecFieldQuantity = "quantity" - NodePoolSpecFieldWorker = "worker" -) - -type NodePoolSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - ControlPlane bool `json:"controlPlane,omitempty" yaml:"controlPlane,omitempty"` - DeleteNotReadyAfterSecs int64 `json:"deleteNotReadyAfterSecs,omitempty" yaml:"deleteNotReadyAfterSecs,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - DrainBeforeDelete bool `json:"drainBeforeDelete,omitempty" yaml:"drainBeforeDelete,omitempty"` - Etcd bool `json:"etcd,omitempty" yaml:"etcd,omitempty"` - HostnamePrefix string `json:"hostnamePrefix,omitempty" yaml:"hostnamePrefix,omitempty"` - NodeAnnotations map[string]string `json:"nodeAnnotations,omitempty" yaml:"nodeAnnotations,omitempty"` - NodeLabels map[string]string `json:"nodeLabels,omitempty" yaml:"nodeLabels,omitempty"` - NodeTaints []Taint `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - NodeTemplateID string `json:"nodeTemplateId,omitempty" yaml:"nodeTemplateId,omitempty"` - Quantity int64 `json:"quantity,omitempty" yaml:"quantity,omitempty"` - Worker bool `json:"worker,omitempty" yaml:"worker,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_status.go deleted file mode 100644 index f5c7ed7da4c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_pool_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - NodePoolStatusType = "nodePoolStatus" - NodePoolStatusFieldConditions = "conditions" -) - -type NodePoolStatus struct { - Conditions []Condition `json:"conditions,omitempty" yaml:"conditions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_rule.go deleted file mode 100644 index 0f8af13ea46..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_rule.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - NodeRuleType = "nodeRule" - NodeRuleFieldCPUThreshold = "cpuThreshold" - NodeRuleFieldCondition = "condition" - NodeRuleFieldMemThreshold = "memThreshold" - NodeRuleFieldNodeID = "nodeId" - NodeRuleFieldSelector = "selector" -) - -type NodeRule struct { - CPUThreshold int64 `json:"cpuThreshold,omitempty" yaml:"cpuThreshold,omitempty"` - Condition string `json:"condition,omitempty" yaml:"condition,omitempty"` - MemThreshold int64 `json:"memThreshold,omitempty" yaml:"memThreshold,omitempty"` - NodeID string `json:"nodeId,omitempty" yaml:"nodeId,omitempty"` - Selector map[string]string `json:"selector,omitempty" yaml:"selector,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector.go deleted file mode 100644 index 721a16f4b21..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - NodeSelectorType = "nodeSelector" - NodeSelectorFieldNodeSelectorTerms = "nodeSelectorTerms" -) - -type NodeSelector struct { - NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms,omitempty" yaml:"nodeSelectorTerms,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_requirement.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_requirement.go deleted file mode 100644 index 9338a8c86c6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_requirement.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - NodeSelectorRequirementType = "nodeSelectorRequirement" - NodeSelectorRequirementFieldKey = "key" - NodeSelectorRequirementFieldOperator = "operator" - NodeSelectorRequirementFieldValues = "values" -) - -type NodeSelectorRequirement struct { - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Operator string `json:"operator,omitempty" yaml:"operator,omitempty"` - Values []string `json:"values,omitempty" yaml:"values,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_term.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_term.go deleted file mode 100644 index 11bf2562b04..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_selector_term.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - NodeSelectorTermType = "nodeSelectorTerm" - NodeSelectorTermFieldMatchExpressions = "matchExpressions" - NodeSelectorTermFieldMatchFields = "matchFields" -) - -type NodeSelectorTerm struct { - MatchExpressions []NodeSelectorRequirement `json:"matchExpressions,omitempty" yaml:"matchExpressions,omitempty"` - MatchFields []NodeSelectorRequirement `json:"matchFields,omitempty" yaml:"matchFields,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_spec.go deleted file mode 100644 index f2f6eefe245..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_spec.go +++ /dev/null @@ -1,50 +0,0 @@ -package client - -const ( - NodeSpecType = "nodeSpec" - NodeSpecFieldControlPlane = "controlPlane" - NodeSpecFieldCustomConfig = "customConfig" - NodeSpecFieldDescription = "description" - NodeSpecFieldDesiredNodeTaints = "desiredNodeTaints" - NodeSpecFieldDesiredNodeUnschedulable = "desiredNodeUnschedulable" - NodeSpecFieldDisplayName = "displayName" - NodeSpecFieldEtcd = "etcd" - NodeSpecFieldImported = "imported" - NodeSpecFieldMetadataUpdate = "metadataUpdate" - NodeSpecFieldNodeDrainInput = "nodeDrainInput" - NodeSpecFieldNodePoolID = "nodePoolId" - NodeSpecFieldNodeTemplateID = "nodeTemplateId" - NodeSpecFieldPodCidr = "podCidr" - NodeSpecFieldPodCidrs = "podCidrs" - NodeSpecFieldProviderId = "providerId" - NodeSpecFieldRequestedHostname = "requestedHostname" - NodeSpecFieldScaledownTime = "scaledownTime" - NodeSpecFieldTaints = "taints" - NodeSpecFieldUnschedulable = "unschedulable" - NodeSpecFieldUpdateTaintsFromAPI = "updateTaintsFromAPI" - NodeSpecFieldWorker = "worker" -) - -type NodeSpec struct { - ControlPlane bool `json:"controlPlane,omitempty" yaml:"controlPlane,omitempty"` - CustomConfig *CustomConfig `json:"customConfig,omitempty" yaml:"customConfig,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DesiredNodeTaints []Taint `json:"desiredNodeTaints,omitempty" yaml:"desiredNodeTaints,omitempty"` - DesiredNodeUnschedulable string `json:"desiredNodeUnschedulable,omitempty" yaml:"desiredNodeUnschedulable,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - Etcd bool `json:"etcd,omitempty" yaml:"etcd,omitempty"` - Imported bool `json:"imported,omitempty" yaml:"imported,omitempty"` - MetadataUpdate *MetadataUpdate `json:"metadataUpdate,omitempty" yaml:"metadataUpdate,omitempty"` - NodeDrainInput *NodeDrainInput `json:"nodeDrainInput,omitempty" yaml:"nodeDrainInput,omitempty"` - NodePoolID string `json:"nodePoolId,omitempty" yaml:"nodePoolId,omitempty"` - NodeTemplateID string `json:"nodeTemplateId,omitempty" yaml:"nodeTemplateId,omitempty"` - PodCidr string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"` - PodCidrs []string `json:"podCidrs,omitempty" yaml:"podCidrs,omitempty"` - ProviderId string `json:"providerId,omitempty" yaml:"providerId,omitempty"` - RequestedHostname string `json:"requestedHostname,omitempty" yaml:"requestedHostname,omitempty"` - ScaledownTime string `json:"scaledownTime,omitempty" yaml:"scaledownTime,omitempty"` - Taints []Taint `json:"taints,omitempty" yaml:"taints,omitempty"` - Unschedulable bool `json:"unschedulable,omitempty" yaml:"unschedulable,omitempty"` - UpdateTaintsFromAPI *bool `json:"updateTaintsFromAPI,omitempty" yaml:"updateTaintsFromAPI,omitempty"` - Worker bool `json:"worker,omitempty" yaml:"worker,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_status.go deleted file mode 100644 index d60d945b1de..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_status.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -const ( - NodeStatusType = "nodeStatus" - NodeStatusFieldAllocatable = "allocatable" - NodeStatusFieldAppliedNodeVersion = "appliedNodeVersion" - NodeStatusFieldCapacity = "capacity" - NodeStatusFieldConditions = "conditions" - NodeStatusFieldDockerInfo = "dockerInfo" - NodeStatusFieldExternalIPAddress = "externalIpAddress" - NodeStatusFieldHostname = "hostname" - NodeStatusFieldIPAddress = "ipAddress" - NodeStatusFieldInfo = "info" - NodeStatusFieldLimits = "limits" - NodeStatusFieldNodeAnnotations = "nodeAnnotations" - NodeStatusFieldNodeConfig = "rkeNode" - NodeStatusFieldNodeLabels = "nodeLabels" - NodeStatusFieldNodeName = "nodeName" - NodeStatusFieldNodePlan = "nodePlan" - NodeStatusFieldNodeTaints = "nodeTaints" - NodeStatusFieldRequested = "requested" - NodeStatusFieldVolumesAttached = "volumesAttached" - NodeStatusFieldVolumesInUse = "volumesInUse" -) - -type NodeStatus struct { - Allocatable map[string]string `json:"allocatable,omitempty" yaml:"allocatable,omitempty"` - AppliedNodeVersion int64 `json:"appliedNodeVersion,omitempty" yaml:"appliedNodeVersion,omitempty"` - Capacity map[string]string `json:"capacity,omitempty" yaml:"capacity,omitempty"` - Conditions []NodeCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - DockerInfo *DockerInfo `json:"dockerInfo,omitempty" yaml:"dockerInfo,omitempty"` - ExternalIPAddress string `json:"externalIpAddress,omitempty" yaml:"externalIpAddress,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - IPAddress string `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"` - Info *NodeInfo `json:"info,omitempty" yaml:"info,omitempty"` - Limits map[string]string `json:"limits,omitempty" yaml:"limits,omitempty"` - NodeAnnotations map[string]string `json:"nodeAnnotations,omitempty" yaml:"nodeAnnotations,omitempty"` - NodeConfig *RKEConfigNode `json:"rkeNode,omitempty" yaml:"rkeNode,omitempty"` - NodeLabels map[string]string `json:"nodeLabels,omitempty" yaml:"nodeLabels,omitempty"` - NodeName string `json:"nodeName,omitempty" yaml:"nodeName,omitempty"` - NodePlan *NodePlan `json:"nodePlan,omitempty" yaml:"nodePlan,omitempty"` - NodeTaints []Taint `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - Requested map[string]string `json:"requested,omitempty" yaml:"requested,omitempty"` - VolumesAttached map[string]AttachedVolume `json:"volumesAttached,omitempty" yaml:"volumesAttached,omitempty"` - VolumesInUse []string `json:"volumesInUse,omitempty" yaml:"volumesInUse,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_system_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_system_info.go deleted file mode 100644 index c5632f82763..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_system_info.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - NodeSystemInfoType = "nodeSystemInfo" - NodeSystemInfoFieldArchitecture = "architecture" - NodeSystemInfoFieldBootID = "bootID" - NodeSystemInfoFieldContainerRuntimeVersion = "containerRuntimeVersion" - NodeSystemInfoFieldKernelVersion = "kernelVersion" - NodeSystemInfoFieldKubeProxyVersion = "kubeProxyVersion" - NodeSystemInfoFieldKubeletVersion = "kubeletVersion" - NodeSystemInfoFieldMachineID = "machineID" - NodeSystemInfoFieldOSImage = "osImage" - NodeSystemInfoFieldOperatingSystem = "operatingSystem" - NodeSystemInfoFieldSystemUUID = "systemUUID" -) - -type NodeSystemInfo struct { - Architecture string `json:"architecture,omitempty" yaml:"architecture,omitempty"` - BootID string `json:"bootID,omitempty" yaml:"bootID,omitempty"` - ContainerRuntimeVersion string `json:"containerRuntimeVersion,omitempty" yaml:"containerRuntimeVersion,omitempty"` - KernelVersion string `json:"kernelVersion,omitempty" yaml:"kernelVersion,omitempty"` - KubeProxyVersion string `json:"kubeProxyVersion,omitempty" yaml:"kubeProxyVersion,omitempty"` - KubeletVersion string `json:"kubeletVersion,omitempty" yaml:"kubeletVersion,omitempty"` - MachineID string `json:"machineID,omitempty" yaml:"machineID,omitempty"` - OSImage string `json:"osImage,omitempty" yaml:"osImage,omitempty"` - OperatingSystem string `json:"operatingSystem,omitempty" yaml:"operatingSystem,omitempty"` - SystemUUID string `json:"systemUUID,omitempty" yaml:"systemUUID,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template.go deleted file mode 100644 index bd6ce9c3e91..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template.go +++ /dev/null @@ -1,160 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - NodeTemplateType = "nodeTemplate" - NodeTemplateFieldAnnotations = "annotations" - NodeTemplateFieldAuthCertificateAuthority = "authCertificateAuthority" - NodeTemplateFieldAuthKey = "authKey" - NodeTemplateFieldCloudCredentialID = "cloudCredentialId" - NodeTemplateFieldCreated = "created" - NodeTemplateFieldCreatorID = "creatorId" - NodeTemplateFieldDescription = "description" - NodeTemplateFieldDockerVersion = "dockerVersion" - NodeTemplateFieldDriver = "driver" - NodeTemplateFieldEngineEnv = "engineEnv" - NodeTemplateFieldEngineInsecureRegistry = "engineInsecureRegistry" - NodeTemplateFieldEngineInstallURL = "engineInstallURL" - NodeTemplateFieldEngineLabel = "engineLabel" - NodeTemplateFieldEngineOpt = "engineOpt" - NodeTemplateFieldEngineRegistryMirror = "engineRegistryMirror" - NodeTemplateFieldEngineStorageDriver = "engineStorageDriver" - NodeTemplateFieldLabels = "labels" - NodeTemplateFieldLogOpt = "logOpt" - NodeTemplateFieldName = "name" - NodeTemplateFieldNodeTaints = "nodeTaints" - NodeTemplateFieldOwnerReferences = "ownerReferences" - NodeTemplateFieldRemoved = "removed" - NodeTemplateFieldState = "state" - NodeTemplateFieldStatus = "status" - NodeTemplateFieldStorageOpt = "storageOpt" - NodeTemplateFieldTransitioning = "transitioning" - NodeTemplateFieldTransitioningMessage = "transitioningMessage" - NodeTemplateFieldUUID = "uuid" - NodeTemplateFieldUseInternalIPAddress = "useInternalIpAddress" -) - -type NodeTemplate struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"authCertificateAuthority,omitempty"` - AuthKey string `json:"authKey,omitempty" yaml:"authKey,omitempty"` - CloudCredentialID string `json:"cloudCredentialId,omitempty" yaml:"cloudCredentialId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DockerVersion string `json:"dockerVersion,omitempty" yaml:"dockerVersion,omitempty"` - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - EngineEnv map[string]string `json:"engineEnv,omitempty" yaml:"engineEnv,omitempty"` - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engineInsecureRegistry,omitempty"` - EngineInstallURL string `json:"engineInstallURL,omitempty" yaml:"engineInstallURL,omitempty"` - EngineLabel map[string]string `json:"engineLabel,omitempty" yaml:"engineLabel,omitempty"` - EngineOpt map[string]string `json:"engineOpt,omitempty" yaml:"engineOpt,omitempty"` - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engineRegistryMirror,omitempty"` - EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engineStorageDriver,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LogOpt map[string]string `json:"logOpt,omitempty" yaml:"logOpt,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NodeTaints []Taint `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *NodeTemplateStatus `json:"status,omitempty" yaml:"status,omitempty"` - StorageOpt map[string]string `json:"storageOpt,omitempty" yaml:"storageOpt,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UseInternalIPAddress *bool `json:"useInternalIpAddress,omitempty" yaml:"useInternalIpAddress,omitempty"` -} - -type NodeTemplateCollection struct { - types.Collection - Data []NodeTemplate `json:"data,omitempty"` - client *NodeTemplateClient -} - -type NodeTemplateClient struct { - apiClient *Client -} - -type NodeTemplateOperations interface { - List(opts *types.ListOpts) (*NodeTemplateCollection, error) - ListAll(opts *types.ListOpts) (*NodeTemplateCollection, error) - Create(opts *NodeTemplate) (*NodeTemplate, error) - Update(existing *NodeTemplate, updates interface{}) (*NodeTemplate, error) - Replace(existing *NodeTemplate) (*NodeTemplate, error) - ByID(id string) (*NodeTemplate, error) - Delete(container *NodeTemplate) error -} - -func newNodeTemplateClient(apiClient *Client) *NodeTemplateClient { - return &NodeTemplateClient{ - apiClient: apiClient, - } -} - -func (c *NodeTemplateClient) Create(container *NodeTemplate) (*NodeTemplate, error) { - resp := &NodeTemplate{} - err := c.apiClient.Ops.DoCreate(NodeTemplateType, container, resp) - return resp, err -} - -func (c *NodeTemplateClient) Update(existing *NodeTemplate, updates interface{}) (*NodeTemplate, error) { - resp := &NodeTemplate{} - err := c.apiClient.Ops.DoUpdate(NodeTemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NodeTemplateClient) Replace(obj *NodeTemplate) (*NodeTemplate, error) { - resp := &NodeTemplate{} - err := c.apiClient.Ops.DoReplace(NodeTemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *NodeTemplateClient) List(opts *types.ListOpts) (*NodeTemplateCollection, error) { - resp := &NodeTemplateCollection{} - err := c.apiClient.Ops.DoList(NodeTemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *NodeTemplateClient) ListAll(opts *types.ListOpts) (*NodeTemplateCollection, error) { - resp := &NodeTemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *NodeTemplateCollection) Next() (*NodeTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NodeTemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NodeTemplateClient) ByID(id string) (*NodeTemplate, error) { - resp := &NodeTemplate{} - err := c.apiClient.Ops.DoByID(NodeTemplateType, id, resp) - return resp, err -} - -func (c *NodeTemplateClient) Delete(container *NodeTemplate) error { - return c.apiClient.Ops.DoResourceDelete(NodeTemplateType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_condition.go deleted file mode 100644 index c3b3fe97ac5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_condition.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - NodeTemplateConditionType = "nodeTemplateCondition" - NodeTemplateConditionFieldLastTransitionTime = "lastTransitionTime" - NodeTemplateConditionFieldLastUpdateTime = "lastUpdateTime" - NodeTemplateConditionFieldReason = "reason" - NodeTemplateConditionFieldStatus = "status" - NodeTemplateConditionFieldType = "type" -) - -type NodeTemplateCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_spec.go deleted file mode 100644 index e93072202de..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_spec.go +++ /dev/null @@ -1,44 +0,0 @@ -package client - -const ( - NodeTemplateSpecType = "nodeTemplateSpec" - NodeTemplateSpecFieldAuthCertificateAuthority = "authCertificateAuthority" - NodeTemplateSpecFieldAuthKey = "authKey" - NodeTemplateSpecFieldCloudCredentialID = "cloudCredentialId" - NodeTemplateSpecFieldDescription = "description" - NodeTemplateSpecFieldDisplayName = "displayName" - NodeTemplateSpecFieldDockerVersion = "dockerVersion" - NodeTemplateSpecFieldDriver = "driver" - NodeTemplateSpecFieldEngineEnv = "engineEnv" - NodeTemplateSpecFieldEngineInsecureRegistry = "engineInsecureRegistry" - NodeTemplateSpecFieldEngineInstallURL = "engineInstallURL" - NodeTemplateSpecFieldEngineLabel = "engineLabel" - NodeTemplateSpecFieldEngineOpt = "engineOpt" - NodeTemplateSpecFieldEngineRegistryMirror = "engineRegistryMirror" - NodeTemplateSpecFieldEngineStorageDriver = "engineStorageDriver" - NodeTemplateSpecFieldLogOpt = "logOpt" - NodeTemplateSpecFieldNodeTaints = "nodeTaints" - NodeTemplateSpecFieldStorageOpt = "storageOpt" - NodeTemplateSpecFieldUseInternalIPAddress = "useInternalIpAddress" -) - -type NodeTemplateSpec struct { - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"authCertificateAuthority,omitempty"` - AuthKey string `json:"authKey,omitempty" yaml:"authKey,omitempty"` - CloudCredentialID string `json:"cloudCredentialId,omitempty" yaml:"cloudCredentialId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - DockerVersion string `json:"dockerVersion,omitempty" yaml:"dockerVersion,omitempty"` - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - EngineEnv map[string]string `json:"engineEnv,omitempty" yaml:"engineEnv,omitempty"` - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engineInsecureRegistry,omitempty"` - EngineInstallURL string `json:"engineInstallURL,omitempty" yaml:"engineInstallURL,omitempty"` - EngineLabel map[string]string `json:"engineLabel,omitempty" yaml:"engineLabel,omitempty"` - EngineOpt map[string]string `json:"engineOpt,omitempty" yaml:"engineOpt,omitempty"` - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engineRegistryMirror,omitempty"` - EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engineStorageDriver,omitempty"` - LogOpt map[string]string `json:"logOpt,omitempty" yaml:"logOpt,omitempty"` - NodeTaints []Taint `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - StorageOpt map[string]string `json:"storageOpt,omitempty" yaml:"storageOpt,omitempty"` - UseInternalIPAddress *bool `json:"useInternalIpAddress,omitempty" yaml:"useInternalIpAddress,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_status.go deleted file mode 100644 index c8b5d713b0c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_template_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - NodeTemplateStatusType = "nodeTemplateStatus" - NodeTemplateStatusFieldConditions = "conditions" -) - -type NodeTemplateStatus struct { - Conditions []NodeTemplateCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_upgrade_strategy.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_upgrade_strategy.go deleted file mode 100644 index 3e6106c3294..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_node_upgrade_strategy.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - NodeUpgradeStrategyType = "nodeUpgradeStrategy" - NodeUpgradeStrategyFieldDrain = "drain" - NodeUpgradeStrategyFieldDrainInput = "nodeDrainInput" - NodeUpgradeStrategyFieldMaxUnavailableControlplane = "maxUnavailableControlplane" - NodeUpgradeStrategyFieldMaxUnavailableWorker = "maxUnavailableWorker" -) - -type NodeUpgradeStrategy struct { - Drain *bool `json:"drain,omitempty" yaml:"drain,omitempty"` - DrainInput *NodeDrainInput `json:"nodeDrainInput,omitempty" yaml:"nodeDrainInput,omitempty"` - MaxUnavailableControlplane string `json:"maxUnavailableControlplane,omitempty" yaml:"maxUnavailableControlplane,omitempty"` - MaxUnavailableWorker string `json:"maxUnavailableWorker,omitempty" yaml:"maxUnavailableWorker,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_nodelocal.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_nodelocal.go deleted file mode 100644 index 392249ccbaa..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_nodelocal.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - NodelocalType = "nodelocal" - NodelocalFieldIPAddress = "ipAddress" - NodelocalFieldNodeLocalDNSPriorityClassName = "nodeLocalDnsPriorityClassName" - NodelocalFieldNodeSelector = "nodeSelector" - NodelocalFieldUpdateStrategy = "updateStrategy" -) - -type Nodelocal struct { - IPAddress string `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"` - NodeLocalDNSPriorityClassName string `json:"nodeLocalDnsPriorityClassName,omitempty" yaml:"nodeLocalDnsPriorityClassName,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"` - UpdateStrategy *DaemonSetUpdateStrategy `json:"updateStrategy,omitempty" yaml:"updateStrategy,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notification.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_notification.go deleted file mode 100644 index 9aff561bcbd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notification.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - NotificationType = "notification" - NotificationFieldDingtalkConfig = "dingtalkConfig" - NotificationFieldMSTeamsConfig = "msteamsConfig" - NotificationFieldMessage = "message" - NotificationFieldPagerdutyConfig = "pagerdutyConfig" - NotificationFieldSMTPConfig = "smtpConfig" - NotificationFieldSlackConfig = "slackConfig" - NotificationFieldWebhookConfig = "webhookConfig" - NotificationFieldWechatConfig = "wechatConfig" -) - -type Notification struct { - DingtalkConfig *DingtalkConfig `json:"dingtalkConfig,omitempty" yaml:"dingtalkConfig,omitempty"` - MSTeamsConfig *MSTeamsConfig `json:"msteamsConfig,omitempty" yaml:"msteamsConfig,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty" yaml:"pagerdutyConfig,omitempty"` - SMTPConfig *SMTPConfig `json:"smtpConfig,omitempty" yaml:"smtpConfig,omitempty"` - SlackConfig *SlackConfig `json:"slackConfig,omitempty" yaml:"slackConfig,omitempty"` - WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty" yaml:"webhookConfig,omitempty"` - WechatConfig *WechatConfig `json:"wechatConfig,omitempty" yaml:"wechatConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier.go deleted file mode 100644 index eadf52c46be..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier.go +++ /dev/null @@ -1,166 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - NotifierType = "notifier" - NotifierFieldAnnotations = "annotations" - NotifierFieldClusterID = "clusterId" - NotifierFieldCreated = "created" - NotifierFieldCreatorID = "creatorId" - NotifierFieldDescription = "description" - NotifierFieldDingtalkConfig = "dingtalkConfig" - NotifierFieldDingtalkCredentialSecret = "dingtalkCredentialSecret" - NotifierFieldLabels = "labels" - NotifierFieldMSTeamsConfig = "msteamsConfig" - NotifierFieldName = "name" - NotifierFieldNamespaceId = "namespaceId" - NotifierFieldOwnerReferences = "ownerReferences" - NotifierFieldPagerdutyConfig = "pagerdutyConfig" - NotifierFieldRemoved = "removed" - NotifierFieldSMTPConfig = "smtpConfig" - NotifierFieldSMTPCredentialSecret = "smtpCredentialSecret" - NotifierFieldSendResolved = "sendResolved" - NotifierFieldSlackConfig = "slackConfig" - NotifierFieldState = "state" - NotifierFieldTransitioning = "transitioning" - NotifierFieldTransitioningMessage = "transitioningMessage" - NotifierFieldUUID = "uuid" - NotifierFieldWebhookConfig = "webhookConfig" - NotifierFieldWechatConfig = "wechatConfig" - NotifierFieldWechatCredentialSecret = "wechatCredentialSecret" -) - -type Notifier struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DingtalkConfig *DingtalkConfig `json:"dingtalkConfig,omitempty" yaml:"dingtalkConfig,omitempty"` - DingtalkCredentialSecret string `json:"dingtalkCredentialSecret,omitempty" yaml:"dingtalkCredentialSecret,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - MSTeamsConfig *MSTeamsConfig `json:"msteamsConfig,omitempty" yaml:"msteamsConfig,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty" yaml:"pagerdutyConfig,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SMTPConfig *SMTPConfig `json:"smtpConfig,omitempty" yaml:"smtpConfig,omitempty"` - SMTPCredentialSecret string `json:"smtpCredentialSecret,omitempty" yaml:"smtpCredentialSecret,omitempty"` - SendResolved bool `json:"sendResolved,omitempty" yaml:"sendResolved,omitempty"` - SlackConfig *SlackConfig `json:"slackConfig,omitempty" yaml:"slackConfig,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty" yaml:"webhookConfig,omitempty"` - WechatConfig *WechatConfig `json:"wechatConfig,omitempty" yaml:"wechatConfig,omitempty"` - WechatCredentialSecret string `json:"wechatCredentialSecret,omitempty" yaml:"wechatCredentialSecret,omitempty"` -} - -type NotifierCollection struct { - types.Collection - Data []Notifier `json:"data,omitempty"` - client *NotifierClient -} - -type NotifierClient struct { - apiClient *Client -} - -type NotifierOperations interface { - List(opts *types.ListOpts) (*NotifierCollection, error) - ListAll(opts *types.ListOpts) (*NotifierCollection, error) - Create(opts *Notifier) (*Notifier, error) - Update(existing *Notifier, updates interface{}) (*Notifier, error) - Replace(existing *Notifier) (*Notifier, error) - ByID(id string) (*Notifier, error) - Delete(container *Notifier) error - - ActionSend(resource *Notifier, input *Notification) error - - CollectionActionSend(resource *NotifierCollection, input *Notification) error -} - -func newNotifierClient(apiClient *Client) *NotifierClient { - return &NotifierClient{ - apiClient: apiClient, - } -} - -func (c *NotifierClient) Create(container *Notifier) (*Notifier, error) { - resp := &Notifier{} - err := c.apiClient.Ops.DoCreate(NotifierType, container, resp) - return resp, err -} - -func (c *NotifierClient) Update(existing *Notifier, updates interface{}) (*Notifier, error) { - resp := &Notifier{} - err := c.apiClient.Ops.DoUpdate(NotifierType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NotifierClient) Replace(obj *Notifier) (*Notifier, error) { - resp := &Notifier{} - err := c.apiClient.Ops.DoReplace(NotifierType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *NotifierClient) List(opts *types.ListOpts) (*NotifierCollection, error) { - resp := &NotifierCollection{} - err := c.apiClient.Ops.DoList(NotifierType, opts, resp) - resp.client = c - return resp, err -} - -func (c *NotifierClient) ListAll(opts *types.ListOpts) (*NotifierCollection, error) { - resp := &NotifierCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *NotifierCollection) Next() (*NotifierCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NotifierCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NotifierClient) ByID(id string) (*Notifier, error) { - resp := &Notifier{} - err := c.apiClient.Ops.DoByID(NotifierType, id, resp) - return resp, err -} - -func (c *NotifierClient) Delete(container *Notifier) error { - return c.apiClient.Ops.DoResourceDelete(NotifierType, &container.Resource) -} - -func (c *NotifierClient) ActionSend(resource *Notifier, input *Notification) error { - err := c.apiClient.Ops.DoAction(NotifierType, "send", &resource.Resource, input, nil) - return err -} - -func (c *NotifierClient) CollectionActionSend(resource *NotifierCollection, input *Notification) error { - err := c.apiClient.Ops.DoCollectionAction(NotifierType, "send", &resource.Collection, input, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_spec.go deleted file mode 100644 index e462eb3a4fb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_spec.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - NotifierSpecType = "notifierSpec" - NotifierSpecFieldClusterID = "clusterId" - NotifierSpecFieldDescription = "description" - NotifierSpecFieldDingtalkConfig = "dingtalkConfig" - NotifierSpecFieldDisplayName = "displayName" - NotifierSpecFieldMSTeamsConfig = "msteamsConfig" - NotifierSpecFieldPagerdutyConfig = "pagerdutyConfig" - NotifierSpecFieldSMTPConfig = "smtpConfig" - NotifierSpecFieldSendResolved = "sendResolved" - NotifierSpecFieldSlackConfig = "slackConfig" - NotifierSpecFieldWebhookConfig = "webhookConfig" - NotifierSpecFieldWechatConfig = "wechatConfig" -) - -type NotifierSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DingtalkConfig *DingtalkConfig `json:"dingtalkConfig,omitempty" yaml:"dingtalkConfig,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - MSTeamsConfig *MSTeamsConfig `json:"msteamsConfig,omitempty" yaml:"msteamsConfig,omitempty"` - PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty" yaml:"pagerdutyConfig,omitempty"` - SMTPConfig *SMTPConfig `json:"smtpConfig,omitempty" yaml:"smtpConfig,omitempty"` - SendResolved bool `json:"sendResolved,omitempty" yaml:"sendResolved,omitempty"` - SlackConfig *SlackConfig `json:"slackConfig,omitempty" yaml:"slackConfig,omitempty"` - WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty" yaml:"webhookConfig,omitempty"` - WechatConfig *WechatConfig `json:"wechatConfig,omitempty" yaml:"wechatConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_status.go deleted file mode 100644 index 79a23b27153..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_notifier_status.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - NotifierStatusType = "notifierStatus" - NotifierStatusFieldDingtalkCredentialSecret = "dingtalkCredentialSecret" - NotifierStatusFieldSMTPCredentialSecret = "smtpCredentialSecret" - NotifierStatusFieldWechatCredentialSecret = "wechatCredentialSecret" -) - -type NotifierStatus struct { - DingtalkCredentialSecret string `json:"dingtalkCredentialSecret,omitempty" yaml:"dingtalkCredentialSecret,omitempty"` - SMTPCredentialSecret string `json:"smtpCredentialSecret,omitempty" yaml:"smtpCredentialSecret,omitempty"` - WechatCredentialSecret string `json:"wechatCredentialSecret,omitempty" yaml:"wechatCredentialSecret,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_object_field_selector.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_object_field_selector.go deleted file mode 100644 index 4951d2af703..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_object_field_selector.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ObjectFieldSelectorType = "objectFieldSelector" - ObjectFieldSelectorFieldAPIVersion = "apiVersion" - ObjectFieldSelectorFieldFieldPath = "fieldPath" -) - -type ObjectFieldSelector struct { - APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"` - FieldPath string `json:"fieldPath,omitempty" yaml:"fieldPath,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_object_meta.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_object_meta.go deleted file mode 100644 index 29f79630f1a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_object_meta.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - ObjectMetaType = "objectMeta" - ObjectMetaFieldAnnotations = "annotations" - ObjectMetaFieldCreated = "created" - ObjectMetaFieldFinalizers = "finalizers" - ObjectMetaFieldLabels = "labels" - ObjectMetaFieldName = "name" - ObjectMetaFieldNamespace = "namespace" - ObjectMetaFieldOwnerReferences = "ownerReferences" - ObjectMetaFieldRemoved = "removed" - ObjectMetaFieldSelfLink = "selfLink" - ObjectMetaFieldUUID = "uuid" -) - -type ObjectMeta struct { - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - Finalizers []string `json:"finalizers,omitempty" yaml:"finalizers,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SelfLink string `json:"selfLink,omitempty" yaml:"selfLink,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_apply_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_apply_input.go deleted file mode 100644 index cc73a7708c8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_apply_input.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - OIDCApplyInputType = "oidcApplyInput" - OIDCApplyInputFieldCode = "code" - OIDCApplyInputFieldEnabled = "enabled" - OIDCApplyInputFieldOIDCConfig = "oidcConfig" -) - -type OIDCApplyInput struct { - Code string `json:"code,omitempty" yaml:"code,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - OIDCConfig *OIDCConfig `json:"oidcConfig,omitempty" yaml:"oidcConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_config.go deleted file mode 100644 index 0e68d0aba7f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_config.go +++ /dev/null @@ -1,52 +0,0 @@ -package client - -const ( - OIDCConfigType = "oidcConfig" - OIDCConfigFieldAccessMode = "accessMode" - OIDCConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - OIDCConfigFieldAnnotations = "annotations" - OIDCConfigFieldAuthEndpoint = "authEndpoint" - OIDCConfigFieldCertificate = "certificate" - OIDCConfigFieldClientID = "clientId" - OIDCConfigFieldClientSecret = "clientSecret" - OIDCConfigFieldCreated = "created" - OIDCConfigFieldCreatorID = "creatorId" - OIDCConfigFieldEnabled = "enabled" - OIDCConfigFieldGroupSearchEnabled = "groupSearchEnabled" - OIDCConfigFieldIssuer = "issuer" - OIDCConfigFieldLabels = "labels" - OIDCConfigFieldName = "name" - OIDCConfigFieldOwnerReferences = "ownerReferences" - OIDCConfigFieldPrivateKey = "privateKey" - OIDCConfigFieldRancherURL = "rancherUrl" - OIDCConfigFieldRemoved = "removed" - OIDCConfigFieldScopes = "scope" - OIDCConfigFieldStatus = "status" - OIDCConfigFieldType = "type" - OIDCConfigFieldUUID = "uuid" -) - -type OIDCConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AuthEndpoint string `json:"authEndpoint,omitempty" yaml:"authEndpoint,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientID string `json:"clientId,omitempty" yaml:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GroupSearchEnabled *bool `json:"groupSearchEnabled,omitempty" yaml:"groupSearchEnabled,omitempty"` - Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PrivateKey string `json:"privateKey,omitempty" yaml:"privateKey,omitempty"` - RancherURL string `json:"rancherUrl,omitempty" yaml:"rancherUrl,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Scopes string `json:"scope,omitempty" yaml:"scope,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_test_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_test_output.go deleted file mode 100644 index db930c861a0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_oidc_test_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - OIDCTestOutputType = "oidcTestOutput" - OIDCTestOutputFieldRedirectURL = "redirectUrl" -) - -type OIDCTestOutput struct { - RedirectURL string `json:"redirectUrl,omitempty" yaml:"redirectUrl,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_okta_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_okta_config.go deleted file mode 100644 index 4279acbc07b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_okta_config.go +++ /dev/null @@ -1,54 +0,0 @@ -package client - -const ( - OKTAConfigType = "oktaConfig" - OKTAConfigFieldAccessMode = "accessMode" - OKTAConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - OKTAConfigFieldAnnotations = "annotations" - OKTAConfigFieldCreated = "created" - OKTAConfigFieldCreatorID = "creatorId" - OKTAConfigFieldDisplayNameField = "displayNameField" - OKTAConfigFieldEnabled = "enabled" - OKTAConfigFieldEntityID = "entityID" - OKTAConfigFieldGroupsField = "groupsField" - OKTAConfigFieldIDPMetadataContent = "idpMetadataContent" - OKTAConfigFieldLabels = "labels" - OKTAConfigFieldName = "name" - OKTAConfigFieldOpenLdapConfig = "openLdapConfig" - OKTAConfigFieldOwnerReferences = "ownerReferences" - OKTAConfigFieldRancherAPIHost = "rancherApiHost" - OKTAConfigFieldRemoved = "removed" - OKTAConfigFieldSpCert = "spCert" - OKTAConfigFieldSpKey = "spKey" - OKTAConfigFieldStatus = "status" - OKTAConfigFieldType = "type" - OKTAConfigFieldUIDField = "uidField" - OKTAConfigFieldUUID = "uuid" - OKTAConfigFieldUserNameField = "userNameField" -) - -type OKTAConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DisplayNameField string `json:"displayNameField,omitempty" yaml:"displayNameField,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - EntityID string `json:"entityID,omitempty" yaml:"entityID,omitempty"` - GroupsField string `json:"groupsField,omitempty" yaml:"groupsField,omitempty"` - IDPMetadataContent string `json:"idpMetadataContent,omitempty" yaml:"idpMetadataContent,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OpenLdapConfig *LdapFields `json:"openLdapConfig,omitempty" yaml:"openLdapConfig,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - RancherAPIHost string `json:"rancherApiHost,omitempty" yaml:"rancherApiHost,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SpCert string `json:"spCert,omitempty" yaml:"spCert,omitempty"` - SpKey string `json:"spKey,omitempty" yaml:"spKey,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UIDField string `json:"uidField,omitempty" yaml:"uidField,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserNameField string `json:"userNameField,omitempty" yaml:"userNameField,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_config.go deleted file mode 100644 index 36af1a48a0d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_config.go +++ /dev/null @@ -1,86 +0,0 @@ -package client - -const ( - OpenLdapConfigType = "openLdapConfig" - OpenLdapConfigFieldAccessMode = "accessMode" - OpenLdapConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - OpenLdapConfigFieldAnnotations = "annotations" - OpenLdapConfigFieldCertificate = "certificate" - OpenLdapConfigFieldConnectionTimeout = "connectionTimeout" - OpenLdapConfigFieldCreated = "created" - OpenLdapConfigFieldCreatorID = "creatorId" - OpenLdapConfigFieldEnabled = "enabled" - OpenLdapConfigFieldGroupDNAttribute = "groupDNAttribute" - OpenLdapConfigFieldGroupMemberMappingAttribute = "groupMemberMappingAttribute" - OpenLdapConfigFieldGroupMemberUserAttribute = "groupMemberUserAttribute" - OpenLdapConfigFieldGroupNameAttribute = "groupNameAttribute" - OpenLdapConfigFieldGroupObjectClass = "groupObjectClass" - OpenLdapConfigFieldGroupSearchAttribute = "groupSearchAttribute" - OpenLdapConfigFieldGroupSearchBase = "groupSearchBase" - OpenLdapConfigFieldGroupSearchFilter = "groupSearchFilter" - OpenLdapConfigFieldLabels = "labels" - OpenLdapConfigFieldName = "name" - OpenLdapConfigFieldNestedGroupMembershipEnabled = "nestedGroupMembershipEnabled" - OpenLdapConfigFieldOwnerReferences = "ownerReferences" - OpenLdapConfigFieldPort = "port" - OpenLdapConfigFieldRemoved = "removed" - OpenLdapConfigFieldServers = "servers" - OpenLdapConfigFieldServiceAccountDistinguishedName = "serviceAccountDistinguishedName" - OpenLdapConfigFieldServiceAccountPassword = "serviceAccountPassword" - OpenLdapConfigFieldStartTLS = "starttls" - OpenLdapConfigFieldStatus = "status" - OpenLdapConfigFieldTLS = "tls" - OpenLdapConfigFieldType = "type" - OpenLdapConfigFieldUUID = "uuid" - OpenLdapConfigFieldUserDisabledBitMask = "userDisabledBitMask" - OpenLdapConfigFieldUserEnabledAttribute = "userEnabledAttribute" - OpenLdapConfigFieldUserLoginAttribute = "userLoginAttribute" - OpenLdapConfigFieldUserMemberAttribute = "userMemberAttribute" - OpenLdapConfigFieldUserNameAttribute = "userNameAttribute" - OpenLdapConfigFieldUserObjectClass = "userObjectClass" - OpenLdapConfigFieldUserSearchAttribute = "userSearchAttribute" - OpenLdapConfigFieldUserSearchBase = "userSearchBase" - OpenLdapConfigFieldUserSearchFilter = "userSearchFilter" -) - -type OpenLdapConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connectionTimeout,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - GroupDNAttribute string `json:"groupDNAttribute,omitempty" yaml:"groupDNAttribute,omitempty"` - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"groupMemberMappingAttribute,omitempty"` - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"groupMemberUserAttribute,omitempty"` - GroupNameAttribute string `json:"groupNameAttribute,omitempty" yaml:"groupNameAttribute,omitempty"` - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"groupObjectClass,omitempty"` - GroupSearchAttribute string `json:"groupSearchAttribute,omitempty" yaml:"groupSearchAttribute,omitempty"` - GroupSearchBase string `json:"groupSearchBase,omitempty" yaml:"groupSearchBase,omitempty"` - GroupSearchFilter string `json:"groupSearchFilter,omitempty" yaml:"groupSearchFilter,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NestedGroupMembershipEnabled bool `json:"nestedGroupMembershipEnabled,omitempty" yaml:"nestedGroupMembershipEnabled,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Servers []string `json:"servers,omitempty" yaml:"servers,omitempty"` - ServiceAccountDistinguishedName string `json:"serviceAccountDistinguishedName,omitempty" yaml:"serviceAccountDistinguishedName,omitempty"` - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"serviceAccountPassword,omitempty"` - StartTLS bool `json:"starttls,omitempty" yaml:"starttls,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"userDisabledBitMask,omitempty"` - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"userEnabledAttribute,omitempty"` - UserLoginAttribute string `json:"userLoginAttribute,omitempty" yaml:"userLoginAttribute,omitempty"` - UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"userMemberAttribute,omitempty"` - UserNameAttribute string `json:"userNameAttribute,omitempty" yaml:"userNameAttribute,omitempty"` - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"userObjectClass,omitempty"` - UserSearchAttribute string `json:"userSearchAttribute,omitempty" yaml:"userSearchAttribute,omitempty"` - UserSearchBase string `json:"userSearchBase,omitempty" yaml:"userSearchBase,omitempty"` - UserSearchFilter string `json:"userSearchFilter,omitempty" yaml:"userSearchFilter,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_test_and_apply_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_test_and_apply_input.go deleted file mode 100644 index 29c48f16031..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_open_ldap_test_and_apply_input.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - OpenLdapTestAndApplyInputType = "openLdapTestAndApplyInput" - OpenLdapTestAndApplyInputFieldLdapConfig = "ldapConfig" - OpenLdapTestAndApplyInputFieldPassword = "password" - OpenLdapTestAndApplyInputFieldUsername = "username" -) - -type OpenLdapTestAndApplyInput struct { - LdapConfig *LdapConfig `json:"ldapConfig,omitempty" yaml:"ldapConfig,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_openstack_cloud_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_openstack_cloud_provider.go deleted file mode 100644 index 6d883ff221d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_openstack_cloud_provider.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - OpenstackCloudProviderType = "openstackCloudProvider" - OpenstackCloudProviderFieldBlockStorage = "blockStorage" - OpenstackCloudProviderFieldGlobal = "global" - OpenstackCloudProviderFieldLoadBalancer = "loadBalancer" - OpenstackCloudProviderFieldMetadata = "metadata" - OpenstackCloudProviderFieldRoute = "route" -) - -type OpenstackCloudProvider struct { - BlockStorage *BlockStorageOpenstackOpts `json:"blockStorage,omitempty" yaml:"blockStorage,omitempty"` - Global *GlobalOpenstackOpts `json:"global,omitempty" yaml:"global,omitempty"` - LoadBalancer *LoadBalancerOpenstackOpts `json:"loadBalancer,omitempty" yaml:"loadBalancer,omitempty"` - Metadata *MetadataOpenstackOpts `json:"metadata,omitempty" yaml:"metadata,omitempty"` - Route *RouteOpenstackOpts `json:"route,omitempty" yaml:"route,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_os_info.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_os_info.go deleted file mode 100644 index c2c503ceafb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_os_info.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - OSInfoType = "osInfo" - OSInfoFieldDockerVersion = "dockerVersion" - OSInfoFieldKernelVersion = "kernelVersion" - OSInfoFieldOperatingSystem = "operatingSystem" -) - -type OSInfo struct { - DockerVersion string `json:"dockerVersion,omitempty" yaml:"dockerVersion,omitempty"` - KernelVersion string `json:"kernelVersion,omitempty" yaml:"kernelVersion,omitempty"` - OperatingSystem string `json:"operatingSystem,omitempty" yaml:"operatingSystem,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_owner_reference.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_owner_reference.go deleted file mode 100644 index 5f4436b64e2..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_owner_reference.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - OwnerReferenceType = "ownerReference" - OwnerReferenceFieldAPIVersion = "apiVersion" - OwnerReferenceFieldBlockOwnerDeletion = "blockOwnerDeletion" - OwnerReferenceFieldController = "controller" - OwnerReferenceFieldKind = "kind" - OwnerReferenceFieldName = "name" - OwnerReferenceFieldUID = "uid" -) - -type OwnerReference struct { - APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"` - BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" yaml:"blockOwnerDeletion,omitempty"` - Controller *bool `json:"controller,omitempty" yaml:"controller,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - UID string `json:"uid,omitempty" yaml:"uid,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pagerduty_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pagerduty_config.go deleted file mode 100644 index 7499318d7c2..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pagerduty_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - PagerdutyConfigType = "pagerdutyConfig" - PagerdutyConfigFieldProxyURL = "proxyUrl" - PagerdutyConfigFieldServiceKey = "serviceKey" -) - -type PagerdutyConfig struct { - ProxyURL string `json:"proxyUrl,omitempty" yaml:"proxyUrl,omitempty"` - ServiceKey string `json:"serviceKey,omitempty" yaml:"serviceKey,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_spec.go deleted file mode 100644 index 4eb879cf886..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_spec.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - PersistentVolumeClaimSpecType = "persistentVolumeClaimSpec" - PersistentVolumeClaimSpecFieldAccessModes = "accessModes" - PersistentVolumeClaimSpecFieldDataSource = "dataSource" - PersistentVolumeClaimSpecFieldDataSourceRef = "dataSourceRef" - PersistentVolumeClaimSpecFieldResources = "resources" - PersistentVolumeClaimSpecFieldSelector = "selector" - PersistentVolumeClaimSpecFieldStorageClassName = "storageClassName" - PersistentVolumeClaimSpecFieldVolumeMode = "volumeMode" - PersistentVolumeClaimSpecFieldVolumeName = "volumeName" -) - -type PersistentVolumeClaimSpec struct { - AccessModes []string `json:"accessModes,omitempty" yaml:"accessModes,omitempty"` - DataSource *TypedLocalObjectReference `json:"dataSource,omitempty" yaml:"dataSource,omitempty"` - DataSourceRef *TypedLocalObjectReference `json:"dataSourceRef,omitempty" yaml:"dataSourceRef,omitempty"` - Resources *ResourceRequirements `json:"resources,omitempty" yaml:"resources,omitempty"` - Selector *LabelSelector `json:"selector,omitempty" yaml:"selector,omitempty"` - StorageClassName string `json:"storageClassName,omitempty" yaml:"storageClassName,omitempty"` - VolumeMode string `json:"volumeMode,omitempty" yaml:"volumeMode,omitempty"` - VolumeName string `json:"volumeName,omitempty" yaml:"volumeName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_template.go deleted file mode 100644 index 1eed7b41dd5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_template.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - PersistentVolumeClaimTemplateType = "persistentVolumeClaimTemplate" - PersistentVolumeClaimTemplateFieldObjectMeta = "metadata" - PersistentVolumeClaimTemplateFieldSpec = "spec" -) - -type PersistentVolumeClaimTemplate struct { - ObjectMeta *ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` - Spec *PersistentVolumeClaimSpec `json:"spec,omitempty" yaml:"spec,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_volume_source.go deleted file mode 100644 index 1b4ae4bb09d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_persistent_volume_claim_volume_source.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - PersistentVolumeClaimVolumeSourceType = "persistentVolumeClaimVolumeSource" - PersistentVolumeClaimVolumeSourceFieldClaimName = "claimName" - PersistentVolumeClaimVolumeSourceFieldReadOnly = "readOnly" -) - -type PersistentVolumeClaimVolumeSource struct { - ClaimName string `json:"claimName,omitempty" yaml:"claimName,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_photon_persistent_disk_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_photon_persistent_disk_volume_source.go deleted file mode 100644 index d6e8ffd3024..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_photon_persistent_disk_volume_source.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - PhotonPersistentDiskVolumeSourceType = "photonPersistentDiskVolumeSource" - PhotonPersistentDiskVolumeSourceFieldFSType = "fsType" - PhotonPersistentDiskVolumeSourceFieldPdID = "pdID" -) - -type PhotonPersistentDiskVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - PdID string `json:"pdID,omitempty" yaml:"pdID,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ping_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_ping_config.go deleted file mode 100644 index 3905905b265..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_ping_config.go +++ /dev/null @@ -1,52 +0,0 @@ -package client - -const ( - PingConfigType = "pingConfig" - PingConfigFieldAccessMode = "accessMode" - PingConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - PingConfigFieldAnnotations = "annotations" - PingConfigFieldCreated = "created" - PingConfigFieldCreatorID = "creatorId" - PingConfigFieldDisplayNameField = "displayNameField" - PingConfigFieldEnabled = "enabled" - PingConfigFieldEntityID = "entityID" - PingConfigFieldGroupsField = "groupsField" - PingConfigFieldIDPMetadataContent = "idpMetadataContent" - PingConfigFieldLabels = "labels" - PingConfigFieldName = "name" - PingConfigFieldOwnerReferences = "ownerReferences" - PingConfigFieldRancherAPIHost = "rancherApiHost" - PingConfigFieldRemoved = "removed" - PingConfigFieldSpCert = "spCert" - PingConfigFieldSpKey = "spKey" - PingConfigFieldStatus = "status" - PingConfigFieldType = "type" - PingConfigFieldUIDField = "uidField" - PingConfigFieldUUID = "uuid" - PingConfigFieldUserNameField = "userNameField" -) - -type PingConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DisplayNameField string `json:"displayNameField,omitempty" yaml:"displayNameField,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - EntityID string `json:"entityID,omitempty" yaml:"entityID,omitempty"` - GroupsField string `json:"groupsField,omitempty" yaml:"groupsField,omitempty"` - IDPMetadataContent string `json:"idpMetadataContent,omitempty" yaml:"idpMetadataContent,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - RancherAPIHost string `json:"rancherApiHost,omitempty" yaml:"rancherApiHost,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SpCert string `json:"spCert,omitempty" yaml:"spCert,omitempty"` - SpKey string `json:"spKey,omitempty" yaml:"spKey,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UIDField string `json:"uidField,omitempty" yaml:"uidField,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserNameField string `json:"userNameField,omitempty" yaml:"userNameField,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity.go deleted file mode 100644 index ebe2958eed7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - PodAffinityType = "podAffinity" - PodAffinityFieldPreferredDuringSchedulingIgnoredDuringExecution = "preferredDuringSchedulingIgnoredDuringExecution" - PodAffinityFieldRequiredDuringSchedulingIgnoredDuringExecution = "requiredDuringSchedulingIgnoredDuringExecution" -) - -type PodAffinity struct { - PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" yaml:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` - RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" yaml:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity_term.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity_term.go deleted file mode 100644 index 6bf99d0f83b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_affinity_term.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - PodAffinityTermType = "podAffinityTerm" - PodAffinityTermFieldLabelSelector = "labelSelector" - PodAffinityTermFieldNamespaceSelector = "namespaceSelector" - PodAffinityTermFieldNamespaces = "namespaces" - PodAffinityTermFieldTopologyKey = "topologyKey" -) - -type PodAffinityTerm struct { - LabelSelector *LabelSelector `json:"labelSelector,omitempty" yaml:"labelSelector,omitempty"` - NamespaceSelector *LabelSelector `json:"namespaceSelector,omitempty" yaml:"namespaceSelector,omitempty"` - Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` - TopologyKey string `json:"topologyKey,omitempty" yaml:"topologyKey,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_anti_affinity.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_anti_affinity.go deleted file mode 100644 index 47fdd692ed6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_anti_affinity.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - PodAntiAffinityType = "podAntiAffinity" - PodAntiAffinityFieldPreferredDuringSchedulingIgnoredDuringExecution = "preferredDuringSchedulingIgnoredDuringExecution" - PodAntiAffinityFieldRequiredDuringSchedulingIgnoredDuringExecution = "requiredDuringSchedulingIgnoredDuringExecution" -) - -type PodAntiAffinity struct { - PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" yaml:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` - RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" yaml:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_rule.go deleted file mode 100644 index 466be84c358..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_rule.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - PodRuleType = "podRule" - PodRuleFieldCondition = "condition" - PodRuleFieldPodID = "podId" - PodRuleFieldRestartIntervalSeconds = "restartIntervalSeconds" - PodRuleFieldRestartTimes = "restartTimes" -) - -type PodRule struct { - Condition string `json:"condition,omitempty" yaml:"condition,omitempty"` - PodID string `json:"podId,omitempty" yaml:"podId,omitempty"` - RestartIntervalSeconds int64 `json:"restartIntervalSeconds,omitempty" yaml:"restartIntervalSeconds,omitempty"` - RestartTimes int64 `json:"restartTimes,omitempty" yaml:"restartTimes,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_spec.go deleted file mode 100644 index 0885248326b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_spec.go +++ /dev/null @@ -1,56 +0,0 @@ -package client - -const ( - PodSecurityPolicySpecType = "podSecurityPolicySpec" - PodSecurityPolicySpecFieldAllowPrivilegeEscalation = "allowPrivilegeEscalation" - PodSecurityPolicySpecFieldAllowedCSIDrivers = "allowedCSIDrivers" - PodSecurityPolicySpecFieldAllowedCapabilities = "allowedCapabilities" - PodSecurityPolicySpecFieldAllowedFlexVolumes = "allowedFlexVolumes" - PodSecurityPolicySpecFieldAllowedHostPaths = "allowedHostPaths" - PodSecurityPolicySpecFieldAllowedProcMountTypes = "allowedProcMountTypes" - PodSecurityPolicySpecFieldAllowedUnsafeSysctls = "allowedUnsafeSysctls" - PodSecurityPolicySpecFieldDefaultAddCapabilities = "defaultAddCapabilities" - PodSecurityPolicySpecFieldDefaultAllowPrivilegeEscalation = "defaultAllowPrivilegeEscalation" - PodSecurityPolicySpecFieldFSGroup = "fsGroup" - PodSecurityPolicySpecFieldForbiddenSysctls = "forbiddenSysctls" - PodSecurityPolicySpecFieldHostIPC = "hostIPC" - PodSecurityPolicySpecFieldHostNetwork = "hostNetwork" - PodSecurityPolicySpecFieldHostPID = "hostPID" - PodSecurityPolicySpecFieldHostPorts = "hostPorts" - PodSecurityPolicySpecFieldPrivileged = "privileged" - PodSecurityPolicySpecFieldReadOnlyRootFilesystem = "readOnlyRootFilesystem" - PodSecurityPolicySpecFieldRequiredDropCapabilities = "requiredDropCapabilities" - PodSecurityPolicySpecFieldRunAsGroup = "runAsGroup" - PodSecurityPolicySpecFieldRunAsUser = "runAsUser" - PodSecurityPolicySpecFieldRuntimeClass = "runtimeClass" - PodSecurityPolicySpecFieldSELinux = "seLinux" - PodSecurityPolicySpecFieldSupplementalGroups = "supplementalGroups" - PodSecurityPolicySpecFieldVolumes = "volumes" -) - -type PodSecurityPolicySpec struct { - AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" yaml:"allowPrivilegeEscalation,omitempty"` - AllowedCSIDrivers []AllowedCSIDriver `json:"allowedCSIDrivers,omitempty" yaml:"allowedCSIDrivers,omitempty"` - AllowedCapabilities []string `json:"allowedCapabilities,omitempty" yaml:"allowedCapabilities,omitempty"` - AllowedFlexVolumes []AllowedFlexVolume `json:"allowedFlexVolumes,omitempty" yaml:"allowedFlexVolumes,omitempty"` - AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty" yaml:"allowedHostPaths,omitempty"` - AllowedProcMountTypes []string `json:"allowedProcMountTypes,omitempty" yaml:"allowedProcMountTypes,omitempty"` - AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty" yaml:"allowedUnsafeSysctls,omitempty"` - DefaultAddCapabilities []string `json:"defaultAddCapabilities,omitempty" yaml:"defaultAddCapabilities,omitempty"` - DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty" yaml:"defaultAllowPrivilegeEscalation,omitempty"` - FSGroup *FSGroupStrategyOptions `json:"fsGroup,omitempty" yaml:"fsGroup,omitempty"` - ForbiddenSysctls []string `json:"forbiddenSysctls,omitempty" yaml:"forbiddenSysctls,omitempty"` - HostIPC bool `json:"hostIPC,omitempty" yaml:"hostIPC,omitempty"` - HostNetwork bool `json:"hostNetwork,omitempty" yaml:"hostNetwork,omitempty"` - HostPID bool `json:"hostPID,omitempty" yaml:"hostPID,omitempty"` - HostPorts []HostPortRange `json:"hostPorts,omitempty" yaml:"hostPorts,omitempty"` - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty" yaml:"readOnlyRootFilesystem,omitempty"` - RequiredDropCapabilities []string `json:"requiredDropCapabilities,omitempty" yaml:"requiredDropCapabilities,omitempty"` - RunAsGroup *RunAsGroupStrategyOptions `json:"runAsGroup,omitempty" yaml:"runAsGroup,omitempty"` - RunAsUser *RunAsUserStrategyOptions `json:"runAsUser,omitempty" yaml:"runAsUser,omitempty"` - RuntimeClass *RuntimeClassStrategyOptions `json:"runtimeClass,omitempty" yaml:"runtimeClass,omitempty"` - SELinux *SELinuxStrategyOptions `json:"seLinux,omitempty" yaml:"seLinux,omitempty"` - SupplementalGroups *SupplementalGroupsStrategyOptions `json:"supplementalGroups,omitempty" yaml:"supplementalGroups,omitempty"` - Volumes []string `json:"volumes,omitempty" yaml:"volumes,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template.go deleted file mode 100644 index 69b67f289e2..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - PodSecurityPolicyTemplateType = "podSecurityPolicyTemplate" - PodSecurityPolicyTemplateFieldAllowPrivilegeEscalation = "allowPrivilegeEscalation" - PodSecurityPolicyTemplateFieldAllowedCSIDrivers = "allowedCSIDrivers" - PodSecurityPolicyTemplateFieldAllowedCapabilities = "allowedCapabilities" - PodSecurityPolicyTemplateFieldAllowedFlexVolumes = "allowedFlexVolumes" - PodSecurityPolicyTemplateFieldAllowedHostPaths = "allowedHostPaths" - PodSecurityPolicyTemplateFieldAllowedProcMountTypes = "allowedProcMountTypes" - PodSecurityPolicyTemplateFieldAllowedUnsafeSysctls = "allowedUnsafeSysctls" - PodSecurityPolicyTemplateFieldAnnotations = "annotations" - PodSecurityPolicyTemplateFieldCreated = "created" - PodSecurityPolicyTemplateFieldCreatorID = "creatorId" - PodSecurityPolicyTemplateFieldDefaultAddCapabilities = "defaultAddCapabilities" - PodSecurityPolicyTemplateFieldDefaultAllowPrivilegeEscalation = "defaultAllowPrivilegeEscalation" - PodSecurityPolicyTemplateFieldDescription = "description" - PodSecurityPolicyTemplateFieldFSGroup = "fsGroup" - PodSecurityPolicyTemplateFieldForbiddenSysctls = "forbiddenSysctls" - PodSecurityPolicyTemplateFieldHostIPC = "hostIPC" - PodSecurityPolicyTemplateFieldHostNetwork = "hostNetwork" - PodSecurityPolicyTemplateFieldHostPID = "hostPID" - PodSecurityPolicyTemplateFieldHostPorts = "hostPorts" - PodSecurityPolicyTemplateFieldLabels = "labels" - PodSecurityPolicyTemplateFieldName = "name" - PodSecurityPolicyTemplateFieldOwnerReferences = "ownerReferences" - PodSecurityPolicyTemplateFieldPrivileged = "privileged" - PodSecurityPolicyTemplateFieldReadOnlyRootFilesystem = "readOnlyRootFilesystem" - PodSecurityPolicyTemplateFieldRemoved = "removed" - PodSecurityPolicyTemplateFieldRequiredDropCapabilities = "requiredDropCapabilities" - PodSecurityPolicyTemplateFieldRunAsGroup = "runAsGroup" - PodSecurityPolicyTemplateFieldRunAsUser = "runAsUser" - PodSecurityPolicyTemplateFieldRuntimeClass = "runtimeClass" - PodSecurityPolicyTemplateFieldSELinux = "seLinux" - PodSecurityPolicyTemplateFieldSupplementalGroups = "supplementalGroups" - PodSecurityPolicyTemplateFieldUUID = "uuid" - PodSecurityPolicyTemplateFieldVolumes = "volumes" -) - -type PodSecurityPolicyTemplate struct { - types.Resource - AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" yaml:"allowPrivilegeEscalation,omitempty"` - AllowedCSIDrivers []AllowedCSIDriver `json:"allowedCSIDrivers,omitempty" yaml:"allowedCSIDrivers,omitempty"` - AllowedCapabilities []string `json:"allowedCapabilities,omitempty" yaml:"allowedCapabilities,omitempty"` - AllowedFlexVolumes []AllowedFlexVolume `json:"allowedFlexVolumes,omitempty" yaml:"allowedFlexVolumes,omitempty"` - AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty" yaml:"allowedHostPaths,omitempty"` - AllowedProcMountTypes []string `json:"allowedProcMountTypes,omitempty" yaml:"allowedProcMountTypes,omitempty"` - AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty" yaml:"allowedUnsafeSysctls,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DefaultAddCapabilities []string `json:"defaultAddCapabilities,omitempty" yaml:"defaultAddCapabilities,omitempty"` - DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty" yaml:"defaultAllowPrivilegeEscalation,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - FSGroup *FSGroupStrategyOptions `json:"fsGroup,omitempty" yaml:"fsGroup,omitempty"` - ForbiddenSysctls []string `json:"forbiddenSysctls,omitempty" yaml:"forbiddenSysctls,omitempty"` - HostIPC bool `json:"hostIPC,omitempty" yaml:"hostIPC,omitempty"` - HostNetwork bool `json:"hostNetwork,omitempty" yaml:"hostNetwork,omitempty"` - HostPID bool `json:"hostPID,omitempty" yaml:"hostPID,omitempty"` - HostPorts []HostPortRange `json:"hostPorts,omitempty" yaml:"hostPorts,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty" yaml:"readOnlyRootFilesystem,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RequiredDropCapabilities []string `json:"requiredDropCapabilities,omitempty" yaml:"requiredDropCapabilities,omitempty"` - RunAsGroup *RunAsGroupStrategyOptions `json:"runAsGroup,omitempty" yaml:"runAsGroup,omitempty"` - RunAsUser *RunAsUserStrategyOptions `json:"runAsUser,omitempty" yaml:"runAsUser,omitempty"` - RuntimeClass *RuntimeClassStrategyOptions `json:"runtimeClass,omitempty" yaml:"runtimeClass,omitempty"` - SELinux *SELinuxStrategyOptions `json:"seLinux,omitempty" yaml:"seLinux,omitempty"` - SupplementalGroups *SupplementalGroupsStrategyOptions `json:"supplementalGroups,omitempty" yaml:"supplementalGroups,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Volumes []string `json:"volumes,omitempty" yaml:"volumes,omitempty"` -} - -type PodSecurityPolicyTemplateCollection struct { - types.Collection - Data []PodSecurityPolicyTemplate `json:"data,omitempty"` - client *PodSecurityPolicyTemplateClient -} - -type PodSecurityPolicyTemplateClient struct { - apiClient *Client -} - -type PodSecurityPolicyTemplateOperations interface { - List(opts *types.ListOpts) (*PodSecurityPolicyTemplateCollection, error) - ListAll(opts *types.ListOpts) (*PodSecurityPolicyTemplateCollection, error) - Create(opts *PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) - Update(existing *PodSecurityPolicyTemplate, updates interface{}) (*PodSecurityPolicyTemplate, error) - Replace(existing *PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) - ByID(id string) (*PodSecurityPolicyTemplate, error) - Delete(container *PodSecurityPolicyTemplate) error -} - -func newPodSecurityPolicyTemplateClient(apiClient *Client) *PodSecurityPolicyTemplateClient { - return &PodSecurityPolicyTemplateClient{ - apiClient: apiClient, - } -} - -func (c *PodSecurityPolicyTemplateClient) Create(container *PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) { - resp := &PodSecurityPolicyTemplate{} - err := c.apiClient.Ops.DoCreate(PodSecurityPolicyTemplateType, container, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateClient) Update(existing *PodSecurityPolicyTemplate, updates interface{}) (*PodSecurityPolicyTemplate, error) { - resp := &PodSecurityPolicyTemplate{} - err := c.apiClient.Ops.DoUpdate(PodSecurityPolicyTemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateClient) Replace(obj *PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) { - resp := &PodSecurityPolicyTemplate{} - err := c.apiClient.Ops.DoReplace(PodSecurityPolicyTemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateClient) List(opts *types.ListOpts) (*PodSecurityPolicyTemplateCollection, error) { - resp := &PodSecurityPolicyTemplateCollection{} - err := c.apiClient.Ops.DoList(PodSecurityPolicyTemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *PodSecurityPolicyTemplateClient) ListAll(opts *types.ListOpts) (*PodSecurityPolicyTemplateCollection, error) { - resp := &PodSecurityPolicyTemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *PodSecurityPolicyTemplateCollection) Next() (*PodSecurityPolicyTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PodSecurityPolicyTemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PodSecurityPolicyTemplateClient) ByID(id string) (*PodSecurityPolicyTemplate, error) { - resp := &PodSecurityPolicyTemplate{} - err := c.apiClient.Ops.DoByID(PodSecurityPolicyTemplateType, id, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateClient) Delete(container *PodSecurityPolicyTemplate) error { - return c.apiClient.Ops.DoResourceDelete(PodSecurityPolicyTemplateType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template_project_binding.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template_project_binding.go deleted file mode 100644 index 548f438f03c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_pod_security_policy_template_project_binding.go +++ /dev/null @@ -1,124 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - PodSecurityPolicyTemplateProjectBindingType = "podSecurityPolicyTemplateProjectBinding" - PodSecurityPolicyTemplateProjectBindingFieldAnnotations = "annotations" - PodSecurityPolicyTemplateProjectBindingFieldCreated = "created" - PodSecurityPolicyTemplateProjectBindingFieldCreatorID = "creatorId" - PodSecurityPolicyTemplateProjectBindingFieldLabels = "labels" - PodSecurityPolicyTemplateProjectBindingFieldName = "name" - PodSecurityPolicyTemplateProjectBindingFieldNamespaceId = "namespaceId" - PodSecurityPolicyTemplateProjectBindingFieldOwnerReferences = "ownerReferences" - PodSecurityPolicyTemplateProjectBindingFieldPodSecurityPolicyTemplateName = "podSecurityPolicyTemplateId" - PodSecurityPolicyTemplateProjectBindingFieldRemoved = "removed" - PodSecurityPolicyTemplateProjectBindingFieldTargetProjectName = "targetProjectId" - PodSecurityPolicyTemplateProjectBindingFieldUUID = "uuid" -) - -type PodSecurityPolicyTemplateProjectBinding struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId,omitempty" yaml:"podSecurityPolicyTemplateId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - TargetProjectName string `json:"targetProjectId,omitempty" yaml:"targetProjectId,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PodSecurityPolicyTemplateProjectBindingCollection struct { - types.Collection - Data []PodSecurityPolicyTemplateProjectBinding `json:"data,omitempty"` - client *PodSecurityPolicyTemplateProjectBindingClient -} - -type PodSecurityPolicyTemplateProjectBindingClient struct { - apiClient *Client -} - -type PodSecurityPolicyTemplateProjectBindingOperations interface { - List(opts *types.ListOpts) (*PodSecurityPolicyTemplateProjectBindingCollection, error) - ListAll(opts *types.ListOpts) (*PodSecurityPolicyTemplateProjectBindingCollection, error) - Create(opts *PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) - Update(existing *PodSecurityPolicyTemplateProjectBinding, updates interface{}) (*PodSecurityPolicyTemplateProjectBinding, error) - Replace(existing *PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) - ByID(id string) (*PodSecurityPolicyTemplateProjectBinding, error) - Delete(container *PodSecurityPolicyTemplateProjectBinding) error -} - -func newPodSecurityPolicyTemplateProjectBindingClient(apiClient *Client) *PodSecurityPolicyTemplateProjectBindingClient { - return &PodSecurityPolicyTemplateProjectBindingClient{ - apiClient: apiClient, - } -} - -func (c *PodSecurityPolicyTemplateProjectBindingClient) Create(container *PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) { - resp := &PodSecurityPolicyTemplateProjectBinding{} - err := c.apiClient.Ops.DoCreate(PodSecurityPolicyTemplateProjectBindingType, container, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateProjectBindingClient) Update(existing *PodSecurityPolicyTemplateProjectBinding, updates interface{}) (*PodSecurityPolicyTemplateProjectBinding, error) { - resp := &PodSecurityPolicyTemplateProjectBinding{} - err := c.apiClient.Ops.DoUpdate(PodSecurityPolicyTemplateProjectBindingType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateProjectBindingClient) Replace(obj *PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) { - resp := &PodSecurityPolicyTemplateProjectBinding{} - err := c.apiClient.Ops.DoReplace(PodSecurityPolicyTemplateProjectBindingType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateProjectBindingClient) List(opts *types.ListOpts) (*PodSecurityPolicyTemplateProjectBindingCollection, error) { - resp := &PodSecurityPolicyTemplateProjectBindingCollection{} - err := c.apiClient.Ops.DoList(PodSecurityPolicyTemplateProjectBindingType, opts, resp) - resp.client = c - return resp, err -} - -func (c *PodSecurityPolicyTemplateProjectBindingClient) ListAll(opts *types.ListOpts) (*PodSecurityPolicyTemplateProjectBindingCollection, error) { - resp := &PodSecurityPolicyTemplateProjectBindingCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *PodSecurityPolicyTemplateProjectBindingCollection) Next() (*PodSecurityPolicyTemplateProjectBindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PodSecurityPolicyTemplateProjectBindingCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PodSecurityPolicyTemplateProjectBindingClient) ByID(id string) (*PodSecurityPolicyTemplateProjectBinding, error) { - resp := &PodSecurityPolicyTemplateProjectBinding{} - err := c.apiClient.Ops.DoByID(PodSecurityPolicyTemplateProjectBindingType, id, resp) - return resp, err -} - -func (c *PodSecurityPolicyTemplateProjectBindingClient) Delete(container *PodSecurityPolicyTemplateProjectBinding) error { - return c.apiClient.Ops.DoResourceDelete(PodSecurityPolicyTemplateProjectBindingType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_policy_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_policy_rule.go deleted file mode 100644 index b7a51ca27ef..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_policy_rule.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - PolicyRuleType = "policyRule" - PolicyRuleFieldAPIGroups = "apiGroups" - PolicyRuleFieldNonResourceURLs = "nonResourceURLs" - PolicyRuleFieldResourceNames = "resourceNames" - PolicyRuleFieldResources = "resources" - PolicyRuleFieldVerbs = "verbs" -) - -type PolicyRule struct { - APIGroups []string `json:"apiGroups,omitempty" yaml:"apiGroups,omitempty"` - NonResourceURLs []string `json:"nonResourceURLs,omitempty" yaml:"nonResourceURLs,omitempty"` - ResourceNames []string `json:"resourceNames,omitempty" yaml:"resourceNames,omitempty"` - Resources []string `json:"resources,omitempty" yaml:"resources,omitempty"` - Verbs []string `json:"verbs,omitempty" yaml:"verbs,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_port_check.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_port_check.go deleted file mode 100644 index 2e9c37e5943..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_port_check.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - PortCheckType = "portCheck" - PortCheckFieldAddress = "address" - PortCheckFieldPort = "port" - PortCheckFieldProtocol = "protocol" -) - -type PortCheck struct { - Address string `json:"address,omitempty" yaml:"address,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_portworx_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_portworx_volume_source.go deleted file mode 100644 index cbe98c6525e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_portworx_volume_source.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - PortworxVolumeSourceType = "portworxVolumeSource" - PortworxVolumeSourceFieldFSType = "fsType" - PortworxVolumeSourceFieldReadOnly = "readOnly" - PortworxVolumeSourceFieldVolumeID = "volumeID" -) - -type PortworxVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - VolumeID string `json:"volumeID,omitempty" yaml:"volumeID,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_preference.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_preference.go deleted file mode 100644 index 5028069c4b7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_preference.go +++ /dev/null @@ -1,122 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - PreferenceType = "preference" - PreferenceFieldAnnotations = "annotations" - PreferenceFieldCreated = "created" - PreferenceFieldCreatorID = "creatorId" - PreferenceFieldLabels = "labels" - PreferenceFieldName = "name" - PreferenceFieldNamespaceId = "namespaceId" - PreferenceFieldOwnerReferences = "ownerReferences" - PreferenceFieldRemoved = "removed" - PreferenceFieldUUID = "uuid" - PreferenceFieldValue = "value" -) - -type Preference struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type PreferenceCollection struct { - types.Collection - Data []Preference `json:"data,omitempty"` - client *PreferenceClient -} - -type PreferenceClient struct { - apiClient *Client -} - -type PreferenceOperations interface { - List(opts *types.ListOpts) (*PreferenceCollection, error) - ListAll(opts *types.ListOpts) (*PreferenceCollection, error) - Create(opts *Preference) (*Preference, error) - Update(existing *Preference, updates interface{}) (*Preference, error) - Replace(existing *Preference) (*Preference, error) - ByID(id string) (*Preference, error) - Delete(container *Preference) error -} - -func newPreferenceClient(apiClient *Client) *PreferenceClient { - return &PreferenceClient{ - apiClient: apiClient, - } -} - -func (c *PreferenceClient) Create(container *Preference) (*Preference, error) { - resp := &Preference{} - err := c.apiClient.Ops.DoCreate(PreferenceType, container, resp) - return resp, err -} - -func (c *PreferenceClient) Update(existing *Preference, updates interface{}) (*Preference, error) { - resp := &Preference{} - err := c.apiClient.Ops.DoUpdate(PreferenceType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PreferenceClient) Replace(obj *Preference) (*Preference, error) { - resp := &Preference{} - err := c.apiClient.Ops.DoReplace(PreferenceType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *PreferenceClient) List(opts *types.ListOpts) (*PreferenceCollection, error) { - resp := &PreferenceCollection{} - err := c.apiClient.Ops.DoList(PreferenceType, opts, resp) - resp.client = c - return resp, err -} - -func (c *PreferenceClient) ListAll(opts *types.ListOpts) (*PreferenceCollection, error) { - resp := &PreferenceCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *PreferenceCollection) Next() (*PreferenceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PreferenceCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PreferenceClient) ByID(id string) (*Preference, error) { - resp := &Preference{} - err := c.apiClient.Ops.DoByID(PreferenceType, id, resp) - return resp, err -} - -func (c *PreferenceClient) Delete(container *Preference) error { - return c.apiClient.Ops.DoResourceDelete(PreferenceType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_preferred_scheduling_term.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_preferred_scheduling_term.go deleted file mode 100644 index b5be217c29d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_preferred_scheduling_term.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - PreferredSchedulingTermType = "preferredSchedulingTerm" - PreferredSchedulingTermFieldPreference = "preference" - PreferredSchedulingTermFieldWeight = "weight" -) - -type PreferredSchedulingTerm struct { - Preference *NodeSelectorTerm `json:"preference,omitempty" yaml:"preference,omitempty"` - Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_principal.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_principal.go deleted file mode 100644 index 1f51a8b122f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_principal.go +++ /dev/null @@ -1,142 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - PrincipalType = "principal" - PrincipalFieldAnnotations = "annotations" - PrincipalFieldCreated = "created" - PrincipalFieldCreatorID = "creatorId" - PrincipalFieldExtraInfo = "extraInfo" - PrincipalFieldLabels = "labels" - PrincipalFieldLoginName = "loginName" - PrincipalFieldMe = "me" - PrincipalFieldMemberOf = "memberOf" - PrincipalFieldName = "name" - PrincipalFieldOwnerReferences = "ownerReferences" - PrincipalFieldPrincipalType = "principalType" - PrincipalFieldProfilePicture = "profilePicture" - PrincipalFieldProfileURL = "profileURL" - PrincipalFieldProvider = "provider" - PrincipalFieldRemoved = "removed" - PrincipalFieldUUID = "uuid" -) - -type Principal struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - ExtraInfo map[string]string `json:"extraInfo,omitempty" yaml:"extraInfo,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LoginName string `json:"loginName,omitempty" yaml:"loginName,omitempty"` - Me bool `json:"me,omitempty" yaml:"me,omitempty"` - MemberOf bool `json:"memberOf,omitempty" yaml:"memberOf,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PrincipalType string `json:"principalType,omitempty" yaml:"principalType,omitempty"` - ProfilePicture string `json:"profilePicture,omitempty" yaml:"profilePicture,omitempty"` - ProfileURL string `json:"profileURL,omitempty" yaml:"profileURL,omitempty"` - Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PrincipalCollection struct { - types.Collection - Data []Principal `json:"data,omitempty"` - client *PrincipalClient -} - -type PrincipalClient struct { - apiClient *Client -} - -type PrincipalOperations interface { - List(opts *types.ListOpts) (*PrincipalCollection, error) - ListAll(opts *types.ListOpts) (*PrincipalCollection, error) - Create(opts *Principal) (*Principal, error) - Update(existing *Principal, updates interface{}) (*Principal, error) - Replace(existing *Principal) (*Principal, error) - ByID(id string) (*Principal, error) - Delete(container *Principal) error - - CollectionActionSearch(resource *PrincipalCollection, input *SearchPrincipalsInput) (*PrincipalCollection, error) -} - -func newPrincipalClient(apiClient *Client) *PrincipalClient { - return &PrincipalClient{ - apiClient: apiClient, - } -} - -func (c *PrincipalClient) Create(container *Principal) (*Principal, error) { - resp := &Principal{} - err := c.apiClient.Ops.DoCreate(PrincipalType, container, resp) - return resp, err -} - -func (c *PrincipalClient) Update(existing *Principal, updates interface{}) (*Principal, error) { - resp := &Principal{} - err := c.apiClient.Ops.DoUpdate(PrincipalType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PrincipalClient) Replace(obj *Principal) (*Principal, error) { - resp := &Principal{} - err := c.apiClient.Ops.DoReplace(PrincipalType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *PrincipalClient) List(opts *types.ListOpts) (*PrincipalCollection, error) { - resp := &PrincipalCollection{} - err := c.apiClient.Ops.DoList(PrincipalType, opts, resp) - resp.client = c - return resp, err -} - -func (c *PrincipalClient) ListAll(opts *types.ListOpts) (*PrincipalCollection, error) { - resp := &PrincipalCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *PrincipalCollection) Next() (*PrincipalCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PrincipalCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PrincipalClient) ByID(id string) (*Principal, error) { - resp := &Principal{} - err := c.apiClient.Ops.DoByID(PrincipalType, id, resp) - return resp, err -} - -func (c *PrincipalClient) Delete(container *Principal) error { - return c.apiClient.Ops.DoResourceDelete(PrincipalType, &container.Resource) -} - -func (c *PrincipalClient) CollectionActionSearch(resource *PrincipalCollection, input *SearchPrincipalsInput) (*PrincipalCollection, error) { - resp := &PrincipalCollection{} - err := c.apiClient.Ops.DoCollectionAction(PrincipalType, "search", &resource.Collection, input, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_private_registry.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_private_registry.go deleted file mode 100644 index 1f6f1999148..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_private_registry.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - PrivateRegistryType = "privateRegistry" - PrivateRegistryFieldECRCredentialPlugin = "ecrCredentialPlugin" - PrivateRegistryFieldIsDefault = "isDefault" - PrivateRegistryFieldPassword = "password" - PrivateRegistryFieldURL = "url" - PrivateRegistryFieldUser = "user" -) - -type PrivateRegistry struct { - ECRCredentialPlugin *ECRCredentialPlugin `json:"ecrCredentialPlugin,omitempty" yaml:"ecrCredentialPlugin,omitempty"` - IsDefault bool `json:"isDefault,omitempty" yaml:"isDefault,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_process.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_process.go deleted file mode 100644 index 425fd657d14..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_process.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -const ( - ProcessType = "process" - ProcessFieldArgs = "args" - ProcessFieldBinds = "binds" - ProcessFieldCommand = "command" - ProcessFieldEnv = "env" - ProcessFieldHealthCheck = "healthCheck" - ProcessFieldImage = "image" - ProcessFieldImageRegistryAuthConfig = "imageRegistryAuthConfig" - ProcessFieldLabels = "labels" - ProcessFieldName = "name" - ProcessFieldNetworkMode = "networkMode" - ProcessFieldPidMode = "pidMode" - ProcessFieldPrivileged = "privileged" - ProcessFieldPublish = "publish" - ProcessFieldRestartPolicy = "restartPolicy" - ProcessFieldUser = "user" - ProcessFieldVolumesFrom = "volumesFrom" -) - -type Process struct { - Args []string `json:"args,omitempty" yaml:"args,omitempty"` - Binds []string `json:"binds,omitempty" yaml:"binds,omitempty"` - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - Env []string `json:"env,omitempty" yaml:"env,omitempty"` - HealthCheck *HealthCheck `json:"healthCheck,omitempty" yaml:"healthCheck,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - ImageRegistryAuthConfig string `json:"imageRegistryAuthConfig,omitempty" yaml:"imageRegistryAuthConfig,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NetworkMode string `json:"networkMode,omitempty" yaml:"networkMode,omitempty"` - PidMode string `json:"pidMode,omitempty" yaml:"pidMode,omitempty"` - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - Publish []string `json:"publish,omitempty" yaml:"publish,omitempty"` - RestartPolicy string `json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` - VolumesFrom []string `json:"volumesFrom,omitempty" yaml:"volumesFrom,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project.go deleted file mode 100644 index 12cd2073a0c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project.go +++ /dev/null @@ -1,188 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectType = "project" - ProjectFieldAnnotations = "annotations" - ProjectFieldClusterID = "clusterId" - ProjectFieldConditions = "conditions" - ProjectFieldContainerDefaultResourceLimit = "containerDefaultResourceLimit" - ProjectFieldCreated = "created" - ProjectFieldCreatorID = "creatorId" - ProjectFieldDescription = "description" - ProjectFieldEnableProjectMonitoring = "enableProjectMonitoring" - ProjectFieldLabels = "labels" - ProjectFieldMonitoringStatus = "monitoringStatus" - ProjectFieldName = "name" - ProjectFieldNamespaceDefaultResourceQuota = "namespaceDefaultResourceQuota" - ProjectFieldNamespaceId = "namespaceId" - ProjectFieldOwnerReferences = "ownerReferences" - ProjectFieldPodSecurityPolicyTemplateName = "podSecurityPolicyTemplateId" - ProjectFieldRemoved = "removed" - ProjectFieldResourceQuota = "resourceQuota" - ProjectFieldState = "state" - ProjectFieldTransitioning = "transitioning" - ProjectFieldTransitioningMessage = "transitioningMessage" - ProjectFieldUUID = "uuid" -) - -type Project struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Conditions []ProjectCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - ContainerDefaultResourceLimit *ContainerResourceLimit `json:"containerDefaultResourceLimit,omitempty" yaml:"containerDefaultResourceLimit,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - EnableProjectMonitoring bool `json:"enableProjectMonitoring,omitempty" yaml:"enableProjectMonitoring,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty" yaml:"monitoringStatus,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceDefaultResourceQuota *NamespaceResourceQuota `json:"namespaceDefaultResourceQuota,omitempty" yaml:"namespaceDefaultResourceQuota,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId,omitempty" yaml:"podSecurityPolicyTemplateId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ResourceQuota *ProjectResourceQuota `json:"resourceQuota,omitempty" yaml:"resourceQuota,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectCollection struct { - types.Collection - Data []Project `json:"data,omitempty"` - client *ProjectClient -} - -type ProjectClient struct { - apiClient *Client -} - -type ProjectOperations interface { - List(opts *types.ListOpts) (*ProjectCollection, error) - ListAll(opts *types.ListOpts) (*ProjectCollection, error) - Create(opts *Project) (*Project, error) - Update(existing *Project, updates interface{}) (*Project, error) - Replace(existing *Project) (*Project, error) - ByID(id string) (*Project, error) - Delete(container *Project) error - - ActionDisableMonitoring(resource *Project) error - - ActionEditMonitoring(resource *Project, input *MonitoringInput) error - - ActionEnableMonitoring(resource *Project, input *MonitoringInput) error - - ActionExportYaml(resource *Project) error - - ActionSetpodsecuritypolicytemplate(resource *Project, input *SetPodSecurityPolicyTemplateInput) (*Project, error) - - ActionViewMonitoring(resource *Project) (*MonitoringOutput, error) -} - -func newProjectClient(apiClient *Client) *ProjectClient { - return &ProjectClient{ - apiClient: apiClient, - } -} - -func (c *ProjectClient) Create(container *Project) (*Project, error) { - resp := &Project{} - err := c.apiClient.Ops.DoCreate(ProjectType, container, resp) - return resp, err -} - -func (c *ProjectClient) Update(existing *Project, updates interface{}) (*Project, error) { - resp := &Project{} - err := c.apiClient.Ops.DoUpdate(ProjectType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectClient) Replace(obj *Project) (*Project, error) { - resp := &Project{} - err := c.apiClient.Ops.DoReplace(ProjectType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectClient) List(opts *types.ListOpts) (*ProjectCollection, error) { - resp := &ProjectCollection{} - err := c.apiClient.Ops.DoList(ProjectType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectClient) ListAll(opts *types.ListOpts) (*ProjectCollection, error) { - resp := &ProjectCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectCollection) Next() (*ProjectCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectClient) ByID(id string) (*Project, error) { - resp := &Project{} - err := c.apiClient.Ops.DoByID(ProjectType, id, resp) - return resp, err -} - -func (c *ProjectClient) Delete(container *Project) error { - return c.apiClient.Ops.DoResourceDelete(ProjectType, &container.Resource) -} - -func (c *ProjectClient) ActionDisableMonitoring(resource *Project) error { - err := c.apiClient.Ops.DoAction(ProjectType, "disableMonitoring", &resource.Resource, nil, nil) - return err -} - -func (c *ProjectClient) ActionEditMonitoring(resource *Project, input *MonitoringInput) error { - err := c.apiClient.Ops.DoAction(ProjectType, "editMonitoring", &resource.Resource, input, nil) - return err -} - -func (c *ProjectClient) ActionEnableMonitoring(resource *Project, input *MonitoringInput) error { - err := c.apiClient.Ops.DoAction(ProjectType, "enableMonitoring", &resource.Resource, input, nil) - return err -} - -func (c *ProjectClient) ActionExportYaml(resource *Project) error { - err := c.apiClient.Ops.DoAction(ProjectType, "exportYaml", &resource.Resource, nil, nil) - return err -} - -func (c *ProjectClient) ActionSetpodsecuritypolicytemplate(resource *Project, input *SetPodSecurityPolicyTemplateInput) (*Project, error) { - resp := &Project{} - err := c.apiClient.Ops.DoAction(ProjectType, "setpodsecuritypolicytemplate", &resource.Resource, input, resp) - return resp, err -} - -func (c *ProjectClient) ActionViewMonitoring(resource *Project) (*MonitoringOutput, error) { - resp := &MonitoringOutput{} - err := c.apiClient.Ops.DoAction(ProjectType, "viewMonitoring", &resource.Resource, nil, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert.go deleted file mode 100644 index 61d0c1fed96..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert.go +++ /dev/null @@ -1,146 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectAlertType = "projectAlert" - ProjectAlertFieldAnnotations = "annotations" - ProjectAlertFieldCreated = "created" - ProjectAlertFieldCreatorID = "creatorId" - ProjectAlertFieldDescription = "description" - ProjectAlertFieldDisplayName = "displayName" - ProjectAlertFieldInitialWaitSeconds = "initialWaitSeconds" - ProjectAlertFieldLabels = "labels" - ProjectAlertFieldName = "name" - ProjectAlertFieldNamespaceId = "namespaceId" - ProjectAlertFieldOwnerReferences = "ownerReferences" - ProjectAlertFieldProjectID = "projectId" - ProjectAlertFieldRecipients = "recipients" - ProjectAlertFieldRemoved = "removed" - ProjectAlertFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ProjectAlertFieldSeverity = "severity" - ProjectAlertFieldState = "state" - ProjectAlertFieldStatus = "status" - ProjectAlertFieldTargetPod = "targetPod" - ProjectAlertFieldTargetWorkload = "targetWorkload" - ProjectAlertFieldTransitioning = "transitioning" - ProjectAlertFieldTransitioningMessage = "transitioningMessage" - ProjectAlertFieldUUID = "uuid" -) - -type ProjectAlert struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - InitialWaitSeconds int64 `json:"initialWaitSeconds,omitempty" yaml:"initialWaitSeconds,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *AlertStatus `json:"status,omitempty" yaml:"status,omitempty"` - TargetPod *TargetPod `json:"targetPod,omitempty" yaml:"targetPod,omitempty"` - TargetWorkload *TargetWorkload `json:"targetWorkload,omitempty" yaml:"targetWorkload,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectAlertCollection struct { - types.Collection - Data []ProjectAlert `json:"data,omitempty"` - client *ProjectAlertClient -} - -type ProjectAlertClient struct { - apiClient *Client -} - -type ProjectAlertOperations interface { - List(opts *types.ListOpts) (*ProjectAlertCollection, error) - ListAll(opts *types.ListOpts) (*ProjectAlertCollection, error) - Create(opts *ProjectAlert) (*ProjectAlert, error) - Update(existing *ProjectAlert, updates interface{}) (*ProjectAlert, error) - Replace(existing *ProjectAlert) (*ProjectAlert, error) - ByID(id string) (*ProjectAlert, error) - Delete(container *ProjectAlert) error -} - -func newProjectAlertClient(apiClient *Client) *ProjectAlertClient { - return &ProjectAlertClient{ - apiClient: apiClient, - } -} - -func (c *ProjectAlertClient) Create(container *ProjectAlert) (*ProjectAlert, error) { - resp := &ProjectAlert{} - err := c.apiClient.Ops.DoCreate(ProjectAlertType, container, resp) - return resp, err -} - -func (c *ProjectAlertClient) Update(existing *ProjectAlert, updates interface{}) (*ProjectAlert, error) { - resp := &ProjectAlert{} - err := c.apiClient.Ops.DoUpdate(ProjectAlertType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectAlertClient) Replace(obj *ProjectAlert) (*ProjectAlert, error) { - resp := &ProjectAlert{} - err := c.apiClient.Ops.DoReplace(ProjectAlertType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectAlertClient) List(opts *types.ListOpts) (*ProjectAlertCollection, error) { - resp := &ProjectAlertCollection{} - err := c.apiClient.Ops.DoList(ProjectAlertType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectAlertClient) ListAll(opts *types.ListOpts) (*ProjectAlertCollection, error) { - resp := &ProjectAlertCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectAlertCollection) Next() (*ProjectAlertCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectAlertCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectAlertClient) ByID(id string) (*ProjectAlert, error) { - resp := &ProjectAlert{} - err := c.apiClient.Ops.DoByID(ProjectAlertType, id, resp) - return resp, err -} - -func (c *ProjectAlertClient) Delete(container *ProjectAlert) error { - return c.apiClient.Ops.DoResourceDelete(ProjectAlertType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_group.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_group.go deleted file mode 100644 index 270755b33b0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_group.go +++ /dev/null @@ -1,140 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectAlertGroupType = "projectAlertGroup" - ProjectAlertGroupFieldAlertState = "alertState" - ProjectAlertGroupFieldAnnotations = "annotations" - ProjectAlertGroupFieldCreated = "created" - ProjectAlertGroupFieldCreatorID = "creatorId" - ProjectAlertGroupFieldDescription = "description" - ProjectAlertGroupFieldGroupIntervalSeconds = "groupIntervalSeconds" - ProjectAlertGroupFieldGroupWaitSeconds = "groupWaitSeconds" - ProjectAlertGroupFieldLabels = "labels" - ProjectAlertGroupFieldName = "name" - ProjectAlertGroupFieldNamespaceId = "namespaceId" - ProjectAlertGroupFieldOwnerReferences = "ownerReferences" - ProjectAlertGroupFieldProjectID = "projectId" - ProjectAlertGroupFieldRecipients = "recipients" - ProjectAlertGroupFieldRemoved = "removed" - ProjectAlertGroupFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ProjectAlertGroupFieldState = "state" - ProjectAlertGroupFieldTransitioning = "transitioning" - ProjectAlertGroupFieldTransitioningMessage = "transitioningMessage" - ProjectAlertGroupFieldUUID = "uuid" -) - -type ProjectAlertGroup struct { - types.Resource - AlertState string `json:"alertState,omitempty" yaml:"alertState,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectAlertGroupCollection struct { - types.Collection - Data []ProjectAlertGroup `json:"data,omitempty"` - client *ProjectAlertGroupClient -} - -type ProjectAlertGroupClient struct { - apiClient *Client -} - -type ProjectAlertGroupOperations interface { - List(opts *types.ListOpts) (*ProjectAlertGroupCollection, error) - ListAll(opts *types.ListOpts) (*ProjectAlertGroupCollection, error) - Create(opts *ProjectAlertGroup) (*ProjectAlertGroup, error) - Update(existing *ProjectAlertGroup, updates interface{}) (*ProjectAlertGroup, error) - Replace(existing *ProjectAlertGroup) (*ProjectAlertGroup, error) - ByID(id string) (*ProjectAlertGroup, error) - Delete(container *ProjectAlertGroup) error -} - -func newProjectAlertGroupClient(apiClient *Client) *ProjectAlertGroupClient { - return &ProjectAlertGroupClient{ - apiClient: apiClient, - } -} - -func (c *ProjectAlertGroupClient) Create(container *ProjectAlertGroup) (*ProjectAlertGroup, error) { - resp := &ProjectAlertGroup{} - err := c.apiClient.Ops.DoCreate(ProjectAlertGroupType, container, resp) - return resp, err -} - -func (c *ProjectAlertGroupClient) Update(existing *ProjectAlertGroup, updates interface{}) (*ProjectAlertGroup, error) { - resp := &ProjectAlertGroup{} - err := c.apiClient.Ops.DoUpdate(ProjectAlertGroupType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectAlertGroupClient) Replace(obj *ProjectAlertGroup) (*ProjectAlertGroup, error) { - resp := &ProjectAlertGroup{} - err := c.apiClient.Ops.DoReplace(ProjectAlertGroupType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectAlertGroupClient) List(opts *types.ListOpts) (*ProjectAlertGroupCollection, error) { - resp := &ProjectAlertGroupCollection{} - err := c.apiClient.Ops.DoList(ProjectAlertGroupType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectAlertGroupClient) ListAll(opts *types.ListOpts) (*ProjectAlertGroupCollection, error) { - resp := &ProjectAlertGroupCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectAlertGroupCollection) Next() (*ProjectAlertGroupCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectAlertGroupCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectAlertGroupClient) ByID(id string) (*ProjectAlertGroup, error) { - resp := &ProjectAlertGroup{} - err := c.apiClient.Ops.DoByID(ProjectAlertGroupType, id, resp) - return resp, err -} - -func (c *ProjectAlertGroupClient) Delete(container *ProjectAlertGroup) error { - return c.apiClient.Ops.DoResourceDelete(ProjectAlertGroupType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule.go deleted file mode 100644 index 40b94d2077f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule.go +++ /dev/null @@ -1,176 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectAlertRuleType = "projectAlertRule" - ProjectAlertRuleFieldAlertState = "alertState" - ProjectAlertRuleFieldAnnotations = "annotations" - ProjectAlertRuleFieldCreated = "created" - ProjectAlertRuleFieldCreatorID = "creatorId" - ProjectAlertRuleFieldGroupID = "groupId" - ProjectAlertRuleFieldGroupIntervalSeconds = "groupIntervalSeconds" - ProjectAlertRuleFieldGroupWaitSeconds = "groupWaitSeconds" - ProjectAlertRuleFieldInherited = "inherited" - ProjectAlertRuleFieldLabels = "labels" - ProjectAlertRuleFieldMetricRule = "metricRule" - ProjectAlertRuleFieldName = "name" - ProjectAlertRuleFieldNamespaceId = "namespaceId" - ProjectAlertRuleFieldOwnerReferences = "ownerReferences" - ProjectAlertRuleFieldPodRule = "podRule" - ProjectAlertRuleFieldProjectID = "projectId" - ProjectAlertRuleFieldRemoved = "removed" - ProjectAlertRuleFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ProjectAlertRuleFieldSeverity = "severity" - ProjectAlertRuleFieldState = "state" - ProjectAlertRuleFieldTransitioning = "transitioning" - ProjectAlertRuleFieldTransitioningMessage = "transitioningMessage" - ProjectAlertRuleFieldUUID = "uuid" - ProjectAlertRuleFieldWorkloadRule = "workloadRule" -) - -type ProjectAlertRule struct { - types.Resource - AlertState string `json:"alertState,omitempty" yaml:"alertState,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - GroupID string `json:"groupId,omitempty" yaml:"groupId,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - Inherited *bool `json:"inherited,omitempty" yaml:"inherited,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - MetricRule *MetricRule `json:"metricRule,omitempty" yaml:"metricRule,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - PodRule *PodRule `json:"podRule,omitempty" yaml:"podRule,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - WorkloadRule *WorkloadRule `json:"workloadRule,omitempty" yaml:"workloadRule,omitempty"` -} - -type ProjectAlertRuleCollection struct { - types.Collection - Data []ProjectAlertRule `json:"data,omitempty"` - client *ProjectAlertRuleClient -} - -type ProjectAlertRuleClient struct { - apiClient *Client -} - -type ProjectAlertRuleOperations interface { - List(opts *types.ListOpts) (*ProjectAlertRuleCollection, error) - ListAll(opts *types.ListOpts) (*ProjectAlertRuleCollection, error) - Create(opts *ProjectAlertRule) (*ProjectAlertRule, error) - Update(existing *ProjectAlertRule, updates interface{}) (*ProjectAlertRule, error) - Replace(existing *ProjectAlertRule) (*ProjectAlertRule, error) - ByID(id string) (*ProjectAlertRule, error) - Delete(container *ProjectAlertRule) error - - ActionActivate(resource *ProjectAlertRule) error - - ActionDeactivate(resource *ProjectAlertRule) error - - ActionMute(resource *ProjectAlertRule) error - - ActionUnmute(resource *ProjectAlertRule) error -} - -func newProjectAlertRuleClient(apiClient *Client) *ProjectAlertRuleClient { - return &ProjectAlertRuleClient{ - apiClient: apiClient, - } -} - -func (c *ProjectAlertRuleClient) Create(container *ProjectAlertRule) (*ProjectAlertRule, error) { - resp := &ProjectAlertRule{} - err := c.apiClient.Ops.DoCreate(ProjectAlertRuleType, container, resp) - return resp, err -} - -func (c *ProjectAlertRuleClient) Update(existing *ProjectAlertRule, updates interface{}) (*ProjectAlertRule, error) { - resp := &ProjectAlertRule{} - err := c.apiClient.Ops.DoUpdate(ProjectAlertRuleType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectAlertRuleClient) Replace(obj *ProjectAlertRule) (*ProjectAlertRule, error) { - resp := &ProjectAlertRule{} - err := c.apiClient.Ops.DoReplace(ProjectAlertRuleType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectAlertRuleClient) List(opts *types.ListOpts) (*ProjectAlertRuleCollection, error) { - resp := &ProjectAlertRuleCollection{} - err := c.apiClient.Ops.DoList(ProjectAlertRuleType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectAlertRuleClient) ListAll(opts *types.ListOpts) (*ProjectAlertRuleCollection, error) { - resp := &ProjectAlertRuleCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectAlertRuleCollection) Next() (*ProjectAlertRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectAlertRuleCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectAlertRuleClient) ByID(id string) (*ProjectAlertRule, error) { - resp := &ProjectAlertRule{} - err := c.apiClient.Ops.DoByID(ProjectAlertRuleType, id, resp) - return resp, err -} - -func (c *ProjectAlertRuleClient) Delete(container *ProjectAlertRule) error { - return c.apiClient.Ops.DoResourceDelete(ProjectAlertRuleType, &container.Resource) -} - -func (c *ProjectAlertRuleClient) ActionActivate(resource *ProjectAlertRule) error { - err := c.apiClient.Ops.DoAction(ProjectAlertRuleType, "activate", &resource.Resource, nil, nil) - return err -} - -func (c *ProjectAlertRuleClient) ActionDeactivate(resource *ProjectAlertRule) error { - err := c.apiClient.Ops.DoAction(ProjectAlertRuleType, "deactivate", &resource.Resource, nil, nil) - return err -} - -func (c *ProjectAlertRuleClient) ActionMute(resource *ProjectAlertRule) error { - err := c.apiClient.Ops.DoAction(ProjectAlertRuleType, "mute", &resource.Resource, nil, nil) - return err -} - -func (c *ProjectAlertRuleClient) ActionUnmute(resource *ProjectAlertRule) error { - err := c.apiClient.Ops.DoAction(ProjectAlertRuleType, "unmute", &resource.Resource, nil, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule_spec.go deleted file mode 100644 index 6ca158f9cbb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_rule_spec.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - ProjectAlertRuleSpecType = "projectAlertRuleSpec" - ProjectAlertRuleSpecFieldDisplayName = "displayName" - ProjectAlertRuleSpecFieldGroupID = "groupId" - ProjectAlertRuleSpecFieldGroupIntervalSeconds = "groupIntervalSeconds" - ProjectAlertRuleSpecFieldGroupWaitSeconds = "groupWaitSeconds" - ProjectAlertRuleSpecFieldInherited = "inherited" - ProjectAlertRuleSpecFieldMetricRule = "metricRule" - ProjectAlertRuleSpecFieldPodRule = "podRule" - ProjectAlertRuleSpecFieldProjectID = "projectId" - ProjectAlertRuleSpecFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ProjectAlertRuleSpecFieldSeverity = "severity" - ProjectAlertRuleSpecFieldWorkloadRule = "workloadRule" -) - -type ProjectAlertRuleSpec struct { - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - GroupID string `json:"groupId,omitempty" yaml:"groupId,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - Inherited *bool `json:"inherited,omitempty" yaml:"inherited,omitempty"` - MetricRule *MetricRule `json:"metricRule,omitempty" yaml:"metricRule,omitempty"` - PodRule *PodRule `json:"podRule,omitempty" yaml:"podRule,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - WorkloadRule *WorkloadRule `json:"workloadRule,omitempty" yaml:"workloadRule,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_spec.go deleted file mode 100644 index 3f67a8589ff..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_alert_spec.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - ProjectAlertSpecType = "projectAlertSpec" - ProjectAlertSpecFieldDescription = "description" - ProjectAlertSpecFieldDisplayName = "displayName" - ProjectAlertSpecFieldInitialWaitSeconds = "initialWaitSeconds" - ProjectAlertSpecFieldProjectID = "projectId" - ProjectAlertSpecFieldRecipients = "recipients" - ProjectAlertSpecFieldRepeatIntervalSeconds = "repeatIntervalSeconds" - ProjectAlertSpecFieldSeverity = "severity" - ProjectAlertSpecFieldTargetPod = "targetPod" - ProjectAlertSpecFieldTargetWorkload = "targetWorkload" -) - -type ProjectAlertSpec struct { - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - InitialWaitSeconds int64 `json:"initialWaitSeconds,omitempty" yaml:"initialWaitSeconds,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - TargetPod *TargetPod `json:"targetPod,omitempty" yaml:"targetPod,omitempty"` - TargetWorkload *TargetWorkload `json:"targetWorkload,omitempty" yaml:"targetWorkload,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_catalog.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_catalog.go deleted file mode 100644 index 2185abe0971..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_catalog.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectCatalogType = "projectCatalog" - ProjectCatalogFieldAnnotations = "annotations" - ProjectCatalogFieldBranch = "branch" - ProjectCatalogFieldCatalogSecrets = "catalogSecrets" - ProjectCatalogFieldCommit = "commit" - ProjectCatalogFieldConditions = "conditions" - ProjectCatalogFieldCreated = "created" - ProjectCatalogFieldCreatorID = "creatorId" - ProjectCatalogFieldCredentialSecret = "credentialSecret" - ProjectCatalogFieldDescription = "description" - ProjectCatalogFieldHelmVersion = "helmVersion" - ProjectCatalogFieldKind = "kind" - ProjectCatalogFieldLabels = "labels" - ProjectCatalogFieldLastRefreshTimestamp = "lastRefreshTimestamp" - ProjectCatalogFieldName = "name" - ProjectCatalogFieldNamespaceId = "namespaceId" - ProjectCatalogFieldOwnerReferences = "ownerReferences" - ProjectCatalogFieldPassword = "password" - ProjectCatalogFieldProjectID = "projectId" - ProjectCatalogFieldRemoved = "removed" - ProjectCatalogFieldState = "state" - ProjectCatalogFieldTransitioning = "transitioning" - ProjectCatalogFieldTransitioningMessage = "transitioningMessage" - ProjectCatalogFieldURL = "url" - ProjectCatalogFieldUUID = "uuid" - ProjectCatalogFieldUsername = "username" -) - -type ProjectCatalog struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type ProjectCatalogCollection struct { - types.Collection - Data []ProjectCatalog `json:"data,omitempty"` - client *ProjectCatalogClient -} - -type ProjectCatalogClient struct { - apiClient *Client -} - -type ProjectCatalogOperations interface { - List(opts *types.ListOpts) (*ProjectCatalogCollection, error) - ListAll(opts *types.ListOpts) (*ProjectCatalogCollection, error) - Create(opts *ProjectCatalog) (*ProjectCatalog, error) - Update(existing *ProjectCatalog, updates interface{}) (*ProjectCatalog, error) - Replace(existing *ProjectCatalog) (*ProjectCatalog, error) - ByID(id string) (*ProjectCatalog, error) - Delete(container *ProjectCatalog) error - - ActionRefresh(resource *ProjectCatalog) (*CatalogRefresh, error) - - CollectionActionRefresh(resource *ProjectCatalogCollection) (*CatalogRefresh, error) -} - -func newProjectCatalogClient(apiClient *Client) *ProjectCatalogClient { - return &ProjectCatalogClient{ - apiClient: apiClient, - } -} - -func (c *ProjectCatalogClient) Create(container *ProjectCatalog) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoCreate(ProjectCatalogType, container, resp) - return resp, err -} - -func (c *ProjectCatalogClient) Update(existing *ProjectCatalog, updates interface{}) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoUpdate(ProjectCatalogType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectCatalogClient) Replace(obj *ProjectCatalog) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoReplace(ProjectCatalogType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectCatalogClient) List(opts *types.ListOpts) (*ProjectCatalogCollection, error) { - resp := &ProjectCatalogCollection{} - err := c.apiClient.Ops.DoList(ProjectCatalogType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectCatalogClient) ListAll(opts *types.ListOpts) (*ProjectCatalogCollection, error) { - resp := &ProjectCatalogCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectCatalogCollection) Next() (*ProjectCatalogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectCatalogCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectCatalogClient) ByID(id string) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoByID(ProjectCatalogType, id, resp) - return resp, err -} - -func (c *ProjectCatalogClient) Delete(container *ProjectCatalog) error { - return c.apiClient.Ops.DoResourceDelete(ProjectCatalogType, &container.Resource) -} - -func (c *ProjectCatalogClient) ActionRefresh(resource *ProjectCatalog) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoAction(ProjectCatalogType, "refresh", &resource.Resource, nil, resp) - return resp, err -} - -func (c *ProjectCatalogClient) CollectionActionRefresh(resource *ProjectCatalogCollection) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoCollectionAction(ProjectCatalogType, "refresh", &resource.Collection, nil, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_condition.go deleted file mode 100644 index b0907cfb8b9..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - ProjectConditionType = "projectCondition" - ProjectConditionFieldLastTransitionTime = "lastTransitionTime" - ProjectConditionFieldLastUpdateTime = "lastUpdateTime" - ProjectConditionFieldMessage = "message" - ProjectConditionFieldReason = "reason" - ProjectConditionFieldStatus = "status" - ProjectConditionFieldType = "type" -) - -type ProjectCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_group_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_group_spec.go deleted file mode 100644 index 8c14f6e8791..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_group_spec.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - ProjectGroupSpecType = "projectGroupSpec" - ProjectGroupSpecFieldDescription = "description" - ProjectGroupSpecFieldDisplayName = "displayName" - ProjectGroupSpecFieldGroupIntervalSeconds = "groupIntervalSeconds" - ProjectGroupSpecFieldGroupWaitSeconds = "groupWaitSeconds" - ProjectGroupSpecFieldProjectID = "projectId" - ProjectGroupSpecFieldRecipients = "recipients" - ProjectGroupSpecFieldRepeatIntervalSeconds = "repeatIntervalSeconds" -) - -type ProjectGroupSpec struct { - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - GroupIntervalSeconds int64 `json:"groupIntervalSeconds,omitempty" yaml:"groupIntervalSeconds,omitempty"` - GroupWaitSeconds int64 `json:"groupWaitSeconds,omitempty" yaml:"groupWaitSeconds,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - RepeatIntervalSeconds int64 `json:"repeatIntervalSeconds,omitempty" yaml:"repeatIntervalSeconds,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging.go deleted file mode 100644 index d27bf900680..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging.go +++ /dev/null @@ -1,162 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectLoggingType = "projectLogging" - ProjectLoggingFieldAnnotations = "annotations" - ProjectLoggingFieldCreated = "created" - ProjectLoggingFieldCreatorID = "creatorId" - ProjectLoggingFieldCustomTargetConfig = "customTargetConfig" - ProjectLoggingFieldElasticsearchConfig = "elasticsearchConfig" - ProjectLoggingFieldEnableJSONParsing = "enableJSONParsing" - ProjectLoggingFieldFluentForwarderConfig = "fluentForwarderConfig" - ProjectLoggingFieldKafkaConfig = "kafkaConfig" - ProjectLoggingFieldLabels = "labels" - ProjectLoggingFieldName = "name" - ProjectLoggingFieldNamespaceId = "namespaceId" - ProjectLoggingFieldOutputFlushInterval = "outputFlushInterval" - ProjectLoggingFieldOutputTags = "outputTags" - ProjectLoggingFieldOwnerReferences = "ownerReferences" - ProjectLoggingFieldProjectID = "projectId" - ProjectLoggingFieldRemoved = "removed" - ProjectLoggingFieldSplunkConfig = "splunkConfig" - ProjectLoggingFieldState = "state" - ProjectLoggingFieldStatus = "status" - ProjectLoggingFieldSyslogConfig = "syslogConfig" - ProjectLoggingFieldTransitioning = "transitioning" - ProjectLoggingFieldTransitioningMessage = "transitioningMessage" - ProjectLoggingFieldUUID = "uuid" -) - -type ProjectLogging struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CustomTargetConfig *CustomTargetConfig `json:"customTargetConfig,omitempty" yaml:"customTargetConfig,omitempty"` - ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty" yaml:"elasticsearchConfig,omitempty"` - EnableJSONParsing bool `json:"enableJSONParsing,omitempty" yaml:"enableJSONParsing,omitempty"` - FluentForwarderConfig *FluentForwarderConfig `json:"fluentForwarderConfig,omitempty" yaml:"fluentForwarderConfig,omitempty"` - KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty" yaml:"kafkaConfig,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OutputFlushInterval int64 `json:"outputFlushInterval,omitempty" yaml:"outputFlushInterval,omitempty"` - OutputTags map[string]string `json:"outputTags,omitempty" yaml:"outputTags,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty" yaml:"splunkConfig,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *ProjectLoggingStatus `json:"status,omitempty" yaml:"status,omitempty"` - SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty" yaml:"syslogConfig,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectLoggingCollection struct { - types.Collection - Data []ProjectLogging `json:"data,omitempty"` - client *ProjectLoggingClient -} - -type ProjectLoggingClient struct { - apiClient *Client -} - -type ProjectLoggingOperations interface { - List(opts *types.ListOpts) (*ProjectLoggingCollection, error) - ListAll(opts *types.ListOpts) (*ProjectLoggingCollection, error) - Create(opts *ProjectLogging) (*ProjectLogging, error) - Update(existing *ProjectLogging, updates interface{}) (*ProjectLogging, error) - Replace(existing *ProjectLogging) (*ProjectLogging, error) - ByID(id string) (*ProjectLogging, error) - Delete(container *ProjectLogging) error - - CollectionActionDryRun(resource *ProjectLoggingCollection, input *ProjectTestInput) error - - CollectionActionTest(resource *ProjectLoggingCollection, input *ProjectTestInput) error -} - -func newProjectLoggingClient(apiClient *Client) *ProjectLoggingClient { - return &ProjectLoggingClient{ - apiClient: apiClient, - } -} - -func (c *ProjectLoggingClient) Create(container *ProjectLogging) (*ProjectLogging, error) { - resp := &ProjectLogging{} - err := c.apiClient.Ops.DoCreate(ProjectLoggingType, container, resp) - return resp, err -} - -func (c *ProjectLoggingClient) Update(existing *ProjectLogging, updates interface{}) (*ProjectLogging, error) { - resp := &ProjectLogging{} - err := c.apiClient.Ops.DoUpdate(ProjectLoggingType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectLoggingClient) Replace(obj *ProjectLogging) (*ProjectLogging, error) { - resp := &ProjectLogging{} - err := c.apiClient.Ops.DoReplace(ProjectLoggingType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectLoggingClient) List(opts *types.ListOpts) (*ProjectLoggingCollection, error) { - resp := &ProjectLoggingCollection{} - err := c.apiClient.Ops.DoList(ProjectLoggingType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectLoggingClient) ListAll(opts *types.ListOpts) (*ProjectLoggingCollection, error) { - resp := &ProjectLoggingCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectLoggingCollection) Next() (*ProjectLoggingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectLoggingCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectLoggingClient) ByID(id string) (*ProjectLogging, error) { - resp := &ProjectLogging{} - err := c.apiClient.Ops.DoByID(ProjectLoggingType, id, resp) - return resp, err -} - -func (c *ProjectLoggingClient) Delete(container *ProjectLogging) error { - return c.apiClient.Ops.DoResourceDelete(ProjectLoggingType, &container.Resource) -} - -func (c *ProjectLoggingClient) CollectionActionDryRun(resource *ProjectLoggingCollection, input *ProjectTestInput) error { - err := c.apiClient.Ops.DoCollectionAction(ProjectLoggingType, "dryRun", &resource.Collection, input, nil) - return err -} - -func (c *ProjectLoggingClient) CollectionActionTest(resource *ProjectLoggingCollection, input *ProjectTestInput) error { - err := c.apiClient.Ops.DoCollectionAction(ProjectLoggingType, "test", &resource.Collection, input, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_spec.go deleted file mode 100644 index c7597a25574..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_spec.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -const ( - ProjectLoggingSpecType = "projectLoggingSpec" - ProjectLoggingSpecFieldCustomTargetConfig = "customTargetConfig" - ProjectLoggingSpecFieldDisplayName = "displayName" - ProjectLoggingSpecFieldElasticsearchConfig = "elasticsearchConfig" - ProjectLoggingSpecFieldEnableJSONParsing = "enableJSONParsing" - ProjectLoggingSpecFieldFluentForwarderConfig = "fluentForwarderConfig" - ProjectLoggingSpecFieldKafkaConfig = "kafkaConfig" - ProjectLoggingSpecFieldOutputFlushInterval = "outputFlushInterval" - ProjectLoggingSpecFieldOutputTags = "outputTags" - ProjectLoggingSpecFieldProjectID = "projectId" - ProjectLoggingSpecFieldSplunkConfig = "splunkConfig" - ProjectLoggingSpecFieldSyslogConfig = "syslogConfig" -) - -type ProjectLoggingSpec struct { - CustomTargetConfig *CustomTargetConfig `json:"customTargetConfig,omitempty" yaml:"customTargetConfig,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty" yaml:"elasticsearchConfig,omitempty"` - EnableJSONParsing bool `json:"enableJSONParsing,omitempty" yaml:"enableJSONParsing,omitempty"` - FluentForwarderConfig *FluentForwarderConfig `json:"fluentForwarderConfig,omitempty" yaml:"fluentForwarderConfig,omitempty"` - KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty" yaml:"kafkaConfig,omitempty"` - OutputFlushInterval int64 `json:"outputFlushInterval,omitempty" yaml:"outputFlushInterval,omitempty"` - OutputTags map[string]string `json:"outputTags,omitempty" yaml:"outputTags,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty" yaml:"splunkConfig,omitempty"` - SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty" yaml:"syslogConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_status.go deleted file mode 100644 index c10fd069da5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_logging_status.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ProjectLoggingStatusType = "projectLoggingStatus" - ProjectLoggingStatusFieldAppliedSpec = "appliedSpec" - ProjectLoggingStatusFieldConditions = "conditions" -) - -type ProjectLoggingStatus struct { - AppliedSpec *ProjectLoggingSpec `json:"appliedSpec,omitempty" yaml:"appliedSpec,omitempty"` - Conditions []LoggingCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_metric_names_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_metric_names_input.go deleted file mode 100644 index f45cf07e572..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_metric_names_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - ProjectMetricNamesInputType = "projectMetricNamesInput" - ProjectMetricNamesInputFieldProjectName = "projectId" -) - -type ProjectMetricNamesInput struct { - ProjectName string `json:"projectId,omitempty" yaml:"projectId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph.go deleted file mode 100644 index 76c55523156..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph.go +++ /dev/null @@ -1,146 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectMonitorGraphType = "projectMonitorGraph" - ProjectMonitorGraphFieldAnnotations = "annotations" - ProjectMonitorGraphFieldCreated = "created" - ProjectMonitorGraphFieldCreatorID = "creatorId" - ProjectMonitorGraphFieldDescription = "description" - ProjectMonitorGraphFieldDetailsMetricsSelector = "detailsMetricsSelector" - ProjectMonitorGraphFieldDisplayResourceType = "displayResourceType" - ProjectMonitorGraphFieldGraphType = "graphType" - ProjectMonitorGraphFieldLabels = "labels" - ProjectMonitorGraphFieldMetricsSelector = "metricsSelector" - ProjectMonitorGraphFieldName = "name" - ProjectMonitorGraphFieldNamespaceId = "namespaceId" - ProjectMonitorGraphFieldOwnerReferences = "ownerReferences" - ProjectMonitorGraphFieldPriority = "priority" - ProjectMonitorGraphFieldProjectID = "projectId" - ProjectMonitorGraphFieldRemoved = "removed" - ProjectMonitorGraphFieldResourceType = "resourceType" - ProjectMonitorGraphFieldUUID = "uuid" - ProjectMonitorGraphFieldYAxis = "yAxis" -) - -type ProjectMonitorGraph struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DetailsMetricsSelector map[string]string `json:"detailsMetricsSelector,omitempty" yaml:"detailsMetricsSelector,omitempty"` - DisplayResourceType string `json:"displayResourceType,omitempty" yaml:"displayResourceType,omitempty"` - GraphType string `json:"graphType,omitempty" yaml:"graphType,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - MetricsSelector map[string]string `json:"metricsSelector,omitempty" yaml:"metricsSelector,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ResourceType string `json:"resourceType,omitempty" yaml:"resourceType,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - YAxis *YAxis `json:"yAxis,omitempty" yaml:"yAxis,omitempty"` -} - -type ProjectMonitorGraphCollection struct { - types.Collection - Data []ProjectMonitorGraph `json:"data,omitempty"` - client *ProjectMonitorGraphClient -} - -type ProjectMonitorGraphClient struct { - apiClient *Client -} - -type ProjectMonitorGraphOperations interface { - List(opts *types.ListOpts) (*ProjectMonitorGraphCollection, error) - ListAll(opts *types.ListOpts) (*ProjectMonitorGraphCollection, error) - Create(opts *ProjectMonitorGraph) (*ProjectMonitorGraph, error) - Update(existing *ProjectMonitorGraph, updates interface{}) (*ProjectMonitorGraph, error) - Replace(existing *ProjectMonitorGraph) (*ProjectMonitorGraph, error) - ByID(id string) (*ProjectMonitorGraph, error) - Delete(container *ProjectMonitorGraph) error - - CollectionActionQuery(resource *ProjectMonitorGraphCollection, input *QueryGraphInput) (*QueryProjectGraphOutput, error) -} - -func newProjectMonitorGraphClient(apiClient *Client) *ProjectMonitorGraphClient { - return &ProjectMonitorGraphClient{ - apiClient: apiClient, - } -} - -func (c *ProjectMonitorGraphClient) Create(container *ProjectMonitorGraph) (*ProjectMonitorGraph, error) { - resp := &ProjectMonitorGraph{} - err := c.apiClient.Ops.DoCreate(ProjectMonitorGraphType, container, resp) - return resp, err -} - -func (c *ProjectMonitorGraphClient) Update(existing *ProjectMonitorGraph, updates interface{}) (*ProjectMonitorGraph, error) { - resp := &ProjectMonitorGraph{} - err := c.apiClient.Ops.DoUpdate(ProjectMonitorGraphType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectMonitorGraphClient) Replace(obj *ProjectMonitorGraph) (*ProjectMonitorGraph, error) { - resp := &ProjectMonitorGraph{} - err := c.apiClient.Ops.DoReplace(ProjectMonitorGraphType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectMonitorGraphClient) List(opts *types.ListOpts) (*ProjectMonitorGraphCollection, error) { - resp := &ProjectMonitorGraphCollection{} - err := c.apiClient.Ops.DoList(ProjectMonitorGraphType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectMonitorGraphClient) ListAll(opts *types.ListOpts) (*ProjectMonitorGraphCollection, error) { - resp := &ProjectMonitorGraphCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectMonitorGraphCollection) Next() (*ProjectMonitorGraphCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectMonitorGraphCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectMonitorGraphClient) ByID(id string) (*ProjectMonitorGraph, error) { - resp := &ProjectMonitorGraph{} - err := c.apiClient.Ops.DoByID(ProjectMonitorGraphType, id, resp) - return resp, err -} - -func (c *ProjectMonitorGraphClient) Delete(container *ProjectMonitorGraph) error { - return c.apiClient.Ops.DoResourceDelete(ProjectMonitorGraphType, &container.Resource) -} - -func (c *ProjectMonitorGraphClient) CollectionActionQuery(resource *ProjectMonitorGraphCollection, input *QueryGraphInput) (*QueryProjectGraphOutput, error) { - resp := &QueryProjectGraphOutput{} - err := c.apiClient.Ops.DoCollectionAction(ProjectMonitorGraphType, "query", &resource.Collection, input, resp) - return resp, err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph_spec.go deleted file mode 100644 index cd3d480e8a1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_monitor_graph_spec.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - ProjectMonitorGraphSpecType = "projectMonitorGraphSpec" - ProjectMonitorGraphSpecFieldDescription = "description" - ProjectMonitorGraphSpecFieldDetailsMetricsSelector = "detailsMetricsSelector" - ProjectMonitorGraphSpecFieldDisplayResourceType = "displayResourceType" - ProjectMonitorGraphSpecFieldGraphType = "graphType" - ProjectMonitorGraphSpecFieldMetricsSelector = "metricsSelector" - ProjectMonitorGraphSpecFieldPriority = "priority" - ProjectMonitorGraphSpecFieldProjectID = "projectId" - ProjectMonitorGraphSpecFieldResourceType = "resourceType" - ProjectMonitorGraphSpecFieldYAxis = "yAxis" -) - -type ProjectMonitorGraphSpec struct { - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DetailsMetricsSelector map[string]string `json:"detailsMetricsSelector,omitempty" yaml:"detailsMetricsSelector,omitempty"` - DisplayResourceType string `json:"displayResourceType,omitempty" yaml:"displayResourceType,omitempty"` - GraphType string `json:"graphType,omitempty" yaml:"graphType,omitempty"` - MetricsSelector map[string]string `json:"metricsSelector,omitempty" yaml:"metricsSelector,omitempty"` - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - ResourceType string `json:"resourceType,omitempty" yaml:"resourceType,omitempty"` - YAxis *YAxis `json:"yAxis,omitempty" yaml:"yAxis,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy.go deleted file mode 100644 index 0df489f8bce..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy.go +++ /dev/null @@ -1,132 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectNetworkPolicyType = "projectNetworkPolicy" - ProjectNetworkPolicyFieldAnnotations = "annotations" - ProjectNetworkPolicyFieldCreated = "created" - ProjectNetworkPolicyFieldCreatorID = "creatorId" - ProjectNetworkPolicyFieldDescription = "description" - ProjectNetworkPolicyFieldLabels = "labels" - ProjectNetworkPolicyFieldName = "name" - ProjectNetworkPolicyFieldNamespaceId = "namespaceId" - ProjectNetworkPolicyFieldOwnerReferences = "ownerReferences" - ProjectNetworkPolicyFieldProjectID = "projectId" - ProjectNetworkPolicyFieldRemoved = "removed" - ProjectNetworkPolicyFieldState = "state" - ProjectNetworkPolicyFieldStatus = "status" - ProjectNetworkPolicyFieldTransitioning = "transitioning" - ProjectNetworkPolicyFieldTransitioningMessage = "transitioningMessage" - ProjectNetworkPolicyFieldUUID = "uuid" -) - -type ProjectNetworkPolicy struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *ProjectNetworkPolicyStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectNetworkPolicyCollection struct { - types.Collection - Data []ProjectNetworkPolicy `json:"data,omitempty"` - client *ProjectNetworkPolicyClient -} - -type ProjectNetworkPolicyClient struct { - apiClient *Client -} - -type ProjectNetworkPolicyOperations interface { - List(opts *types.ListOpts) (*ProjectNetworkPolicyCollection, error) - ListAll(opts *types.ListOpts) (*ProjectNetworkPolicyCollection, error) - Create(opts *ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) - Update(existing *ProjectNetworkPolicy, updates interface{}) (*ProjectNetworkPolicy, error) - Replace(existing *ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) - ByID(id string) (*ProjectNetworkPolicy, error) - Delete(container *ProjectNetworkPolicy) error -} - -func newProjectNetworkPolicyClient(apiClient *Client) *ProjectNetworkPolicyClient { - return &ProjectNetworkPolicyClient{ - apiClient: apiClient, - } -} - -func (c *ProjectNetworkPolicyClient) Create(container *ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) { - resp := &ProjectNetworkPolicy{} - err := c.apiClient.Ops.DoCreate(ProjectNetworkPolicyType, container, resp) - return resp, err -} - -func (c *ProjectNetworkPolicyClient) Update(existing *ProjectNetworkPolicy, updates interface{}) (*ProjectNetworkPolicy, error) { - resp := &ProjectNetworkPolicy{} - err := c.apiClient.Ops.DoUpdate(ProjectNetworkPolicyType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectNetworkPolicyClient) Replace(obj *ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) { - resp := &ProjectNetworkPolicy{} - err := c.apiClient.Ops.DoReplace(ProjectNetworkPolicyType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectNetworkPolicyClient) List(opts *types.ListOpts) (*ProjectNetworkPolicyCollection, error) { - resp := &ProjectNetworkPolicyCollection{} - err := c.apiClient.Ops.DoList(ProjectNetworkPolicyType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectNetworkPolicyClient) ListAll(opts *types.ListOpts) (*ProjectNetworkPolicyCollection, error) { - resp := &ProjectNetworkPolicyCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectNetworkPolicyCollection) Next() (*ProjectNetworkPolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectNetworkPolicyCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectNetworkPolicyClient) ByID(id string) (*ProjectNetworkPolicy, error) { - resp := &ProjectNetworkPolicy{} - err := c.apiClient.Ops.DoByID(ProjectNetworkPolicyType, id, resp) - return resp, err -} - -func (c *ProjectNetworkPolicyClient) Delete(container *ProjectNetworkPolicy) error { - return c.apiClient.Ops.DoResourceDelete(ProjectNetworkPolicyType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_spec.go deleted file mode 100644 index 6875efbd54f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_spec.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ProjectNetworkPolicySpecType = "projectNetworkPolicySpec" - ProjectNetworkPolicySpecFieldDescription = "description" - ProjectNetworkPolicySpecFieldProjectID = "projectId" -) - -type ProjectNetworkPolicySpec struct { - Description string `json:"description,omitempty" yaml:"description,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_status.go deleted file mode 100644 index cef3c1639c6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_network_policy_status.go +++ /dev/null @@ -1,8 +0,0 @@ -package client - -const ( - ProjectNetworkPolicyStatusType = "projectNetworkPolicyStatus" -) - -type ProjectNetworkPolicyStatus struct { -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_resource_quota.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_resource_quota.go deleted file mode 100644 index 05f7366092a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_resource_quota.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ProjectResourceQuotaType = "projectResourceQuota" - ProjectResourceQuotaFieldLimit = "limit" - ProjectResourceQuotaFieldUsedLimit = "usedLimit" -) - -type ProjectResourceQuota struct { - Limit *ResourceQuotaLimit `json:"limit,omitempty" yaml:"limit,omitempty"` - UsedLimit *ResourceQuotaLimit `json:"usedLimit,omitempty" yaml:"usedLimit,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_role_template_binding.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_role_template_binding.go deleted file mode 100644 index 47237560bab..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_role_template_binding.go +++ /dev/null @@ -1,134 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectRoleTemplateBindingType = "projectRoleTemplateBinding" - ProjectRoleTemplateBindingFieldAnnotations = "annotations" - ProjectRoleTemplateBindingFieldCreated = "created" - ProjectRoleTemplateBindingFieldCreatorID = "creatorId" - ProjectRoleTemplateBindingFieldGroupID = "groupId" - ProjectRoleTemplateBindingFieldGroupPrincipalID = "groupPrincipalId" - ProjectRoleTemplateBindingFieldLabels = "labels" - ProjectRoleTemplateBindingFieldName = "name" - ProjectRoleTemplateBindingFieldNamespaceId = "namespaceId" - ProjectRoleTemplateBindingFieldOwnerReferences = "ownerReferences" - ProjectRoleTemplateBindingFieldProjectID = "projectId" - ProjectRoleTemplateBindingFieldRemoved = "removed" - ProjectRoleTemplateBindingFieldRoleTemplateID = "roleTemplateId" - ProjectRoleTemplateBindingFieldServiceAccount = "serviceAccount" - ProjectRoleTemplateBindingFieldUUID = "uuid" - ProjectRoleTemplateBindingFieldUserID = "userId" - ProjectRoleTemplateBindingFieldUserPrincipalID = "userPrincipalId" -) - -type ProjectRoleTemplateBinding struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - GroupID string `json:"groupId,omitempty" yaml:"groupId,omitempty"` - GroupPrincipalID string `json:"groupPrincipalId,omitempty" yaml:"groupPrincipalId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RoleTemplateID string `json:"roleTemplateId,omitempty" yaml:"roleTemplateId,omitempty"` - ServiceAccount string `json:"serviceAccount,omitempty" yaml:"serviceAccount,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserID string `json:"userId,omitempty" yaml:"userId,omitempty"` - UserPrincipalID string `json:"userPrincipalId,omitempty" yaml:"userPrincipalId,omitempty"` -} - -type ProjectRoleTemplateBindingCollection struct { - types.Collection - Data []ProjectRoleTemplateBinding `json:"data,omitempty"` - client *ProjectRoleTemplateBindingClient -} - -type ProjectRoleTemplateBindingClient struct { - apiClient *Client -} - -type ProjectRoleTemplateBindingOperations interface { - List(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error) - ListAll(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error) - Create(opts *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) - Update(existing *ProjectRoleTemplateBinding, updates interface{}) (*ProjectRoleTemplateBinding, error) - Replace(existing *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) - ByID(id string) (*ProjectRoleTemplateBinding, error) - Delete(container *ProjectRoleTemplateBinding) error -} - -func newProjectRoleTemplateBindingClient(apiClient *Client) *ProjectRoleTemplateBindingClient { - return &ProjectRoleTemplateBindingClient{ - apiClient: apiClient, - } -} - -func (c *ProjectRoleTemplateBindingClient) Create(container *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) { - resp := &ProjectRoleTemplateBinding{} - err := c.apiClient.Ops.DoCreate(ProjectRoleTemplateBindingType, container, resp) - return resp, err -} - -func (c *ProjectRoleTemplateBindingClient) Update(existing *ProjectRoleTemplateBinding, updates interface{}) (*ProjectRoleTemplateBinding, error) { - resp := &ProjectRoleTemplateBinding{} - err := c.apiClient.Ops.DoUpdate(ProjectRoleTemplateBindingType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectRoleTemplateBindingClient) Replace(obj *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) { - resp := &ProjectRoleTemplateBinding{} - err := c.apiClient.Ops.DoReplace(ProjectRoleTemplateBindingType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectRoleTemplateBindingClient) List(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error) { - resp := &ProjectRoleTemplateBindingCollection{} - err := c.apiClient.Ops.DoList(ProjectRoleTemplateBindingType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectRoleTemplateBindingClient) ListAll(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error) { - resp := &ProjectRoleTemplateBindingCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectRoleTemplateBindingCollection) Next() (*ProjectRoleTemplateBindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectRoleTemplateBindingCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectRoleTemplateBindingClient) ByID(id string) (*ProjectRoleTemplateBinding, error) { - resp := &ProjectRoleTemplateBinding{} - err := c.apiClient.Ops.DoByID(ProjectRoleTemplateBindingType, id, resp) - return resp, err -} - -func (c *ProjectRoleTemplateBindingClient) Delete(container *ProjectRoleTemplateBinding) error { - return c.apiClient.Ops.DoResourceDelete(ProjectRoleTemplateBindingType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_spec.go deleted file mode 100644 index 42865b9431b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_spec.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - ProjectSpecType = "projectSpec" - ProjectSpecFieldClusterID = "clusterId" - ProjectSpecFieldContainerDefaultResourceLimit = "containerDefaultResourceLimit" - ProjectSpecFieldDescription = "description" - ProjectSpecFieldDisplayName = "displayName" - ProjectSpecFieldEnableProjectMonitoring = "enableProjectMonitoring" - ProjectSpecFieldNamespaceDefaultResourceQuota = "namespaceDefaultResourceQuota" - ProjectSpecFieldResourceQuota = "resourceQuota" -) - -type ProjectSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - ContainerDefaultResourceLimit *ContainerResourceLimit `json:"containerDefaultResourceLimit,omitempty" yaml:"containerDefaultResourceLimit,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - EnableProjectMonitoring bool `json:"enableProjectMonitoring,omitempty" yaml:"enableProjectMonitoring,omitempty"` - NamespaceDefaultResourceQuota *NamespaceResourceQuota `json:"namespaceDefaultResourceQuota,omitempty" yaml:"namespaceDefaultResourceQuota,omitempty"` - ResourceQuota *ProjectResourceQuota `json:"resourceQuota,omitempty" yaml:"resourceQuota,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_status.go deleted file mode 100644 index c50730d087a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_status.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ProjectStatusType = "projectStatus" - ProjectStatusFieldConditions = "conditions" - ProjectStatusFieldMonitoringStatus = "monitoringStatus" - ProjectStatusFieldPodSecurityPolicyTemplateName = "podSecurityPolicyTemplateId" -) - -type ProjectStatus struct { - Conditions []ProjectCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty" yaml:"monitoringStatus,omitempty"` - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId,omitempty" yaml:"podSecurityPolicyTemplateId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_test_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_test_input.go deleted file mode 100644 index 3ea126ac7be..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_project_test_input.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - ProjectTestInputType = "projectTestInput" - ProjectTestInputFieldCustomTargetConfig = "customTargetConfig" - ProjectTestInputFieldElasticsearchConfig = "elasticsearchConfig" - ProjectTestInputFieldFluentForwarderConfig = "fluentForwarderConfig" - ProjectTestInputFieldKafkaConfig = "kafkaConfig" - ProjectTestInputFieldOutputTags = "outputTags" - ProjectTestInputFieldProjectName = "projectId" - ProjectTestInputFieldSplunkConfig = "splunkConfig" - ProjectTestInputFieldSyslogConfig = "syslogConfig" -) - -type ProjectTestInput struct { - CustomTargetConfig *CustomTargetConfig `json:"customTargetConfig,omitempty" yaml:"customTargetConfig,omitempty"` - ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty" yaml:"elasticsearchConfig,omitempty"` - FluentForwarderConfig *FluentForwarderConfig `json:"fluentForwarderConfig,omitempty" yaml:"fluentForwarderConfig,omitempty"` - KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty" yaml:"kafkaConfig,omitempty"` - OutputTags map[string]string `json:"outputTags,omitempty" yaml:"outputTags,omitempty"` - ProjectName string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty" yaml:"splunkConfig,omitempty"` - SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty" yaml:"syslogConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_projected_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_projected_volume_source.go deleted file mode 100644 index f90539eefd2..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_projected_volume_source.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ProjectedVolumeSourceType = "projectedVolumeSource" - ProjectedVolumeSourceFieldDefaultMode = "defaultMode" - ProjectedVolumeSourceFieldSources = "sources" -) - -type ProjectedVolumeSource struct { - DefaultMode *int64 `json:"defaultMode,omitempty" yaml:"defaultMode,omitempty"` - Sources []VolumeProjection `json:"sources,omitempty" yaml:"sources,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_provider_configuration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_provider_configuration.go deleted file mode 100644 index 4a29cfdffe7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_provider_configuration.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - ProviderConfigurationType = "providerConfiguration" - ProviderConfigurationFieldAESCBC = "aescbc" - ProviderConfigurationFieldAESGCM = "aesgcm" - ProviderConfigurationFieldIdentity = "identity" - ProviderConfigurationFieldKMS = "kms" - ProviderConfigurationFieldSecretbox = "secretbox" -) - -type ProviderConfiguration struct { - AESCBC *AESConfiguration `json:"aescbc,omitempty" yaml:"aescbc,omitempty"` - AESGCM *AESConfiguration `json:"aesgcm,omitempty" yaml:"aesgcm,omitempty"` - Identity *IdentityConfiguration `json:"identity,omitempty" yaml:"identity,omitempty"` - KMS *KMSConfiguration `json:"kms,omitempty" yaml:"kms,omitempty"` - Secretbox *SecretboxConfiguration `json:"secretbox,omitempty" yaml:"secretbox,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_public_endpoint.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_public_endpoint.go deleted file mode 100644 index 85844aac732..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_public_endpoint.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - PublicEndpointType = "publicEndpoint" - PublicEndpointFieldAddresses = "addresses" - PublicEndpointFieldAllNodes = "allNodes" - PublicEndpointFieldHostname = "hostname" - PublicEndpointFieldIngressID = "ingressId" - PublicEndpointFieldNodeID = "nodeId" - PublicEndpointFieldPath = "path" - PublicEndpointFieldPodID = "podId" - PublicEndpointFieldPort = "port" - PublicEndpointFieldProtocol = "protocol" - PublicEndpointFieldServiceID = "serviceId" -) - -type PublicEndpoint struct { - Addresses []string `json:"addresses,omitempty" yaml:"addresses,omitempty"` - AllNodes bool `json:"allNodes,omitempty" yaml:"allNodes,omitempty"` - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - IngressID string `json:"ingressId,omitempty" yaml:"ingressId,omitempty"` - NodeID string `json:"nodeId,omitempty" yaml:"nodeId,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - PodID string `json:"podId,omitempty" yaml:"podId,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` - ServiceID string `json:"serviceId,omitempty" yaml:"serviceId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph.go deleted file mode 100644 index f3494d5b9b7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - QueryClusterGraphType = "queryClusterGraph" - QueryClusterGraphFieldGraphName = "graphID" - QueryClusterGraphFieldSeries = "series" -) - -type QueryClusterGraph struct { - GraphName string `json:"graphID,omitempty" yaml:"graphID,omitempty"` - Series []string `json:"series,omitempty" yaml:"series,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph_output.go deleted file mode 100644 index 78258045f35..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_graph_output.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - QueryClusterGraphOutputType = "queryClusterGraphOutput" - QueryClusterGraphOutputFieldData = "data" - QueryClusterGraphOutputFieldType = "type" -) - -type QueryClusterGraphOutput struct { - Data []QueryClusterGraph `json:"data,omitempty" yaml:"data,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_metric_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_metric_input.go deleted file mode 100644 index 716fdde5b12..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_cluster_metric_input.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - QueryClusterMetricInputType = "queryClusterMetricInput" - QueryClusterMetricInputFieldClusterName = "clusterId" - QueryClusterMetricInputFieldExpr = "expr" - QueryClusterMetricInputFieldFrom = "from" - QueryClusterMetricInputFieldInterval = "interval" - QueryClusterMetricInputFieldTo = "to" -) - -type QueryClusterMetricInput struct { - ClusterName string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Expr string `json:"expr,omitempty" yaml:"expr,omitempty"` - From string `json:"from,omitempty" yaml:"from,omitempty"` - Interval string `json:"interval,omitempty" yaml:"interval,omitempty"` - To string `json:"to,omitempty" yaml:"to,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_graph_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_graph_input.go deleted file mode 100644 index 2ec12878454..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_graph_input.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - QueryGraphInputType = "queryGraphInput" - QueryGraphInputFieldFilters = "filters" - QueryGraphInputFieldFrom = "from" - QueryGraphInputFieldInterval = "interval" - QueryGraphInputFieldIsDetails = "isDetails" - QueryGraphInputFieldMetricParams = "metricParams" - QueryGraphInputFieldTo = "to" -) - -type QueryGraphInput struct { - Filters map[string]string `json:"filters,omitempty" yaml:"filters,omitempty"` - From string `json:"from,omitempty" yaml:"from,omitempty"` - Interval string `json:"interval,omitempty" yaml:"interval,omitempty"` - IsDetails bool `json:"isDetails,omitempty" yaml:"isDetails,omitempty"` - MetricParams map[string]string `json:"metricParams,omitempty" yaml:"metricParams,omitempty"` - To string `json:"to,omitempty" yaml:"to,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_metric_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_metric_output.go deleted file mode 100644 index 9f93276a876..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_metric_output.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - QueryMetricOutputType = "queryMetricOutput" - QueryMetricOutputFieldSeries = "series" - QueryMetricOutputFieldType = "type" -) - -type QueryMetricOutput struct { - Series []string `json:"series,omitempty" yaml:"series,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph.go deleted file mode 100644 index 106f3426506..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - QueryProjectGraphType = "queryProjectGraph" - QueryProjectGraphFieldGraphName = "graphID" - QueryProjectGraphFieldSeries = "series" -) - -type QueryProjectGraph struct { - GraphName string `json:"graphID,omitempty" yaml:"graphID,omitempty"` - Series []string `json:"series,omitempty" yaml:"series,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph_output.go deleted file mode 100644 index 0d4406c144a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_graph_output.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - QueryProjectGraphOutputType = "queryProjectGraphOutput" - QueryProjectGraphOutputFieldData = "data" - QueryProjectGraphOutputFieldType = "type" -) - -type QueryProjectGraphOutput struct { - Data []QueryProjectGraph `json:"data,omitempty" yaml:"data,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_metric_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_metric_input.go deleted file mode 100644 index 57972708a6a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_query_project_metric_input.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - QueryProjectMetricInputType = "queryProjectMetricInput" - QueryProjectMetricInputFieldExpr = "expr" - QueryProjectMetricInputFieldFrom = "from" - QueryProjectMetricInputFieldInterval = "interval" - QueryProjectMetricInputFieldProjectName = "projectId" - QueryProjectMetricInputFieldTo = "to" -) - -type QueryProjectMetricInput struct { - Expr string `json:"expr,omitempty" yaml:"expr,omitempty"` - From string `json:"from,omitempty" yaml:"from,omitempty"` - Interval string `json:"interval,omitempty" yaml:"interval,omitempty"` - ProjectName string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - To string `json:"to,omitempty" yaml:"to,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_question.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_question.go deleted file mode 100644 index 60426833db6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_question.go +++ /dev/null @@ -1,44 +0,0 @@ -package client - -const ( - QuestionType = "question" - QuestionFieldDefault = "default" - QuestionFieldDescription = "description" - QuestionFieldGroup = "group" - QuestionFieldInvalidChars = "invalidChars" - QuestionFieldLabel = "label" - QuestionFieldMax = "max" - QuestionFieldMaxLength = "maxLength" - QuestionFieldMin = "min" - QuestionFieldMinLength = "minLength" - QuestionFieldOptions = "options" - QuestionFieldRequired = "required" - QuestionFieldSatisfies = "satisfies" - QuestionFieldShowIf = "showIf" - QuestionFieldShowSubquestionIf = "showSubquestionIf" - QuestionFieldSubquestions = "subquestions" - QuestionFieldType = "type" - QuestionFieldValidChars = "validChars" - QuestionFieldVariable = "variable" -) - -type Question struct { - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Group string `json:"group,omitempty" yaml:"group,omitempty"` - InvalidChars string `json:"invalidChars,omitempty" yaml:"invalidChars,omitempty"` - Label string `json:"label,omitempty" yaml:"label,omitempty"` - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - MaxLength int64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"` - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` - MinLength int64 `json:"minLength,omitempty" yaml:"minLength,omitempty"` - Options []string `json:"options,omitempty" yaml:"options,omitempty"` - Required bool `json:"required,omitempty" yaml:"required,omitempty"` - Satisfies string `json:"satisfies,omitempty" yaml:"satisfies,omitempty"` - ShowIf string `json:"showIf,omitempty" yaml:"showIf,omitempty"` - ShowSubquestionIf string `json:"showSubquestionIf,omitempty" yaml:"showSubquestionIf,omitempty"` - Subquestions []SubQuestion `json:"subquestions,omitempty" yaml:"subquestions,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - ValidChars string `json:"validChars,omitempty" yaml:"validChars,omitempty"` - Variable string `json:"variable,omitempty" yaml:"variable,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_quobyte_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_quobyte_volume_source.go deleted file mode 100644 index 41e308d3bfa..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_quobyte_volume_source.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - QuobyteVolumeSourceType = "quobyteVolumeSource" - QuobyteVolumeSourceFieldGroup = "group" - QuobyteVolumeSourceFieldReadOnly = "readOnly" - QuobyteVolumeSourceFieldRegistry = "registry" - QuobyteVolumeSourceFieldTenant = "tenant" - QuobyteVolumeSourceFieldUser = "user" - QuobyteVolumeSourceFieldVolume = "volume" -) - -type QuobyteVolumeSource struct { - Group string `json:"group,omitempty" yaml:"group,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - Registry string `json:"registry,omitempty" yaml:"registry,omitempty"` - Tenant string `json:"tenant,omitempty" yaml:"tenant,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` - Volume string `json:"volume,omitempty" yaml:"volume,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_kubernetes_engine_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_kubernetes_engine_config.go deleted file mode 100644 index 19d33699c76..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_kubernetes_engine_config.go +++ /dev/null @@ -1,62 +0,0 @@ -package client - -const ( - RancherKubernetesEngineConfigType = "rancherKubernetesEngineConfig" - RancherKubernetesEngineConfigFieldAddonJobTimeout = "addonJobTimeout" - RancherKubernetesEngineConfigFieldAddons = "addons" - RancherKubernetesEngineConfigFieldAddonsInclude = "addonsInclude" - RancherKubernetesEngineConfigFieldAuthentication = "authentication" - RancherKubernetesEngineConfigFieldAuthorization = "authorization" - RancherKubernetesEngineConfigFieldBastionHost = "bastionHost" - RancherKubernetesEngineConfigFieldCloudProvider = "cloudProvider" - RancherKubernetesEngineConfigFieldClusterName = "clusterName" - RancherKubernetesEngineConfigFieldDNS = "dns" - RancherKubernetesEngineConfigFieldEnableCRIDockerd = "enableCriDockerd" - RancherKubernetesEngineConfigFieldIgnoreDockerVersion = "ignoreDockerVersion" - RancherKubernetesEngineConfigFieldIngress = "ingress" - RancherKubernetesEngineConfigFieldMonitoring = "monitoring" - RancherKubernetesEngineConfigFieldNetwork = "network" - RancherKubernetesEngineConfigFieldNodes = "nodes" - RancherKubernetesEngineConfigFieldPrefixPath = "prefixPath" - RancherKubernetesEngineConfigFieldPrivateRegistries = "privateRegistries" - RancherKubernetesEngineConfigFieldRestore = "restore" - RancherKubernetesEngineConfigFieldRotateCertificates = "rotateCertificates" - RancherKubernetesEngineConfigFieldRotateEncryptionKey = "rotateEncryptionKey" - RancherKubernetesEngineConfigFieldSSHAgentAuth = "sshAgentAuth" - RancherKubernetesEngineConfigFieldSSHCertPath = "sshCertPath" - RancherKubernetesEngineConfigFieldSSHKeyPath = "sshKeyPath" - RancherKubernetesEngineConfigFieldServices = "services" - RancherKubernetesEngineConfigFieldUpgradeStrategy = "upgradeStrategy" - RancherKubernetesEngineConfigFieldVersion = "kubernetesVersion" - RancherKubernetesEngineConfigFieldWindowsPrefixPath = "winPrefixPath" -) - -type RancherKubernetesEngineConfig struct { - AddonJobTimeout int64 `json:"addonJobTimeout,omitempty" yaml:"addonJobTimeout,omitempty"` - Addons string `json:"addons,omitempty" yaml:"addons,omitempty"` - AddonsInclude []string `json:"addonsInclude,omitempty" yaml:"addonsInclude,omitempty"` - Authentication *AuthnConfig `json:"authentication,omitempty" yaml:"authentication,omitempty"` - Authorization *AuthzConfig `json:"authorization,omitempty" yaml:"authorization,omitempty"` - BastionHost *BastionHost `json:"bastionHost,omitempty" yaml:"bastionHost,omitempty"` - CloudProvider *CloudProvider `json:"cloudProvider,omitempty" yaml:"cloudProvider,omitempty"` - ClusterName string `json:"clusterName,omitempty" yaml:"clusterName,omitempty"` - DNS *DNSConfig `json:"dns,omitempty" yaml:"dns,omitempty"` - EnableCRIDockerd *bool `json:"enableCriDockerd,omitempty" yaml:"enableCriDockerd,omitempty"` - IgnoreDockerVersion *bool `json:"ignoreDockerVersion,omitempty" yaml:"ignoreDockerVersion,omitempty"` - Ingress *IngressConfig `json:"ingress,omitempty" yaml:"ingress,omitempty"` - Monitoring *MonitoringConfig `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` - Network *NetworkConfig `json:"network,omitempty" yaml:"network,omitempty"` - Nodes []RKEConfigNode `json:"nodes,omitempty" yaml:"nodes,omitempty"` - PrefixPath string `json:"prefixPath,omitempty" yaml:"prefixPath,omitempty"` - PrivateRegistries []PrivateRegistry `json:"privateRegistries,omitempty" yaml:"privateRegistries,omitempty"` - Restore *RestoreConfig `json:"restore,omitempty" yaml:"restore,omitempty"` - RotateCertificates *RotateCertificates `json:"rotateCertificates,omitempty" yaml:"rotateCertificates,omitempty"` - RotateEncryptionKey bool `json:"rotateEncryptionKey,omitempty" yaml:"rotateEncryptionKey,omitempty"` - SSHAgentAuth bool `json:"sshAgentAuth,omitempty" yaml:"sshAgentAuth,omitempty"` - SSHCertPath string `json:"sshCertPath,omitempty" yaml:"sshCertPath,omitempty"` - SSHKeyPath string `json:"sshKeyPath,omitempty" yaml:"sshKeyPath,omitempty"` - Services *RKEConfigServices `json:"services,omitempty" yaml:"services,omitempty"` - UpgradeStrategy *NodeUpgradeStrategy `json:"upgradeStrategy,omitempty" yaml:"upgradeStrategy,omitempty"` - Version string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` - WindowsPrefixPath string `json:"winPrefixPath,omitempty" yaml:"winPrefixPath,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_user_notification.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_user_notification.go deleted file mode 100644 index 8fa289e628d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rancher_user_notification.go +++ /dev/null @@ -1,122 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - RancherUserNotificationType = "rancherUserNotification" - RancherUserNotificationFieldAnnotations = "annotations" - RancherUserNotificationFieldComponentName = "componentName" - RancherUserNotificationFieldCreated = "created" - RancherUserNotificationFieldCreatorID = "creatorId" - RancherUserNotificationFieldLabels = "labels" - RancherUserNotificationFieldMessage = "message" - RancherUserNotificationFieldName = "name" - RancherUserNotificationFieldOwnerReferences = "ownerReferences" - RancherUserNotificationFieldRemoved = "removed" - RancherUserNotificationFieldUUID = "uuid" -) - -type RancherUserNotification struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ComponentName string `json:"componentName,omitempty" yaml:"componentName,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RancherUserNotificationCollection struct { - types.Collection - Data []RancherUserNotification `json:"data,omitempty"` - client *RancherUserNotificationClient -} - -type RancherUserNotificationClient struct { - apiClient *Client -} - -type RancherUserNotificationOperations interface { - List(opts *types.ListOpts) (*RancherUserNotificationCollection, error) - ListAll(opts *types.ListOpts) (*RancherUserNotificationCollection, error) - Create(opts *RancherUserNotification) (*RancherUserNotification, error) - Update(existing *RancherUserNotification, updates interface{}) (*RancherUserNotification, error) - Replace(existing *RancherUserNotification) (*RancherUserNotification, error) - ByID(id string) (*RancherUserNotification, error) - Delete(container *RancherUserNotification) error -} - -func newRancherUserNotificationClient(apiClient *Client) *RancherUserNotificationClient { - return &RancherUserNotificationClient{ - apiClient: apiClient, - } -} - -func (c *RancherUserNotificationClient) Create(container *RancherUserNotification) (*RancherUserNotification, error) { - resp := &RancherUserNotification{} - err := c.apiClient.Ops.DoCreate(RancherUserNotificationType, container, resp) - return resp, err -} - -func (c *RancherUserNotificationClient) Update(existing *RancherUserNotification, updates interface{}) (*RancherUserNotification, error) { - resp := &RancherUserNotification{} - err := c.apiClient.Ops.DoUpdate(RancherUserNotificationType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RancherUserNotificationClient) Replace(obj *RancherUserNotification) (*RancherUserNotification, error) { - resp := &RancherUserNotification{} - err := c.apiClient.Ops.DoReplace(RancherUserNotificationType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *RancherUserNotificationClient) List(opts *types.ListOpts) (*RancherUserNotificationCollection, error) { - resp := &RancherUserNotificationCollection{} - err := c.apiClient.Ops.DoList(RancherUserNotificationType, opts, resp) - resp.client = c - return resp, err -} - -func (c *RancherUserNotificationClient) ListAll(opts *types.ListOpts) (*RancherUserNotificationCollection, error) { - resp := &RancherUserNotificationCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *RancherUserNotificationCollection) Next() (*RancherUserNotificationCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RancherUserNotificationCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RancherUserNotificationClient) ByID(id string) (*RancherUserNotification, error) { - resp := &RancherUserNotification{} - err := c.apiClient.Ops.DoByID(RancherUserNotificationType, id, resp) - return resp, err -} - -func (c *RancherUserNotificationClient) Delete(container *RancherUserNotification) error { - return c.apiClient.Ops.DoResourceDelete(RancherUserNotificationType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rbd_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rbd_volume_source.go deleted file mode 100644 index 436a8b73b66..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rbd_volume_source.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - RBDVolumeSourceType = "rbdVolumeSource" - RBDVolumeSourceFieldCephMonitors = "monitors" - RBDVolumeSourceFieldFSType = "fsType" - RBDVolumeSourceFieldKeyring = "keyring" - RBDVolumeSourceFieldRBDImage = "image" - RBDVolumeSourceFieldRBDPool = "pool" - RBDVolumeSourceFieldRadosUser = "user" - RBDVolumeSourceFieldReadOnly = "readOnly" - RBDVolumeSourceFieldSecretRef = "secretRef" -) - -type RBDVolumeSource struct { - CephMonitors []string `json:"monitors,omitempty" yaml:"monitors,omitempty"` - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - Keyring string `json:"keyring,omitempty" yaml:"keyring,omitempty"` - RBDImage string `json:"image,omitempty" yaml:"image,omitempty"` - RBDPool string `json:"pool,omitempty" yaml:"pool,omitempty"` - RadosUser string `json:"user,omitempty" yaml:"user,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SecretRef *LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_recipient.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_recipient.go deleted file mode 100644 index ca5199da400..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_recipient.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - RecipientType = "recipient" - RecipientFieldNotifierID = "notifierId" - RecipientFieldNotifierType = "notifierType" - RecipientFieldRecipient = "recipient" -) - -type Recipient struct { - NotifierID string `json:"notifierId,omitempty" yaml:"notifierId,omitempty"` - NotifierType string `json:"notifierType,omitempty" yaml:"notifierType,omitempty"` - Recipient string `json:"recipient,omitempty" yaml:"recipient,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_configuration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_configuration.go deleted file mode 100644 index 3c09f763b2c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_configuration.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ResourceConfigurationType = "resourceConfiguration" - ResourceConfigurationFieldProviders = "providers" - ResourceConfigurationFieldResources = "resources" -) - -type ResourceConfiguration struct { - Providers []ProviderConfiguration `json:"providers,omitempty" yaml:"providers,omitempty"` - Resources []string `json:"resources,omitempty" yaml:"resources,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_field_selector.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_field_selector.go deleted file mode 100644 index d9c0c92e5c0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_field_selector.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ResourceFieldSelectorType = "resourceFieldSelector" - ResourceFieldSelectorFieldContainerName = "containerName" - ResourceFieldSelectorFieldDivisor = "divisor" - ResourceFieldSelectorFieldResource = "resource" -) - -type ResourceFieldSelector struct { - ContainerName string `json:"containerName,omitempty" yaml:"containerName,omitempty"` - Divisor string `json:"divisor,omitempty" yaml:"divisor,omitempty"` - Resource string `json:"resource,omitempty" yaml:"resource,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_quota_limit.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_quota_limit.go deleted file mode 100644 index 4bc04abf43d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_quota_limit.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -const ( - ResourceQuotaLimitType = "resourceQuotaLimit" - ResourceQuotaLimitFieldConfigMaps = "configMaps" - ResourceQuotaLimitFieldLimitsCPU = "limitsCpu" - ResourceQuotaLimitFieldLimitsMemory = "limitsMemory" - ResourceQuotaLimitFieldPersistentVolumeClaims = "persistentVolumeClaims" - ResourceQuotaLimitFieldPods = "pods" - ResourceQuotaLimitFieldReplicationControllers = "replicationControllers" - ResourceQuotaLimitFieldRequestsCPU = "requestsCpu" - ResourceQuotaLimitFieldRequestsMemory = "requestsMemory" - ResourceQuotaLimitFieldRequestsStorage = "requestsStorage" - ResourceQuotaLimitFieldSecrets = "secrets" - ResourceQuotaLimitFieldServices = "services" - ResourceQuotaLimitFieldServicesLoadBalancers = "servicesLoadBalancers" - ResourceQuotaLimitFieldServicesNodePorts = "servicesNodePorts" -) - -type ResourceQuotaLimit struct { - ConfigMaps string `json:"configMaps,omitempty" yaml:"configMaps,omitempty"` - LimitsCPU string `json:"limitsCpu,omitempty" yaml:"limitsCpu,omitempty"` - LimitsMemory string `json:"limitsMemory,omitempty" yaml:"limitsMemory,omitempty"` - PersistentVolumeClaims string `json:"persistentVolumeClaims,omitempty" yaml:"persistentVolumeClaims,omitempty"` - Pods string `json:"pods,omitempty" yaml:"pods,omitempty"` - ReplicationControllers string `json:"replicationControllers,omitempty" yaml:"replicationControllers,omitempty"` - RequestsCPU string `json:"requestsCpu,omitempty" yaml:"requestsCpu,omitempty"` - RequestsMemory string `json:"requestsMemory,omitempty" yaml:"requestsMemory,omitempty"` - RequestsStorage string `json:"requestsStorage,omitempty" yaml:"requestsStorage,omitempty"` - Secrets string `json:"secrets,omitempty" yaml:"secrets,omitempty"` - Services string `json:"services,omitempty" yaml:"services,omitempty"` - ServicesLoadBalancers string `json:"servicesLoadBalancers,omitempty" yaml:"servicesLoadBalancers,omitempty"` - ServicesNodePorts string `json:"servicesNodePorts,omitempty" yaml:"servicesNodePorts,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_requirements.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_requirements.go deleted file mode 100644 index dd549d9ebd6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_resource_requirements.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - ResourceRequirementsType = "resourceRequirements" - ResourceRequirementsFieldLimits = "limits" - ResourceRequirementsFieldRequests = "requests" -) - -type ResourceRequirements struct { - Limits map[string]string `json:"limits,omitempty" yaml:"limits,omitempty"` - Requests map[string]string `json:"requests,omitempty" yaml:"requests,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_config.go deleted file mode 100644 index 8370f96f3f5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RestoreConfigType = "restoreConfig" - RestoreConfigFieldRestore = "restore" - RestoreConfigFieldSnapshotName = "snapshotName" -) - -type RestoreConfig struct { - Restore bool `json:"restore,omitempty" yaml:"restore,omitempty"` - SnapshotName string `json:"snapshotName,omitempty" yaml:"snapshotName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_from_etcd_backup_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_from_etcd_backup_input.go deleted file mode 100644 index 7bd5f59f9be..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_restore_from_etcd_backup_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RestoreFromEtcdBackupInputType = "restoreFromEtcdBackupInput" - RestoreFromEtcdBackupInputFieldEtcdBackupID = "etcdBackupId" - RestoreFromEtcdBackupInputFieldRestoreRkeConfig = "restoreRkeConfig" -) - -type RestoreFromEtcdBackupInput struct { - EtcdBackupID string `json:"etcdBackupId,omitempty" yaml:"etcdBackupId,omitempty"` - RestoreRkeConfig string `json:"restoreRkeConfig,omitempty" yaml:"restoreRkeConfig,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke2config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke2config.go deleted file mode 100644 index 3e355a9a5a5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke2config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - Rke2ConfigType = "rke2Config" - Rke2ConfigFieldClusterUpgradeStrategy = "rke2upgradeStrategy" - Rke2ConfigFieldVersion = "kubernetesVersion" -) - -type Rke2Config struct { - ClusterUpgradeStrategy *ClusterUpgradeStrategy `json:"rke2upgradeStrategy,omitempty" yaml:"rke2upgradeStrategy,omitempty"` - Version string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_addon.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_addon.go deleted file mode 100644 index 67719eedd03..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_addon.go +++ /dev/null @@ -1,120 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - RkeAddonType = "rkeAddon" - RkeAddonFieldAnnotations = "annotations" - RkeAddonFieldCreated = "created" - RkeAddonFieldCreatorID = "creatorId" - RkeAddonFieldLabels = "labels" - RkeAddonFieldName = "name" - RkeAddonFieldOwnerReferences = "ownerReferences" - RkeAddonFieldRemoved = "removed" - RkeAddonFieldTemplate = "template" - RkeAddonFieldUUID = "uuid" -) - -type RkeAddon struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Template string `json:"template,omitempty" yaml:"template,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RkeAddonCollection struct { - types.Collection - Data []RkeAddon `json:"data,omitempty"` - client *RkeAddonClient -} - -type RkeAddonClient struct { - apiClient *Client -} - -type RkeAddonOperations interface { - List(opts *types.ListOpts) (*RkeAddonCollection, error) - ListAll(opts *types.ListOpts) (*RkeAddonCollection, error) - Create(opts *RkeAddon) (*RkeAddon, error) - Update(existing *RkeAddon, updates interface{}) (*RkeAddon, error) - Replace(existing *RkeAddon) (*RkeAddon, error) - ByID(id string) (*RkeAddon, error) - Delete(container *RkeAddon) error -} - -func newRkeAddonClient(apiClient *Client) *RkeAddonClient { - return &RkeAddonClient{ - apiClient: apiClient, - } -} - -func (c *RkeAddonClient) Create(container *RkeAddon) (*RkeAddon, error) { - resp := &RkeAddon{} - err := c.apiClient.Ops.DoCreate(RkeAddonType, container, resp) - return resp, err -} - -func (c *RkeAddonClient) Update(existing *RkeAddon, updates interface{}) (*RkeAddon, error) { - resp := &RkeAddon{} - err := c.apiClient.Ops.DoUpdate(RkeAddonType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RkeAddonClient) Replace(obj *RkeAddon) (*RkeAddon, error) { - resp := &RkeAddon{} - err := c.apiClient.Ops.DoReplace(RkeAddonType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *RkeAddonClient) List(opts *types.ListOpts) (*RkeAddonCollection, error) { - resp := &RkeAddonCollection{} - err := c.apiClient.Ops.DoList(RkeAddonType, opts, resp) - resp.client = c - return resp, err -} - -func (c *RkeAddonClient) ListAll(opts *types.ListOpts) (*RkeAddonCollection, error) { - resp := &RkeAddonCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *RkeAddonCollection) Next() (*RkeAddonCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RkeAddonCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RkeAddonClient) ByID(id string) (*RkeAddon, error) { - resp := &RkeAddon{} - err := c.apiClient.Ops.DoByID(RkeAddonType, id, resp) - return resp, err -} - -func (c *RkeAddonClient) Delete(container *RkeAddon) error { - return c.apiClient.Ops.DoResourceDelete(RkeAddonType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node.go deleted file mode 100644 index a8a2c20abf4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node.go +++ /dev/null @@ -1,38 +0,0 @@ -package client - -const ( - RKEConfigNodeType = "rkeConfigNode" - RKEConfigNodeFieldAddress = "address" - RKEConfigNodeFieldDockerSocket = "dockerSocket" - RKEConfigNodeFieldHostnameOverride = "hostnameOverride" - RKEConfigNodeFieldInternalAddress = "internalAddress" - RKEConfigNodeFieldLabels = "labels" - RKEConfigNodeFieldNodeID = "nodeId" - RKEConfigNodeFieldPort = "port" - RKEConfigNodeFieldRole = "role" - RKEConfigNodeFieldSSHAgentAuth = "sshAgentAuth" - RKEConfigNodeFieldSSHCert = "sshCert" - RKEConfigNodeFieldSSHCertPath = "sshCertPath" - RKEConfigNodeFieldSSHKey = "sshKey" - RKEConfigNodeFieldSSHKeyPath = "sshKeyPath" - RKEConfigNodeFieldTaints = "taints" - RKEConfigNodeFieldUser = "user" -) - -type RKEConfigNode struct { - Address string `json:"address,omitempty" yaml:"address,omitempty"` - DockerSocket string `json:"dockerSocket,omitempty" yaml:"dockerSocket,omitempty"` - HostnameOverride string `json:"hostnameOverride,omitempty" yaml:"hostnameOverride,omitempty"` - InternalAddress string `json:"internalAddress,omitempty" yaml:"internalAddress,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - NodeID string `json:"nodeId,omitempty" yaml:"nodeId,omitempty"` - Port string `json:"port,omitempty" yaml:"port,omitempty"` - Role []string `json:"role,omitempty" yaml:"role,omitempty"` - SSHAgentAuth bool `json:"sshAgentAuth,omitempty" yaml:"sshAgentAuth,omitempty"` - SSHCert string `json:"sshCert,omitempty" yaml:"sshCert,omitempty"` - SSHCertPath string `json:"sshCertPath,omitempty" yaml:"sshCertPath,omitempty"` - SSHKey string `json:"sshKey,omitempty" yaml:"sshKey,omitempty"` - SSHKeyPath string `json:"sshKeyPath,omitempty" yaml:"sshKeyPath,omitempty"` - Taints []RKETaint `json:"taints,omitempty" yaml:"taints,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node_plan.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node_plan.go deleted file mode 100644 index fd9224fedf4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_node_plan.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - RKEConfigNodePlanType = "rkeConfigNodePlan" - RKEConfigNodePlanFieldAddress = "address" - RKEConfigNodePlanFieldAnnotations = "annotations" - RKEConfigNodePlanFieldFiles = "files" - RKEConfigNodePlanFieldLabels = "labels" - RKEConfigNodePlanFieldPortChecks = "portChecks" - RKEConfigNodePlanFieldProcesses = "processes" - RKEConfigNodePlanFieldTaints = "taints" -) - -type RKEConfigNodePlan struct { - Address string `json:"address,omitempty" yaml:"address,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Files []File `json:"files,omitempty" yaml:"files,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - PortChecks []PortCheck `json:"portChecks,omitempty" yaml:"portChecks,omitempty"` - Processes map[string]Process `json:"processes,omitempty" yaml:"processes,omitempty"` - Taints []RKETaint `json:"taints,omitempty" yaml:"taints,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_services.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_services.go deleted file mode 100644 index 16086f60efa..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_config_services.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - RKEConfigServicesType = "rkeConfigServices" - RKEConfigServicesFieldEtcd = "etcd" - RKEConfigServicesFieldKubeAPI = "kubeApi" - RKEConfigServicesFieldKubeController = "kubeController" - RKEConfigServicesFieldKubelet = "kubelet" - RKEConfigServicesFieldKubeproxy = "kubeproxy" - RKEConfigServicesFieldScheduler = "scheduler" -) - -type RKEConfigServices struct { - Etcd *ETCDService `json:"etcd,omitempty" yaml:"etcd,omitempty"` - KubeAPI *KubeAPIService `json:"kubeApi,omitempty" yaml:"kubeApi,omitempty"` - KubeController *KubeControllerService `json:"kubeController,omitempty" yaml:"kubeController,omitempty"` - Kubelet *KubeletService `json:"kubelet,omitempty" yaml:"kubelet,omitempty"` - Kubeproxy *KubeproxyService `json:"kubeproxy,omitempty" yaml:"kubeproxy,omitempty"` - Scheduler *SchedulerService `json:"scheduler,omitempty" yaml:"scheduler,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_service_option.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_service_option.go deleted file mode 100644 index 6c5173f0f22..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_service_option.go +++ /dev/null @@ -1,120 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - RkeK8sServiceOptionType = "rkeK8sServiceOption" - RkeK8sServiceOptionFieldAnnotations = "annotations" - RkeK8sServiceOptionFieldCreated = "created" - RkeK8sServiceOptionFieldCreatorID = "creatorId" - RkeK8sServiceOptionFieldLabels = "labels" - RkeK8sServiceOptionFieldName = "name" - RkeK8sServiceOptionFieldOwnerReferences = "ownerReferences" - RkeK8sServiceOptionFieldRemoved = "removed" - RkeK8sServiceOptionFieldServiceOptions = "serviceOptions" - RkeK8sServiceOptionFieldUUID = "uuid" -) - -type RkeK8sServiceOption struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ServiceOptions *KubernetesServicesOptions `json:"serviceOptions,omitempty" yaml:"serviceOptions,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RkeK8sServiceOptionCollection struct { - types.Collection - Data []RkeK8sServiceOption `json:"data,omitempty"` - client *RkeK8sServiceOptionClient -} - -type RkeK8sServiceOptionClient struct { - apiClient *Client -} - -type RkeK8sServiceOptionOperations interface { - List(opts *types.ListOpts) (*RkeK8sServiceOptionCollection, error) - ListAll(opts *types.ListOpts) (*RkeK8sServiceOptionCollection, error) - Create(opts *RkeK8sServiceOption) (*RkeK8sServiceOption, error) - Update(existing *RkeK8sServiceOption, updates interface{}) (*RkeK8sServiceOption, error) - Replace(existing *RkeK8sServiceOption) (*RkeK8sServiceOption, error) - ByID(id string) (*RkeK8sServiceOption, error) - Delete(container *RkeK8sServiceOption) error -} - -func newRkeK8sServiceOptionClient(apiClient *Client) *RkeK8sServiceOptionClient { - return &RkeK8sServiceOptionClient{ - apiClient: apiClient, - } -} - -func (c *RkeK8sServiceOptionClient) Create(container *RkeK8sServiceOption) (*RkeK8sServiceOption, error) { - resp := &RkeK8sServiceOption{} - err := c.apiClient.Ops.DoCreate(RkeK8sServiceOptionType, container, resp) - return resp, err -} - -func (c *RkeK8sServiceOptionClient) Update(existing *RkeK8sServiceOption, updates interface{}) (*RkeK8sServiceOption, error) { - resp := &RkeK8sServiceOption{} - err := c.apiClient.Ops.DoUpdate(RkeK8sServiceOptionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RkeK8sServiceOptionClient) Replace(obj *RkeK8sServiceOption) (*RkeK8sServiceOption, error) { - resp := &RkeK8sServiceOption{} - err := c.apiClient.Ops.DoReplace(RkeK8sServiceOptionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *RkeK8sServiceOptionClient) List(opts *types.ListOpts) (*RkeK8sServiceOptionCollection, error) { - resp := &RkeK8sServiceOptionCollection{} - err := c.apiClient.Ops.DoList(RkeK8sServiceOptionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *RkeK8sServiceOptionClient) ListAll(opts *types.ListOpts) (*RkeK8sServiceOptionCollection, error) { - resp := &RkeK8sServiceOptionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *RkeK8sServiceOptionCollection) Next() (*RkeK8sServiceOptionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RkeK8sServiceOptionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RkeK8sServiceOptionClient) ByID(id string) (*RkeK8sServiceOption, error) { - resp := &RkeK8sServiceOption{} - err := c.apiClient.Ops.DoByID(RkeK8sServiceOptionType, id, resp) - return resp, err -} - -func (c *RkeK8sServiceOptionClient) Delete(container *RkeK8sServiceOption) error { - return c.apiClient.Ops.DoResourceDelete(RkeK8sServiceOptionType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_system_image.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_system_image.go deleted file mode 100644 index 3fb0e153f52..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_k8s_system_image.go +++ /dev/null @@ -1,120 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - RkeK8sSystemImageType = "rkeK8sSystemImage" - RkeK8sSystemImageFieldAnnotations = "annotations" - RkeK8sSystemImageFieldCreated = "created" - RkeK8sSystemImageFieldCreatorID = "creatorId" - RkeK8sSystemImageFieldLabels = "labels" - RkeK8sSystemImageFieldName = "name" - RkeK8sSystemImageFieldOwnerReferences = "ownerReferences" - RkeK8sSystemImageFieldRemoved = "removed" - RkeK8sSystemImageFieldSystemImages = "systemImages" - RkeK8sSystemImageFieldUUID = "uuid" -) - -type RkeK8sSystemImage struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SystemImages *RKESystemImages `json:"systemImages,omitempty" yaml:"systemImages,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RkeK8sSystemImageCollection struct { - types.Collection - Data []RkeK8sSystemImage `json:"data,omitempty"` - client *RkeK8sSystemImageClient -} - -type RkeK8sSystemImageClient struct { - apiClient *Client -} - -type RkeK8sSystemImageOperations interface { - List(opts *types.ListOpts) (*RkeK8sSystemImageCollection, error) - ListAll(opts *types.ListOpts) (*RkeK8sSystemImageCollection, error) - Create(opts *RkeK8sSystemImage) (*RkeK8sSystemImage, error) - Update(existing *RkeK8sSystemImage, updates interface{}) (*RkeK8sSystemImage, error) - Replace(existing *RkeK8sSystemImage) (*RkeK8sSystemImage, error) - ByID(id string) (*RkeK8sSystemImage, error) - Delete(container *RkeK8sSystemImage) error -} - -func newRkeK8sSystemImageClient(apiClient *Client) *RkeK8sSystemImageClient { - return &RkeK8sSystemImageClient{ - apiClient: apiClient, - } -} - -func (c *RkeK8sSystemImageClient) Create(container *RkeK8sSystemImage) (*RkeK8sSystemImage, error) { - resp := &RkeK8sSystemImage{} - err := c.apiClient.Ops.DoCreate(RkeK8sSystemImageType, container, resp) - return resp, err -} - -func (c *RkeK8sSystemImageClient) Update(existing *RkeK8sSystemImage, updates interface{}) (*RkeK8sSystemImage, error) { - resp := &RkeK8sSystemImage{} - err := c.apiClient.Ops.DoUpdate(RkeK8sSystemImageType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RkeK8sSystemImageClient) Replace(obj *RkeK8sSystemImage) (*RkeK8sSystemImage, error) { - resp := &RkeK8sSystemImage{} - err := c.apiClient.Ops.DoReplace(RkeK8sSystemImageType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *RkeK8sSystemImageClient) List(opts *types.ListOpts) (*RkeK8sSystemImageCollection, error) { - resp := &RkeK8sSystemImageCollection{} - err := c.apiClient.Ops.DoList(RkeK8sSystemImageType, opts, resp) - resp.client = c - return resp, err -} - -func (c *RkeK8sSystemImageClient) ListAll(opts *types.ListOpts) (*RkeK8sSystemImageCollection, error) { - resp := &RkeK8sSystemImageCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *RkeK8sSystemImageCollection) Next() (*RkeK8sSystemImageCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RkeK8sSystemImageCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RkeK8sSystemImageClient) ByID(id string) (*RkeK8sSystemImage, error) { - resp := &RkeK8sSystemImage{} - err := c.apiClient.Ops.DoByID(RkeK8sSystemImageType, id, resp) - return resp, err -} - -func (c *RkeK8sSystemImageClient) Delete(container *RkeK8sSystemImage) error { - return c.apiClient.Ops.DoResourceDelete(RkeK8sSystemImageType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_system_images.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_system_images.go deleted file mode 100644 index 185a3f0770e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_system_images.go +++ /dev/null @@ -1,90 +0,0 @@ -package client - -const ( - RKESystemImagesType = "rkeSystemImages" - RKESystemImagesFieldAciCniDeployContainer = "aciCniDeployContainer" - RKESystemImagesFieldAciControllerContainer = "aciControllerContainer" - RKESystemImagesFieldAciGbpServerContainer = "aciGbpServerContainer" - RKESystemImagesFieldAciHostContainer = "aciHostContainer" - RKESystemImagesFieldAciMcastContainer = "aciMcastContainer" - RKESystemImagesFieldAciOpenvSwitchContainer = "aciOvsContainer" - RKESystemImagesFieldAciOpflexContainer = "aciOpflexContainer" - RKESystemImagesFieldAciOpflexServerContainer = "aciOpflexServerContainer" - RKESystemImagesFieldAlpine = "alpine" - RKESystemImagesFieldCalicoCNI = "calicoCni" - RKESystemImagesFieldCalicoControllers = "calicoControllers" - RKESystemImagesFieldCalicoCtl = "calicoCtl" - RKESystemImagesFieldCalicoFlexVol = "calicoFlexVol" - RKESystemImagesFieldCalicoNode = "calicoNode" - RKESystemImagesFieldCanalCNI = "canalCni" - RKESystemImagesFieldCanalControllers = "canalControllers" - RKESystemImagesFieldCanalFlannel = "canalFlannel" - RKESystemImagesFieldCanalFlexVol = "canalFlexVol" - RKESystemImagesFieldCanalNode = "canalNode" - RKESystemImagesFieldCertDownloader = "certDownloader" - RKESystemImagesFieldCoreDNS = "coredns" - RKESystemImagesFieldCoreDNSAutoscaler = "corednsAutoscaler" - RKESystemImagesFieldDNSmasq = "dnsmasq" - RKESystemImagesFieldEtcd = "etcd" - RKESystemImagesFieldFlannel = "flannel" - RKESystemImagesFieldFlannelCNI = "flannelCni" - RKESystemImagesFieldIngress = "ingress" - RKESystemImagesFieldIngressBackend = "ingressBackend" - RKESystemImagesFieldIngressWebhook = "ingressWebhook" - RKESystemImagesFieldKubeDNS = "kubedns" - RKESystemImagesFieldKubeDNSAutoscaler = "kubednsAutoscaler" - RKESystemImagesFieldKubeDNSSidecar = "kubednsSidecar" - RKESystemImagesFieldKubernetes = "kubernetes" - RKESystemImagesFieldKubernetesServicesSidecar = "kubernetesServicesSidecar" - RKESystemImagesFieldMetricsServer = "metricsServer" - RKESystemImagesFieldNginxProxy = "nginxProxy" - RKESystemImagesFieldNodelocal = "nodelocal" - RKESystemImagesFieldPodInfraContainer = "podInfraContainer" - RKESystemImagesFieldWeaveCNI = "weaveCni" - RKESystemImagesFieldWeaveNode = "weaveNode" - RKESystemImagesFieldWindowsPodInfraContainer = "windowsPodInfraContainer" -) - -type RKESystemImages struct { - AciCniDeployContainer string `json:"aciCniDeployContainer,omitempty" yaml:"aciCniDeployContainer,omitempty"` - AciControllerContainer string `json:"aciControllerContainer,omitempty" yaml:"aciControllerContainer,omitempty"` - AciGbpServerContainer string `json:"aciGbpServerContainer,omitempty" yaml:"aciGbpServerContainer,omitempty"` - AciHostContainer string `json:"aciHostContainer,omitempty" yaml:"aciHostContainer,omitempty"` - AciMcastContainer string `json:"aciMcastContainer,omitempty" yaml:"aciMcastContainer,omitempty"` - AciOpenvSwitchContainer string `json:"aciOvsContainer,omitempty" yaml:"aciOvsContainer,omitempty"` - AciOpflexContainer string `json:"aciOpflexContainer,omitempty" yaml:"aciOpflexContainer,omitempty"` - AciOpflexServerContainer string `json:"aciOpflexServerContainer,omitempty" yaml:"aciOpflexServerContainer,omitempty"` - Alpine string `json:"alpine,omitempty" yaml:"alpine,omitempty"` - CalicoCNI string `json:"calicoCni,omitempty" yaml:"calicoCni,omitempty"` - CalicoControllers string `json:"calicoControllers,omitempty" yaml:"calicoControllers,omitempty"` - CalicoCtl string `json:"calicoCtl,omitempty" yaml:"calicoCtl,omitempty"` - CalicoFlexVol string `json:"calicoFlexVol,omitempty" yaml:"calicoFlexVol,omitempty"` - CalicoNode string `json:"calicoNode,omitempty" yaml:"calicoNode,omitempty"` - CanalCNI string `json:"canalCni,omitempty" yaml:"canalCni,omitempty"` - CanalControllers string `json:"canalControllers,omitempty" yaml:"canalControllers,omitempty"` - CanalFlannel string `json:"canalFlannel,omitempty" yaml:"canalFlannel,omitempty"` - CanalFlexVol string `json:"canalFlexVol,omitempty" yaml:"canalFlexVol,omitempty"` - CanalNode string `json:"canalNode,omitempty" yaml:"canalNode,omitempty"` - CertDownloader string `json:"certDownloader,omitempty" yaml:"certDownloader,omitempty"` - CoreDNS string `json:"coredns,omitempty" yaml:"coredns,omitempty"` - CoreDNSAutoscaler string `json:"corednsAutoscaler,omitempty" yaml:"corednsAutoscaler,omitempty"` - DNSmasq string `json:"dnsmasq,omitempty" yaml:"dnsmasq,omitempty"` - Etcd string `json:"etcd,omitempty" yaml:"etcd,omitempty"` - Flannel string `json:"flannel,omitempty" yaml:"flannel,omitempty"` - FlannelCNI string `json:"flannelCni,omitempty" yaml:"flannelCni,omitempty"` - Ingress string `json:"ingress,omitempty" yaml:"ingress,omitempty"` - IngressBackend string `json:"ingressBackend,omitempty" yaml:"ingressBackend,omitempty"` - IngressWebhook string `json:"ingressWebhook,omitempty" yaml:"ingressWebhook,omitempty"` - KubeDNS string `json:"kubedns,omitempty" yaml:"kubedns,omitempty"` - KubeDNSAutoscaler string `json:"kubednsAutoscaler,omitempty" yaml:"kubednsAutoscaler,omitempty"` - KubeDNSSidecar string `json:"kubednsSidecar,omitempty" yaml:"kubednsSidecar,omitempty"` - Kubernetes string `json:"kubernetes,omitempty" yaml:"kubernetes,omitempty"` - KubernetesServicesSidecar string `json:"kubernetesServicesSidecar,omitempty" yaml:"kubernetesServicesSidecar,omitempty"` - MetricsServer string `json:"metricsServer,omitempty" yaml:"metricsServer,omitempty"` - NginxProxy string `json:"nginxProxy,omitempty" yaml:"nginxProxy,omitempty"` - Nodelocal string `json:"nodelocal,omitempty" yaml:"nodelocal,omitempty"` - PodInfraContainer string `json:"podInfraContainer,omitempty" yaml:"podInfraContainer,omitempty"` - WeaveCNI string `json:"weaveCni,omitempty" yaml:"weaveCni,omitempty"` - WeaveNode string `json:"weaveNode,omitempty" yaml:"weaveNode,omitempty"` - WindowsPodInfraContainer string `json:"windowsPodInfraContainer,omitempty" yaml:"windowsPodInfraContainer,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_taint.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_taint.go deleted file mode 100644 index 8cd196fab93..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rke_taint.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - RKETaintType = "rkeTaint" - RKETaintFieldEffect = "effect" - RKETaintFieldKey = "key" - RKETaintFieldTimeAdded = "timeAdded" - RKETaintFieldValue = "value" -) - -type RKETaint struct { - Effect string `json:"effect,omitempty" yaml:"effect,omitempty"` - Key string `json:"key,omitempty" yaml:"key,omitempty"` - TimeAdded string `json:"timeAdded,omitempty" yaml:"timeAdded,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_role_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_role_template.go deleted file mode 100644 index 15447b7beb3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_role_template.go +++ /dev/null @@ -1,140 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - RoleTemplateType = "roleTemplate" - RoleTemplateFieldAdministrative = "administrative" - RoleTemplateFieldAnnotations = "annotations" - RoleTemplateFieldBuiltin = "builtin" - RoleTemplateFieldClusterCreatorDefault = "clusterCreatorDefault" - RoleTemplateFieldContext = "context" - RoleTemplateFieldCreated = "created" - RoleTemplateFieldCreatorID = "creatorId" - RoleTemplateFieldDescription = "description" - RoleTemplateFieldExternal = "external" - RoleTemplateFieldHidden = "hidden" - RoleTemplateFieldLabels = "labels" - RoleTemplateFieldLocked = "locked" - RoleTemplateFieldName = "name" - RoleTemplateFieldOwnerReferences = "ownerReferences" - RoleTemplateFieldProjectCreatorDefault = "projectCreatorDefault" - RoleTemplateFieldRemoved = "removed" - RoleTemplateFieldRoleTemplateIDs = "roleTemplateIds" - RoleTemplateFieldRules = "rules" - RoleTemplateFieldUUID = "uuid" -) - -type RoleTemplate struct { - types.Resource - Administrative bool `json:"administrative,omitempty" yaml:"administrative,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"` - ClusterCreatorDefault bool `json:"clusterCreatorDefault,omitempty" yaml:"clusterCreatorDefault,omitempty"` - Context string `json:"context,omitempty" yaml:"context,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - External bool `json:"external,omitempty" yaml:"external,omitempty"` - Hidden bool `json:"hidden,omitempty" yaml:"hidden,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Locked bool `json:"locked,omitempty" yaml:"locked,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProjectCreatorDefault bool `json:"projectCreatorDefault,omitempty" yaml:"projectCreatorDefault,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RoleTemplateIDs []string `json:"roleTemplateIds,omitempty" yaml:"roleTemplateIds,omitempty"` - Rules []PolicyRule `json:"rules,omitempty" yaml:"rules,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RoleTemplateCollection struct { - types.Collection - Data []RoleTemplate `json:"data,omitempty"` - client *RoleTemplateClient -} - -type RoleTemplateClient struct { - apiClient *Client -} - -type RoleTemplateOperations interface { - List(opts *types.ListOpts) (*RoleTemplateCollection, error) - ListAll(opts *types.ListOpts) (*RoleTemplateCollection, error) - Create(opts *RoleTemplate) (*RoleTemplate, error) - Update(existing *RoleTemplate, updates interface{}) (*RoleTemplate, error) - Replace(existing *RoleTemplate) (*RoleTemplate, error) - ByID(id string) (*RoleTemplate, error) - Delete(container *RoleTemplate) error -} - -func newRoleTemplateClient(apiClient *Client) *RoleTemplateClient { - return &RoleTemplateClient{ - apiClient: apiClient, - } -} - -func (c *RoleTemplateClient) Create(container *RoleTemplate) (*RoleTemplate, error) { - resp := &RoleTemplate{} - err := c.apiClient.Ops.DoCreate(RoleTemplateType, container, resp) - return resp, err -} - -func (c *RoleTemplateClient) Update(existing *RoleTemplate, updates interface{}) (*RoleTemplate, error) { - resp := &RoleTemplate{} - err := c.apiClient.Ops.DoUpdate(RoleTemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RoleTemplateClient) Replace(obj *RoleTemplate) (*RoleTemplate, error) { - resp := &RoleTemplate{} - err := c.apiClient.Ops.DoReplace(RoleTemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *RoleTemplateClient) List(opts *types.ListOpts) (*RoleTemplateCollection, error) { - resp := &RoleTemplateCollection{} - err := c.apiClient.Ops.DoList(RoleTemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *RoleTemplateClient) ListAll(opts *types.ListOpts) (*RoleTemplateCollection, error) { - resp := &RoleTemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *RoleTemplateCollection) Next() (*RoleTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RoleTemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RoleTemplateClient) ByID(id string) (*RoleTemplate, error) { - resp := &RoleTemplate{} - err := c.apiClient.Ops.DoByID(RoleTemplateType, id, resp) - return resp, err -} - -func (c *RoleTemplateClient) Delete(container *RoleTemplate) error { - return c.apiClient.Ops.DoResourceDelete(RoleTemplateType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update.go deleted file mode 100644 index 180f638b992..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RollingUpdateType = "rollingUpdate" - RollingUpdateFieldBatchSize = "batchSize" - RollingUpdateFieldInterval = "interval" -) - -type RollingUpdate struct { - BatchSize int64 `json:"batchSize,omitempty" yaml:"batchSize,omitempty"` - Interval int64 `json:"interval,omitempty" yaml:"interval,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_daemon_set.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_daemon_set.go deleted file mode 100644 index f6c2e12b2e7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_daemon_set.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -import ( - "k8s.io/apimachinery/pkg/util/intstr" -) - -const ( - RollingUpdateDaemonSetType = "rollingUpdateDaemonSet" - RollingUpdateDaemonSetFieldMaxSurge = "maxSurge" - RollingUpdateDaemonSetFieldMaxUnavailable = "maxUnavailable" -) - -type RollingUpdateDaemonSet struct { - MaxSurge intstr.IntOrString `json:"maxSurge,omitempty" yaml:"maxSurge,omitempty"` - MaxUnavailable intstr.IntOrString `json:"maxUnavailable,omitempty" yaml:"maxUnavailable,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_deployment.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_deployment.go deleted file mode 100644 index 535fb36fa05..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rolling_update_deployment.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -import ( - "k8s.io/apimachinery/pkg/util/intstr" -) - -const ( - RollingUpdateDeploymentType = "rollingUpdateDeployment" - RollingUpdateDeploymentFieldMaxSurge = "maxSurge" - RollingUpdateDeploymentFieldMaxUnavailable = "maxUnavailable" -) - -type RollingUpdateDeployment struct { - MaxSurge intstr.IntOrString `json:"maxSurge,omitempty" yaml:"maxSurge,omitempty"` - MaxUnavailable intstr.IntOrString `json:"maxUnavailable,omitempty" yaml:"maxUnavailable,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_input.go deleted file mode 100644 index e827476203f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RotateCertificateInputType = "rotateCertificateInput" - RotateCertificateInputFieldCACertificates = "caCertificates" - RotateCertificateInputFieldServices = "services" -) - -type RotateCertificateInput struct { - CACertificates bool `json:"caCertificates,omitempty" yaml:"caCertificates,omitempty"` - Services string `json:"services,omitempty" yaml:"services,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_output.go deleted file mode 100644 index 47c50ec82f6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificate_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - RotateCertificateOutputType = "rotateCertificateOutput" - RotateCertificateOutputFieldMessage = "message" -) - -type RotateCertificateOutput struct { - Message string `json:"message,omitempty" yaml:"message,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificates.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificates.go deleted file mode 100644 index 219450f860e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_certificates.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RotateCertificatesType = "rotateCertificates" - RotateCertificatesFieldCACertificates = "caCertificates" - RotateCertificatesFieldServices = "services" -) - -type RotateCertificates struct { - CACertificates bool `json:"caCertificates,omitempty" yaml:"caCertificates,omitempty"` - Services string `json:"services,omitempty" yaml:"services,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_encryption_key_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_encryption_key_output.go deleted file mode 100644 index 23360d02fec..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_rotate_encryption_key_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - RotateEncryptionKeyOutputType = "rotateEncryptionKeyOutput" - RotateEncryptionKeyOutputFieldMessage = "message" -) - -type RotateEncryptionKeyOutput struct { - Message string `json:"message,omitempty" yaml:"message,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_route53provider_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_route53provider_config.go deleted file mode 100644 index 0932c3f529e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_route53provider_config.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - Route53ProviderConfigType = "route53ProviderConfig" - Route53ProviderConfigFieldAccessKey = "accessKey" - Route53ProviderConfigFieldAdditionalOptions = "additionalOptions" - Route53ProviderConfigFieldCredentialsPath = "credentialsPath" - Route53ProviderConfigFieldRegion = "region" - Route53ProviderConfigFieldRoleArn = "roleArn" - Route53ProviderConfigFieldSecretKey = "secretKey" - Route53ProviderConfigFieldZoneType = "zoneType" -) - -type Route53ProviderConfig struct { - AccessKey string `json:"accessKey,omitempty" yaml:"accessKey,omitempty"` - AdditionalOptions map[string]string `json:"additionalOptions,omitempty" yaml:"additionalOptions,omitempty"` - CredentialsPath string `json:"credentialsPath,omitempty" yaml:"credentialsPath,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - RoleArn string `json:"roleArn,omitempty" yaml:"roleArn,omitempty"` - SecretKey string `json:"secretKey,omitempty" yaml:"secretKey,omitempty"` - ZoneType string `json:"zoneType,omitempty" yaml:"zoneType,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_route_openstack_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_route_openstack_opts.go deleted file mode 100644 index ad6f9882ecb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_route_openstack_opts.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - RouteOpenstackOptsType = "routeOpenstackOpts" - RouteOpenstackOptsFieldRouterID = "router-id" -) - -type RouteOpenstackOpts struct { - RouterID string `json:"router-id,omitempty" yaml:"router-id,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_group_strategy_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_group_strategy_options.go deleted file mode 100644 index a2859639996..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_group_strategy_options.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RunAsGroupStrategyOptionsType = "runAsGroupStrategyOptions" - RunAsGroupStrategyOptionsFieldRanges = "ranges" - RunAsGroupStrategyOptionsFieldRule = "rule" -) - -type RunAsGroupStrategyOptions struct { - Ranges []IDRange `json:"ranges,omitempty" yaml:"ranges,omitempty"` - Rule string `json:"rule,omitempty" yaml:"rule,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_user_strategy_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_user_strategy_options.go deleted file mode 100644 index 61d9e0f13f4..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_run_as_user_strategy_options.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RunAsUserStrategyOptionsType = "runAsUserStrategyOptions" - RunAsUserStrategyOptionsFieldRanges = "ranges" - RunAsUserStrategyOptionsFieldRule = "rule" -) - -type RunAsUserStrategyOptions struct { - Ranges []IDRange `json:"ranges,omitempty" yaml:"ranges,omitempty"` - Rule string `json:"rule,omitempty" yaml:"rule,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_runtime_class_strategy_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_runtime_class_strategy_options.go deleted file mode 100644 index 01d7c02d687..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_runtime_class_strategy_options.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RuntimeClassStrategyOptionsType = "runtimeClassStrategyOptions" - RuntimeClassStrategyOptionsFieldAllowedRuntimeClassNames = "allowedRuntimeClassNames" - RuntimeClassStrategyOptionsFieldDefaultRuntimeClassName = "defaultRuntimeClassName" -) - -type RuntimeClassStrategyOptions struct { - AllowedRuntimeClassNames []string `json:"allowedRuntimeClassNames,omitempty" yaml:"allowedRuntimeClassNames,omitempty"` - DefaultRuntimeClassName string `json:"defaultRuntimeClassName,omitempty" yaml:"defaultRuntimeClassName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_s3backup_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_s3backup_config.go deleted file mode 100644 index 14ea5874925..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_s3backup_config.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - S3BackupConfigType = "s3BackupConfig" - S3BackupConfigFieldAccessKey = "accessKey" - S3BackupConfigFieldBucketName = "bucketName" - S3BackupConfigFieldCustomCA = "customCa" - S3BackupConfigFieldEndpoint = "endpoint" - S3BackupConfigFieldFolder = "folder" - S3BackupConfigFieldRegion = "region" - S3BackupConfigFieldSecretKey = "secretKey" -) - -type S3BackupConfig struct { - AccessKey string `json:"accessKey,omitempty" yaml:"accessKey,omitempty"` - BucketName string `json:"bucketName,omitempty" yaml:"bucketName,omitempty"` - CustomCA string `json:"customCa,omitempty" yaml:"customCa,omitempty"` - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Folder string `json:"folder,omitempty" yaml:"folder,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - SecretKey string `json:"secretKey,omitempty" yaml:"secretKey,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_s3credential_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_s3credential_config.go deleted file mode 100644 index f351e8a3b2c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_s3credential_config.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - S3CredentialConfigType = "s3CredentialConfig" - S3CredentialConfigFieldAccessKey = "accessKey" - S3CredentialConfigFieldDefaultBucket = "defaultBucket" - S3CredentialConfigFieldDefaultEndpoint = "defaultEndpoint" - S3CredentialConfigFieldDefaultEndpointCA = "defaultEndpointCA" - S3CredentialConfigFieldDefaultFolder = "defaultFolder" - S3CredentialConfigFieldDefaultRegion = "defaultRegion" - S3CredentialConfigFieldDefaultSkipSSLVerify = "defaultSkipSSLVerify" - S3CredentialConfigFieldSecretKey = "secretKey" -) - -type S3CredentialConfig struct { - AccessKey string `json:"accessKey,omitempty" yaml:"accessKey,omitempty"` - DefaultBucket string `json:"defaultBucket,omitempty" yaml:"defaultBucket,omitempty"` - DefaultEndpoint string `json:"defaultEndpoint,omitempty" yaml:"defaultEndpoint,omitempty"` - DefaultEndpointCA string `json:"defaultEndpointCA,omitempty" yaml:"defaultEndpointCA,omitempty"` - DefaultFolder string `json:"defaultFolder,omitempty" yaml:"defaultFolder,omitempty"` - DefaultRegion string `json:"defaultRegion,omitempty" yaml:"defaultRegion,omitempty"` - DefaultSkipSSLVerify string `json:"defaultSkipSSLVerify,omitempty" yaml:"defaultSkipSSLVerify,omitempty"` - SecretKey string `json:"secretKey,omitempty" yaml:"secretKey,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_input.go deleted file mode 100644 index a7d31f9377e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - SamlConfigTestInputType = "samlConfigTestInput" - SamlConfigTestInputFieldFinalRedirectURL = "finalRedirectUrl" -) - -type SamlConfigTestInput struct { - FinalRedirectURL string `json:"finalRedirectUrl,omitempty" yaml:"finalRedirectUrl,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_output.go deleted file mode 100644 index e9e5b95bc9f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_config_test_output.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - SamlConfigTestOutputType = "samlConfigTestOutput" - SamlConfigTestOutputFieldIdpRedirectURL = "idpRedirectUrl" -) - -type SamlConfigTestOutput struct { - IdpRedirectURL string `json:"idpRedirectUrl,omitempty" yaml:"idpRedirectUrl,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_token.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_token.go deleted file mode 100644 index 91f0fb3ce85..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_saml_token.go +++ /dev/null @@ -1,124 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - SamlTokenType = "samlToken" - SamlTokenFieldAnnotations = "annotations" - SamlTokenFieldCreated = "created" - SamlTokenFieldCreatorID = "creatorId" - SamlTokenFieldExpiresAt = "expiresAt" - SamlTokenFieldLabels = "labels" - SamlTokenFieldName = "name" - SamlTokenFieldNamespaceId = "namespaceId" - SamlTokenFieldOwnerReferences = "ownerReferences" - SamlTokenFieldRemoved = "removed" - SamlTokenFieldToken = "token" - SamlTokenFieldUUID = "uuid" -) - -type SamlToken struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - ExpiresAt string `json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type SamlTokenCollection struct { - types.Collection - Data []SamlToken `json:"data,omitempty"` - client *SamlTokenClient -} - -type SamlTokenClient struct { - apiClient *Client -} - -type SamlTokenOperations interface { - List(opts *types.ListOpts) (*SamlTokenCollection, error) - ListAll(opts *types.ListOpts) (*SamlTokenCollection, error) - Create(opts *SamlToken) (*SamlToken, error) - Update(existing *SamlToken, updates interface{}) (*SamlToken, error) - Replace(existing *SamlToken) (*SamlToken, error) - ByID(id string) (*SamlToken, error) - Delete(container *SamlToken) error -} - -func newSamlTokenClient(apiClient *Client) *SamlTokenClient { - return &SamlTokenClient{ - apiClient: apiClient, - } -} - -func (c *SamlTokenClient) Create(container *SamlToken) (*SamlToken, error) { - resp := &SamlToken{} - err := c.apiClient.Ops.DoCreate(SamlTokenType, container, resp) - return resp, err -} - -func (c *SamlTokenClient) Update(existing *SamlToken, updates interface{}) (*SamlToken, error) { - resp := &SamlToken{} - err := c.apiClient.Ops.DoUpdate(SamlTokenType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SamlTokenClient) Replace(obj *SamlToken) (*SamlToken, error) { - resp := &SamlToken{} - err := c.apiClient.Ops.DoReplace(SamlTokenType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *SamlTokenClient) List(opts *types.ListOpts) (*SamlTokenCollection, error) { - resp := &SamlTokenCollection{} - err := c.apiClient.Ops.DoList(SamlTokenType, opts, resp) - resp.client = c - return resp, err -} - -func (c *SamlTokenClient) ListAll(opts *types.ListOpts) (*SamlTokenCollection, error) { - resp := &SamlTokenCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *SamlTokenCollection) Next() (*SamlTokenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SamlTokenCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SamlTokenClient) ByID(id string) (*SamlToken, error) { - resp := &SamlToken{} - err := c.apiClient.Ops.DoByID(SamlTokenType, id, resp) - return resp, err -} - -func (c *SamlTokenClient) Delete(container *SamlToken) error { - return c.apiClient.Ops.DoResourceDelete(SamlTokenType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_input.go deleted file mode 100644 index b756e4fea84..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - SaveAsTemplateInputType = "saveAsTemplateInput" - SaveAsTemplateInputFieldClusterTemplateName = "clusterTemplateName" - SaveAsTemplateInputFieldClusterTemplateRevisionName = "clusterTemplateRevisionName" -) - -type SaveAsTemplateInput struct { - ClusterTemplateName string `json:"clusterTemplateName,omitempty" yaml:"clusterTemplateName,omitempty"` - ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty" yaml:"clusterTemplateRevisionName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_output.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_output.go deleted file mode 100644 index e509010517c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_save_as_template_output.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - SaveAsTemplateOutputType = "saveAsTemplateOutput" - SaveAsTemplateOutputFieldClusterTemplateName = "clusterTemplateName" - SaveAsTemplateOutputFieldClusterTemplateRevisionName = "clusterTemplateRevisionName" -) - -type SaveAsTemplateOutput struct { - ClusterTemplateName string `json:"clusterTemplateName,omitempty" yaml:"clusterTemplateName,omitempty"` - ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty" yaml:"clusterTemplateRevisionName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_scale_iovolume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_scale_iovolume_source.go deleted file mode 100644 index 58e00091713..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_scale_iovolume_source.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - ScaleIOVolumeSourceType = "scaleIOVolumeSource" - ScaleIOVolumeSourceFieldFSType = "fsType" - ScaleIOVolumeSourceFieldGateway = "gateway" - ScaleIOVolumeSourceFieldProtectionDomain = "protectionDomain" - ScaleIOVolumeSourceFieldReadOnly = "readOnly" - ScaleIOVolumeSourceFieldSSLEnabled = "sslEnabled" - ScaleIOVolumeSourceFieldSecretRef = "secretRef" - ScaleIOVolumeSourceFieldStorageMode = "storageMode" - ScaleIOVolumeSourceFieldStoragePool = "storagePool" - ScaleIOVolumeSourceFieldSystem = "system" - ScaleIOVolumeSourceFieldVolumeName = "volumeName" -) - -type ScaleIOVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - Gateway string `json:"gateway,omitempty" yaml:"gateway,omitempty"` - ProtectionDomain string `json:"protectionDomain,omitempty" yaml:"protectionDomain,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SSLEnabled bool `json:"sslEnabled,omitempty" yaml:"sslEnabled,omitempty"` - SecretRef *LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` - StorageMode string `json:"storageMode,omitempty" yaml:"storageMode,omitempty"` - StoragePool string `json:"storagePool,omitempty" yaml:"storagePool,omitempty"` - System string `json:"system,omitempty" yaml:"system,omitempty"` - VolumeName string `json:"volumeName,omitempty" yaml:"volumeName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_scheduler_service.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_scheduler_service.go deleted file mode 100644 index 1af88decf01..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_scheduler_service.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - SchedulerServiceType = "schedulerService" - SchedulerServiceFieldExtraArgs = "extraArgs" - SchedulerServiceFieldExtraArgsArray = "extraArgsArray" - SchedulerServiceFieldExtraBinds = "extraBinds" - SchedulerServiceFieldExtraEnv = "extraEnv" - SchedulerServiceFieldImage = "image" - SchedulerServiceFieldWindowsExtraArgs = "winExtraArgs" - SchedulerServiceFieldWindowsExtraArgsArray = "winExtraArgsArray" - SchedulerServiceFieldWindowsExtraBinds = "winExtraBinds" - SchedulerServiceFieldWindowsExtraEnv = "winExtraEnv" -) - -type SchedulerService struct { - ExtraArgs map[string]string `json:"extraArgs,omitempty" yaml:"extraArgs,omitempty"` - ExtraArgsArray map[string][]string `json:"extraArgsArray,omitempty" yaml:"extraArgsArray,omitempty"` - ExtraBinds []string `json:"extraBinds,omitempty" yaml:"extraBinds,omitempty"` - ExtraEnv []string `json:"extraEnv,omitempty" yaml:"extraEnv,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - WindowsExtraArgs map[string]string `json:"winExtraArgs,omitempty" yaml:"winExtraArgs,omitempty"` - WindowsExtraArgsArray map[string][]string `json:"winExtraArgsArray,omitempty" yaml:"winExtraArgsArray,omitempty"` - WindowsExtraBinds []string `json:"winExtraBinds,omitempty" yaml:"winExtraBinds,omitempty"` - WindowsExtraEnv []string `json:"winExtraEnv,omitempty" yaml:"winExtraEnv,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_options.go deleted file mode 100644 index 5e109c1023c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_options.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - SELinuxOptionsType = "seLinuxOptions" - SELinuxOptionsFieldLevel = "level" - SELinuxOptionsFieldRole = "role" - SELinuxOptionsFieldType = "type" - SELinuxOptionsFieldUser = "user" -) - -type SELinuxOptions struct { - Level string `json:"level,omitempty" yaml:"level,omitempty"` - Role string `json:"role,omitempty" yaml:"role,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_strategy_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_strategy_options.go deleted file mode 100644 index 4d1a1756051..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_se_linux_strategy_options.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - SELinuxStrategyOptionsType = "seLinuxStrategyOptions" - SELinuxStrategyOptionsFieldRule = "rule" - SELinuxStrategyOptionsFieldSELinuxOptions = "seLinuxOptions" -) - -type SELinuxStrategyOptions struct { - Rule string `json:"rule,omitempty" yaml:"rule,omitempty"` - SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" yaml:"seLinuxOptions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_search_principals_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_search_principals_input.go deleted file mode 100644 index c486b4c2d25..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_search_principals_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - SearchPrincipalsInputType = "searchPrincipalsInput" - SearchPrincipalsInputFieldName = "name" - SearchPrincipalsInputFieldPrincipalType = "principalType" -) - -type SearchPrincipalsInput struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` - PrincipalType string `json:"principalType,omitempty" yaml:"principalType,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_key_selector.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_key_selector.go deleted file mode 100644 index 9a236419ebd..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_key_selector.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - SecretKeySelectorType = "secretKeySelector" - SecretKeySelectorFieldKey = "key" - SecretKeySelectorFieldName = "name" - SecretKeySelectorFieldOptional = "optional" -) - -type SecretKeySelector struct { - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_projection.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_projection.go deleted file mode 100644 index 684b025c33a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_projection.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - SecretProjectionType = "secretProjection" - SecretProjectionFieldItems = "items" - SecretProjectionFieldName = "name" - SecretProjectionFieldOptional = "optional" -) - -type SecretProjection struct { - Items []KeyToPath `json:"items,omitempty" yaml:"items,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_volume_source.go deleted file mode 100644 index bdb5109b1a0..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secret_volume_source.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - SecretVolumeSourceType = "secretVolumeSource" - SecretVolumeSourceFieldDefaultMode = "defaultMode" - SecretVolumeSourceFieldItems = "items" - SecretVolumeSourceFieldOptional = "optional" - SecretVolumeSourceFieldSecretName = "secretName" -) - -type SecretVolumeSource struct { - DefaultMode *int64 `json:"defaultMode,omitempty" yaml:"defaultMode,omitempty"` - Items []KeyToPath `json:"items,omitempty" yaml:"items,omitempty"` - Optional *bool `json:"optional,omitempty" yaml:"optional,omitempty"` - SecretName string `json:"secretName,omitempty" yaml:"secretName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secretbox_configuration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_secretbox_configuration.go deleted file mode 100644 index c913985ab22..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secretbox_configuration.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - SecretboxConfigurationType = "secretboxConfiguration" - SecretboxConfigurationFieldKeys = "keys" -) - -type SecretboxConfiguration struct { - Keys []Key `json:"keys,omitempty" yaml:"keys,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secrets_encryption_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_secrets_encryption_config.go deleted file mode 100644 index 658ff6b5ab1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_secrets_encryption_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - SecretsEncryptionConfigType = "secretsEncryptionConfig" - SecretsEncryptionConfigFieldCustomConfig = "customConfig" - SecretsEncryptionConfigFieldEnabled = "enabled" -) - -type SecretsEncryptionConfig struct { - CustomConfig *EncryptionConfiguration `json:"customConfig,omitempty" yaml:"customConfig,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_service_account_token_projection.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_service_account_token_projection.go deleted file mode 100644 index 7d2e880ec9a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_service_account_token_projection.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - ServiceAccountTokenProjectionType = "serviceAccountTokenProjection" - ServiceAccountTokenProjectionFieldAudience = "audience" - ServiceAccountTokenProjectionFieldExpirationSeconds = "expirationSeconds" - ServiceAccountTokenProjectionFieldPath = "path" -) - -type ServiceAccountTokenProjection struct { - Audience string `json:"audience,omitempty" yaml:"audience,omitempty"` - ExpirationSeconds *int64 `json:"expirationSeconds,omitempty" yaml:"expirationSeconds,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_service_override.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_service_override.go deleted file mode 100644 index 96ed63c0454..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_service_override.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - ServiceOverrideType = "serviceOverride" - ServiceOverrideFieldRegion = "region" - ServiceOverrideFieldService = "service" - ServiceOverrideFieldSigningMethod = "signing-method" - ServiceOverrideFieldSigningName = "signing-name" - ServiceOverrideFieldSigningRegion = "signing-region" - ServiceOverrideFieldURL = "url" -) - -type ServiceOverride struct { - Region string `json:"region,omitempty" yaml:"region,omitempty"` - Service string `json:"service,omitempty" yaml:"service,omitempty"` - SigningMethod string `json:"signing-method,omitempty" yaml:"signing-method,omitempty"` - SigningName string `json:"signing-name,omitempty" yaml:"signing-name,omitempty"` - SigningRegion string `json:"signing-region,omitempty" yaml:"signing-region,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_set_password_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_set_password_input.go deleted file mode 100644 index 4dc32d6c9ef..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_set_password_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - SetPasswordInputType = "setPasswordInput" - SetPasswordInputFieldNewPassword = "newPassword" -) - -type SetPasswordInput struct { - NewPassword string `json:"newPassword,omitempty" yaml:"newPassword,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_set_pod_security_policy_template_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_set_pod_security_policy_template_input.go deleted file mode 100644 index cb17b5089fa..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_set_pod_security_policy_template_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - SetPodSecurityPolicyTemplateInputType = "setPodSecurityPolicyTemplateInput" - SetPodSecurityPolicyTemplateInputFieldPodSecurityPolicyTemplateName = "podSecurityPolicyTemplateId" -) - -type SetPodSecurityPolicyTemplateInput struct { - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId,omitempty" yaml:"podSecurityPolicyTemplateId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_setting.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_setting.go deleted file mode 100644 index 6ea352ba204..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_setting.go +++ /dev/null @@ -1,126 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - SettingType = "setting" - SettingFieldAnnotations = "annotations" - SettingFieldCreated = "created" - SettingFieldCreatorID = "creatorId" - SettingFieldCustomized = "customized" - SettingFieldDefault = "default" - SettingFieldLabels = "labels" - SettingFieldName = "name" - SettingFieldOwnerReferences = "ownerReferences" - SettingFieldRemoved = "removed" - SettingFieldSource = "source" - SettingFieldUUID = "uuid" - SettingFieldValue = "value" -) - -type Setting struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Customized bool `json:"customized,omitempty" yaml:"customized,omitempty"` - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - Source string `json:"source,omitempty" yaml:"source,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type SettingCollection struct { - types.Collection - Data []Setting `json:"data,omitempty"` - client *SettingClient -} - -type SettingClient struct { - apiClient *Client -} - -type SettingOperations interface { - List(opts *types.ListOpts) (*SettingCollection, error) - ListAll(opts *types.ListOpts) (*SettingCollection, error) - Create(opts *Setting) (*Setting, error) - Update(existing *Setting, updates interface{}) (*Setting, error) - Replace(existing *Setting) (*Setting, error) - ByID(id string) (*Setting, error) - Delete(container *Setting) error -} - -func newSettingClient(apiClient *Client) *SettingClient { - return &SettingClient{ - apiClient: apiClient, - } -} - -func (c *SettingClient) Create(container *Setting) (*Setting, error) { - resp := &Setting{} - err := c.apiClient.Ops.DoCreate(SettingType, container, resp) - return resp, err -} - -func (c *SettingClient) Update(existing *Setting, updates interface{}) (*Setting, error) { - resp := &Setting{} - err := c.apiClient.Ops.DoUpdate(SettingType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SettingClient) Replace(obj *Setting) (*Setting, error) { - resp := &Setting{} - err := c.apiClient.Ops.DoReplace(SettingType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *SettingClient) List(opts *types.ListOpts) (*SettingCollection, error) { - resp := &SettingCollection{} - err := c.apiClient.Ops.DoList(SettingType, opts, resp) - resp.client = c - return resp, err -} - -func (c *SettingClient) ListAll(opts *types.ListOpts) (*SettingCollection, error) { - resp := &SettingCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *SettingCollection) Next() (*SettingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SettingCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SettingClient) ByID(id string) (*Setting, error) { - resp := &Setting{} - err := c.apiClient.Ops.DoByID(SettingType, id, resp) - return resp, err -} - -func (c *SettingClient) Delete(container *Setting) error { - return c.apiClient.Ops.DoResourceDelete(SettingType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_shibboleth_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_shibboleth_config.go deleted file mode 100644 index 8ab4b89af37..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_shibboleth_config.go +++ /dev/null @@ -1,54 +0,0 @@ -package client - -const ( - ShibbolethConfigType = "shibbolethConfig" - ShibbolethConfigFieldAccessMode = "accessMode" - ShibbolethConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds" - ShibbolethConfigFieldAnnotations = "annotations" - ShibbolethConfigFieldCreated = "created" - ShibbolethConfigFieldCreatorID = "creatorId" - ShibbolethConfigFieldDisplayNameField = "displayNameField" - ShibbolethConfigFieldEnabled = "enabled" - ShibbolethConfigFieldEntityID = "entityID" - ShibbolethConfigFieldGroupsField = "groupsField" - ShibbolethConfigFieldIDPMetadataContent = "idpMetadataContent" - ShibbolethConfigFieldLabels = "labels" - ShibbolethConfigFieldName = "name" - ShibbolethConfigFieldOpenLdapConfig = "openLdapConfig" - ShibbolethConfigFieldOwnerReferences = "ownerReferences" - ShibbolethConfigFieldRancherAPIHost = "rancherApiHost" - ShibbolethConfigFieldRemoved = "removed" - ShibbolethConfigFieldSpCert = "spCert" - ShibbolethConfigFieldSpKey = "spKey" - ShibbolethConfigFieldStatus = "status" - ShibbolethConfigFieldType = "type" - ShibbolethConfigFieldUIDField = "uidField" - ShibbolethConfigFieldUUID = "uuid" - ShibbolethConfigFieldUserNameField = "userNameField" -) - -type ShibbolethConfig struct { - AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DisplayNameField string `json:"displayNameField,omitempty" yaml:"displayNameField,omitempty"` - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - EntityID string `json:"entityID,omitempty" yaml:"entityID,omitempty"` - GroupsField string `json:"groupsField,omitempty" yaml:"groupsField,omitempty"` - IDPMetadataContent string `json:"idpMetadataContent,omitempty" yaml:"idpMetadataContent,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OpenLdapConfig *LdapFields `json:"openLdapConfig,omitempty" yaml:"openLdapConfig,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - RancherAPIHost string `json:"rancherApiHost,omitempty" yaml:"rancherApiHost,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - SpCert string `json:"spCert,omitempty" yaml:"spCert,omitempty"` - SpKey string `json:"spKey,omitempty" yaml:"spKey,omitempty"` - Status *AuthConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UIDField string `json:"uidField,omitempty" yaml:"uidField,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserNameField string `json:"userNameField,omitempty" yaml:"userNameField,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_slack_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_slack_config.go deleted file mode 100644 index ecd9df7f019..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_slack_config.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - SlackConfigType = "slackConfig" - SlackConfigFieldDefaultRecipient = "defaultRecipient" - SlackConfigFieldProxyURL = "proxyUrl" - SlackConfigFieldURL = "url" -) - -type SlackConfig struct { - DefaultRecipient string `json:"defaultRecipient,omitempty" yaml:"defaultRecipient,omitempty"` - ProxyURL string `json:"proxyUrl,omitempty" yaml:"proxyUrl,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_smtp_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_smtp_config.go deleted file mode 100644 index bea2249f255..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_smtp_config.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - SMTPConfigType = "smtpConfig" - SMTPConfigFieldDefaultRecipient = "defaultRecipient" - SMTPConfigFieldHost = "host" - SMTPConfigFieldPassword = "password" - SMTPConfigFieldPort = "port" - SMTPConfigFieldSender = "sender" - SMTPConfigFieldTLS = "tls" - SMTPConfigFieldUsername = "username" -) - -type SMTPConfig struct { - DefaultRecipient string `json:"defaultRecipient,omitempty" yaml:"defaultRecipient,omitempty"` - Host string `json:"host,omitempty" yaml:"host,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - Sender string `json:"sender,omitempty" yaml:"sender,omitempty"` - TLS *bool `json:"tls,omitempty" yaml:"tls,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_splunk_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_splunk_config.go deleted file mode 100644 index 0220e0f2c8e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_splunk_config.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - SplunkConfigType = "splunkConfig" - SplunkConfigFieldCertificate = "certificate" - SplunkConfigFieldClientCert = "clientCert" - SplunkConfigFieldClientKey = "clientKey" - SplunkConfigFieldClientKeyPass = "clientKeyPass" - SplunkConfigFieldEndpoint = "endpoint" - SplunkConfigFieldIndex = "index" - SplunkConfigFieldSSLVerify = "sslVerify" - SplunkConfigFieldSource = "source" - SplunkConfigFieldToken = "token" -) - -type SplunkConfig struct { - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty" yaml:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty" yaml:"clientKey,omitempty"` - ClientKeyPass string `json:"clientKeyPass,omitempty" yaml:"clientKeyPass,omitempty"` - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Index string `json:"index,omitempty" yaml:"index,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty" yaml:"sslVerify,omitempty"` - Source string `json:"source,omitempty" yaml:"source,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_storage_osvolume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_storage_osvolume_source.go deleted file mode 100644 index 46dc40fd38c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_storage_osvolume_source.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - StorageOSVolumeSourceType = "storageOSVolumeSource" - StorageOSVolumeSourceFieldFSType = "fsType" - StorageOSVolumeSourceFieldReadOnly = "readOnly" - StorageOSVolumeSourceFieldSecretRef = "secretRef" - StorageOSVolumeSourceFieldVolumeName = "volumeName" - StorageOSVolumeSourceFieldVolumeNamespace = "volumeNamespace" -) - -type StorageOSVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"` - SecretRef *LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` - VolumeName string `json:"volumeName,omitempty" yaml:"volumeName,omitempty"` - VolumeNamespace string `json:"volumeNamespace,omitempty" yaml:"volumeNamespace,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_sub_question.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_sub_question.go deleted file mode 100644 index f0a47e0a316..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_sub_question.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -const ( - SubQuestionType = "subQuestion" - SubQuestionFieldDefault = "default" - SubQuestionFieldDescription = "description" - SubQuestionFieldGroup = "group" - SubQuestionFieldInvalidChars = "invalidChars" - SubQuestionFieldLabel = "label" - SubQuestionFieldMax = "max" - SubQuestionFieldMaxLength = "maxLength" - SubQuestionFieldMin = "min" - SubQuestionFieldMinLength = "minLength" - SubQuestionFieldOptions = "options" - SubQuestionFieldRequired = "required" - SubQuestionFieldSatisfies = "satisfies" - SubQuestionFieldShowIf = "showIf" - SubQuestionFieldType = "type" - SubQuestionFieldValidChars = "validChars" - SubQuestionFieldVariable = "variable" -) - -type SubQuestion struct { - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Group string `json:"group,omitempty" yaml:"group,omitempty"` - InvalidChars string `json:"invalidChars,omitempty" yaml:"invalidChars,omitempty"` - Label string `json:"label,omitempty" yaml:"label,omitempty"` - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - MaxLength int64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"` - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` - MinLength int64 `json:"minLength,omitempty" yaml:"minLength,omitempty"` - Options []string `json:"options,omitempty" yaml:"options,omitempty"` - Required bool `json:"required,omitempty" yaml:"required,omitempty"` - Satisfies string `json:"satisfies,omitempty" yaml:"satisfies,omitempty"` - ShowIf string `json:"showIf,omitempty" yaml:"showIf,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - ValidChars string `json:"validChars,omitempty" yaml:"validChars,omitempty"` - Variable string `json:"variable,omitempty" yaml:"variable,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_supplemental_groups_strategy_options.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_supplemental_groups_strategy_options.go deleted file mode 100644 index 972fd7a7511..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_supplemental_groups_strategy_options.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - SupplementalGroupsStrategyOptionsType = "supplementalGroupsStrategyOptions" - SupplementalGroupsStrategyOptionsFieldRanges = "ranges" - SupplementalGroupsStrategyOptionsFieldRule = "rule" -) - -type SupplementalGroupsStrategyOptions struct { - Ranges []IDRange `json:"ranges,omitempty" yaml:"ranges,omitempty"` - Rule string `json:"rule,omitempty" yaml:"rule,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_syslog_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_syslog_config.go deleted file mode 100644 index 50b04bc43ac..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_syslog_config.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -const ( - SyslogConfigType = "syslogConfig" - SyslogConfigFieldCertificate = "certificate" - SyslogConfigFieldClientCert = "clientCert" - SyslogConfigFieldClientKey = "clientKey" - SyslogConfigFieldEnableTLS = "enableTls" - SyslogConfigFieldEndpoint = "endpoint" - SyslogConfigFieldProgram = "program" - SyslogConfigFieldProtocol = "protocol" - SyslogConfigFieldSSLVerify = "sslVerify" - SyslogConfigFieldSeverity = "severity" - SyslogConfigFieldToken = "token" -) - -type SyslogConfig struct { - Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty" yaml:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty" yaml:"clientKey,omitempty"` - EnableTLS bool `json:"enableTls,omitempty" yaml:"enableTls,omitempty"` - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Program string `json:"program,omitempty" yaml:"program,omitempty"` - Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty" yaml:"sslVerify,omitempty"` - Severity string `json:"severity,omitempty" yaml:"severity,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_system_service_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_system_service_rule.go deleted file mode 100644 index c872b66997a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_system_service_rule.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - SystemServiceRuleType = "systemServiceRule" - SystemServiceRuleFieldCondition = "condition" -) - -type SystemServiceRule struct { - Condition string `json:"condition,omitempty" yaml:"condition,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_taint.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_taint.go deleted file mode 100644 index cec2b5ff73c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_taint.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - TaintType = "taint" - TaintFieldEffect = "effect" - TaintFieldKey = "key" - TaintFieldTimeAdded = "timeAdded" - TaintFieldValue = "value" -) - -type Taint struct { - Effect string `json:"effect,omitempty" yaml:"effect,omitempty"` - Key string `json:"key,omitempty" yaml:"key,omitempty"` - TimeAdded string `json:"timeAdded,omitempty" yaml:"timeAdded,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_target.go deleted file mode 100644 index cd8d7282046..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - TargetType = "target" - TargetFieldAppID = "appId" - TargetFieldHealthstate = "healthState" - TargetFieldProjectID = "projectId" - TargetFieldState = "state" -) - -type Target struct { - AppID string `json:"appId,omitempty" yaml:"appId,omitempty"` - Healthstate string `json:"healthState,omitempty" yaml:"healthState,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_event.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_event.go deleted file mode 100644 index 320af98959d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_event.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - TargetEventType = "targetEvent" - TargetEventFieldEventType = "eventType" - TargetEventFieldResourceKind = "resourceKind" -) - -type TargetEvent struct { - EventType string `json:"eventType,omitempty" yaml:"eventType,omitempty"` - ResourceKind string `json:"resourceKind,omitempty" yaml:"resourceKind,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_node.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_node.go deleted file mode 100644 index 1ad406266f3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_node.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - TargetNodeType = "targetNode" - TargetNodeFieldCPUThreshold = "cpuThreshold" - TargetNodeFieldCondition = "condition" - TargetNodeFieldMemThreshold = "memThreshold" - TargetNodeFieldNodeID = "nodeId" - TargetNodeFieldSelector = "selector" -) - -type TargetNode struct { - CPUThreshold int64 `json:"cpuThreshold,omitempty" yaml:"cpuThreshold,omitempty"` - Condition string `json:"condition,omitempty" yaml:"condition,omitempty"` - MemThreshold int64 `json:"memThreshold,omitempty" yaml:"memThreshold,omitempty"` - NodeID string `json:"nodeId,omitempty" yaml:"nodeId,omitempty"` - Selector map[string]string `json:"selector,omitempty" yaml:"selector,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_pod.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_pod.go deleted file mode 100644 index 458d5f71070..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_pod.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - TargetPodType = "targetPod" - TargetPodFieldCondition = "condition" - TargetPodFieldPodID = "podId" - TargetPodFieldRestartIntervalSeconds = "restartIntervalSeconds" - TargetPodFieldRestartTimes = "restartTimes" -) - -type TargetPod struct { - Condition string `json:"condition,omitempty" yaml:"condition,omitempty"` - PodID string `json:"podId,omitempty" yaml:"podId,omitempty"` - RestartIntervalSeconds int64 `json:"restartIntervalSeconds,omitempty" yaml:"restartIntervalSeconds,omitempty"` - RestartTimes int64 `json:"restartTimes,omitempty" yaml:"restartTimes,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_system_service.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_system_service.go deleted file mode 100644 index 19708e592a3..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_system_service.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - TargetSystemServiceType = "targetSystemService" - TargetSystemServiceFieldCondition = "condition" -) - -type TargetSystemService struct { - Condition string `json:"condition,omitempty" yaml:"condition,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_workload.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_workload.go deleted file mode 100644 index cc21ad14325..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_target_workload.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - TargetWorkloadType = "targetWorkload" - TargetWorkloadFieldAvailablePercentage = "availablePercentage" - TargetWorkloadFieldSelector = "selector" - TargetWorkloadFieldWorkloadID = "workloadId" -) - -type TargetWorkload struct { - AvailablePercentage int64 `json:"availablePercentage,omitempty" yaml:"availablePercentage,omitempty"` - Selector map[string]string `json:"selector,omitempty" yaml:"selector,omitempty"` - WorkloadID string `json:"workloadId,omitempty" yaml:"workloadId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_template.go deleted file mode 100644 index 9b155630086..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template.go +++ /dev/null @@ -1,166 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - TemplateType = "template" - TemplateFieldAnnotations = "annotations" - TemplateFieldCatalogID = "catalogId" - TemplateFieldCategories = "categories" - TemplateFieldCategory = "category" - TemplateFieldClusterCatalogID = "clusterCatalogId" - TemplateFieldClusterID = "clusterId" - TemplateFieldCreated = "created" - TemplateFieldCreatorID = "creatorId" - TemplateFieldDefaultTemplateVersionID = "defaultTemplateVersionId" - TemplateFieldDefaultVersion = "defaultVersion" - TemplateFieldDescription = "description" - TemplateFieldFolderName = "folderName" - TemplateFieldIcon = "icon" - TemplateFieldIconFilename = "iconFilename" - TemplateFieldLabels = "labels" - TemplateFieldMaintainer = "maintainer" - TemplateFieldName = "name" - TemplateFieldOwnerReferences = "ownerReferences" - TemplateFieldPath = "path" - TemplateFieldProjectCatalogID = "projectCatalogId" - TemplateFieldProjectID = "projectId" - TemplateFieldProjectURL = "projectURL" - TemplateFieldReadme = "readme" - TemplateFieldRemoved = "removed" - TemplateFieldState = "state" - TemplateFieldStatus = "status" - TemplateFieldTransitioning = "transitioning" - TemplateFieldTransitioningMessage = "transitioningMessage" - TemplateFieldUUID = "uuid" - TemplateFieldUpgradeFrom = "upgradeFrom" - TemplateFieldVersionLinks = "versionLinks" - TemplateFieldVersions = "versions" -) - -type Template struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - CatalogID string `json:"catalogId,omitempty" yaml:"catalogId,omitempty"` - Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` - Category string `json:"category,omitempty" yaml:"category,omitempty"` - ClusterCatalogID string `json:"clusterCatalogId,omitempty" yaml:"clusterCatalogId,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DefaultTemplateVersionID string `json:"defaultTemplateVersionId,omitempty" yaml:"defaultTemplateVersionId,omitempty"` - DefaultVersion string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - FolderName string `json:"folderName,omitempty" yaml:"folderName,omitempty"` - Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` - IconFilename string `json:"iconFilename,omitempty" yaml:"iconFilename,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Maintainer string `json:"maintainer,omitempty" yaml:"maintainer,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ProjectCatalogID string `json:"projectCatalogId,omitempty" yaml:"projectCatalogId,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - ProjectURL string `json:"projectURL,omitempty" yaml:"projectURL,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgradeFrom,omitempty"` - VersionLinks map[string]string `json:"versionLinks,omitempty" yaml:"versionLinks,omitempty"` - Versions []TemplateVersionSpec `json:"versions,omitempty" yaml:"versions,omitempty"` -} - -type TemplateCollection struct { - types.Collection - Data []Template `json:"data,omitempty"` - client *TemplateClient -} - -type TemplateClient struct { - apiClient *Client -} - -type TemplateOperations interface { - List(opts *types.ListOpts) (*TemplateCollection, error) - ListAll(opts *types.ListOpts) (*TemplateCollection, error) - Create(opts *Template) (*Template, error) - Update(existing *Template, updates interface{}) (*Template, error) - Replace(existing *Template) (*Template, error) - ByID(id string) (*Template, error) - Delete(container *Template) error -} - -func newTemplateClient(apiClient *Client) *TemplateClient { - return &TemplateClient{ - apiClient: apiClient, - } -} - -func (c *TemplateClient) Create(container *Template) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoCreate(TemplateType, container, resp) - return resp, err -} - -func (c *TemplateClient) Update(existing *Template, updates interface{}) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoUpdate(TemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TemplateClient) Replace(obj *Template) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoReplace(TemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *TemplateClient) List(opts *types.ListOpts) (*TemplateCollection, error) { - resp := &TemplateCollection{} - err := c.apiClient.Ops.DoList(TemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *TemplateClient) ListAll(opts *types.ListOpts) (*TemplateCollection, error) { - resp := &TemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *TemplateCollection) Next() (*TemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TemplateClient) ByID(id string) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoByID(TemplateType, id, resp) - return resp, err -} - -func (c *TemplateClient) Delete(container *Template) error { - return c.apiClient.Ops.DoResourceDelete(TemplateType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_content.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_content.go deleted file mode 100644 index 14061ba7b9a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_content.go +++ /dev/null @@ -1,120 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - TemplateContentType = "templateContent" - TemplateContentFieldAnnotations = "annotations" - TemplateContentFieldCreated = "created" - TemplateContentFieldCreatorID = "creatorId" - TemplateContentFieldData = "data" - TemplateContentFieldLabels = "labels" - TemplateContentFieldName = "name" - TemplateContentFieldOwnerReferences = "ownerReferences" - TemplateContentFieldRemoved = "removed" - TemplateContentFieldUUID = "uuid" -) - -type TemplateContent struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Data string `json:"data,omitempty" yaml:"data,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type TemplateContentCollection struct { - types.Collection - Data []TemplateContent `json:"data,omitempty"` - client *TemplateContentClient -} - -type TemplateContentClient struct { - apiClient *Client -} - -type TemplateContentOperations interface { - List(opts *types.ListOpts) (*TemplateContentCollection, error) - ListAll(opts *types.ListOpts) (*TemplateContentCollection, error) - Create(opts *TemplateContent) (*TemplateContent, error) - Update(existing *TemplateContent, updates interface{}) (*TemplateContent, error) - Replace(existing *TemplateContent) (*TemplateContent, error) - ByID(id string) (*TemplateContent, error) - Delete(container *TemplateContent) error -} - -func newTemplateContentClient(apiClient *Client) *TemplateContentClient { - return &TemplateContentClient{ - apiClient: apiClient, - } -} - -func (c *TemplateContentClient) Create(container *TemplateContent) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoCreate(TemplateContentType, container, resp) - return resp, err -} - -func (c *TemplateContentClient) Update(existing *TemplateContent, updates interface{}) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoUpdate(TemplateContentType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TemplateContentClient) Replace(obj *TemplateContent) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoReplace(TemplateContentType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *TemplateContentClient) List(opts *types.ListOpts) (*TemplateContentCollection, error) { - resp := &TemplateContentCollection{} - err := c.apiClient.Ops.DoList(TemplateContentType, opts, resp) - resp.client = c - return resp, err -} - -func (c *TemplateContentClient) ListAll(opts *types.ListOpts) (*TemplateContentCollection, error) { - resp := &TemplateContentCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *TemplateContentCollection) Next() (*TemplateContentCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TemplateContentCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TemplateContentClient) ByID(id string) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoByID(TemplateContentType, id, resp) - return resp, err -} - -func (c *TemplateContentClient) Delete(container *TemplateContent) error { - return c.apiClient.Ops.DoResourceDelete(TemplateContentType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_spec.go deleted file mode 100644 index dbce148ad54..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_spec.go +++ /dev/null @@ -1,48 +0,0 @@ -package client - -const ( - TemplateSpecType = "templateSpec" - TemplateSpecFieldCatalogID = "catalogId" - TemplateSpecFieldCategories = "categories" - TemplateSpecFieldCategory = "category" - TemplateSpecFieldClusterCatalogID = "clusterCatalogId" - TemplateSpecFieldClusterID = "clusterId" - TemplateSpecFieldDefaultTemplateVersionID = "defaultTemplateVersionId" - TemplateSpecFieldDefaultVersion = "defaultVersion" - TemplateSpecFieldDescription = "description" - TemplateSpecFieldDisplayName = "displayName" - TemplateSpecFieldFolderName = "folderName" - TemplateSpecFieldIcon = "icon" - TemplateSpecFieldIconFilename = "iconFilename" - TemplateSpecFieldMaintainer = "maintainer" - TemplateSpecFieldPath = "path" - TemplateSpecFieldProjectCatalogID = "projectCatalogId" - TemplateSpecFieldProjectID = "projectId" - TemplateSpecFieldProjectURL = "projectURL" - TemplateSpecFieldReadme = "readme" - TemplateSpecFieldUpgradeFrom = "upgradeFrom" - TemplateSpecFieldVersions = "versions" -) - -type TemplateSpec struct { - CatalogID string `json:"catalogId,omitempty" yaml:"catalogId,omitempty"` - Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` - Category string `json:"category,omitempty" yaml:"category,omitempty"` - ClusterCatalogID string `json:"clusterCatalogId,omitempty" yaml:"clusterCatalogId,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - DefaultTemplateVersionID string `json:"defaultTemplateVersionId,omitempty" yaml:"defaultTemplateVersionId,omitempty"` - DefaultVersion string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - FolderName string `json:"folderName,omitempty" yaml:"folderName,omitempty"` - Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` - IconFilename string `json:"iconFilename,omitempty" yaml:"iconFilename,omitempty"` - Maintainer string `json:"maintainer,omitempty" yaml:"maintainer,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ProjectCatalogID string `json:"projectCatalogId,omitempty" yaml:"projectCatalogId,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - ProjectURL string `json:"projectURL,omitempty" yaml:"projectURL,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgradeFrom,omitempty"` - Versions []TemplateVersionSpec `json:"versions,omitempty" yaml:"versions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_status.go deleted file mode 100644 index 573947c56bc..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - TemplateStatusType = "templateStatus" - TemplateStatusFieldHelmVersion = "helmVersion" -) - -type TemplateStatus struct { - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version.go deleted file mode 100644 index f981e2c84ad..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version.go +++ /dev/null @@ -1,158 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - TemplateVersionType = "templateVersion" - TemplateVersionFieldAnnotations = "annotations" - TemplateVersionFieldAppReadme = "appReadme" - TemplateVersionFieldCreated = "created" - TemplateVersionFieldCreatorID = "creatorId" - TemplateVersionFieldDigest = "digest" - TemplateVersionFieldExternalID = "externalId" - TemplateVersionFieldFiles = "files" - TemplateVersionFieldKubeVersion = "kubeVersion" - TemplateVersionFieldLabels = "labels" - TemplateVersionFieldName = "name" - TemplateVersionFieldOwnerReferences = "ownerReferences" - TemplateVersionFieldQuestions = "questions" - TemplateVersionFieldRancherMaxVersion = "rancherMaxVersion" - TemplateVersionFieldRancherMinVersion = "rancherMinVersion" - TemplateVersionFieldRancherVersion = "rancherVersion" - TemplateVersionFieldReadme = "readme" - TemplateVersionFieldRemoved = "removed" - TemplateVersionFieldRequiredNamespace = "requiredNamespace" - TemplateVersionFieldState = "state" - TemplateVersionFieldStatus = "status" - TemplateVersionFieldTransitioning = "transitioning" - TemplateVersionFieldTransitioningMessage = "transitioningMessage" - TemplateVersionFieldUUID = "uuid" - TemplateVersionFieldUpgradeVersionLinks = "upgradeVersionLinks" - TemplateVersionFieldVersion = "version" - TemplateVersionFieldVersionDir = "versionDir" - TemplateVersionFieldVersionName = "versionName" - TemplateVersionFieldVersionURLs = "versionUrls" -) - -type TemplateVersion struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AppReadme string `json:"appReadme,omitempty" yaml:"appReadme,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - Files map[string]string `json:"files,omitempty" yaml:"files,omitempty"` - KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - RancherMaxVersion string `json:"rancherMaxVersion,omitempty" yaml:"rancherMaxVersion,omitempty"` - RancherMinVersion string `json:"rancherMinVersion,omitempty" yaml:"rancherMinVersion,omitempty"` - RancherVersion string `json:"rancherVersion,omitempty" yaml:"rancherVersion,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RequiredNamespace string `json:"requiredNamespace,omitempty" yaml:"requiredNamespace,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateVersionStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty" yaml:"upgradeVersionLinks,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - VersionDir string `json:"versionDir,omitempty" yaml:"versionDir,omitempty"` - VersionName string `json:"versionName,omitempty" yaml:"versionName,omitempty"` - VersionURLs []string `json:"versionUrls,omitempty" yaml:"versionUrls,omitempty"` -} - -type TemplateVersionCollection struct { - types.Collection - Data []TemplateVersion `json:"data,omitempty"` - client *TemplateVersionClient -} - -type TemplateVersionClient struct { - apiClient *Client -} - -type TemplateVersionOperations interface { - List(opts *types.ListOpts) (*TemplateVersionCollection, error) - ListAll(opts *types.ListOpts) (*TemplateVersionCollection, error) - Create(opts *TemplateVersion) (*TemplateVersion, error) - Update(existing *TemplateVersion, updates interface{}) (*TemplateVersion, error) - Replace(existing *TemplateVersion) (*TemplateVersion, error) - ByID(id string) (*TemplateVersion, error) - Delete(container *TemplateVersion) error -} - -func newTemplateVersionClient(apiClient *Client) *TemplateVersionClient { - return &TemplateVersionClient{ - apiClient: apiClient, - } -} - -func (c *TemplateVersionClient) Create(container *TemplateVersion) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoCreate(TemplateVersionType, container, resp) - return resp, err -} - -func (c *TemplateVersionClient) Update(existing *TemplateVersion, updates interface{}) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoUpdate(TemplateVersionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TemplateVersionClient) Replace(obj *TemplateVersion) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoReplace(TemplateVersionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *TemplateVersionClient) List(opts *types.ListOpts) (*TemplateVersionCollection, error) { - resp := &TemplateVersionCollection{} - err := c.apiClient.Ops.DoList(TemplateVersionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *TemplateVersionClient) ListAll(opts *types.ListOpts) (*TemplateVersionCollection, error) { - resp := &TemplateVersionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *TemplateVersionCollection) Next() (*TemplateVersionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TemplateVersionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TemplateVersionClient) ByID(id string) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoByID(TemplateVersionType, id, resp) - return resp, err -} - -func (c *TemplateVersionClient) Delete(container *TemplateVersion) error { - return c.apiClient.Ops.DoResourceDelete(TemplateVersionType, &container.Resource) -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_spec.go deleted file mode 100644 index ba9dd9fe502..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_spec.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -const ( - TemplateVersionSpecType = "templateVersionSpec" - TemplateVersionSpecFieldAppReadme = "appReadme" - TemplateVersionSpecFieldDigest = "digest" - TemplateVersionSpecFieldExternalID = "externalId" - TemplateVersionSpecFieldFiles = "files" - TemplateVersionSpecFieldKubeVersion = "kubeVersion" - TemplateVersionSpecFieldQuestions = "questions" - TemplateVersionSpecFieldRancherMaxVersion = "rancherMaxVersion" - TemplateVersionSpecFieldRancherMinVersion = "rancherMinVersion" - TemplateVersionSpecFieldRancherVersion = "rancherVersion" - TemplateVersionSpecFieldReadme = "readme" - TemplateVersionSpecFieldRequiredNamespace = "requiredNamespace" - TemplateVersionSpecFieldUpgradeVersionLinks = "upgradeVersionLinks" - TemplateVersionSpecFieldVersion = "version" - TemplateVersionSpecFieldVersionDir = "versionDir" - TemplateVersionSpecFieldVersionName = "versionName" - TemplateVersionSpecFieldVersionURLs = "versionUrls" -) - -type TemplateVersionSpec struct { - AppReadme string `json:"appReadme,omitempty" yaml:"appReadme,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - Files map[string]string `json:"files,omitempty" yaml:"files,omitempty"` - KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - RancherMaxVersion string `json:"rancherMaxVersion,omitempty" yaml:"rancherMaxVersion,omitempty"` - RancherMinVersion string `json:"rancherMinVersion,omitempty" yaml:"rancherMinVersion,omitempty"` - RancherVersion string `json:"rancherVersion,omitempty" yaml:"rancherVersion,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - RequiredNamespace string `json:"requiredNamespace,omitempty" yaml:"requiredNamespace,omitempty"` - UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty" yaml:"upgradeVersionLinks,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - VersionDir string `json:"versionDir,omitempty" yaml:"versionDir,omitempty"` - VersionName string `json:"versionName,omitempty" yaml:"versionName,omitempty"` - VersionURLs []string `json:"versionUrls,omitempty" yaml:"versionUrls,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_status.go deleted file mode 100644 index ea736ff6c5e..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_template_version_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - TemplateVersionStatusType = "templateVersionStatus" - TemplateVersionStatusFieldHelmVersion = "helmVersion" -) - -type TemplateVersionStatus struct { - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_time_series.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_time_series.go deleted file mode 100644 index 974cc7dea0a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_time_series.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - TimeSeriesType = "timeSeries" - TimeSeriesFieldName = "name" - TimeSeriesFieldPoints = "points" -) - -type TimeSeries struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Points [][]float64 `json:"points,omitempty" yaml:"points,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_token.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_token.go deleted file mode 100644 index 40c591dd024..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_token.go +++ /dev/null @@ -1,155 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - TokenType = "token" - TokenFieldAnnotations = "annotations" - TokenFieldAuthProvider = "authProvider" - TokenFieldClusterID = "clusterId" - TokenFieldCreated = "created" - TokenFieldCreatorID = "creatorId" - TokenFieldCurrent = "current" - TokenFieldDescription = "description" - TokenFieldEnabled = "enabled" - TokenFieldExpired = "expired" - TokenFieldExpiresAt = "expiresAt" - TokenFieldGroupPrincipals = "groupPrincipals" - TokenFieldIsDerived = "isDerived" - TokenFieldLabels = "labels" - TokenFieldLastUpdateTime = "lastUpdateTime" - TokenFieldName = "name" - TokenFieldOwnerReferences = "ownerReferences" - TokenFieldProviderInfo = "providerInfo" - TokenFieldRemoved = "removed" - TokenFieldTTLMillis = "ttl" - TokenFieldToken = "token" - TokenFieldUUID = "uuid" - TokenFieldUserID = "userId" - TokenFieldUserPrincipal = "userPrincipal" -) - -type Token struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AuthProvider string `json:"authProvider,omitempty" yaml:"authProvider,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Current bool `json:"current,omitempty" yaml:"current,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Expired bool `json:"expired,omitempty" yaml:"expired,omitempty"` - ExpiresAt string `json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"` - GroupPrincipals []string `json:"groupPrincipals,omitempty" yaml:"groupPrincipals,omitempty"` - IsDerived bool `json:"isDerived,omitempty" yaml:"isDerived,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - ProviderInfo map[string]string `json:"providerInfo,omitempty" yaml:"providerInfo,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - TTLMillis int64 `json:"ttl,omitempty" yaml:"ttl,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserID string `json:"userId,omitempty" yaml:"userId,omitempty"` - UserPrincipal string `json:"userPrincipal,omitempty" yaml:"userPrincipal,omitempty"` -} - -type TokenCollection struct { - types.Collection - Data []Token `json:"data,omitempty"` - client *TokenClient -} - -type TokenClient struct { - apiClient *Client -} - -type TokenOperations interface { - List(opts *types.ListOpts) (*TokenCollection, error) - ListAll(opts *types.ListOpts) (*TokenCollection, error) - Create(opts *Token) (*Token, error) - Update(existing *Token, updates interface{}) (*Token, error) - Replace(existing *Token) (*Token, error) - ByID(id string) (*Token, error) - Delete(container *Token) error - - CollectionActionLogout(resource *TokenCollection) error -} - -func newTokenClient(apiClient *Client) *TokenClient { - return &TokenClient{ - apiClient: apiClient, - } -} - -func (c *TokenClient) Create(container *Token) (*Token, error) { - resp := &Token{} - err := c.apiClient.Ops.DoCreate(TokenType, container, resp) - return resp, err -} - -func (c *TokenClient) Update(existing *Token, updates interface{}) (*Token, error) { - resp := &Token{} - err := c.apiClient.Ops.DoUpdate(TokenType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TokenClient) Replace(obj *Token) (*Token, error) { - resp := &Token{} - err := c.apiClient.Ops.DoReplace(TokenType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *TokenClient) List(opts *types.ListOpts) (*TokenCollection, error) { - resp := &TokenCollection{} - err := c.apiClient.Ops.DoList(TokenType, opts, resp) - resp.client = c - return resp, err -} - -func (c *TokenClient) ListAll(opts *types.ListOpts) (*TokenCollection, error) { - resp := &TokenCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *TokenCollection) Next() (*TokenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TokenCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TokenClient) ByID(id string) (*Token, error) { - resp := &Token{} - err := c.apiClient.Ops.DoByID(TokenType, id, resp) - return resp, err -} - -func (c *TokenClient) Delete(container *Token) error { - return c.apiClient.Ops.DoResourceDelete(TokenType, &container.Resource) -} - -func (c *TokenClient) CollectionActionLogout(resource *TokenCollection) error { - err := c.apiClient.Ops.DoCollectionAction(TokenType, "logout", &resource.Collection, nil, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_toleration.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_toleration.go deleted file mode 100644 index eabdd9d9b24..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_toleration.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - TolerationType = "toleration" - TolerationFieldEffect = "effect" - TolerationFieldKey = "key" - TolerationFieldOperator = "operator" - TolerationFieldTolerationSeconds = "tolerationSeconds" - TolerationFieldValue = "value" -) - -type Toleration struct { - Effect string `json:"effect,omitempty" yaml:"effect,omitempty"` - Key string `json:"key,omitempty" yaml:"key,omitempty"` - Operator string `json:"operator,omitempty" yaml:"operator,omitempty"` - TolerationSeconds *int64 `json:"tolerationSeconds,omitempty" yaml:"tolerationSeconds,omitempty"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_typed_local_object_reference.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_typed_local_object_reference.go deleted file mode 100644 index 0de2ebea0d5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_typed_local_object_reference.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - TypedLocalObjectReferenceType = "typedLocalObjectReference" - TypedLocalObjectReferenceFieldAPIGroup = "apiGroup" - TypedLocalObjectReferenceFieldKind = "kind" - TypedLocalObjectReferenceFieldName = "name" -) - -type TypedLocalObjectReference struct { - APIGroup string `json:"apiGroup,omitempty" yaml:"apiGroup,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_update_global_dnstargets_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_update_global_dnstargets_input.go deleted file mode 100644 index 5aec4f78efe..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_update_global_dnstargets_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - UpdateGlobalDNSTargetsInputType = "updateGlobalDNSTargetsInput" - UpdateGlobalDNSTargetsInputFieldProjectIDs = "projectIds" -) - -type UpdateGlobalDNSTargetsInput struct { - ProjectIDs []string `json:"projectIds,omitempty" yaml:"projectIds,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_update_multi_cluster_app_targets_input.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_update_multi_cluster_app_targets_input.go deleted file mode 100644 index 8ccaf6a12f1..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_update_multi_cluster_app_targets_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - UpdateMultiClusterAppTargetsInputType = "updateMultiClusterAppTargetsInput" - UpdateMultiClusterAppTargetsInputFieldAnswers = "answers" - UpdateMultiClusterAppTargetsInputFieldProjects = "projects" -) - -type UpdateMultiClusterAppTargetsInput struct { - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Projects []string `json:"projects,omitempty" yaml:"projects,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_upgrade_strategy.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_upgrade_strategy.go deleted file mode 100644 index 1bd375c9c0c..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_upgrade_strategy.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - UpgradeStrategyType = "upgradeStrategy" - UpgradeStrategyFieldRollingUpdate = "rollingUpdate" -) - -type UpgradeStrategy struct { - RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty" yaml:"rollingUpdate,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_user.go deleted file mode 100644 index 454a2965ab6..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user.go +++ /dev/null @@ -1,169 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - UserType = "user" - UserFieldAnnotations = "annotations" - UserFieldConditions = "conditions" - UserFieldCreated = "created" - UserFieldCreatorID = "creatorId" - UserFieldDescription = "description" - UserFieldEnabled = "enabled" - UserFieldLabels = "labels" - UserFieldMe = "me" - UserFieldMustChangePassword = "mustChangePassword" - UserFieldName = "name" - UserFieldOwnerReferences = "ownerReferences" - UserFieldPassword = "password" - UserFieldPrincipalIDs = "principalIds" - UserFieldRemoved = "removed" - UserFieldState = "state" - UserFieldTransitioning = "transitioning" - UserFieldTransitioningMessage = "transitioningMessage" - UserFieldUUID = "uuid" - UserFieldUsername = "username" -) - -type User struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Conditions []UserCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Me bool `json:"me,omitempty" yaml:"me,omitempty"` - MustChangePassword bool `json:"mustChangePassword,omitempty" yaml:"mustChangePassword,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - PrincipalIDs []string `json:"principalIds,omitempty" yaml:"principalIds,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type UserCollection struct { - types.Collection - Data []User `json:"data,omitempty"` - client *UserClient -} - -type UserClient struct { - apiClient *Client -} - -type UserOperations interface { - List(opts *types.ListOpts) (*UserCollection, error) - ListAll(opts *types.ListOpts) (*UserCollection, error) - Create(opts *User) (*User, error) - Update(existing *User, updates interface{}) (*User, error) - Replace(existing *User) (*User, error) - ByID(id string) (*User, error) - Delete(container *User) error - - ActionRefreshauthprovideraccess(resource *User) error - - ActionSetpassword(resource *User, input *SetPasswordInput) (*User, error) - - CollectionActionChangepassword(resource *UserCollection, input *ChangePasswordInput) error - - CollectionActionRefreshauthprovideraccess(resource *UserCollection) error -} - -func newUserClient(apiClient *Client) *UserClient { - return &UserClient{ - apiClient: apiClient, - } -} - -func (c *UserClient) Create(container *User) (*User, error) { - resp := &User{} - err := c.apiClient.Ops.DoCreate(UserType, container, resp) - return resp, err -} - -func (c *UserClient) Update(existing *User, updates interface{}) (*User, error) { - resp := &User{} - err := c.apiClient.Ops.DoUpdate(UserType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *UserClient) Replace(obj *User) (*User, error) { - resp := &User{} - err := c.apiClient.Ops.DoReplace(UserType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *UserClient) List(opts *types.ListOpts) (*UserCollection, error) { - resp := &UserCollection{} - err := c.apiClient.Ops.DoList(UserType, opts, resp) - resp.client = c - return resp, err -} - -func (c *UserClient) ListAll(opts *types.ListOpts) (*UserCollection, error) { - resp := &UserCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *UserCollection) Next() (*UserCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &UserCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *UserClient) ByID(id string) (*User, error) { - resp := &User{} - err := c.apiClient.Ops.DoByID(UserType, id, resp) - return resp, err -} - -func (c *UserClient) Delete(container *User) error { - return c.apiClient.Ops.DoResourceDelete(UserType, &container.Resource) -} - -func (c *UserClient) ActionRefreshauthprovideraccess(resource *User) error { - err := c.apiClient.Ops.DoAction(UserType, "refreshauthprovideraccess", &resource.Resource, nil, nil) - return err -} - -func (c *UserClient) ActionSetpassword(resource *User, input *SetPasswordInput) (*User, error) { - resp := &User{} - err := c.apiClient.Ops.DoAction(UserType, "setpassword", &resource.Resource, input, resp) - return resp, err -} - -func (c *UserClient) CollectionActionChangepassword(resource *UserCollection, input *ChangePasswordInput) error { - err := c.apiClient.Ops.DoCollectionAction(UserType, "changepassword", &resource.Collection, input, nil) - return err -} - -func (c *UserClient) CollectionActionRefreshauthprovideraccess(resource *UserCollection) error { - err := c.apiClient.Ops.DoCollectionAction(UserType, "refreshauthprovideraccess", &resource.Collection, nil, nil) - return err -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_attribute.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_attribute.go deleted file mode 100644 index f565fde1920..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_attribute.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -const ( - UserAttributeType = "userAttribute" - UserAttributeFieldAnnotations = "annotations" - UserAttributeFieldCreated = "created" - UserAttributeFieldCreatorID = "creatorId" - UserAttributeFieldExtraByProvider = "extraByProvider" - UserAttributeFieldGroupPrincipals = "groupPrincipals" - UserAttributeFieldLabels = "labels" - UserAttributeFieldLastRefresh = "lastRefresh" - UserAttributeFieldName = "name" - UserAttributeFieldNeedsRefresh = "needsRefresh" - UserAttributeFieldOwnerReferences = "ownerReferences" - UserAttributeFieldRemoved = "removed" - UserAttributeFieldUUID = "uuid" - UserAttributeFieldUserName = "userName" -) - -type UserAttribute struct { - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - ExtraByProvider map[string]map[string][]string `json:"extraByProvider,omitempty" yaml:"extraByProvider,omitempty"` - GroupPrincipals map[string]Principal `json:"groupPrincipals,omitempty" yaml:"groupPrincipals,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastRefresh string `json:"lastRefresh,omitempty" yaml:"lastRefresh,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NeedsRefresh bool `json:"needsRefresh,omitempty" yaml:"needsRefresh,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UserName string `json:"userName,omitempty" yaml:"userName,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_condition.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_condition.go deleted file mode 100644 index 7d19141d13b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - UserConditionType = "userCondition" - UserConditionFieldLastTransitionTime = "lastTransitionTime" - UserConditionFieldLastUpdateTime = "lastUpdateTime" - UserConditionFieldMessage = "message" - UserConditionFieldReason = "reason" - UserConditionFieldStatus = "status" - UserConditionFieldType = "type" -) - -type UserCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_spec.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_spec.go deleted file mode 100644 index a3b927d323d..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_spec.go +++ /dev/null @@ -1,8 +0,0 @@ -package client - -const ( - UserSpecType = "userSpec" -) - -type UserSpec struct { -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_status.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_status.go deleted file mode 100644 index a42c797d6fb..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_user_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - UserStatusType = "userStatus" - UserStatusFieldConditions = "conditions" -) - -type UserStatus struct { - Conditions []UserCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_values.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_values.go deleted file mode 100644 index f8b87ddb004..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_values.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - ValuesType = "values" - ValuesFieldBoolValue = "boolValue" - ValuesFieldIntValue = "intValue" - ValuesFieldStringSliceValue = "stringSliceValue" - ValuesFieldStringValue = "stringValue" -) - -type Values struct { - BoolValue bool `json:"boolValue,omitempty" yaml:"boolValue,omitempty"` - IntValue int64 `json:"intValue,omitempty" yaml:"intValue,omitempty"` - StringSliceValue []string `json:"stringSliceValue,omitempty" yaml:"stringSliceValue,omitempty"` - StringValue string `json:"stringValue,omitempty" yaml:"stringValue,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_version_commits.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_version_commits.go deleted file mode 100644 index 493b1e1e689..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_version_commits.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - VersionCommitsType = "versionCommits" - VersionCommitsFieldValue = "Value" -) - -type VersionCommits struct { - Value map[string]string `json:"Value,omitempty" yaml:"Value,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_virtual_center_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_virtual_center_config.go deleted file mode 100644 index b29d74df578..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_virtual_center_config.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - VirtualCenterConfigType = "virtualCenterConfig" - VirtualCenterConfigFieldDatacenters = "datacenters" - VirtualCenterConfigFieldPassword = "password" - VirtualCenterConfigFieldRoundTripperCount = "soap-roundtrip-count" - VirtualCenterConfigFieldUser = "user" - VirtualCenterConfigFieldVCenterPort = "port" -) - -type VirtualCenterConfig struct { - Datacenters string `json:"datacenters,omitempty" yaml:"datacenters,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - RoundTripperCount int64 `json:"soap-roundtrip-count,omitempty" yaml:"soap-roundtrip-count,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` - VCenterPort string `json:"port,omitempty" yaml:"port,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_volume_projection.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_volume_projection.go deleted file mode 100644 index 69054b843a7..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_volume_projection.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - VolumeProjectionType = "volumeProjection" - VolumeProjectionFieldConfigMap = "configMap" - VolumeProjectionFieldDownwardAPI = "downwardAPI" - VolumeProjectionFieldSecret = "secret" - VolumeProjectionFieldServiceAccountToken = "serviceAccountToken" -) - -type VolumeProjection struct { - ConfigMap *ConfigMapProjection `json:"configMap,omitempty" yaml:"configMap,omitempty"` - DownwardAPI *DownwardAPIProjection `json:"downwardAPI,omitempty" yaml:"downwardAPI,omitempty"` - Secret *SecretProjection `json:"secret,omitempty" yaml:"secret,omitempty"` - ServiceAccountToken *ServiceAccountTokenProjection `json:"serviceAccountToken,omitempty" yaml:"serviceAccountToken,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_cloud_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_cloud_provider.go deleted file mode 100644 index 63bbae2d50f..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_cloud_provider.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - VsphereCloudProviderType = "vsphereCloudProvider" - VsphereCloudProviderFieldDisk = "disk" - VsphereCloudProviderFieldGlobal = "global" - VsphereCloudProviderFieldNetwork = "network" - VsphereCloudProviderFieldVirtualCenter = "virtualCenter" - VsphereCloudProviderFieldWorkspace = "workspace" -) - -type VsphereCloudProvider struct { - Disk *DiskVsphereOpts `json:"disk,omitempty" yaml:"disk,omitempty"` - Global *GlobalVsphereOpts `json:"global,omitempty" yaml:"global,omitempty"` - Network *NetworkVshpereOpts `json:"network,omitempty" yaml:"network,omitempty"` - VirtualCenter map[string]VirtualCenterConfig `json:"virtualCenter,omitempty" yaml:"virtualCenter,omitempty"` - Workspace *WorkspaceVsphereOpts `json:"workspace,omitempty" yaml:"workspace,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_virtual_disk_volume_source.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_virtual_disk_volume_source.go deleted file mode 100644 index ed671ad47d5..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_vsphere_virtual_disk_volume_source.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - VsphereVirtualDiskVolumeSourceType = "vsphereVirtualDiskVolumeSource" - VsphereVirtualDiskVolumeSourceFieldFSType = "fsType" - VsphereVirtualDiskVolumeSourceFieldStoragePolicyID = "storagePolicyID" - VsphereVirtualDiskVolumeSourceFieldStoragePolicyName = "storagePolicyName" - VsphereVirtualDiskVolumeSourceFieldVolumePath = "volumePath" -) - -type VsphereVirtualDiskVolumeSource struct { - FSType string `json:"fsType,omitempty" yaml:"fsType,omitempty"` - StoragePolicyID string `json:"storagePolicyID,omitempty" yaml:"storagePolicyID,omitempty"` - StoragePolicyName string `json:"storagePolicyName,omitempty" yaml:"storagePolicyName,omitempty"` - VolumePath string `json:"volumePath,omitempty" yaml:"volumePath,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_weave_network_provider.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_weave_network_provider.go deleted file mode 100644 index 2cd7b6fa093..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_weave_network_provider.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - WeaveNetworkProviderType = "weaveNetworkProvider" - WeaveNetworkProviderFieldPassword = "password" -) - -type WeaveNetworkProvider struct { - Password string `json:"password,omitempty" yaml:"password,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_webhook_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_webhook_config.go deleted file mode 100644 index 41ca3c55ca8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_webhook_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - WebhookConfigType = "webhookConfig" - WebhookConfigFieldProxyURL = "proxyUrl" - WebhookConfigFieldURL = "url" -) - -type WebhookConfig struct { - ProxyURL string `json:"proxyUrl,omitempty" yaml:"proxyUrl,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_wechat_config.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_wechat_config.go deleted file mode 100644 index f7e6a69b9b8..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_wechat_config.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -const ( - WechatConfigType = "wechatConfig" - WechatConfigFieldAPIURL = "apiUrl" - WechatConfigFieldAgent = "agent" - WechatConfigFieldCorp = "corp" - WechatConfigFieldDefaultRecipient = "defaultRecipient" - WechatConfigFieldProxyURL = "proxyUrl" - WechatConfigFieldRecipientType = "recipientType" - WechatConfigFieldSecret = "secret" -) - -type WechatConfig struct { - APIURL string `json:"apiUrl,omitempty" yaml:"apiUrl,omitempty"` - Agent string `json:"agent,omitempty" yaml:"agent,omitempty"` - Corp string `json:"corp,omitempty" yaml:"corp,omitempty"` - DefaultRecipient string `json:"defaultRecipient,omitempty" yaml:"defaultRecipient,omitempty"` - ProxyURL string `json:"proxyUrl,omitempty" yaml:"proxyUrl,omitempty"` - RecipientType string `json:"recipientType,omitempty" yaml:"recipientType,omitempty"` - Secret string `json:"secret,omitempty" yaml:"secret,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_weighted_pod_affinity_term.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_weighted_pod_affinity_term.go deleted file mode 100644 index a046f5ae28b..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_weighted_pod_affinity_term.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - WeightedPodAffinityTermType = "weightedPodAffinityTerm" - WeightedPodAffinityTermFieldPodAffinityTerm = "podAffinityTerm" - WeightedPodAffinityTermFieldWeight = "weight" -) - -type WeightedPodAffinityTerm struct { - PodAffinityTerm *PodAffinityTerm `json:"podAffinityTerm,omitempty" yaml:"podAffinityTerm,omitempty"` - Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_workload_rule.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_workload_rule.go deleted file mode 100644 index 107ec70bd0a..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_workload_rule.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - WorkloadRuleType = "workloadRule" - WorkloadRuleFieldAvailablePercentage = "availablePercentage" - WorkloadRuleFieldSelector = "selector" - WorkloadRuleFieldWorkloadID = "workloadId" -) - -type WorkloadRule struct { - AvailablePercentage int64 `json:"availablePercentage,omitempty" yaml:"availablePercentage,omitempty"` - Selector map[string]string `json:"selector,omitempty" yaml:"selector,omitempty"` - WorkloadID string `json:"workloadId,omitempty" yaml:"workloadId,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_workspace_vsphere_opts.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_workspace_vsphere_opts.go deleted file mode 100644 index 3f13897e9fc..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_workspace_vsphere_opts.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - WorkspaceVsphereOptsType = "workspaceVsphereOpts" - WorkspaceVsphereOptsFieldDatacenter = "datacenter" - WorkspaceVsphereOptsFieldDefaultDatastore = "default-datastore" - WorkspaceVsphereOptsFieldFolder = "folder" - WorkspaceVsphereOptsFieldResourcePoolPath = "resourcepool-path" - WorkspaceVsphereOptsFieldVCenterIP = "server" -) - -type WorkspaceVsphereOpts struct { - Datacenter string `json:"datacenter,omitempty" yaml:"datacenter,omitempty"` - DefaultDatastore string `json:"default-datastore,omitempty" yaml:"default-datastore,omitempty"` - Folder string `json:"folder,omitempty" yaml:"folder,omitempty"` - ResourcePoolPath string `json:"resourcepool-path,omitempty" yaml:"resourcepool-path,omitempty"` - VCenterIP string `json:"server,omitempty" yaml:"server,omitempty"` -} diff --git a/tests/framework/clients/rancher/generated/management/v3/zz_generated_y_axis.go b/tests/framework/clients/rancher/generated/management/v3/zz_generated_y_axis.go deleted file mode 100644 index f0976bc8742..00000000000 --- a/tests/framework/clients/rancher/generated/management/v3/zz_generated_y_axis.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - YAxisType = "yAxis" - YAxisFieldUnit = "unit" -) - -type YAxis struct { - Unit string `json:"unit,omitempty" yaml:"unit,omitempty"` -} diff --git a/tests/framework/clients/rancher/v1/client.go b/tests/framework/clients/rancher/v1/client.go deleted file mode 100644 index a6fe59afeab..00000000000 --- a/tests/framework/clients/rancher/v1/client.go +++ /dev/null @@ -1,445 +0,0 @@ -package v1 - -import ( - "bytes" - "crypto/tls" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "regexp" - "sort" - "strings" - "time" - - "github.com/rancher/apiserver/pkg/types" - normantypes "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/pkg/clientbase" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - hostRegex = "https://(.+)/v1" - duration = 100 * time.Millisecond // duration of 100 miliseconds to be short since this is a fast check - factor = 1 // with a factor of 1 - steps = 5 // only do 5 tries -) - -// State is the Steve specific field in the rancher Steve API -type State struct { - Error bool `json:"error,omitempty" yaml:"error,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Transitioning bool `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` -} - -// Relationship is the Steve specific field in the rancher Steve API -type Relationship struct { - FromID string `json:"fromId,omitempty" yaml:"fromId,omitempty"` - FromType string `json:"fromType,omitempty" yaml:"fromType,omitempty"` - Rel string `json:"rel,omitempty" yaml:"rel,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` -} - -// ObjectMeta is the native k8s object meta field that kubernetes objects used, with the added -// Steve API State field. -type ObjectMeta struct { - metav1.ObjectMeta - State *State `json:"state,omitempty" yaml:"state,omitempty"` - Relationships *[]Relationship `json:"relationships,omitempty" yaml:"relationships,omitempty"` - Fields []any `json:"fields,omitempty" yaml:"fields,omitempty"` -} - -// SteveAPIObject is the generic object used in the v1/steve API call responses -type SteveAPIObject struct { - normantypes.Resource - JSONResp map[string]any - metav1.TypeMeta `json:",inline"` - ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Spec any `json:"spec,omitempty" yaml:"spec,omitempty"` - Status any `json:"status,omitempty" yaml:"status,omitempty"` -} - -// SteveCollection is the collection type of the SteveAPIObjects -type SteveCollection struct { - types.Collection - Data []SteveAPIObject `json:"data,omitempty"` - client *SteveClient -} - -// SteveClient is the client used to access Steve API endpoints -type SteveClient struct { - apiClient *Client - steveType string -} - -// NamespacedSteveClient is the client used to access namespaced Steve API endpoints -type NamespacedSteveClient struct { - SteveClient - namespace string -} - -type SteveOperations interface { - List(params url.Values) (*SteveCollection, error) - ListAll(params url.Values) (*SteveCollection, error) - Create(opts any) (*SteveAPIObject, error) - Update(existing *SteveAPIObject, updates any) (*SteveAPIObject, error) - Replace(existing *SteveAPIObject) (*SteveAPIObject, error) - ByID(id string) (*SteveAPIObject, error) - Delete(container *SteveAPIObject) error -} - -type Client struct { - clientbase.APIBaseClient -} - -func NewClient(opts *clientbase.ClientOpts) (*Client, error) { - baseClient, err := clientbase.NewAPIClient(opts) - if err != nil { - return nil, err - } - - client := &Client{ - APIBaseClient: baseClient, - } - - return client, nil -} - -// SteveType is a function that sets the resource type for the SteveClient -// e.g. accessing the Steve namespace resource -// -// nameSpaceClient := client.V1.SteveType("namespace") -func (c *Client) SteveType(steveType string) *SteveClient { - return &SteveClient{ - apiClient: c, - steveType: steveType, - } -} - -func (c *SteveClient) NamespacedSteveClient(namespace string) *NamespacedSteveClient { - return &NamespacedSteveClient{*c, namespace} -} - -// ProxyDownstream is a function that sets the URL to a proxy URL -// to be able to make Steve API calls to a downstream cluster -func (c *Client) ProxyDownstream(clusterID string) (*Client, error) { - // sometimes it is necessary to retry the GetCollectionURL due to the schema not being updated - // fast enough after a cluster has been provisioned - var backoff = wait.Backoff{ - Duration: duration, - Factor: factor, - Jitter: 0, - Steps: steps, - } - - hostRegexp := regexp.MustCompile(hostRegex) - - matches := hostRegexp.FindStringSubmatch(c.Opts.URL) - host := matches[1] - - updatedOpts := *c.Opts - proxyHost := fmt.Sprintf("https://%s/k8s/clusters/%s/v1", host, clusterID) - updatedOpts.URL = proxyHost - - var baseClient clientbase.APIBaseClient - err := wait.ExponentialBackoff(backoff, func() (done bool, err error) { - baseClient, err = clientbase.NewAPIClient(&updatedOpts) - if err != nil { - return false, err - } - - typesLength := len(baseClient.Types) - if typesLength > 0 { - return true, nil - } - - return false, nil - }) - - if err != nil { - return nil, fmt.Errorf("failed creating Proxy Client. Backoff error: %v", err) - } - - client := &Client{ - APIBaseClient: baseClient, - } - client.Ops.Session = c.Ops.Session - - return client, nil -} - -func (c *SteveClient) Create(container any) (*SteveAPIObject, error) { - resp := &SteveAPIObject{} - var jsonResp map[string]any - err := c.apiClient.Ops.DoCreate(c.steveType, container, &jsonResp) - if err != nil { - return nil, err - } - err = ConvertToK8sType(jsonResp, resp) - resp.JSONResp = jsonResp - return resp, err -} - -func (c *SteveClient) Update(existing *SteveAPIObject, updates any) (*SteveAPIObject, error) { - resp := &SteveAPIObject{} - var jsonResp map[string]any - err := c.apiClient.Ops.DoUpdate(c.steveType, &existing.Resource, updates, &jsonResp) - if err != nil { - return nil, err - } - err = ConvertToK8sType(jsonResp, resp) - resp.JSONResp = jsonResp - return resp, err -} - -func (c *SteveClient) Replace(obj *SteveAPIObject) (*SteveAPIObject, error) { - resp := &SteveAPIObject{} - var jsonResp map[string]any - err := c.apiClient.Ops.DoReplace(c.steveType, &obj.Resource, obj, &jsonResp) - if err != nil { - return nil, err - } - err = ConvertToK8sType(jsonResp, resp) - resp.JSONResp = jsonResp - return resp, err -} - -func (c *SteveClient) List(query url.Values) (*SteveCollection, error) { - resp := &SteveCollection{} - var jsonResp map[string]any - url, err := c.apiClient.Ops.GetCollectionURL(c.steveType, "GET") - if err != nil { - return nil, err - } - url = url + "?" + query.Encode() - err = c.apiClient.Ops.DoGet(url, nil, &jsonResp) - if err != nil { - return nil, err - } - - err = ConvertToK8sType(jsonResp, resp) - if err != nil { - return nil, err - } - - steveList := jsonResp["data"] - for index, item := range steveList.([]any) { - resp.Data[index].JSONResp = item.(map[string]any) - } - return resp, err -} - -func (c *SteveClient) ListAll(params url.Values) (*SteveCollection, error) { - resp, err := c.List(params) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (sc *SteveCollection) Next() (*SteveCollection, error) { - if sc != nil && sc.Pagination != nil && sc.Pagination.Next != "" { - resp := &SteveCollection{} - err := sc.client.apiClient.Ops.DoNext(sc.Pagination.Next, resp) - resp.client = sc.client - return resp, err - } - return nil, nil -} - -func (sc *SteveCollection) Names() (names []string) { - for _, item := range sc.Data { - names = append(names, item.Name) - } - - sort.Strings(names) - - return -} - -func (c *SteveClient) ByID(id string) (*SteveAPIObject, error) { - resp := &SteveAPIObject{} - var jsonResp map[string]any - - err := c.apiClient.Ops.DoByID(c.steveType, id, &jsonResp) - if err != nil { - return nil, err - } - err = ConvertToK8sType(jsonResp, resp) - resp.JSONResp = jsonResp - return resp, err -} - -func (c *SteveClient) Delete(container *SteveAPIObject) error { - return c.apiClient.Ops.DoResourceDelete(c.steveType, &container.Resource) -} - -func (c *NamespacedSteveClient) Create(container any) (*SteveAPIObject, error) { - resp := &SteveAPIObject{} - var jsonResp map[string]any - url, err := c.apiClient.Ops.GetCollectionURL(c.steveType, "POST") - if err != nil { - return nil, err - } - if c.namespace != "" { - url += "/" + c.namespace - } - err = c.apiClient.Ops.DoModify("POST", url, container, &jsonResp) - if err != nil { - return nil, err - } - err = ConvertToK8sType(jsonResp, resp) - resp.JSONResp = jsonResp - return resp, err -} - -func (c *NamespacedSteveClient) Update(existing *SteveAPIObject, updates any) (*SteveAPIObject, error) { - return c.SteveClient.Update(existing, updates) -} - -func (c *NamespacedSteveClient) PerformPutCaptureHeaders(host, token, name string, payload interface{}) (http.Header, []byte, error) { - body, err := json.Marshal(payload) - if err != nil { - return nil, nil, fmt.Errorf("error marshalling payload: %v", err) - } - - url := fmt.Sprintf("https://%v/v1/%v/%v/%v", host, c.steveType, c.namespace, name) - req, err := http.NewRequest(http.MethodPut, url, bytes.NewBuffer(body)) - if err != nil { - return nil, nil, fmt.Errorf("error creating request: %v", err) - } - - req.Header.Set("Authorization", "Bearer "+token) - req.Header.Set("Content-Type", "application/json") - - // Create a custom HTTP client with custom transport settings to skip certificate verification - tr := &http.Transport{} - if c.apiClient.Opts.Insecure { - tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - } - - var httpClient = &http.Client{Transport: tr} - resp, err := httpClient.Do(req) - if err != nil { - return nil, nil, fmt.Errorf("error executing request: %v", err) - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return resp.Header, nil, fmt.Errorf("received HTTP error: %s", resp.Status) - } - - byteContent, err := io.ReadAll(resp.Body) - if err != nil { - return resp.Header, nil, fmt.Errorf("error reading response body: %v", err) - } - - if len(byteContent) == 0 { - return resp.Header, nil, fmt.Errorf("received empty response") - } - - return resp.Header, byteContent, nil -} - -func (c *NamespacedSteveClient) Replace(obj *SteveAPIObject) (*SteveAPIObject, error) { - return c.SteveClient.Replace(obj) -} - -func (c *NamespacedSteveClient) List(query url.Values) (*SteveCollection, error) { - resp := &SteveCollection{} - var jsonResp map[string]any - url, err := c.apiClient.Ops.GetCollectionURL(c.steveType, "GET") - if err != nil { - return nil, err - } - if c.namespace != "" { - url += "/" + c.namespace - } - if len(query) > 0 { - url += "?" + query.Encode() - } - err = c.apiClient.Ops.DoGet(url, nil, &jsonResp) - if err != nil { - return nil, err - } - - err = ConvertToK8sType(jsonResp, resp) - if err != nil { - return nil, err - } - - steveList := jsonResp["data"] - for index, item := range steveList.([]any) { - resp.Data[index].JSONResp = item.(map[string]any) - } - return resp, err -} - -func (c *NamespacedSteveClient) ListAll(params url.Values) (*SteveCollection, error) { - resp, err := c.List(params) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (c *NamespacedSteveClient) ByID(id string) (*SteveAPIObject, error) { - var namespacedID string - - if strings.Contains(id, c.namespace) { - namespacedID = id - } else { - namespacedID = fmt.Sprintf(c.namespace + "/" + id) - } - - return c.SteveClient.ByID(namespacedID) -} - -func (c *NamespacedSteveClient) Delete(container *SteveAPIObject) error { - return c.SteveClient.Delete(container) -} - -// ConvertToK8sType is helper function that coverts the generic Spec, Status, JSONResp fields of a -// SteveAPIObject to its native kubernetes type -// e.g. converting a SteveAPIObject spec to a NamespaceSpec -// -// namespaceSpec := &coreV1.NamespaceSpec{} -// err := namespaces.ConvertToK8sType(createdNamespace.Spec, namespaceSpec) -// require.NoError(p.T(), err) -// -// namespaceSpec.Finalizers -func ConvertToK8sType(steveResp any, kubernetesObject any) error { - jsonbody, err := json.Marshal(steveResp) - if err != nil { - return err - } - - if err := json.Unmarshal(jsonbody, kubernetesObject); err != nil { - return err - } - - return nil -} diff --git a/tests/framework/clients/rke/client.go b/tests/framework/clients/rke/client.go deleted file mode 100644 index a4005d48ae0..00000000000 --- a/tests/framework/clients/rke/client.go +++ /dev/null @@ -1,36 +0,0 @@ -package rke - -import ( - rkeClientV1 "github.com/rancher/rancher/pkg/generated/clientset/versioned/typed/rke.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/pkg/session" - "k8s.io/client-go/rest" -) - -// Client is a struct that embeds the `RkeV1Interface` (provisioning client) and has Session as an attribute -// The session.Session attributes is passed all way down to the Cluster -type Client struct { - rkeClientV1.RkeV1Interface - ts *session.Session -} - -// RKEControlPlane is a struct that embeds RKEControlPlaneInterface and has session.Session as an attribute to keep track of the resources created by RKEControlPlaneInterface -type RKEControlPlane struct { // nolint:all - rkeClientV1.RKEControlPlaneInterface - ts *session.Session -} - -// NewForConfig creates a new RkeV1Client for the given config. It also takes session.Session as parameter to track the resources -// the ProvisioningV1Client creates -func NewForConfig(c *rest.Config, ts *session.Session) (*Client, error) { - rkeClient, err := rkeClientV1.NewForConfig(c) - if err != nil { - return nil, err - } - - return &Client{rkeClient, ts}, nil -} - -// RKEControlPlanes takes a namespace and returns an RKEControlPlane object that is used for the CRUD of a pkg/apis/rke.cattle.io/v1 RKEControlPlane -func (p *Client) RKEControlPlanes(namespace string) *RKEControlPlane { - return &RKEControlPlane{p.RkeV1Interface.RKEControlPlanes(namespace), p.ts} -} diff --git a/tests/framework/clients/rkecli/rkecli.go b/tests/framework/clients/rkecli/rkecli.go deleted file mode 100644 index 507fd4cccc9..00000000000 --- a/tests/framework/clients/rkecli/rkecli.go +++ /dev/null @@ -1,36 +0,0 @@ -package rkecli - -import ( - "os/exec" - - "github.com/pkg/errors" -) - -const rkeCmd = "rke" - -// Up uses RKE CLI up command. -// Cluster file path arg points to the cluster.yml file, args appended to the command. -func Up(clusterFilePath string, args ...string) error { - msg, err := exec.Command(rkeCmd, "--version").CombinedOutput() - if err != nil { - return errors.Wrapf(err, "rke isn't executable: [%v] ", msg) - } - - up := "up" - - // Default rke up command - commandArgs := []string{ - up, - "--config", - clusterFilePath, - } - - commandArgs = append(commandArgs, args...) - - msg, err = exec.Command(rkeCmd, commandArgs...).CombinedOutput() - if err != nil { - return errors.Wrapf(err, "rke up: [%v] ", string(msg)) - } - - return nil -} diff --git a/tests/framework/clients/rkecli/state.go b/tests/framework/clients/rkecli/state.go deleted file mode 100644 index 4de7b0b08dc..00000000000 --- a/tests/framework/clients/rkecli/state.go +++ /dev/null @@ -1,205 +0,0 @@ -package rkecli - -import ( - "encoding/json" - "fmt" - "os" - "strings" - - "github.com/pkg/errors" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v3 "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/configmaps" - "github.com/rancher/rancher/tests/framework/pkg/file" - "github.com/rancher/rancher/tests/framework/pkg/nodes" - "github.com/rancher/rke/cluster" - rketypes "github.com/rancher/rke/types" - "gopkg.in/yaml.v2" - corev1 "k8s.io/api/core/v1" -) - -const filePrefix = "cluster" -const dirName = "rke-cattle-test-dir" - -// NewRKEConfigs creates a new dir. -// In that dir, it generates state and cluster files from the state configmap. -// Returns generated state and cluster files' paths. -func NewRKEConfigs(client *rancher.Client) (stateFilePath, clusterFilePath string, err error) { - err = file.NewDir(dirName) - if err != nil { - return - } - - state, err := GetFullState(client) - if err != nil { - return - } - - clusterFilePath, err = NewClusterFile(state, dirName) - if err != nil { - return - } - - stateFilePath, err = NewStateFile(state, dirName) - if err != nil { - return - } - - return -} - -// ReadClusterFromStateFile is a function that reads the RKE config from the given state file path. -// Returns RKE config. -func ReadClusterFromStateFile(stateFilePath string) (*v3.RancherKubernetesEngineConfig, error) { - byteState, err := os.ReadFile(stateFilePath) - if err != nil { - return nil, err - } - - //get bytes state - state := make(map[string]interface{}) - err = json.Unmarshal(byteState, &state) - if err != nil { - return nil, err - } - - //reach rke config in the current state - byteRkeConfig := state["currentState"].(map[string]interface{})["rkeConfig"] - byteTest, err := json.Marshal(byteRkeConfig) - if err != nil { - return nil, err - } - - //final unmarshal to get the struct - rkeConfig := new(v3.RancherKubernetesEngineConfig) - err = json.Unmarshal(byteTest, rkeConfig) - if err != nil { - return nil, err - } - - return rkeConfig, nil -} - -// UpdateKubernetesVersion is a function that updates kubernetes version value in cluster.yml file. -func UpdateKubernetesVersion(kubernetesVersion, clusterFilePath string) error { - byteRkeConfig, err := os.ReadFile(clusterFilePath) - if err != nil { - return err - } - - rkeConfig := new(rketypes.RancherKubernetesEngineConfig) - err = yaml.Unmarshal(byteRkeConfig, rkeConfig) - if err != nil { - return err - } - - rkeConfig.Version = kubernetesVersion - - byteConfig, err := yaml.Marshal(rkeConfig) - if err != nil { - return err - } - - return os.WriteFile(clusterFilePath, byteConfig, 0644) -} - -// NewClusterFile is a function that generates new cluster.yml file from the full state. -// Returns the generated file's path. -func NewClusterFile(state *cluster.FullState, dirName string) (clusterFilePath string, err error) { - extension := "yml" - rkeConfigFileName := fmt.Sprintf("%v/%v.%v", dirName, filePrefix, extension) - - rkeConfig := rketypes.RancherKubernetesEngineConfig{} - currentRkeConfig := state.CurrentState.RancherKubernetesEngineConfig.DeepCopy() - - rkeConfig.Version = currentRkeConfig.Version - rkeConfig.Nodes = currentRkeConfig.Nodes - - rkeConfig.SSHKeyPath = appendSSHPath(currentRkeConfig.SSHKeyPath) - for i := range rkeConfig.Nodes { - rkeConfig.Nodes[i].SSHKeyPath = appendSSHPath(rkeConfig.Nodes[i].SSHKeyPath) - } - - marshaled, err := yaml.Marshal(rkeConfig) - if err != nil { - return - } - - fileName := file.Name(rkeConfigFileName) - - clusterFilePath, err = fileName.NewFile(marshaled) - if err != nil { - return - } - - return -} - -// NewStateFile is a function that generates new cluster.rkestate file from the full state. -// Returns the generated file's path. -func NewStateFile(state *cluster.FullState, dirName string) (stateFilePath string, err error) { - extension := "rkestate" - rkeStateFileName := fmt.Sprintf("%v/%v.%v", dirName, filePrefix, extension) - - marshaled, err := json.Marshal(state) - if err != nil { - return - } - - stateFilePath, err = file.Name(rkeStateFileName).NewFile(marshaled) - if err != nil { - return - } - - return -} - -// GetFullState is a function that gets RKE full state from "full-cluster-state" configmap. -// And returns the cluster full state. -func GetFullState(client *rancher.Client) (state *cluster.FullState, err error) { - namespacedConfigmapClient := client.Steve.SteveType(configmaps.ConfigMapSteveType).NamespacedSteveClient(cluster.SystemNamespace) - if err != nil { - return - } - - configmapResp, err := namespacedConfigmapClient.ByID(cluster.FullStateConfigMapName) - if err != nil { - return - } - - configmap := &corev1.ConfigMap{} - err = v1.ConvertToK8sType(configmapResp.JSONResp, configmap) - if err != nil { - return - } - - rawState, ok := configmap.Data[cluster.FullStateConfigMapName] - if !ok { - err = errors.Wrapf(err, "couldn't retrieve full state data in the configmap") - return - } - - rkeFullState := &cluster.FullState{} - err = json.Unmarshal([]byte(rawState), rkeFullState) - if err != nil { - return - } - - return rkeFullState, nil -} - -// appendSSHPath reads sshPath input from the cattle config file. -// If the config input has a different prefix, adds the prefix. -func appendSSHPath(sshPath string) string { - sshPathPrefix := nodes.GetSSHPath().SSHPath - - if strings.HasPrefix(sshPath, sshPathPrefix) { - return sshPath - } - - ssh := ".ssh/" - sshPath = strings.TrimPrefix(sshPath, ssh) - - return fmt.Sprintf(sshPathPrefix + "/" + sshPath) -} diff --git a/tests/framework/codegen/generator/cleanup/main.go b/tests/framework/codegen/generator/cleanup/main.go deleted file mode 100644 index 298b209fded..00000000000 --- a/tests/framework/codegen/generator/cleanup/main.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "os" -) - -func main() { - if err := run(); err != nil { - panic(err) - } -} - -func run() error { - if err := os.RemoveAll("./clients/rancher/generated"); err != nil { - return err - } - return nil -} diff --git a/tests/framework/codegen/generator/generator.go b/tests/framework/codegen/generator/generator.go deleted file mode 100644 index c4ce4e35517..00000000000 --- a/tests/framework/codegen/generator/generator.go +++ /dev/null @@ -1,43 +0,0 @@ -package generator - -import ( - "path" - "strings" - - "github.com/rancher/norman/generator" - "github.com/rancher/norman/types" -) - -var ( - outputDir = "./" - baseCattle = "./clients/rancher/generated" -) - -// GenerateClient is used to generate clients using `schema` an object of type Schemas from the norman/types package -// defined by specific api e.g. management.cattle.io -func GenerateClient(schemas *types.Schemas, backendTypes map[string]bool) { - version := getVersion(schemas) - group := strings.Split(version.Group, ".")[0] - - cattleOutputPackage := path.Join(baseCattle, group, version.Version) - - if err := generator.GenerateClient(schemas, backendTypes, outputDir, cattleOutputPackage); err != nil { - panic(err) - } -} - -func getVersion(schemas *types.Schemas) *types.APIVersion { - var version types.APIVersion - for _, schema := range schemas.Schemas() { - if version.Group == "" { - version = schema.Version - continue - } - if version.Group != schema.Version.Group || - version.Version != schema.Version.Version { - panic("schema set contains two APIVersions") - } - } - - return &version -} diff --git a/tests/framework/codegen/main.go b/tests/framework/codegen/main.go deleted file mode 100644 index 629c9958350..00000000000 --- a/tests/framework/codegen/main.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "bytes" - "os" - "path/filepath" - "strings" - - "github.com/rancher/rancher/tests/framework/codegen/generator" - managementSchema "github.com/rancher/rancher/tests/framework/pkg/schemas/management.cattle.io/v3" -) - -func main() { - os.Unsetenv("GOPATH") - generator.GenerateClient(managementSchema.Schemas, map[string]bool{ - "userAttribute": true, - }) - - if err := replaceClientBasePackages(); err != nil { - panic(err) - } -} - -// replaceClientBasePackages walks through the zz_generated_client generated by generator.GenerateClient to replace imports from -// "github.com/rancher/norman/clientbase" to "github.com/rancher/rancher/tests/framework/pkg/clientbase" to use our modified code of the -// session.Session tracking the resources created by the Management Client. -func replaceClientBasePackages() error { - return filepath.Walk("./clients/rancher/generated", func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - if strings.HasPrefix(info.Name(), "zz_generated_client") { - input, err := os.ReadFile(path) - if err != nil { - return err - } - - replacement := bytes.Replace(input, []byte("github.com/rancher/norman/clientbase"), []byte("github.com/rancher/rancher/tests/framework/pkg/clientbase"), -1) - - if err = os.WriteFile(path, replacement, 0666); err != nil { - return err - } - } - - return nil - }) -} diff --git a/tests/framework/extensions/charts/awsoutoftree.go b/tests/framework/extensions/charts/awsoutoftree.go deleted file mode 100644 index 6028feb97bf..00000000000 --- a/tests/framework/extensions/charts/awsoutoftree.go +++ /dev/null @@ -1,265 +0,0 @@ -package charts - -import ( - "time" - - "github.com/rancher/rancher/pkg/api/steve/catalog/types" - - appv1 "k8s.io/api/apps/v1" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - repoType = "catalog.cattle.io.clusterrepo" - appsType = "catalog.cattle.io.apps" - awsUpstreamCloudProviderRepo = "https://github.com/kubernetes/cloud-provider-aws.git" - masterBranch = "master" - AwsUpstreamChartName = "aws-cloud-controller-manager" - kubeSystemNamespace = "kube-system" -) - -// InstallAWSOutOfTreeChart installs the CSI chart for aws cloud provider in a given cluster. -func InstallAWSOutOfTreeChart(client *rancher.Client, installOptions *InstallOptions, repoName, clusterID string) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - awsChartInstallActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: AwsUpstreamChartName, - Namespace: kubeSystemNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartInstallAction := awsChartInstallAction(awsChartInstallActionPayload, repoName, kubeSystemNamespace, installOptions.ProjectID) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - err = catalogClient.InstallChart(chartInstallAction, repoName) - if err != nil { - return err - } - - err = VerifyChartInstall(catalogClient, kubeSystemNamespace, AwsUpstreamChartName) - if err != nil { - return err - } - - steveclient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return err - } - - chartNodeSelector := map[string]string{ - "node-role.kubernetes.io/controlplane": "true", - } - err = updateHelmNodeSelectors(steveclient, kubeSystemNamespace, AwsUpstreamChartName, chartNodeSelector) - - return err -} - -// awsChartInstallAction is a helper function that returns a chartInstallAction for aws out-of-tree chart. -func awsChartInstallAction(awsChartInstallActionPayload *payloadOpts, repoName, chartNamespace, chartProject string) *types.ChartInstallAction { - chartValues := map[string]interface{}{ - "args": []interface{}{ - "--use-service-account-credentials=true", - "--configure-cloud-routes=false", - "--v=2", - "--cloud-provider=aws", - }, - // note: order of []interface{} must match the chart's order. A union is taken in the order given (not a pure replacement of the object) - "clusterRoleRules": []interface{}{ - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "events", - }, - "verbs": []interface{}{ - "patch", - "create", - "update", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "nodes", - }, - "verbs": []interface{}{ - "*", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "nodes/status", - }, - "verbs": []interface{}{ - "patch", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "services", - }, - "verbs": []interface{}{ - "list", - "patch", - "update", - "watch", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "services/status", - }, - "verbs": []interface{}{ - "list", - "patch", - "update", - "watch", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "serviceaccounts", - }, - "verbs": []interface{}{ - "get", - "create", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "persistentvolumes", - }, - "verbs": []interface{}{ - "get", - "list", - "update", - "watch", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "endpoints", - }, - "verbs": []interface{}{ - "get", - "create", - "list", - "watch", - "update", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{ - "coordination.k8s.io", - }, - "resources": []interface{}{ - "leases", - }, - "verbs": []interface{}{ - "get", - "create", - "list", - "watch", - "update", - }, - }, - map[string]interface{}{ - "apiGroups": []interface{}{""}, - "resources": []interface{}{ - "serviceaccounts/token", - }, - "verbs": []interface{}{ - "create", - }, - }, - }, - "nodeSelector": map[string]interface{}{ - "node-role.kubernetes.io/controlplane": "true", - }, - "tolerations": []interface{}{ - map[string]interface{}{ - "effect": "NoSchedule", - "value": "true", - "key": "node-role.kubernetes.io/controlplane", - }, - map[string]interface{}{ - "effect": "NoSchedule", - "value": "true", - "key": "node.cloudprovider.kubernetes.io/uninitialized", - }, - map[string]interface{}{ - "effect": "NoSchedule", - "value": "true", - "key": "node-role.kubernetes.io/master", - }, - }, - } - - chartInstall := newChartInstall( - awsChartInstallActionPayload.Name, - awsChartInstallActionPayload.InstallOptions.Version, - awsChartInstallActionPayload.InstallOptions.ClusterID, - awsChartInstallActionPayload.InstallOptions.ClusterName, - awsChartInstallActionPayload.Host, - repoName, - chartProject, - awsChartInstallActionPayload.DefaultRegistry, - chartValues) - chartInstalls := []types.ChartInstall{*chartInstall} - - return newChartInstallAction(chartNamespace, awsChartInstallActionPayload.ProjectID, chartInstalls) -} - -// updateHelmNodeSelectors is a function that updates the newNodeSelector for a given Daemonset's nodeSelector. This is required due to an -// upstream bug in helm charts, where you can't override the nodeSelector during a deployment of an upstream chart. -func updateHelmNodeSelectors(client *steveV1.Client, daemonsetNamespace, daemonsetName string, newNodeSelector map[string]string) error { - err := kwait.Poll(1*time.Second, 1*time.Minute, func() (done bool, err error) { - _, err = client.SteveType(pods.DaemonsetSteveType).ByID(daemonsetNamespace + "/" + daemonsetName) - if err != nil { - return false, nil - } - return true, nil - }) - if err != nil { - return err - } - - steveDaemonset, err := client.SteveType(pods.DaemonsetSteveType).ByID(daemonsetNamespace + "/" + daemonsetName) - if err != nil { - return err - } - - daemonsetObject := new(appv1.DaemonSet) - err = steveV1.ConvertToK8sType(steveDaemonset, &daemonsetObject) - if err != nil { - return err - } - - daemonsetObject.Spec.Template.Spec.NodeSelector = newNodeSelector - - _, err = client.SteveType(pods.DaemonsetSteveType).Update(steveDaemonset, daemonsetObject) - return err -} diff --git a/tests/framework/extensions/charts/charts.go b/tests/framework/extensions/charts/charts.go deleted file mode 100644 index b8349dc58b9..00000000000 --- a/tests/framework/extensions/charts/charts.go +++ /dev/null @@ -1,371 +0,0 @@ -package charts - -import ( - "context" - "time" - - "github.com/rancher/rancher/pkg/api/scheme" - catalogv1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - v1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/workloads/daemonsets" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/workloads/deployments" - "github.com/rancher/rancher/tests/framework/pkg/wait" - appv1 "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - kwait "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - // defaultRegistrySettingID is a private constant string that contains the ID of system default registry setting. - defaultRegistrySettingID = "system-default-registry" - // serverURLSettingID is a private constant string that contains the ID of server URL setting. - serverURLSettingID = "server-url" - rancherChartsName = "rancher-charts" - active = "active" -) - -// InstallOptions is a struct of the required options to install a chart. -type InstallOptions struct { - Version string - ClusterID string - ClusterName string - ProjectID string -} - -// payloadOpts is a private struct that contains the options for the chart payloads. -// It is used to avoid passing the same options to different functions while using the chart helpers. -type payloadOpts struct { - InstallOptions - Name string - Namespace string - Host string - DefaultRegistry string -} - -// RancherIstioOpts is a struct of the required options to install Rancher Istio with desired chart values. -type RancherIstioOpts struct { - IngressGateways bool - EgressGateways bool - Pilot bool - Telemetry bool - Kiali bool - Tracing bool - CNI bool -} - -// RancherMonitoringOpts is a struct of the required options to install Rancher Monitoring with desired chart values. -type RancherMonitoringOpts struct { - IngressNginx bool - RKEControllerManager bool - RKEEtcd bool - RKEProxy bool - RKEScheduler bool -} - -// RancherLoggingOpts is a struct of the required options to install Rancher Logging with desired chart values. -type RancherLoggingOpts struct { - AdditionalLoggingSources bool -} - -// GetChartCaseEndpointResult is a struct that GetChartCaseEndpoint helper function returns. -// It contains the boolean for healthy response and the request body. -type GetChartCaseEndpointResult struct { - Ok bool - Body string -} - -// ChartStatus is a struct that GetChartStatus helper function returns. -// It contains the boolean for is already installed and the chart information. -type ChartStatus struct { - IsAlreadyInstalled bool - ChartDetails *catalogv1.App -} - -// GetChartStatus is a helper function that takes client, clusterID, chartNamespace and chartName as args, -// uses admin catalog client to check if chart is already installed, if the chart is already installed returns chart information. -func GetChartStatus(client *rancher.Client, clusterID, chartNamespace, chartName string) (*ChartStatus, error) { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return nil, err - } - adminCatalogClient, err := adminClient.GetClusterCatalogClient(clusterID) - if err != nil { - return nil, err - } - - chartList, err := adminCatalogClient.Apps(chartNamespace).List(context.TODO(), metav1.ListOptions{}) - if err != nil { - return nil, err - } - - for _, chart := range chartList.Items { - if chart.Name == chartName { - return &ChartStatus{ - IsAlreadyInstalled: true, - ChartDetails: &chart, - }, nil - } - } - - return &ChartStatus{ - IsAlreadyInstalled: false, - ChartDetails: nil, - }, nil -} - -// WatchAndWaitDeployments is a helper function that watches the deployments -// sequentially in a specific namespace and waits until number of expected replicas is equal to number of available replicas. -func WatchAndWaitDeployments(client *rancher.Client, clusterID, namespace string, listOptions metav1.ListOptions) error { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(clusterID) - if err != nil { - return err - } - adminDeploymentResource := adminDynamicClient.Resource(deployments.DeploymentGroupVersionResource).Namespace(namespace) - - deployments, err := adminDeploymentResource.List(context.TODO(), listOptions) - if err != nil { - return err - } - - var deploymentList []appv1.Deployment - - for _, unstructuredDeployment := range deployments.Items { - newDeployment := &appv1.Deployment{} - err := scheme.Scheme.Convert(&unstructuredDeployment, newDeployment, unstructuredDeployment.GroupVersionKind()) - if err != nil { - return err - } - - deploymentList = append(deploymentList, *newDeployment) - } - - for _, deployment := range deploymentList { - watchAppInterface, err := adminDeploymentResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + deployment.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - deploymentsUnstructured := event.Object.(*unstructured.Unstructured) - deployment := &appv1.Deployment{} - - err = scheme.Scheme.Convert(deploymentsUnstructured, deployment, deploymentsUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - - if *deployment.Spec.Replicas == deployment.Status.AvailableReplicas { - return true, nil - } - return false, nil - }) - } - - return nil -} - -// WatchAndWaitDeploymentForAnnotation is a helper function that watches the deployment -// in a specific namespace and waits until expected annotation key and its value. -func WatchAndWaitDeploymentForAnnotation(client *rancher.Client, clusterID, namespace, deploymentName, annotationKey, annotationValue string) error { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(clusterID) - if err != nil { - return err - } - adminDeploymentResource := adminDynamicClient.Resource(deployments.DeploymentGroupVersionResource).Namespace(namespace) - - watchAppInterface, err := adminDeploymentResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + deploymentName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - deploymentsUnstructured := event.Object.(*unstructured.Unstructured) - deployment := &appv1.Deployment{} - - err = scheme.Scheme.Convert(deploymentsUnstructured, deployment, deploymentsUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - - if deployment.ObjectMeta.Annotations[annotationKey] == annotationValue { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - return nil -} - -// WatchAndWaitDaemonSets is a helper function that watches the DaemonSets -// sequentially in a specific namespace and waits until number of available DeamonSets is equal to number of desired scheduled Daemonsets. -func WatchAndWaitDaemonSets(client *rancher.Client, clusterID, namespace string, listOptions metav1.ListOptions) error { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(clusterID) - if err != nil { - return err - } - adminDaemonSetResource := adminDynamicClient.Resource(daemonsets.DaemonSetGroupVersionResource).Namespace(namespace) - - daemonSets, err := adminDaemonSetResource.List(context.TODO(), listOptions) - if err != nil { - return err - } - - var daemonSetList []appv1.DaemonSet - - for _, unstructuredDaemonSet := range daemonSets.Items { - newDaemonSet := &appv1.DaemonSet{} - err := scheme.Scheme.Convert(&unstructuredDaemonSet, newDaemonSet, unstructuredDaemonSet.GroupVersionKind()) - if err != nil { - return err - } - - daemonSetList = append(daemonSetList, *newDaemonSet) - } - - for _, daemonSet := range daemonSetList { - watchAppInterface, err := adminDaemonSetResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + daemonSet.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - daemonsetsUnstructured := event.Object.(*unstructured.Unstructured) - daemonset := &appv1.DaemonSet{} - - err = scheme.Scheme.Convert(daemonsetsUnstructured, daemonset, daemonsetsUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - - if daemonset.Status.DesiredNumberScheduled == daemonset.Status.NumberAvailable { - return true, nil - } - return false, nil - }) - } - - return nil -} - -// WatchAndWaitStatefulSets is a helper function that watches the StatefulSets -// sequentially in a specific namespace and waits until number of expected replicas is equal to number of ready replicas. -func WatchAndWaitStatefulSets(client *rancher.Client, clusterID, namespace string, listOptions metav1.ListOptions) error { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(clusterID) - if err != nil { - return err - } - adminStatefulSetResource := adminDynamicClient.Resource(appv1.SchemeGroupVersion.WithResource("statefulsets")).Namespace(namespace) - - statefulSets, err := adminStatefulSetResource.List(context.TODO(), listOptions) - if err != nil { - return err - } - - var statefulSetList []appv1.StatefulSet - - for _, unstructuredStatefulSet := range statefulSets.Items { - newStatefulSet := &appv1.StatefulSet{} - err := scheme.Scheme.Convert(&unstructuredStatefulSet, newStatefulSet, unstructuredStatefulSet.GroupVersionKind()) - if err != nil { - return err - } - - statefulSetList = append(statefulSetList, *newStatefulSet) - } - - for _, statefulSet := range statefulSetList { - watchAppInterface, err := adminStatefulSetResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + statefulSet.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - statefulSetsUnstructured := event.Object.(*unstructured.Unstructured) - statefulSet := &appv1.StatefulSet{} - - err = scheme.Scheme.Convert(statefulSetsUnstructured, statefulSet, statefulSetsUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - - if *statefulSet.Spec.Replicas == statefulSet.Status.ReadyReplicas { - return true, nil - } - return false, nil - }) - } - - return nil -} - -// CreateChartRepoFromGithub creates a ClusterRepo in a given client via github instead of helm -func CreateChartRepoFromGithub(client *steveV1.Client, githubURL, githubBranch, repoName string) error { - repoObject := v1.ClusterRepo{ - ObjectMeta: metav1.ObjectMeta{ - Name: repoName, - }, - Spec: v1.RepoSpec{ - GitRepo: githubURL, - GitBranch: githubBranch, - InsecureSkipTLSverify: true, - }, - } - _, err := client.SteveType(repoType).Create(repoObject) - if err != nil { - return err - } - - err = kwait.Poll(1*time.Second, 2*time.Minute, func() (done bool, err error) { - res, err := client.SteveType(repoType).List(nil) - if err != nil { - return false, err - } - - for _, repo := range res.Data { - if repo.Name == repoName { - if repo.State.Name == active { - return true, nil - } - } - } - - return false, nil - }) - return err -} diff --git a/tests/framework/extensions/charts/gatekeeperconfig.go b/tests/framework/extensions/charts/gatekeeperconfig.go deleted file mode 100644 index 7e653074548..00000000000 --- a/tests/framework/extensions/charts/gatekeeperconfig.go +++ /dev/null @@ -1,37 +0,0 @@ -package charts - -import "gopkg.in/yaml.v2" - -// GenerateGatekeeperConfigYaml generates the yaml for a config for OPA gatekeeper https://open-policy-agent.github.io/gatekeeper/website/docs/exempt-namespaces#exempting-namespaces-from-gatekeeper-using-config-resource -func GenerateGatekeeperConfigYaml(excludedNamespaces []string, processes []string, name string, namespace string, apiVersion string, kind string) (string, error) { - confMatch := ConfigMatch{ - {ExcludedNamespaces: excludedNamespaces, - Processes: processes}, - } - - confSpec := ConfigSpec{ - Match: confMatch, - } - - confMetadata := Metadata{ - Name: name, - Namespace: namespace, - } - - confYaml := ConfigYaml{ - APIVersion: apiVersion, - Kind: kind, - Metadata: confMetadata, - Spec: confSpec, - } - - yamlData, err := yaml.Marshal(&confYaml) - if err != nil { - return "", err - } - - yamlString := string(yamlData) - - return yamlString, err - -} diff --git a/tests/framework/extensions/charts/gatekeeperresources.go b/tests/framework/extensions/charts/gatekeeperresources.go deleted file mode 100644 index 49eb21b3dca..00000000000 --- a/tests/framework/extensions/charts/gatekeeperresources.go +++ /dev/null @@ -1,62 +0,0 @@ -package charts - -// These are the structs used to generate the yaml for OPA Gatekeeper Constraints and Configs -// Constraints are what Gatekeeper uses to describe and enforce specific policies in a cluster. More on Constraints: https://open-policy-agent.github.io/gatekeeper/website/docs/howto -// Configs define clusterwide rules for Gatekeeper. More on Configs: https://open-policy-agent.github.io/gatekeeper/website/docs/exempt-namespaces - -// Metadata struct can be shared by Configs and Constraints -type Metadata struct { - Name string `yaml:"name"` - Namespace string `yaml:"namespace"` -} - -// ConfigYaml all the structs that make up a gatekeeper Config are nested in this struct, Configs and Constraints are similar K8s objects, but require different Specs -type ConfigYaml struct { - APIVersion string `yaml:"apiVersion"` - Kind string `yaml:"kind"` - Metadata Metadata `yaml:"metadata"` - Spec ConfigSpec `yaml:"spec"` -} - -// ConfigSpec spec field for ConfigYaml, it contains different fields than ConstraintSpec -type ConfigSpec struct { - Match ConfigMatch `yaml:"match"` -} - -// ConfigMatch match field for ConfigYaml, it contains different fields than ConstraintMatch -type ConfigMatch []struct { - ExcludedNamespaces []string `yaml:"excludedNamespaces"` - Processes []string `yaml:"processes"` -} - -// ConstraintYaml All the structs that make up a gatekeeper Constraint are nested in this struct, Configs and Constraints are similar K8s objects, but require different Specs -type ConstraintYaml struct { - APIVersion string `yaml:"apiVersion"` - Kind string `yaml:"kind"` - Metadata Metadata `yaml:"metadata"` - Spec ConstraintSpec `yaml:"spec"` -} - -// ConstraintSpec spec field for ConstraintYaml, it contains different fields than ConfigSpec -type ConstraintSpec struct { - EnforcementAction string `yaml:"enforcementAction"` - Match ConstraintMatch `yaml:"match"` - Parameters ConstraintParameters `yaml:"parameters"` -} - -// ConstraintMatch match field for ConstraintYaml, it contains different fields than ConfigMatch -type ConstraintMatch struct { - ExcludedNamespaces []string `yaml:"excludedNamespaces"` - Kinds ConstraintKinds `yaml:"kinds"` -} - -// ConstraintKinds field -type ConstraintKinds []struct { - APIGroups []string `yaml:"apiGroups"` - Kinds []string `yaml:"kinds"` -} - -// ConstraintParameters field -type ConstraintParameters struct { - Namespaces []string `yaml:"namespaces"` -} diff --git a/tests/framework/extensions/charts/opaconstraint.go b/tests/framework/extensions/charts/opaconstraint.go deleted file mode 100644 index c8a51e2d854..00000000000 --- a/tests/framework/extensions/charts/opaconstraint.go +++ /dev/null @@ -1,49 +0,0 @@ -package charts - -import ( - "gopkg.in/yaml.v2" -) - -// GenerateGatekeeperConstraintYaml takes inputs to generate the yaml for an OPA Gatekeeper Constraint from an OPA Constraint Template. This can be used to dynamically generate OPA Constraints based on test data -func GenerateGatekeeperConstraintYaml(apiGroups []string, excludedNamespaces []string, kinds []string, name string, namespaces []string, enforcementAction string, apiVersion string, kind string) (string, error) { - - nSKinds := ConstraintKinds{ - {APIGroups: apiGroups}, - {Kinds: kinds}, - } - - nSMetadata := Metadata{ - Name: name, - } - - nSParameters := ConstraintParameters{ - Namespaces: namespaces, - } - - nSMatch := ConstraintMatch{ - ExcludedNamespaces: excludedNamespaces, - Kinds: nSKinds, - } - - nSSpec := ConstraintSpec{ - EnforcementAction: enforcementAction, - Match: nSMatch, - Parameters: nSParameters, - } - - allowedNamespaces := ConstraintYaml{ - APIVersion: apiVersion, - Kind: kind, - Metadata: nSMetadata, - Spec: nSSpec, - } - - yamlData, err := yaml.Marshal(&allowedNamespaces) - if err != nil { - return "", err - } - - yamlString := string(yamlData) - - return yamlString, err -} diff --git a/tests/framework/extensions/charts/payloads.go b/tests/framework/extensions/charts/payloads.go deleted file mode 100644 index d02801cf2b3..00000000000 --- a/tests/framework/extensions/charts/payloads.go +++ /dev/null @@ -1,113 +0,0 @@ -package charts - -import ( - "time" - - "github.com/rancher/rancher/pkg/api/steve/catalog/types" - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// newChartUninstallAction is a private constructor that creates a default payload for chart uninstall action with all disabled options. -func newChartUninstallAction() *types.ChartUninstallAction { - return &types.ChartUninstallAction{ - DisableHooks: false, - DryRun: false, - KeepHistory: false, - Timeout: nil, - Description: "", - } -} - -// newChartInstallAction is a private constructor that creates a payload for chart install action with given namespace, projectId and chartInstalls. -func newChartInstallAction(namespace, projectID string, chartInstalls []types.ChartInstall) *types.ChartInstallAction { - return &types.ChartInstallAction{ - DisableHooks: false, - Timeout: &metav1.Duration{Duration: 600 * time.Second}, - Wait: true, - Namespace: namespace, - ProjectID: projectID, - DisableOpenAPIValidation: false, - Charts: chartInstalls, - } -} - -// newChartUpgradeAction is a private constructor that creates a payload for chart upgrade action with given namespace and chartUpgrades. -func newChartUpgradeAction(namespace string, chartUpgrades []types.ChartUpgrade) *types.ChartUpgradeAction { - return &types.ChartUpgradeAction{ - DisableHooks: false, - Timeout: &metav1.Duration{Duration: 600 * time.Second}, - Wait: true, - Namespace: namespace, - DisableOpenAPIValidation: false, - Force: false, - CleanupOnFail: false, - Charts: chartUpgrades, - } -} - -// newChartInstallAction is a private constructor that creates a chart install with given chart values that can be used for chart install action. -func newChartInstall(name, version, clusterID, clusterName, url, repoName, projectID, defaultRegistry string, chartValues map[string]interface{}) *types.ChartInstall { - chartInstall := types.ChartInstall{ - Annotations: map[string]string{ - "catalog.cattle.io/ui-source-repo": repoName, - "catalog.cattle.io/ui-source-repo-type": "cluster", - }, - ChartName: name, - ReleaseName: name, - Version: version, - Values: v3.MapStringInterface{ - "global": map[string]interface{}{ - "cattle": map[string]string{ - "clusterId": clusterID, - "clusterName": clusterName, - "rkePathPrefix": "", - "rkeWindowsPathPrefix": "", - "systemDefaultRegistry": defaultRegistry, - "url": url, - "systemProjectId": projectID, - }, - "systemDefaultRegistry": defaultRegistry, - }, - }, - } - - for k, v := range chartValues { - chartInstall.Values[k] = v - } - - return &chartInstall -} - -// newChartUpgradeAction is a private constructor that creates a chart upgrade with given chart values that can be used for chart upgrade action. -func newChartUpgrade(name, version, clusterID, clusterName, url, defaultRegistry string, chartValues map[string]interface{}) *types.ChartUpgrade { - chartUpgrade := types.ChartUpgrade{ - Annotations: map[string]string{ - "catalog.cattle.io/ui-source-repo": "rancher-charts", - "catalog.cattle.io/ui-source-repo-type": "cluster", - }, - ChartName: name, - ReleaseName: name, - Version: version, - Values: v3.MapStringInterface{ - "global": map[string]interface{}{ - "cattle": map[string]string{ - "clusterId": clusterID, - "clusterName": clusterName, - "rkePathPrefix": "", - "rkeWindowsPathPrefix": "", - "systemDefaultRegistry": defaultRegistry, - "url": url, - }, - "systemDefaultRegistry": defaultRegistry, - }, - }, - ResetValues: false, - } - - for k, v := range chartValues { - chartUpgrade.Values[k] = v - } - - return &chartUpgrade -} diff --git a/tests/framework/extensions/charts/ranchergatekeeper.go b/tests/framework/extensions/charts/ranchergatekeeper.go deleted file mode 100644 index 000f2a7c912..00000000000 --- a/tests/framework/extensions/charts/ranchergatekeeper.go +++ /dev/null @@ -1,300 +0,0 @@ -package charts - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/steve/catalog/types" - catalogv1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - kubenamespaces "github.com/rancher/rancher/tests/framework/extensions/kubeapi/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/wait" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - // Namespace that rancher gatekeeper chart is installed in - RancherGatekeeperNamespace = "cattle-gatekeeper-system" - // Name of the rancher gatekeeper chart - RancherGatekeeperName = "rancher-gatekeeper" - // Name of rancher gatekeeper crd chart - RancherGatekeeperCRDName = "rancher-gatekeeper-crd" -) - -// InstallRancherGatekeeperChart installs the OPA gatekeeper chart -func InstallRancherGatekeeperChart(client *rancher.Client, installOptions *InstallOptions) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - gatekeeperChartInstallActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: RancherGatekeeperName, - Namespace: RancherGatekeeperNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartInstallAction := newGatekeeperChartInstallAction(gatekeeperChartInstallActionPayload) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - // Cleanup registration - - // register uninstall rancher-gatekeeper as a cleanup function - client.Session.RegisterCleanupFunc(func() error { - // UninstallAction for when uninstalling the rancher-gatekeeper chart - defaultChartUninstallAction := newChartUninstallAction() - - err := catalogClient.UninstallChart(RancherGatekeeperName, RancherGatekeeperNamespace, defaultChartUninstallAction) - if err != nil { - return err - } - - watchAppInterface, err := catalogClient.Apps(RancherGatekeeperNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherGatekeeperName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - chart := event.Object.(*catalogv1.App) - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error uninstalling rancher gatekeeper chart") - } else if event.Type == watch.Deleted { - return true, nil - } else if chart == nil { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - err = catalogClient.UninstallChart(RancherGatekeeperCRDName, RancherGatekeeperNamespace, defaultChartUninstallAction) - if err != nil { - return err - } - - watchAppInterface, err = catalogClient.Apps(RancherGatekeeperNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherGatekeeperCRDName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - chart := event.Object.(*catalogv1.App) - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error uninstalling rancher gatekeeper chart") - } else if event.Type == watch.Deleted { - return true, nil - } else if chart == nil { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - steveclient, err := client.Steve.ProxyDownstream(installOptions.ClusterID) - if err != nil { - return err - } - - namespaceClient := steveclient.SteveType(namespaces.NamespaceSteveType) - - namespace, err := namespaceClient.ByID(RancherGatekeeperNamespace) - if err != nil { - return err - } - - err = namespaceClient.Delete(namespace) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(installOptions.ClusterID) - if err != nil { - return err - } - adminNamespaceResource := adminDynamicClient.Resource(kubenamespaces.NamespaceGroupVersionResource).Namespace("") - - watchNamespaceInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherGatekeeperNamespace, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchNamespaceInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - err = catalogClient.InstallChart(chartInstallAction, catalog.RancherChartRepo) - if err != nil { - return err - } - - // wait for chart to be fully deployed - watchAppInterface, err := catalogClient.Apps(RancherGatekeeperNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherGatekeeperName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusDeployed) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - return nil -} - -// newGatekeeperChartInstallAction is a helper function that returns an array of newChartInstallActions for installing the gatekeeper and gatekeepr-crd charts -func newGatekeeperChartInstallAction(p *payloadOpts) *types.ChartInstallAction { - chartInstall := newChartInstall(p.Name, p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, rancherChartsName, p.ProjectID, p.DefaultRegistry, nil) - chartInstallCRD := newChartInstall(p.Name+"-crd", p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, rancherChartsName, p.ProjectID, p.DefaultRegistry, nil) - - chartInstalls := []types.ChartInstall{*chartInstallCRD, *chartInstall} - - chartInstallAction := newChartInstallAction(p.Namespace, p.ProjectID, chartInstalls) - - return chartInstallAction -} - -// UpgradeRanchergatekeeperChart is a helper function that upgrades the rancher-gatekeeper chart. -func UpgradeRancherGatekeeperChart(client *rancher.Client, installOptions *InstallOptions) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - gatekeeperChartUpgradeActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: RancherGatekeeperName, - Namespace: RancherGatekeeperNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartUpgradeAction := newGatekeeperChartUpgradeAction(gatekeeperChartUpgradeActionPayload) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - err = catalogClient.UpgradeChart(chartUpgradeAction, catalog.RancherChartRepo) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminCatalogClient, err := adminClient.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - // wait for chart to be in status pending upgrade - watchAppInterface, err := adminCatalogClient.Apps(RancherGatekeeperNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherGatekeeperName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusPendingUpgrade) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - // wait for chart to be full deployed - watchAppInterface, err = adminCatalogClient.Apps(RancherGatekeeperNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherGatekeeperName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusDeployed) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - return nil -} - -// newGatekeeperChartUpgradeAction is a private helper function that returns chart upgrade action. -func newGatekeeperChartUpgradeAction(p *payloadOpts) *types.ChartUpgradeAction { - chartUpgrade := newChartUpgrade(p.Name, p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, p.DefaultRegistry, nil) - chartUpgradeCRD := newChartUpgrade(p.Name+"-crd", p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, p.DefaultRegistry, nil) - chartUpgrades := []types.ChartUpgrade{*chartUpgradeCRD, *chartUpgrade} - - chartUpgradeAction := newChartUpgradeAction(p.Namespace, chartUpgrades) - - return chartUpgradeAction -} diff --git a/tests/framework/extensions/charts/rancheristio.go b/tests/framework/extensions/charts/rancheristio.go deleted file mode 100644 index 73fcd870ae2..00000000000 --- a/tests/framework/extensions/charts/rancheristio.go +++ /dev/null @@ -1,308 +0,0 @@ -package charts - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/steve/catalog/types" - catalogv1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - kubenamespaces "github.com/rancher/rancher/tests/framework/extensions/kubeapi/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/wait" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - // Namespace that rancher istio chart is installed in - RancherIstioNamespace = "istio-system" - // Name of the rancher istio chart - RancherIstioName = "rancher-istio" -) - -// InstallRancherIstioChart is a helper function that installs the rancher-istio chart. -func InstallRancherIstioChart(client *rancher.Client, installOptions *InstallOptions, rancherIstioOpts *RancherIstioOpts) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - istioChartInstallActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: RancherIstioName, - Namespace: RancherIstioNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartInstallAction := newIstioChartInstallAction(istioChartInstallActionPayload, rancherIstioOpts) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - // Cleanup registration - client.Session.RegisterCleanupFunc(func() error { - // UninstallAction for when uninstalling the rancher-istio chart - defaultChartUninstallAction := newChartUninstallAction() - - err := catalogClient.UninstallChart(RancherIstioName, RancherIstioNamespace, defaultChartUninstallAction) - if err != nil { - return err - } - - watchAppInterface, err := catalogClient.Apps(RancherIstioNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherIstioName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error uninstalling rancher istio chart") - } else if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - steveclient, err := client.Steve.ProxyDownstream(installOptions.ClusterID) - if err != nil { - return err - } - - namespaceClient := steveclient.SteveType(namespaces.NamespaceSteveType) - - namespace, err := namespaceClient.ByID(RancherIstioNamespace) - if err != nil { - return err - } - - err = namespaceClient.Delete(namespace) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(installOptions.ClusterID) - if err != nil { - return err - } - adminNamespaceResource := adminDynamicClient.Resource(kubenamespaces.NamespaceGroupVersionResource).Namespace("") - - watchNamespaceInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherIstioNamespace, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchNamespaceInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - err = catalogClient.InstallChart(chartInstallAction, catalog.RancherChartRepo) - if err != nil { - return err - } - - // wait for chart to be full deployed - watchAppInterface, err := catalogClient.Apps(RancherIstioNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherIstioName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusDeployed) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - return nil -} - -// newIstioChartInstallAction is a private helper function that returns chart install action with istio and payload options. -func newIstioChartInstallAction(p *payloadOpts, rancherIstioOpts *RancherIstioOpts) *types.ChartInstallAction { - istioValues := map[string]interface{}{ - "tracing": map[string]interface{}{ - "enabled": rancherIstioOpts.Tracing, - }, - "kiali": map[string]interface{}{ - "enabled": rancherIstioOpts.Kiali, - }, - "ingressGateways": map[string]interface{}{ - "enabled": rancherIstioOpts.IngressGateways, - }, - "egressGateways": map[string]interface{}{ - "enabled": rancherIstioOpts.EgressGateways, - }, - "pilot": map[string]interface{}{ - "enabled": rancherIstioOpts.Pilot, - }, - "telemetry": map[string]interface{}{ - "enabled": rancherIstioOpts.Telemetry, - }, - "cni": map[string]interface{}{ - "enabled": rancherIstioOpts.CNI, - }, - } - chartInstall := newChartInstall(p.Name, p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, rancherChartsName, p.ProjectID, p.DefaultRegistry, istioValues) - chartInstalls := []types.ChartInstall{*chartInstall} - - chartInstallAction := newChartInstallAction(p.Namespace, p.InstallOptions.ProjectID, chartInstalls) - - return chartInstallAction -} - -// UpgradeRancherIstioChart is a helper function that upgrades the rancher-istio chart. -func UpgradeRancherIstioChart(client *rancher.Client, installOptions *InstallOptions, rancherIstioOpts *RancherIstioOpts) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - istioChartUpgradeActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: RancherIstioName, - Namespace: RancherIstioNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartUpgradeAction := newIstioChartUpgradeAction(istioChartUpgradeActionPayload, rancherIstioOpts) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - err = catalogClient.UpgradeChart(chartUpgradeAction, catalog.RancherChartRepo) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminCatalogClient, err := adminClient.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - // wait for chart to be in status pending upgrade - watchAppInterface, err := adminCatalogClient.Apps(RancherIstioNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherIstioName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusPendingUpgrade) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - // wait for chart to be full deployed - watchAppInterface, err = adminCatalogClient.Apps(RancherIstioNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherIstioName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusDeployed) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - return nil -} - -// newIstioChartUpgradeAction is a private helper function that returns chart upgrade action with istio and payload options. -func newIstioChartUpgradeAction(p *payloadOpts, rancherIstioOpts *RancherIstioOpts) *types.ChartUpgradeAction { - istioValues := map[string]interface{}{ - "tracing": map[string]interface{}{ - "enabled": rancherIstioOpts.Tracing, - }, - "kiali": map[string]interface{}{ - "enabled": rancherIstioOpts.Kiali, - }, - "ingressGateways": map[string]interface{}{ - "enabled": rancherIstioOpts.IngressGateways, - }, - "egressGateways": map[string]interface{}{ - "enabled": rancherIstioOpts.EgressGateways, - }, - "pilot": map[string]interface{}{ - "enabled": rancherIstioOpts.Pilot, - }, - "telemetry": map[string]interface{}{ - "enabled": rancherIstioOpts.Telemetry, - }, - "cni": map[string]interface{}{ - "enabled": rancherIstioOpts.CNI, - }, - } - chartUpgrade := newChartUpgrade(p.Name, p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, p.DefaultRegistry, istioValues) - chartUpgrades := []types.ChartUpgrade{*chartUpgrade} - - chartUpgradeAction := newChartUpgradeAction(p.Namespace, chartUpgrades) - - return chartUpgradeAction -} diff --git a/tests/framework/extensions/charts/rancherlogging.go b/tests/framework/extensions/charts/rancherlogging.go deleted file mode 100644 index f471dfd531a..00000000000 --- a/tests/framework/extensions/charts/rancherlogging.go +++ /dev/null @@ -1,201 +0,0 @@ -package charts - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/steve/catalog/types" - catalogv1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - kubenamespaces "github.com/rancher/rancher/tests/framework/extensions/kubeapi/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/wait" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - // Namespace that rancher logging chart is installed in - RancherLoggingNamespace = "cattle-logging-system" - // Name of the rancher logging chart - RancherLoggingName = "rancher-logging" - // Name of rancher logging crd chart - RancherLoggingCRDName = "rancher-logging-crd" -) - -// InstallRancherLoggingChart is a helper function that installs the rancher-logging chart. -func InstallRancherLoggingChart(client *rancher.Client, installOptions *InstallOptions, rancherLoggingOpts *RancherLoggingOpts) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - loggingChartInstallActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: RancherLoggingName, - Namespace: RancherLoggingNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartInstallAction := newLoggingChartInstallAction(loggingChartInstallActionPayload, rancherLoggingOpts) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - // Cleanup registration - client.Session.RegisterCleanupFunc(func() error { - // UninstallAction for when uninstalling the rancher-logging chart - defaultChartUninstallAction := newChartUninstallAction() - - err = catalogClient.UninstallChart(RancherLoggingName, RancherLoggingNamespace, defaultChartUninstallAction) - if err != nil { - return err - } - - watchAppInterface, err := catalogClient.Apps(RancherLoggingNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherLoggingName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error uninstalling rancher logging chart") - } else if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - err = catalogClient.UninstallChart(RancherLoggingCRDName, RancherLoggingNamespace, defaultChartUninstallAction) - if err != nil { - return err - } - - watchAppInterface, err = catalogClient.Apps(RancherLoggingNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherLoggingCRDName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - chart := event.Object.(*catalogv1.App) - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error uninstalling rancher logging chart") - } else if event.Type == watch.Deleted { - return true, nil - } else if chart == nil { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - steveclient, err := client.Steve.ProxyDownstream(installOptions.ClusterID) - if err != nil { - return err - } - - namespaceClient := steveclient.SteveType(namespaces.NamespaceSteveType) - - namespace, err := namespaceClient.ByID(RancherLoggingNamespace) - if err != nil { - return err - } - - err = namespaceClient.Delete(namespace) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(installOptions.ClusterID) - if err != nil { - return err - } - adminNamespaceResource := adminDynamicClient.Resource(kubenamespaces.NamespaceGroupVersionResource).Namespace("") - - watchNamespaceInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherLoggingNamespace, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchNamespaceInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - err = catalogClient.InstallChart(chartInstallAction, catalog.RancherChartRepo) - if err != nil { - return err - } - - // wait for chart to be full deployed - watchAppInterface, err := catalogClient.Apps(RancherLoggingNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherLoggingName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusDeployed) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - return nil -} - -// newLoggingChartInstallAction is a private helper function that returns chart install action with logging and payload options. -func newLoggingChartInstallAction(p *payloadOpts, rancherLoggingOpts *RancherLoggingOpts) *types.ChartInstallAction { - loggingValues := map[string]interface{}{ - "additionalLoggingSources": map[string]interface{}{ - "enabled": rancherLoggingOpts.AdditionalLoggingSources, - }, - } - - chartInstall := newChartInstall(p.Name, p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, rancherChartsName, p.ProjectID, p.DefaultRegistry, loggingValues) - chartInstallCRD := newChartInstall(p.Name+"-crd", p.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, rancherChartsName, p.ProjectID, p.DefaultRegistry, nil) - chartInstalls := []types.ChartInstall{*chartInstallCRD, *chartInstall} - - chartInstallAction := newChartInstallAction(p.Namespace, p.ProjectID, chartInstalls) - - return chartInstallAction -} diff --git a/tests/framework/extensions/charts/ranchermonitoring.go b/tests/framework/extensions/charts/ranchermonitoring.go deleted file mode 100644 index 056ecebf2af..00000000000 --- a/tests/framework/extensions/charts/ranchermonitoring.go +++ /dev/null @@ -1,345 +0,0 @@ -package charts - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/steve/catalog/types" - catalogv1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - kubenamespaces "github.com/rancher/rancher/tests/framework/extensions/kubeapi/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/wait" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - // Namespace that rancher monitoring chart is installed in - RancherMonitoringNamespace = "cattle-monitoring-system" - // Name of the rancher monitoring chart - RancherMonitoringName = "rancher-monitoring" - // Name of the rancher monitoring alert config secret - RancherMonitoringAlertSecret = "alertmanager-rancher-monitoring-alertmanager" - // Name of rancher monitoring crd chart - RancherMonitoringCRDName = "rancher-monitoring-crd" -) - -// InstallRancherMonitoringChart is a helper function that installs the rancher-monitoring chart. -func InstallRancherMonitoringChart(client *rancher.Client, installOptions *InstallOptions, rancherMonitoringOpts *RancherMonitoringOpts) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - monitoringChartInstallActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: RancherMonitoringName, - Namespace: RancherMonitoringNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartInstallAction := newMonitoringChartInstallAction(monitoringChartInstallActionPayload, rancherMonitoringOpts) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - // Cleanup registration - client.Session.RegisterCleanupFunc(func() error { - // UninstallAction for when uninstalling the rancher-monitoring chart - defaultChartUninstallAction := newChartUninstallAction() - - err = catalogClient.UninstallChart(RancherMonitoringName, RancherMonitoringNamespace, defaultChartUninstallAction) - if err != nil { - return err - } - - watchAppInterface, err := catalogClient.Apps(RancherMonitoringNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherMonitoringName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error uninstalling rancher monitoring chart") - } else if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - err = catalogClient.UninstallChart(RancherMonitoringCRDName, RancherMonitoringNamespace, defaultChartUninstallAction) - if err != nil { - return err - } - - watchAppInterface, err = catalogClient.Apps(RancherMonitoringNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherMonitoringCRDName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - chart := event.Object.(*catalogv1.App) - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error uninstalling rancher monitoring chart") - } else if event.Type == watch.Deleted { - return true, nil - } else if chart == nil { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - steveclient, err := client.Steve.ProxyDownstream(installOptions.ClusterID) - if err != nil { - return err - } - - namespaceClient := steveclient.SteveType(namespaces.NamespaceSteveType) - - namespace, err := namespaceClient.ByID(RancherMonitoringNamespace) - if err != nil { - return err - } - - err = namespaceClient.Delete(namespace) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(installOptions.ClusterID) - if err != nil { - return err - } - adminNamespaceResource := adminDynamicClient.Resource(kubenamespaces.NamespaceGroupVersionResource).Namespace("") - - watchNamespaceInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherMonitoringNamespace, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchNamespaceInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - err = catalogClient.InstallChart(chartInstallAction, catalog.RancherChartRepo) - if err != nil { - return err - } - - // wait for chart to be full deployed - watchAppInterface, err := catalogClient.Apps(RancherMonitoringNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherMonitoringName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusDeployed) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - return nil -} - -// newMonitoringChartInstallAction is a private helper function that returns chart install action with monitoring and payload options. -func newMonitoringChartInstallAction(p *payloadOpts, rancherMonitoringOpts *RancherMonitoringOpts) *types.ChartInstallAction { - monitoringValues := map[string]interface{}{ - "ingressNgnix": map[string]interface{}{ - "enabled": rancherMonitoringOpts.IngressNginx, - }, - "prometheus": map[string]interface{}{ - "prometheusSpec": map[string]interface{}{ - "evaluationInterval": "1m", - "retentionSize": "50GiB", - "scrapeInterval": "1m", - }, - }, - "rkeControllerManager": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEControllerManager, - }, - "rkeEtcd": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEEtcd, - }, - "rkeProxy": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEProxy, - }, - "rkeScheduler": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEScheduler, - }, - } - - chartInstall := newChartInstall(p.Name, p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, rancherChartsName, p.ProjectID, p.DefaultRegistry, monitoringValues) - chartInstallCRD := newChartInstall(p.Name+"-crd", p.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, rancherChartsName, p.ProjectID, p.DefaultRegistry, nil) - chartInstalls := []types.ChartInstall{*chartInstallCRD, *chartInstall} - - chartInstallAction := newChartInstallAction(p.Namespace, p.ProjectID, chartInstalls) - - return chartInstallAction -} - -// UpgradeMonitoringChart is a helper function that upgrades the rancher-monitoring chart. -func UpgradeRancherMonitoringChart(client *rancher.Client, installOptions *InstallOptions, rancherMonitoringOpts *RancherMonitoringOpts) error { - serverSetting, err := client.Management.Setting.ByID(serverURLSettingID) - if err != nil { - return err - } - - registrySetting, err := client.Management.Setting.ByID(defaultRegistrySettingID) - if err != nil { - return err - } - - monitoringChartUpgradeActionPayload := &payloadOpts{ - InstallOptions: *installOptions, - Name: RancherMonitoringName, - Namespace: RancherMonitoringNamespace, - Host: serverSetting.Value, - DefaultRegistry: registrySetting.Value, - } - - chartUpgradeAction := newMonitoringChartUpgradeAction(monitoringChartUpgradeActionPayload, rancherMonitoringOpts) - - catalogClient, err := client.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - err = catalogClient.UpgradeChart(chartUpgradeAction, catalog.RancherChartRepo) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - adminCatalogClient, err := adminClient.GetClusterCatalogClient(installOptions.ClusterID) - if err != nil { - return err - } - - // wait for chart to be in status pending upgrade - watchAppInterface, err := adminCatalogClient.Apps(RancherMonitoringNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherMonitoringName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusPendingUpgrade) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - // wait for chart to be full deployed - watchAppInterface, err = adminCatalogClient.Apps(RancherMonitoringNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + RancherMonitoringName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*catalogv1.App) - - state := app.Status.Summary.State - if state == string(catalogv1.StatusDeployed) { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - return nil -} - -// newMonitoringChartUpgradeAction is a private helper function that returns chart upgrade action with monitoring and payload options. -func newMonitoringChartUpgradeAction(p *payloadOpts, rancherMonitoringOpts *RancherMonitoringOpts) *types.ChartUpgradeAction { - monitoringValues := map[string]interface{}{ - "ingressNgnix": map[string]interface{}{ - "enabled": rancherMonitoringOpts.IngressNginx, - }, - "prometheus": map[string]interface{}{ - "prometheusSpec": map[string]interface{}{ - "evaluationInterval": "1m", - "retentionSize": "50GiB", - "scrapeInterval": "1m", - }, - }, - "rkeControllerManager": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEControllerManager, - }, - "rkeEtcd": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEEtcd, - }, - "rkeProxy": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEProxy, - }, - "rkeScheduler": map[string]interface{}{ - "enabled": rancherMonitoringOpts.RKEScheduler, - }, - } - chartUpgrade := newChartUpgrade(p.Name, p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, p.DefaultRegistry, monitoringValues) - chartUpgradeCRD := newChartUpgrade(p.Name+"-crd", p.InstallOptions.Version, p.InstallOptions.ClusterID, p.InstallOptions.ClusterName, p.Host, p.DefaultRegistry, monitoringValues) - chartUpgrades := []types.ChartUpgrade{*chartUpgradeCRD, *chartUpgrade} - - chartUpgradeAction := newChartUpgradeAction(p.Namespace, chartUpgrades) - - return chartUpgradeAction -} diff --git a/tests/framework/extensions/charts/rancherwebhook.go b/tests/framework/extensions/charts/rancherwebhook.go deleted file mode 100644 index 90f6d0182dd..00000000000 --- a/tests/framework/extensions/charts/rancherwebhook.go +++ /dev/null @@ -1,8 +0,0 @@ -package charts - -const ( - // Namespace that rancher webhook chart is installed in - RancherWebhookNamespace = "cattle-system" - // Name of the rancher webhook chart - RancherWebhookName = "rancher-webhook" -) diff --git a/tests/framework/extensions/charts/verify.go b/tests/framework/extensions/charts/verify.go deleted file mode 100644 index 04933b781b7..00000000000 --- a/tests/framework/extensions/charts/verify.go +++ /dev/null @@ -1,34 +0,0 @@ -package charts - -import ( - "context" - - v1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/pkg/wait" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" -) - -// VerifyChartInstall verifies that the app from a chart was successfully deployed -func VerifyChartInstall(client *catalog.Client, chartNamespace, chartName string) error { - watchAppInterface, err := client.Apps(chartNamespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + chartName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { - app := event.Object.(*v1.App) - - state := app.Status.Summary.State - if state == string(v1.StatusDeployed) { - return true, nil - } - return false, nil - }) - return err -} diff --git a/tests/framework/extensions/cloudcredentials/aws/create.go b/tests/framework/extensions/cloudcredentials/aws/create.go deleted file mode 100644 index e38aa3ad903..00000000000 --- a/tests/framework/extensions/cloudcredentials/aws/create.go +++ /dev/null @@ -1,29 +0,0 @@ -package aws - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const awsCloudCredNameBase = "awsCloudCredential" - -// CreateAWSCloudCredentials is a helper function that takes the rancher Client as a parameter and creates -// an AWS cloud credential, and returns the CloudCredential response -func CreateAWSCloudCredentials(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) { - var amazonEC2CredentialConfig cloudcredentials.AmazonEC2CredentialConfig - config.LoadConfig(cloudcredentials.AmazonEC2CredentialConfigurationFileKey, &amazonEC2CredentialConfig) - - cloudCredential := cloudcredentials.CloudCredential{ - Name: awsCloudCredNameBase, - AmazonEC2CredentialConfig: &amazonEC2CredentialConfig, - } - - resp := &cloudcredentials.CloudCredential{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.CloudCredentialType, cloudCredential, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/cloudcredentials/aws_config.go b/tests/framework/extensions/cloudcredentials/aws_config.go deleted file mode 100644 index d5d7093c01c..00000000000 --- a/tests/framework/extensions/cloudcredentials/aws_config.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudcredentials - -// The json/yaml config key for the aws cloud credential config -const AmazonEC2CredentialConfigurationFileKey = "awsCredentials" - -// AmazonEC2CredentialConfig is configuration need to create an aws cloud credential -type AmazonEC2CredentialConfig struct { - AccessKey string `json:"accessKey" yaml:"accessKey"` - SecretKey string `json:"secretKey" yaml:"secretKey"` - DefaultRegion string `json:"defaultRegion,omitempty" yaml:"defaultRegion"` -} diff --git a/tests/framework/extensions/cloudcredentials/azure/create.go b/tests/framework/extensions/cloudcredentials/azure/create.go deleted file mode 100644 index 28bae36c610..00000000000 --- a/tests/framework/extensions/cloudcredentials/azure/create.go +++ /dev/null @@ -1,29 +0,0 @@ -package azure - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const azureCloudCredNameBase = "azureOceanCloudCredential" - -// CreateAzureCloudCredentials is a helper function that takes the rancher Client as a parameter and creates -// an Azure cloud credential, and returns the CloudCredential response -func CreateAzureCloudCredentials(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) { - var azureCredentialConfig cloudcredentials.AzureCredentialConfig - config.LoadConfig(cloudcredentials.AzureCredentialConfigurationFileKey, &azureCredentialConfig) - - cloudCredential := cloudcredentials.CloudCredential{ - Name: azureCloudCredNameBase, - AzureCredentialConfig: &azureCredentialConfig, - } - - resp := &cloudcredentials.CloudCredential{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.CloudCredentialType, cloudCredential, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/cloudcredentials/azure_config.go b/tests/framework/extensions/cloudcredentials/azure_config.go deleted file mode 100644 index 2df4a6a512e..00000000000 --- a/tests/framework/extensions/cloudcredentials/azure_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudcredentials - -// The json/yaml config key for the azure cloud credential config -const AzureCredentialConfigurationFileKey = "azureCredentials" - -// AzureCredentialConfig is configuration need to create an azure cloud credential -type AzureCredentialConfig struct { - ClientID string `json:"clientId" yaml:"clientId"` - ClientSecret string `json:"clientSecret" yaml:"clientSecret"` - SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"` - Environment string `json:"environment" yaml:"environment"` -} diff --git a/tests/framework/extensions/cloudcredentials/cloudcredentials.go b/tests/framework/extensions/cloudcredentials/cloudcredentials.go deleted file mode 100644 index 50f00d43d27..00000000000 --- a/tests/framework/extensions/cloudcredentials/cloudcredentials.go +++ /dev/null @@ -1,25 +0,0 @@ -package cloudcredentials - -import ( - "github.com/rancher/norman/types" -) - -// CloudCredential is the main struct needed to create a cloud credential depending on the outside cloud service provider -type CloudCredential struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty"` - Created string `json:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty"` - Description string `json:"description,omitempty"` - Labels map[string]string `json:"labels,omitempty"` - Name string `json:"name,omitempty"` - Removed string `json:"removed,omitempty"` - AmazonEC2CredentialConfig *AmazonEC2CredentialConfig `json:"amazonec2credentialConfig,omitempty"` - AzureCredentialConfig *AzureCredentialConfig `json:"azurecredentialConfig,omitempty"` - DigitalOceanCredentialConfig *DigitalOceanCredentialConfig `json:"digitaloceancredentialConfig,omitempty"` - LinodeCredentialConfig *LinodeCredentialConfig `json:"linodecredentialConfig,omitempty"` - HarvesterCredentialConfig *HarvesterCredentialConfig `json:"harvestercredentialConfig,omitempty"` - GoogleCredentialConfig *GoogleCredentialConfig `json:"googlecredentialConfig,omitempty"` - VmwareVsphereConfig *VmwarevsphereCredentialConfig `json:"vmwarevspherecredentialConfig,omitempty"` - UUID string `json:"uuid,omitempty"` -} diff --git a/tests/framework/extensions/cloudcredentials/digitalocean/create.go b/tests/framework/extensions/cloudcredentials/digitalocean/create.go deleted file mode 100644 index 8e6276d9a29..00000000000 --- a/tests/framework/extensions/cloudcredentials/digitalocean/create.go +++ /dev/null @@ -1,29 +0,0 @@ -package digitalocean - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const digitalOceanCloudCredNameBase = "digitalOceanCloudCredential" - -// CreateDigitalOceanCloudCredentials is a helper function that takes the rancher Client as a parameter and creates -// a Digital Ocean cloud credential, and returns the CloudCredential response -func CreateDigitalOceanCloudCredentials(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) { - var digitalOceanCredentialConfig cloudcredentials.DigitalOceanCredentialConfig - config.LoadConfig(cloudcredentials.DigitalOceanCredentialConfigurationFileKey, &digitalOceanCredentialConfig) - - cloudCredential := cloudcredentials.CloudCredential{ - Name: digitalOceanCloudCredNameBase, - DigitalOceanCredentialConfig: &digitalOceanCredentialConfig, - } - - resp := &cloudcredentials.CloudCredential{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.CloudCredentialType, cloudCredential, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/cloudcredentials/digitalocean_config.go b/tests/framework/extensions/cloudcredentials/digitalocean_config.go deleted file mode 100644 index 484f6e7ac2d..00000000000 --- a/tests/framework/extensions/cloudcredentials/digitalocean_config.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudcredentials - -// The json/yaml config key for the digital ocean cloud credential config -const DigitalOceanCredentialConfigurationFileKey = "digitalOceanCredentials" - -// DigitalOceanCredentialConfig is configuration need to create a digital ocean cloud credential -type DigitalOceanCredentialConfig struct { - AccessToken string `json:"accessToken" yaml:"accessToken"` -} diff --git a/tests/framework/extensions/cloudcredentials/google/create.go b/tests/framework/extensions/cloudcredentials/google/create.go deleted file mode 100644 index 28390a9eca2..00000000000 --- a/tests/framework/extensions/cloudcredentials/google/create.go +++ /dev/null @@ -1,29 +0,0 @@ -package google - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const googleCloudCredNameBase = "googleCloudCredNameBase" - -// CreateGoogleCloudCredentials is a helper function that takes the rancher Client as a parameter and creates -// a Google cloud credential, and returns the CloudCredential response -func CreateGoogleCloudCredentials(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) { - var googleCredentialConfig cloudcredentials.GoogleCredentialConfig - config.LoadConfig(cloudcredentials.GoogleCredentialConfigurationFileKey, &googleCredentialConfig) - - cloudCredential := cloudcredentials.CloudCredential{ - Name: googleCloudCredNameBase, - GoogleCredentialConfig: &googleCredentialConfig, - } - - resp := &cloudcredentials.CloudCredential{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.CloudCredentialType, cloudCredential, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/cloudcredentials/google_config.go b/tests/framework/extensions/cloudcredentials/google_config.go deleted file mode 100644 index 406763deea9..00000000000 --- a/tests/framework/extensions/cloudcredentials/google_config.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudcredentials - -// The json/yaml config key for the google cloud credential config -const GoogleCredentialConfigurationFileKey = "googleCredentials" - -// GoogleCredentialConfig is configuration need to create a google cloud credential -type GoogleCredentialConfig struct { - AuthEncodedJSON string `json:"authEncodedJson" yaml:"authEncodedJson"` -} diff --git a/tests/framework/extensions/cloudcredentials/harvester/create.go b/tests/framework/extensions/cloudcredentials/harvester/create.go deleted file mode 100644 index 86693162fb3..00000000000 --- a/tests/framework/extensions/cloudcredentials/harvester/create.go +++ /dev/null @@ -1,29 +0,0 @@ -package harvester - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const harvesterCloudCredNameBase = "harvesterCloudCredential" - -// CreateHarvesterCloudCredentials is a helper function that takes the rancher Client as a parameter and creates -// a harvester cloud credential, and returns the CloudCredential response -func CreateHarvesterCloudCredentials(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) { - var harvesterCredentialConfig cloudcredentials.HarvesterCredentialConfig - config.LoadConfig(cloudcredentials.HarvesterCredentialConfigurationFileKey, &harvesterCredentialConfig) - - cloudCredential := cloudcredentials.CloudCredential{ - Name: harvesterCloudCredNameBase, - HarvesterCredentialConfig: &harvesterCredentialConfig, - } - - resp := &cloudcredentials.CloudCredential{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.CloudCredentialType, cloudCredential, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/cloudcredentials/harvester_config.go b/tests/framework/extensions/cloudcredentials/harvester_config.go deleted file mode 100644 index 3a357a4cd41..00000000000 --- a/tests/framework/extensions/cloudcredentials/harvester_config.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudcredentials - -// The json/yaml config key for the harvester cloud credential config -const HarvesterCredentialConfigurationFileKey = "harvesterCredentials" - -// HarvesterCredentialConfig is configuration need to create a harvester cloud credential -type HarvesterCredentialConfig struct { - ClusterID string `json:"clusterId" yaml:"clusterId"` - ClusterType string `json:"clusterType" yaml:"clusterType"` - KubeconfigContent string `json:"kubeconfigContent" yaml:"kubeconfigContent"` -} diff --git a/tests/framework/extensions/cloudcredentials/linode/create.go b/tests/framework/extensions/cloudcredentials/linode/create.go deleted file mode 100644 index 0201c888b11..00000000000 --- a/tests/framework/extensions/cloudcredentials/linode/create.go +++ /dev/null @@ -1,29 +0,0 @@ -package linode - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const linodeCloudCredNameBase = "linodeCloudCredential" - -// CreateLinodeCloudCredentials is a helper function that takes the rancher Client as a parameter and creates -// a Linode cloud credential, and returns the CloudCredential response -func CreateLinodeCloudCredentials(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) { - var linodeCredentialConfig cloudcredentials.LinodeCredentialConfig - config.LoadConfig(cloudcredentials.LinodeCredentialConfigurationFileKey, &linodeCredentialConfig) - - cloudCredential := cloudcredentials.CloudCredential{ - Name: linodeCloudCredNameBase, - LinodeCredentialConfig: &linodeCredentialConfig, - } - - resp := &cloudcredentials.CloudCredential{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.CloudCredentialType, cloudCredential, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/cloudcredentials/linode_config.go b/tests/framework/extensions/cloudcredentials/linode_config.go deleted file mode 100644 index 974acc5976f..00000000000 --- a/tests/framework/extensions/cloudcredentials/linode_config.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudcredentials - -// The json/yaml config key for the linode cloud credential config -const LinodeCredentialConfigurationFileKey = "linodeCredentials" - -// LinodeCredentialConfig is configuration need to create a linode cloud credential -type LinodeCredentialConfig struct { - Token string `json:"token" yaml:"token"` -} diff --git a/tests/framework/extensions/cloudcredentials/vsphere/create.go b/tests/framework/extensions/cloudcredentials/vsphere/create.go deleted file mode 100644 index d34f892f3e3..00000000000 --- a/tests/framework/extensions/cloudcredentials/vsphere/create.go +++ /dev/null @@ -1,29 +0,0 @@ -package vsphere - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const vmwarevsphereCloudCredNameBase = "vmwarevsphereCloudCredential" - -// CreateVsphereCloudCredentials is a helper function that takes the rancher Client as a parameter and creates -// an AWS cloud credential, and returns the CloudCredential response -func CreateVsphereCloudCredentials(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) { - var vmwarevsphereCredentialConfig cloudcredentials.VmwarevsphereCredentialConfig - config.LoadConfig(cloudcredentials.VmwarevsphereCredentialConfigurationFileKey, &vmwarevsphereCredentialConfig) - - cloudCredential := cloudcredentials.CloudCredential{ - Name: vmwarevsphereCloudCredNameBase, - VmwareVsphereConfig: &vmwarevsphereCredentialConfig, - } - - resp := &cloudcredentials.CloudCredential{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.CloudCredentialType, cloudCredential, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/cloudcredentials/vsphere_config.go b/tests/framework/extensions/cloudcredentials/vsphere_config.go deleted file mode 100644 index b46c6f408cc..00000000000 --- a/tests/framework/extensions/cloudcredentials/vsphere_config.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudcredentials - -// The json/yaml config key for the azure cloud credential config -const VmwarevsphereCredentialConfigurationFileKey = "vmwarevsphereCredentials" - -// VmwareVsphereCredentialConfig is configuration need to create an vsphere cloud credential -type VmwarevsphereCredentialConfig struct { - Password string `json:"password" yaml:"password"` - Username string `json:"username" yaml:"username"` - Vcenter string `json:"vcenter" yaml:"vcenter"` - VcenterPort string `json:"vcenterPort" yaml:"vcenterPort"` -} diff --git a/tests/framework/extensions/clusterrolebindings/clusterrolebindings.go b/tests/framework/extensions/clusterrolebindings/clusterrolebindings.go deleted file mode 100644 index 1ca756fcaf3..00000000000 --- a/tests/framework/extensions/clusterrolebindings/clusterrolebindings.go +++ /dev/null @@ -1,5 +0,0 @@ -package clusterrolebindings - -const ( - ClusterRoleBindingSteveType = "rbac.authorization.k8s.io.clusterrolebinding" -) diff --git a/tests/framework/extensions/clusters/aks/aks_cluster_config.go b/tests/framework/extensions/clusters/aks/aks_cluster_config.go deleted file mode 100644 index c990139159a..00000000000 --- a/tests/framework/extensions/clusters/aks/aks_cluster_config.go +++ /dev/null @@ -1,100 +0,0 @@ -package aks - -import ( - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const ( - // The json/yaml config key for the AKS hosted cluster config - AKSClusterConfigConfigurationFileKey = "aksClusterConfig" -) - -// ClusterConfig is the configuration needed to create an AKS host cluster -type ClusterConfig struct { - AuthorizedIPRanges *[]string `json:"authorizedIpRanges,omitempty" yaml:"authorizedIpRanges,omitempty"` - AzureCredentialSecret string `json:"azureCredentialSecret" yaml:"azureCredentialSecret"` - DNSPrefix *string `json:"dnsPrefix,omitempty" yaml:"dnsPrefix,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` - LinuxAdminUsername *string `json:"linuxAdminUsername,omitempty" yaml:"linuxAdminUsername,omitempty"` - LinuxSSHPublicKey *string `json:"sshPublicKey,omitempty" yaml:"sshPublicKey,omitempty"` - LoadBalancerSKU *string `json:"loadBalancerSku,omitempty" yaml:"loadBalancerSku,omitempty"` - LogAnalyticsWorkspaceGroup *string `json:"logAnalyticsWorkspaceGroup,omitempty" yaml:"logAnalyticsWorkspaceGroup,omitempty"` - LogAnalyticsWorkspaceName *string `json:"logAnalyticsWorkspaceName,omitempty" yaml:"logAnalyticsWorkspaceName,omitempty"` - Monitoring *bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` - NetworkDNSServiceIP *string `json:"dnsServiceIp,omitempty" yaml:"dnsServiceIp,omitempty"` - NetworkDockerBridgeCIDR *string `json:"dockerBridgeCidr,omitempty" yaml:"dockerBridgeCidr,omitempty"` - NetworkPlugin *string `json:"networkPlugin,omitempty" yaml:"networkPlugin,omitempty"` - NetworkPodCIDR *string `json:"podCidr,omitempty" yaml:"podCidr,omitempty"` - NetworkPolicy *string `json:"networkPolicy,omitempty" yaml:"networkPolicy,omitempty"` - NetworkServiceCIDR *string `json:"serviceCidr,omitempty" yaml:"serviceCidr,omitempty"` - NodePools *[]NodePool `json:"nodePools,omitempty" yaml:"nodePools,omitempty"` - PrivateCluster *bool `json:"privateCluster,omitempty" yaml:"privateCluster,omitempty"` - ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"` - ResourceLocation string `json:"resourceLocation" yaml:"resourceLocation"` - Subnet *string `json:"subnet,omitempty" yaml:"subnet,omitempty"` - Tags map[string]string `json:"tags" yaml:"tags"` - VirtualNetwork *string `json:"virtualNetwork,omitempty" yaml:"virtualNetwork,omitempty"` - VirtualNetworkResourceGroup *string `json:"virtualNetworkResourceGroup,omitempty" yaml:"virtualNetworkResourceGroup,omitempty"` -} - -// NodePool is the configuration needed to an AKS node pool -type NodePool struct { - AvailabilityZones *[]string `json:"availabilityZones,omitempty" yaml:"availabilityZones,omitempty"` - EnableAutoScaling *bool `json:"enableAutoScaling,omitempty" yaml:"enableAutoScaling,omitempty"` - MaxPods *int64 `json:"maxPods,omitempty" yaml:"maxPods,omitempty"` - MaxCount *int64 `json:"maxCount,omitempty" yaml:"maxCount,omitempty"` - MinCount *int64 `json:"minCount,omitempty" yaml:"minCount,omitempty"` - Mode string `json:"mode" yaml:"mode"` - Name *string `json:"name,omitempty" yaml:"name,omitempty"` - NodeCount *int64 `json:"nodeCount,omitempty" yaml:"nodeCount,omitempty"` - OrchestratorVersion *string `json:"orchestratorVersion,omitempty" yaml:"orchestratorVersion,omitempty"` - OsDiskSizeGB *int64 `json:"osDiskSizeGB,omitempty" yaml:"osDiskSizeGB,omitempty"` - OsDiskType string `json:"osDiskType" yaml:"osDiskType"` - OsType string `json:"osType" yaml:"osType"` - VMSize string `json:"vmSize" yaml:"vmSize"` -} - -func aksNodePoolConstructor(aksNodePoolConfigs *[]NodePool, kubernetesVersion string) []management.AKSNodePool { - var aksNodePools []management.AKSNodePool - for _, aksNodePoolConfig := range *aksNodePoolConfigs { - aksNodePool := management.AKSNodePool{ - AvailabilityZones: aksNodePoolConfig.AvailabilityZones, - Count: aksNodePoolConfig.NodeCount, - EnableAutoScaling: aksNodePoolConfig.EnableAutoScaling, - MaxPods: aksNodePoolConfig.MaxPods, - MaxCount: aksNodePoolConfig.MaxCount, - MinCount: aksNodePoolConfig.MinCount, - Mode: aksNodePoolConfig.Mode, - Name: aksNodePoolConfig.Name, - OrchestratorVersion: &kubernetesVersion, - OsDiskSizeGB: aksNodePoolConfig.OsDiskSizeGB, - OsDiskType: aksNodePoolConfig.OsDiskType, - OsType: aksNodePoolConfig.OsType, - VMSize: aksNodePoolConfig.VMSize, - } - aksNodePools = append(aksNodePools, aksNodePool) - } - return aksNodePools -} - -func HostClusterConfig(displayName, cloudCredentialID string) *management.AKSClusterConfigSpec { - var aksClusterConfig ClusterConfig - config.LoadConfig(AKSClusterConfigConfigurationFileKey, &aksClusterConfig) - - return &management.AKSClusterConfigSpec{ - AzureCredentialSecret: cloudCredentialID, - ClusterName: displayName, - DNSPrefix: aksClusterConfig.DNSPrefix, - Imported: false, - KubernetesVersion: aksClusterConfig.KubernetesVersion, - LinuxAdminUsername: aksClusterConfig.LinuxAdminUsername, - LoadBalancerSKU: aksClusterConfig.LoadBalancerSKU, - NetworkPlugin: aksClusterConfig.NetworkPlugin, - NodePools: aksNodePoolConstructor(aksClusterConfig.NodePools, *aksClusterConfig.KubernetesVersion), - PrivateCluster: aksClusterConfig.PrivateCluster, - ResourceGroup: aksClusterConfig.ResourceGroup, - ResourceLocation: aksClusterConfig.ResourceLocation, - Tags: aksClusterConfig.Tags, - } -} diff --git a/tests/framework/extensions/clusters/aks/create.go b/tests/framework/extensions/clusters/aks/create.go deleted file mode 100644 index 5d41f394f34..00000000000 --- a/tests/framework/extensions/clusters/aks/create.go +++ /dev/null @@ -1,28 +0,0 @@ -package aks - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" -) - -// CreateAKSHostedCluster is a helper function that creates an AKS hosted cluster. -func CreateAKSHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) { - aksHostCluster := HostClusterConfig(displayName, cloudCredentialID) - cluster := &management.Cluster{ - AKSConfig: aksHostCluster, - DockerRootDir: "/var/lib/docker", - EnableClusterAlerting: enableClusterAlerting, - EnableClusterMonitoring: enableClusterMonitoring, - EnableNetworkPolicy: &enableNetworkPolicy, - Labels: labels, - Name: displayName, - WindowsPreferedCluster: windowsPreferedCluster, - } - - clusterResp, err := client.Management.Cluster.Create(cluster) - if err != nil { - return nil, err - } - - return clusterResp, err -} diff --git a/tests/framework/extensions/clusters/aks/nodepools.go b/tests/framework/extensions/clusters/aks/nodepools.go deleted file mode 100644 index e40c893747f..00000000000 --- a/tests/framework/extensions/clusters/aks/nodepools.go +++ /dev/null @@ -1,72 +0,0 @@ -package aks - -import ( - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/sirupsen/logrus" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - active = "active" -) - -// updateNodePoolQuantity is a helper method that will update the node pool with the desired quantity. -func updateNodePoolQuantity(client *rancher.Client, cluster *management.Cluster, nodePool *NodePool) (*management.Cluster, error) { - clusterResp, err := client.Management.Cluster.ByID(cluster.ID) - if err != nil { - return nil, err - } - - var aksConfig = clusterResp.AKSConfig - *aksConfig.NodePools[0].Count += *nodePool.NodeCount - - aksHostCluster := &management.Cluster{ - AKSConfig: aksConfig, - DockerRootDir: "/var/lib/docker", - EnableClusterAlerting: clusterResp.EnableClusterAlerting, - EnableClusterMonitoring: clusterResp.EnableClusterMonitoring, - EnableNetworkPolicy: clusterResp.EnableNetworkPolicy, - Labels: clusterResp.Labels, - Name: clusterResp.Name, - WindowsPreferedCluster: clusterResp.WindowsPreferedCluster, - } - - logrus.Infof("Scaling the agentpool to %v total nodes", *aksConfig.NodePools[0].Count) - updatedCluster, err := client.Management.Cluster.Update(clusterResp, aksHostCluster) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, 10*time.Minute, func() (done bool, err error) { - clusterResp, err := client.Management.Cluster.ByID(updatedCluster.ID) - if err != nil { - return false, err - } - - if clusterResp.State == active && clusterResp.NodeCount == *aksConfig.NodePools[0].Count { - return true, nil - } - - return false, nil - }) - if err != nil { - return nil, err - } - - return updatedCluster, nil -} - -// ScalingAKSNodePoolsNodes is a helper function that tests scaling of an AKS node pool by adding a new one and then deleting it. -func ScalingAKSNodePoolsNodes(client *rancher.Client, cluster *management.Cluster, nodePool *NodePool) (*management.Cluster, error) { - updatedCluster, err := updateNodePoolQuantity(client, cluster, nodePool) - if err != nil { - return nil, err - } - - logrus.Infof("Agentpool has been scaled!") - - return updatedCluster, nil -} diff --git a/tests/framework/extensions/clusters/bundledclusters/bundledclusters.go b/tests/framework/extensions/clusters/bundledclusters/bundledclusters.go deleted file mode 100644 index 7e0dc4db225..00000000000 --- a/tests/framework/extensions/clusters/bundledclusters/bundledclusters.go +++ /dev/null @@ -1,45 +0,0 @@ -package bundledclusters - -import ( - "fmt" - - v3 "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" -) - -// BundledCluster is a struct that can contain different cluster version types and the meta of the cluster: -// - Meta is a ClusterMeta value of cluster's meta. -// - V1 is a v1 type cluster value of the cluster. -// - V3 is a v3 type cluster value of the cluster. -type BundledCluster struct { - Meta *clusters.ClusterMeta - V1 *v1.SteveAPIObject - V3 *v3.Cluster -} - -// NewWithClusterMeta is a constructor to initialize a BundledCluster. -// It returns cluster meta struct and error if any. -// Cluster v1 and v3 versions can't store value at the same time. -func NewWithClusterMeta(cmeta *clusters.ClusterMeta) (cluster *BundledCluster, err error) { - cluster = new(BundledCluster) - - clusterMeta := *cmeta - - isClusterImported := cmeta.IsImported - isClusterRKE2 := cmeta.Provider == clusters.KubernetesProviderRKE2 - isClusterK3S := cmeta.Provider == clusters.KubernetesProviderK3S - - isClusterV1 := (isClusterK3S || isClusterRKE2) && isClusterImported - - if isClusterV1 { - cluster.V1 = new(v1.SteveAPIObject) - clusterMeta.ID = fmt.Sprintf("fleet-default/%v", clusterMeta.Name) - } else if !isClusterV1 { - cluster.V3 = new(v3.Cluster) - } - - cluster.Meta = &clusterMeta - - return -} diff --git a/tests/framework/extensions/clusters/bundledclusters/get.go b/tests/framework/extensions/clusters/bundledclusters/get.go deleted file mode 100644 index 200a221647a..00000000000 --- a/tests/framework/extensions/clusters/bundledclusters/get.go +++ /dev/null @@ -1,32 +0,0 @@ -package bundledclusters - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" -) - -// Get is a method of BundledCluster that uses provisioning and management clients -// to get related cluster data depending on cluster version. -func (bc *BundledCluster) Get(client *rancher.Client) (cluster *BundledCluster, err error) { - cluster = new(BundledCluster) - cluster.Meta = bc.Meta - - steveclient := client.Steve.SteveType(clusters.ProvisioningSteveResourceType) - if err != nil { - return - } - - if bc.V1 != nil { - cluster.V1, err = steveclient.ByID(cluster.Meta.ID) - if err != nil { - return cluster, err - } - } else if bc.V3 != nil { - cluster.V3, err = client.Management.Cluster.ByID(cluster.Meta.ID) - if err != nil { - return cluster, err - } - } - - return -} diff --git a/tests/framework/extensions/clusters/bundledclusters/list.go b/tests/framework/extensions/clusters/bundledclusters/list.go deleted file mode 100644 index cd89c80ab39..00000000000 --- a/tests/framework/extensions/clusters/bundledclusters/list.go +++ /dev/null @@ -1,72 +0,0 @@ -package bundledclusters - -import ( - "github.com/pkg/errors" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - available "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" -) - -// ListAvailable is a method of BundledCluster that uses list available functions -// depending on cluster's provider information. Returns versions as slice of strings -// and error if any. -func (bc *BundledCluster) ListAvailableVersions(client *rancher.Client) (versions []string, err error) { - switch bc.Meta.Provider { - case clusters.KubernetesProviderRKE: - if bc.Meta.IsImported { - versions, err = available.ListRKE1ImportedAvailableVersions(client, bc.V3) - if err != nil { - return - } - } else { - versions, err = available.ListRKE1AvailableVersions(client, bc.V3) - if err != nil { - return - } - } - case clusters.KubernetesProviderRKE2: - if bc.Meta.IsImported { - versions, err = available.ListRKE2AvailableVersions(client, bc.V1) - if err != nil { - return - } - } else { - versions, err = available.ListNormanRKE2AvailableVersions(client, bc.V3) - if err != nil { - return - } - } - case clusters.KubernetesProviderK3S: - if bc.Meta.IsImported { - versions, err = available.ListK3SAvailableVersions(client, bc.V1) - if err != nil { - return - } - } else { - versions, err = available.ListNormanK3SAvailableVersions(client, bc.V3) - if err != nil { - return - } - } - case clusters.KubernetesProviderGKE: - versions, err = available.ListGKEAvailableVersions(client, bc.V3) - if err != nil { - return - } - case clusters.KubernetesProviderAKS: - versions, err = available.ListAKSAvailableVersions(client, bc.V3) - if err != nil { - return - } - case clusters.KubernetesProviderEKS: - versions, err = available.ListEKSAvailableVersions(client, bc.V3) - if err != nil { - return - } - default: - return nil, errors.Wrap(err, "list available versions failed") - } - - return -} diff --git a/tests/framework/extensions/clusters/bundledclusters/update.go b/tests/framework/extensions/clusters/bundledclusters/update.go deleted file mode 100644 index e47d27f4b23..00000000000 --- a/tests/framework/extensions/clusters/bundledclusters/update.go +++ /dev/null @@ -1,215 +0,0 @@ -package bundledclusters - -import ( - "github.com/pkg/errors" - - apiv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v3 "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/clients/rkecli" - "github.com/rancher/rancher/tests/framework/extensions/clusters" -) - -// Update is a method of BundledCluster that uses provisioning and management clients -// to update related cluster data depending on cluster version. -func (bc *BundledCluster) Update(client *rancher.Client, cUpdates *BundledCluster) (updatedCluster *BundledCluster, err error) { - updatedCluster = new(BundledCluster) - updatedCluster.Meta = bc.Meta - - steveclient := client.Steve.SteveType(clusters.ProvisioningSteveResourceType) - if err != nil { - return - } - - if bc.V1 != nil { - updatedCluster.V1, err = steveclient.Update(bc.V1, cUpdates.V1) - if err != nil { - return - } - } else if bc.V3 != nil { - updatedCluster.V3, err = client.Management.Cluster.Update(bc.V3, cUpdates.V3) - if err != nil { - return - } - } - - return -} - -// UpdateKubernetesVersion is a method of BundledCluster that uses update method of BundledCluster -// depending on cluster's provider information. Returns updated BundledCluster and error if any. -func (bc *BundledCluster) UpdateKubernetesVersion(client *rancher.Client, versionToUpgrade *string) (updatedCluster *BundledCluster, err error) { - if bc.V1 == nil && bc.V3 == nil { - return nil, errors.Wrapf(err, "cluster %v doesn't contain related data: v1: {%v}, v3: {%v}", bc.Meta.Name, bc.V1, bc.V3) - } - - bundledv3 := BundledCluster{V3: new(v3.Cluster)} - bundledv1 := BundledCluster{V1: new(v1.SteveAPIObject)} - - switch bc.Meta.Provider { - case clusters.KubernetesProviderRKE: - if !bc.Meta.IsImported { - bundledv3.V3.Name = bc.Meta.Name - bundledv3.V3.RancherKubernetesEngineConfig = bc.V3.RancherKubernetesEngineConfig - bundledv3.V3.RancherKubernetesEngineConfig.Version = *versionToUpgrade - - updatedCluster, err = bc.Update(client, &bundledv3) - if err != nil { - return updatedCluster, err - } - } else { - bundledv3.Meta = bc.Meta - //rke up - statePath, clusterPath, err := rkecli.NewRKEConfigs(client) - if err != nil { - return nil, errors.Wrap(err, "couldn't generate new rke configs") - } - err = rkecli.UpdateKubernetesVersion(*versionToUpgrade, clusterPath) - if err != nil { - return nil, errors.Wrap(err, "couldn't update kubernetes version in the rke config") - } - - err = rkecli.Up(clusterPath) - if err != nil { - return nil, errors.Wrap(err, "couldn't update the cluster") - } - - // read from state to get v3 rke config without any type cast - rkeConfig, err := rkecli.ReadClusterFromStateFile(statePath) - if err != nil { - return nil, errors.Wrap(err, "couldn't read the new state from the state file") - } - - bundledv3.V3.RancherKubernetesEngineConfig = rkeConfig - updatedCluster = &bundledv3 - } - case clusters.KubernetesProviderRKE2: - if !bc.Meta.IsImported { - bundledv3.V3.Name = bc.Meta.Name - bundledv3.V3.Rke2Config = bc.V3.Rke2Config - bundledv3.V3.Rke2Config.Version = *versionToUpgrade - - updatedCluster, err = bc.Update(client, &bundledv3) - if err != nil { - return updatedCluster, err - } - } else { - bundledv1.V1 = bc.V1 - clusterSpec := &apiv1.ClusterSpec{} - err = v1.ConvertToK8sType(bundledv1.V1.Spec, clusterSpec) - if err != nil { - return updatedCluster, err - } - - clusterSpec.KubernetesVersion = *versionToUpgrade - bundledv1.V1.Spec = clusterSpec - - updatedCluster, err = bc.Update(client, &bundledv1) - if err != nil { - return updatedCluster, err - } - } - case clusters.KubernetesProviderK3S: - if !bc.Meta.IsImported { - bundledv3.V3.Name = bc.Meta.Name - bundledv3.V3.K3sConfig = bc.V3.K3sConfig - bundledv3.V3.K3sConfig.Version = *versionToUpgrade - - updatedCluster, err = bc.Update(client, &bundledv3) - if err != nil { - return updatedCluster, err - } - } else { - bundledv1.V1 = bc.V1 - clusterSpec := &apiv1.ClusterSpec{} - err = v1.ConvertToK8sType(bundledv1.V1.Spec, clusterSpec) - if err != nil { - return updatedCluster, err - } - - clusterSpec.KubernetesVersion = *versionToUpgrade - bundledv1.V1.Spec = clusterSpec - - updatedCluster, err = bc.Update(client, &bundledv1) - if err != nil { - return updatedCluster, err - } - } - case clusters.KubernetesProviderGKE: - bundledv3.V3.Name = bc.Meta.Name - bundledv3.V3.GKEConfig = bc.V3.GKEConfig - bundledv3.V3.GKEConfig.KubernetesVersion = versionToUpgrade - - updatedCluster, err = bc.Update(client, &bundledv3) - if err != nil { - return updatedCluster, err - } - case clusters.KubernetesProviderAKS: - bundledv3.V3.Name = bc.Meta.Name - bundledv3.V3.AKSConfig = bc.V3.AKSConfig - bundledv3.V3.AKSConfig.KubernetesVersion = versionToUpgrade - - updatedCluster, err = bc.Update(client, &bundledv3) - if err != nil { - return updatedCluster, err - } - case clusters.KubernetesProviderEKS: - bundledv3.V3.Name = bc.Meta.Name - bundledv3.V3.EKSConfig = bc.V3.EKSConfig - bundledv3.V3.EKSConfig.KubernetesVersion = versionToUpgrade - - updatedCluster, err = bc.Update(client, &bundledv3) - if err != nil { - return updatedCluster, err - } - default: - return nil, errors.Wrap(err, "kubernetes version upgrade failed") - } - - return -} - -// UpdateNodePoolKubernetesVersions is a method of BundledCluster that uses update method of BundledCluster -// depending on cluster's provider information. Returns updated BundledCluster and error if any. -func (bc *BundledCluster) UpdateNodepoolKubernetesVersions(client *rancher.Client, versionToUpgrade *string) (updatedCluster *BundledCluster, err error) { - if bc.V3 == nil { - return nil, errors.Wrapf(err, "cluster %v doesn't contain related data", bc.V3) - } - - cluster := bc - - switch bc.Meta.Provider { - case clusters.KubernetesProviderGKE: - for i := range cluster.V3.GKEConfig.NodePools { - cluster.V3.GKEConfig.NodePools[i].Version = versionToUpgrade - } - - updatedCluster, err = bc.Update(client, cluster) - if err != nil { - return - } - case clusters.KubernetesProviderAKS: - for i := range cluster.V3.AKSConfig.NodePools { - cluster.V3.AKSConfig.NodePools[i].OrchestratorVersion = versionToUpgrade - } - - updatedCluster, err = bc.Update(client, cluster) - if err != nil { - return - } - case clusters.KubernetesProviderEKS: - for i := range cluster.V3.EKSConfig.NodeGroups { - cluster.V3.EKSConfig.NodeGroups[i].Version = versionToUpgrade - } - - updatedCluster, err = bc.Update(client, cluster) - if err != nil { - return - } - default: - return nil, errors.Wrap(err, "node pool kubernetes version upgrade failed") - } - - return -} diff --git a/tests/framework/extensions/clusters/clusterconfig.go b/tests/framework/extensions/clusters/clusterconfig.go deleted file mode 100644 index 123d90c2ebe..00000000000 --- a/tests/framework/extensions/clusters/clusterconfig.go +++ /dev/null @@ -1,62 +0,0 @@ -package clusters - -import ( - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - provisioningInput "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" -) - -type ClusterConfig struct { - KubernetesVersion string `json:"kubernetesVersion" yaml:"kubernetesVersion"` - CNI string `json:"cni" yaml:"cni"` - PSACT string `json:"psact" yaml:"psact"` - PNI bool `json:"pni" yaml:"pni"` - NodePools []provisioningInput.NodePools `json:"nodepools" yaml:"nodepools"` - MachinePools []provisioningInput.MachinePools `json:"machinepools" yaml:"machinepools"` - CloudProvider string `json:"cloudProvider" yaml:"cloudProvider"` - Providers *[]string `json:"providers" yaml:"providers"` - NodeProviders *[]string `json:"nodeProviders" yaml:"nodeProviders"` - Hardened bool `json:"hardened" yaml:"hardened"` - AddOnConfig *provisioningInput.AddOnConfig `json:"addonConfig" yaml:"addonConfig"` - AgentEnvVars *[]rkev1.EnvVar `json:"agentEnvVars" yaml:"agentEnvVars"` - AgentEnvVarsRKE1 *[]management.EnvVar `json:"agentEnvVarsRKE1" yaml:"agentEnvVarsRKE1"` - ClusterAgent *management.AgentDeploymentCustomization `json:"clusterAgent" yaml:"clusterAgent"` - FleetAgent *management.AgentDeploymentCustomization `json:"fleetAgent" yaml:"fleetAgent"` - ETCD *rkev1.ETCD `json:"etcd" yaml:"etcd"` - ETCDRKE1 *management.ETCDService `json:"etcdRKE1" yaml:"etcdRKE1"` - LabelsAndAnnotations *provisioningInput.LabelsAndAnnotations `json:"labelsAndAnnotations" yaml:"labelsAndAnnotations"` - Networking *provisioningInput.Networking `json:"networking" yaml:"networking"` - Registries *provisioningInput.Registries `json:"registries" yaml:"registries"` - UpgradeStrategy *rkev1.ClusterUpgradeStrategy `json:"upgradeStrategy" yaml:"upgradeStrategy"` - Advanced *provisioningInput.Advanced `json:"advanced" yaml:"advanced"` - ClusterSSHTests []provisioningInput.SSHTestCase `json:"clusterSSHTests" yaml:"clusterSSHTests"` - CRIDockerd bool `json:"criDockerd" yaml:"criDockerd"` -} - -// ConvertConfigToClusterConfig converts the config from (user) provisioning input to a cluster config -func ConvertConfigToClusterConfig(provisioningConfig *provisioningInput.Config) *ClusterConfig { - var newConfig ClusterConfig - newConfig.AddOnConfig = provisioningConfig.AddOnConfig - newConfig.MachinePools = provisioningConfig.MachinePools - newConfig.NodePools = provisioningConfig.NodePools - newConfig.AgentEnvVars = provisioningConfig.AgentEnvVars - newConfig.Networking = provisioningConfig.Networking - newConfig.Advanced = provisioningConfig.Advanced - newConfig.Providers = &provisioningConfig.Providers - newConfig.NodeProviders = &provisioningConfig.NodeProviders - newConfig.ClusterAgent = provisioningConfig.ClusterAgent - newConfig.FleetAgent = provisioningConfig.FleetAgent - newConfig.ETCD = provisioningConfig.ETCD - newConfig.ETCDRKE1 = provisioningConfig.ETCDRKE1 - newConfig.LabelsAndAnnotations = provisioningConfig.LabelsAndAnnotations - newConfig.Registries = provisioningConfig.Registries - newConfig.UpgradeStrategy = provisioningConfig.UpgradeStrategy - newConfig.CloudProvider = provisioningConfig.CloudProvider - - newConfig.Hardened = provisioningConfig.Hardened - newConfig.PSACT = provisioningConfig.PSACT - newConfig.PNI = provisioningConfig.PNI - newConfig.ClusterSSHTests = provisioningConfig.ClusterSSHTests - - return &newConfig -} diff --git a/tests/framework/extensions/clusters/clustermeta.go b/tests/framework/extensions/clusters/clustermeta.go deleted file mode 100644 index a343e0bc070..00000000000 --- a/tests/framework/extensions/clusters/clustermeta.go +++ /dev/null @@ -1,112 +0,0 @@ -package clusters - -import ( - "github.com/pkg/errors" - "github.com/rancher/rancher/tests/framework/clients/rancher" -) - -// KubernetesProvider is a string type to determine cluster's provider. -type KubernetesProvider string - -const ( - local = "local" - - rke = "rke" - k3s = "k3s" - rke2 = "rke2" - aks = "aks" - eks = "eks" - gke = "gke" - - // KubernetesProvider string enums are to determine cluster's provider. - KubernetesProviderRKE KubernetesProvider = rke - KubernetesProviderRKE2 KubernetesProvider = rke2 - KubernetesProviderK3S KubernetesProvider = k3s - KubernetesProviderAKS KubernetesProvider = aks - KubernetesProviderEKS KubernetesProvider = eks - KubernetesProviderGKE KubernetesProvider = gke -) - -// ClusterMeta is a struct that contains a cluster's meta -type ClusterMeta struct { - // ID used for value of cluster's ID - ID string - - // Name used for cluster's name. - Name string - - // Provider is used for cluster's provider. - Provider KubernetesProvider - - // IsHosted is used for cluster's hosted information. - IsHosted bool - - // IsImported is used for cluster's imported information. - IsImported bool - - // IsLocal is used for cluster's local information. - IsLocal bool -} - -// NewClusterMeta is a function to initialize new ClusterMeta for a specific cluster. -func NewClusterMeta(client *rancher.Client, clusterName string) (clusterMeta *ClusterMeta, err error) { - clusterMeta = new(ClusterMeta) - clusterMeta.Name = clusterName - - clusterMeta.ID, err = GetClusterIDByName(client, clusterName) - if err != nil { - return - } - - clusterMeta.Provider, err = GetClusterProvider(client, clusterMeta.ID) - if err != nil { - return - } - - clusterMeta.IsImported, err = IsClusterImported(client, clusterMeta.ID) - if err != nil { - return - } - - clusterMeta.IsHosted = IsHostedProvider(clusterMeta.Provider) - - clusterMeta.IsLocal = clusterMeta.Name == local - - return -} - -// GetClusterProvider is a function to get cluster's KubernetesProvider. -func GetClusterProvider(client *rancher.Client, clusterID string) (provider KubernetesProvider, err error) { - cluster, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return - } - - switch cluster.Provider { - case rke: - provider = KubernetesProviderRKE - case k3s: - provider = KubernetesProviderK3S - case rke2: - provider = KubernetesProviderRKE2 - case aks: - provider = KubernetesProviderAKS - case eks: - provider = KubernetesProviderEKS - case gke: - provider = KubernetesProviderGKE - default: - return "", errors.Wrap(err, "invalid cluster provider") - } - - return -} - -// IsHostedProvider is a function to get a boolean value about if the cluster is hosted or not. -func IsHostedProvider(provider KubernetesProvider) (isHosted bool) { - if provider == KubernetesProviderAKS || provider == KubernetesProviderGKE || provider == KubernetesProviderEKS { - return true - } - - return -} diff --git a/tests/framework/extensions/clusters/clusters.go b/tests/framework/extensions/clusters/clusters.go deleted file mode 100644 index c8a00bbe8f6..00000000000 --- a/tests/framework/extensions/clusters/clusters.go +++ /dev/null @@ -1,1301 +0,0 @@ -package clusters - -import ( - "context" - "fmt" - "strings" - "time" - - "github.com/pkg/errors" - "github.com/rancher/norman/types" - "github.com/rancher/rancher/pkg/api/scheme" - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - "github.com/rancher/rancher/tests/framework/pkg/wait" - "github.com/rancher/wrangler/pkg/summary" - "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - kwait "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - active = "active" - baseline = "baseline" - externalAws = "external-aws" - FleetSteveResourceType = "fleet.cattle.io.cluster" - PodSecurityAdmissionSteveResoureType = "management.cattle.io.podsecurityadmissionconfigurationtemplate" - ProvisioningSteveResourceType = "provisioning.cattle.io.cluster" - - etcdRole = "etcd-role" - controlPlaneRole = "control-plane-role" - workerRole = "worker-role" - - externalCloudProviderString = "cloud-provider=external" - kubeletArgKey = "kubelet-arg" - kubeletAPIServerArgKey = "kubeapi-server-arg" - kubeControllerManagerArgKey = "kube-controller-manager-arg" - cloudProviderAnnotationName = "cloud-provider-name" - disableCloudController = "disable-cloud-controller" - protectKernelDefaults = "protect-kernel-defaults" - - clusterStateUpgrading = "upgrading" // For imported RKE2 and K3s clusters - clusterStateUpdating = "updating" // For all clusters except imported K3s and RKE2 - clusterErrorStateMessage = "cluster is in error state" -) - -// GetV1ProvisioningClusterByName is a helper function that returns the cluster ID by name -func GetV1ProvisioningClusterByName(client *rancher.Client, clusterName string) (string, error) { - clusterList, err := client.Steve.SteveType(ProvisioningSteveResourceType).List(nil) - if err != nil { - return "", err - } - - for _, cluster := range clusterList.Data { - if cluster.Name == clusterName { - return cluster.ID, nil - } - } - - return "", nil -} - -// GetClusterIDByName is a helper function that returns the cluster ID by name -func GetClusterIDByName(client *rancher.Client, clusterName string) (string, error) { - clusterList, err := client.Management.Cluster.List(&types.ListOpts{}) - if err != nil { - return "", err - } - - for _, cluster := range clusterList.Data { - if cluster.Name == clusterName { - return cluster.ID, nil - } - } - - return "", nil -} - -// GetClusterNameByID is a helper function that returns the cluster ID by name -func GetClusterNameByID(client *rancher.Client, clusterID string) (string, error) { - clusterList, err := client.Management.Cluster.List(&types.ListOpts{}) - if err != nil { - return "", err - } - - for _, cluster := range clusterList.Data { - if cluster.ID == clusterID { - return cluster.Name, nil - } - } - - return "", nil -} - -// IsProvisioningClusterReady is basic check function that would be used for the wait.WatchWait func in pkg/wait. -// This functions just waits until a cluster becomes ready. -func IsProvisioningClusterReady(event watch.Event) (ready bool, err error) { - cluster := event.Object.(*apisV1.Cluster) - var updated bool - ready = cluster.Status.Ready - for _, condition := range cluster.Status.Conditions { - if condition.Type == "Updated" && condition.Status == corev1.ConditionTrue { - updated = true - logrus.Infof("Cluster status is active!") - } - } - - return ready && updated, nil -} - -// IsHostedProvisioningClusterReady is basic check function that would be used for the wait.WatchWait func in pkg/wait. -// This functions just waits until a hosted cluster becomes ready. -func IsHostedProvisioningClusterReady(event watch.Event) (ready bool, err error) { - clusterUnstructured := event.Object.(*unstructured.Unstructured) - cluster := &v3.Cluster{} - err = scheme.Scheme.Convert(clusterUnstructured, cluster, clusterUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - for _, cond := range cluster.Status.Conditions { - if cond.Type == "Ready" && cond.Status == "True" { - logrus.Infof("Cluster status is active!") - return true, nil - } - } - - return false, nil -} - -// CheckServiceAccountTokenSecret verifies if a serviceAccountTokenSecret exists or not in the cluster. -func CheckServiceAccountTokenSecret(client *rancher.Client, clusterName string) (success bool, err error) { - clusterID, err := GetClusterIDByName(client, clusterName) - if err != nil { - return false, err - } - - cluster, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return false, err - } - - if cluster.ServiceAccountTokenSecret == "" { - logrus.Warn("warning: serviceAccountTokenSecret does not exist in this cluster!") - return false, nil - } - - logrus.Infof("serviceAccountTokenSecret in this cluster is: %s", cluster.ServiceAccountTokenSecret) - return true, nil -} - -// CreateRancherBaselinePSACT creates custom PSACT called rancher-baseline which sets each PSS to baseline. -func CreateRancherBaselinePSACT(client *rancher.Client, psact string) error { - _, err := client.Steve.SteveType(PodSecurityAdmissionSteveResoureType).ByID(psact) - if err == nil { - return err - } - - template := &v3.PodSecurityAdmissionConfigurationTemplate{ - ObjectMeta: metav1.ObjectMeta{ - Name: psact, - }, - Description: "This is a custom baseline Pod Security Admission Configuration Template. " + - "It defines a minimally restrictive policy which prevents known privilege escalations. " + - "This policy contains namespace level exemptions for Rancher components.", - Configuration: v3.PodSecurityAdmissionConfigurationTemplateSpec{ - Defaults: v3.PodSecurityAdmissionConfigurationTemplateDefaults{ - Enforce: baseline, - Audit: baseline, - Warn: baseline, - }, - Exemptions: v3.PodSecurityAdmissionConfigurationTemplateExemptions{ - Usernames: []string{}, - RuntimeClasses: []string{}, - Namespaces: []string{ - "ingress-nginx", - "kube-system", - "cattle-system", - "cattle-epinio-system", - "cattle-fleet-system", - "longhorn-system", - "cattle-neuvector-system", - "cattle-monitoring-system", - "rancher-alerting-drivers", - "cis-operator-system", - "cattle-csp-adapter-system", - "cattle-externalip-system", - "cattle-gatekeeper-system", - "istio-system", - "cattle-istio-system", - "cattle-logging-system", - "cattle-windows-gmsa-system", - "cattle-sriov-system", - "cattle-ui-plugin-system", - "tigera-operator", - }, - }, - }, - } - - _, err = client.Steve.SteveType(PodSecurityAdmissionSteveResoureType).Create(template) - if err != nil { - return err - } - - return nil -} - -// NewRKE1lusterConfig is a constructor for a v3.Cluster object, to be used by the rancher.Client.Provisioning client. -func NewRKE1ClusterConfig(clusterName string, client *rancher.Client, clustersConfig *ClusterConfig) *management.Cluster { - backupConfigEnabled := true - criDockerBool := false - if clustersConfig.CRIDockerd { - criDockerBool = true - } - newConfig := &management.Cluster{ - DockerRootDir: "/var/lib/docker", - EnableClusterAlerting: false, - EnableClusterMonitoring: false, - LocalClusterAuthEndpoint: &management.LocalClusterAuthEndpoint{ - Enabled: true, - }, - Name: clusterName, - RancherKubernetesEngineConfig: &management.RancherKubernetesEngineConfig{ - DNS: &management.DNSConfig{ - Provider: "coredns", - Options: map[string]string{ - "stubDomains": "cluster.local", - }, - }, - EnableCRIDockerd: &criDockerBool, - Ingress: &management.IngressConfig{ - Provider: "nginx", - }, - Monitoring: &management.MonitoringConfig{ - Provider: "metrics-server", - }, - Network: &management.NetworkConfig{ - Plugin: clustersConfig.CNI, - MTU: 0, - Options: map[string]string{}, - }, - Services: &management.RKEConfigServices{ - Etcd: &management.ETCDService{ - BackupConfig: &management.BackupConfig{ - Enabled: &backupConfigEnabled, - IntervalHours: 12, - Retention: 6, - SafeTimestamp: true, - Timeout: 120, - }, - }, - }, - Version: clustersConfig.KubernetesVersion, - }, - } - newConfig.ClusterAgentDeploymentCustomization = clustersConfig.ClusterAgent - newConfig.FleetAgentDeploymentCustomization = clustersConfig.FleetAgent - - if clustersConfig.Registries != nil { - if clustersConfig.Registries.RKE1Registries != nil { - newConfig.RancherKubernetesEngineConfig.PrivateRegistries = clustersConfig.Registries.RKE1Registries - for _, registry := range clustersConfig.Registries.RKE1Registries { - if registry.ECRCredentialPlugin != nil { - awsAccessKeyID := fmt.Sprintf("AWS_ACCESS_KEY_ID=%s", registry.ECRCredentialPlugin.AwsAccessKeyID) - awsSecretAccessKey := fmt.Sprintf("AWS_SECRET_ACCESS_KEY=%s", registry.ECRCredentialPlugin.AwsSecretAccessKey) - extraEnv := []string{awsAccessKeyID, awsSecretAccessKey} - newConfig.RancherKubernetesEngineConfig.Services = &management.RKEConfigServices{ - Kubelet: &management.KubeletService{ - ExtraEnv: extraEnv, - }, - } - break - } - } - } - } - - if clustersConfig.CloudProvider != "" { - newConfig.RancherKubernetesEngineConfig.CloudProvider = &management.CloudProvider{ - Name: clustersConfig.CloudProvider, - } - if clustersConfig.CloudProvider == externalAws { - trueBoolean := true - newConfig.RancherKubernetesEngineConfig.CloudProvider.UseInstanceMetadataHostname = &trueBoolean - } - } - - if clustersConfig.ETCDRKE1 != nil { - newConfig.RancherKubernetesEngineConfig.Services.Etcd = clustersConfig.ETCDRKE1 - } - - if clustersConfig.PSACT != "" { - newConfig.DefaultPodSecurityAdmissionConfigurationTemplateName = clustersConfig.PSACT - } - - return newConfig -} - -// NewK3SRKE2ClusterConfig is a constructor for a apisV1.Cluster object, to be used by the rancher.Client.Provisioning client. -func NewK3SRKE2ClusterConfig(clusterName, namespace string, clustersConfig *ClusterConfig, machinePools []apisV1.RKEMachinePool, cloudCredentialSecretName string) *apisV1.Cluster { - typeMeta := metav1.TypeMeta{ - Kind: "Cluster", - APIVersion: "provisioning.cattle.io/v1", - } - - //metav1.ObjectMeta - objectMeta := metav1.ObjectMeta{ - Name: clusterName, - Namespace: namespace, - } - - etcd := &rkev1.ETCD{ - SnapshotRetention: 5, - SnapshotScheduleCron: "0 */5 * * *", - } - if clustersConfig.ETCD != nil { - etcd = clustersConfig.ETCD - if etcd.S3 != nil { - etcd.S3.CloudCredentialName = cloudCredentialSecretName - } - } - - chartValuesMap := rkev1.GenericMap{ - Data: map[string]interface{}{}, - } - chartAdditionalManifest := "" - if clustersConfig.AddOnConfig != nil { - if clustersConfig.AddOnConfig.ChartValues != nil { - chartValuesMap = *clustersConfig.AddOnConfig.ChartValues - } - chartAdditionalManifest = clustersConfig.AddOnConfig.AdditionalManifest - } - - machineGlobalConfigMap := rkev1.GenericMap{ - Data: map[string]interface{}{ - "cni": clustersConfig.CNI, - "disable-kube-proxy": false, - "etcd-expose-metrics": false, - "profile": nil, - }, - } - machineSelectorConfigs := []rkev1.RKESystemConfig{} - if clustersConfig.Advanced != nil { - if clustersConfig.Advanced.MachineGlobalConfig != nil { - for k, v := range clustersConfig.Advanced.MachineGlobalConfig.Data { - machineGlobalConfigMap.Data[k] = v - } - } - - if clustersConfig.Advanced.MachineSelectors != nil { - machineSelectorConfigs = *clustersConfig.Advanced.MachineSelectors - } - } - - localClusterAuthEndpoint := rkev1.LocalClusterAuthEndpoint{ - CACerts: "", - Enabled: false, - FQDN: "", - } - if clustersConfig.Networking != nil { - if clustersConfig.Networking.LocalClusterAuthEndpoint != nil { - localClusterAuthEndpoint = *clustersConfig.Networking.LocalClusterAuthEndpoint - } - } - - upgradeStrategy := rkev1.ClusterUpgradeStrategy{ - ControlPlaneConcurrency: "10%", - ControlPlaneDrainOptions: rkev1.DrainOptions{}, - WorkerConcurrency: "10%", - WorkerDrainOptions: rkev1.DrainOptions{}, - } - if clustersConfig.UpgradeStrategy != nil { - upgradeStrategy = *clustersConfig.UpgradeStrategy - } - - clusterAgentDeploymentCustomization := &apisV1.AgentDeploymentCustomization{} - if clustersConfig.ClusterAgent != nil { - clusterAgentOverrides := ResourceConfigHelper(clustersConfig.ClusterAgent.OverrideResourceRequirements) - clusterAgentDeploymentCustomization.OverrideResourceRequirements = clusterAgentOverrides - v1ClusterTolerations := []corev1.Toleration{} - for _, t := range clustersConfig.ClusterAgent.AppendTolerations { - v1ClusterTolerations = append(v1ClusterTolerations, corev1.Toleration{ - Key: t.Key, - Operator: corev1.TolerationOperator(t.Operator), - Value: t.Value, - Effect: corev1.TaintEffect(t.Effect), - }) - } - clusterAgentDeploymentCustomization.AppendTolerations = v1ClusterTolerations - clusterAgentDeploymentCustomization.OverrideAffinity = AgentAffinityConfigHelper(clustersConfig.ClusterAgent.OverrideAffinity) - } - - fleetAgentDeploymentCustomization := &apisV1.AgentDeploymentCustomization{} - if clustersConfig.FleetAgent != nil { - fleetAgentOverrides := ResourceConfigHelper(clustersConfig.FleetAgent.OverrideResourceRequirements) - fleetAgentDeploymentCustomization.OverrideResourceRequirements = fleetAgentOverrides - v1FleetTolerations := []corev1.Toleration{} - for _, t := range clustersConfig.FleetAgent.AppendTolerations { - v1FleetTolerations = append(v1FleetTolerations, corev1.Toleration{ - Key: t.Key, - Operator: corev1.TolerationOperator(t.Operator), - Value: t.Value, - Effect: corev1.TaintEffect(t.Effect), - }) - } - fleetAgentDeploymentCustomization.AppendTolerations = v1FleetTolerations - fleetAgentDeploymentCustomization.OverrideAffinity = AgentAffinityConfigHelper(clustersConfig.FleetAgent.OverrideAffinity) - } - var registries *rkev1.Registry - if clustersConfig.Registries != nil { - registries = clustersConfig.Registries.RKE2Registries - } - - if clustersConfig.CloudProvider == provisioninginput.AWSProviderName.String() { - machineSelectorConfigs = append(machineSelectorConfigs, awsOutOfTreeSystemConfig()...) - } - - rkeSpecCommon := rkev1.RKEClusterSpecCommon{ - UpgradeStrategy: upgradeStrategy, - ChartValues: chartValuesMap, - MachineGlobalConfig: machineGlobalConfigMap, - MachineSelectorConfig: machineSelectorConfigs, - AdditionalManifest: chartAdditionalManifest, - Registries: registries, - ETCD: etcd, - } - rkeConfig := &apisV1.RKEConfig{ - RKEClusterSpecCommon: rkeSpecCommon, - MachinePools: machinePools, - } - - spec := apisV1.ClusterSpec{ - CloudCredentialSecretName: cloudCredentialSecretName, - KubernetesVersion: clustersConfig.KubernetesVersion, - LocalClusterAuthEndpoint: localClusterAuthEndpoint, - RKEConfig: rkeConfig, - ClusterAgentDeploymentCustomization: clusterAgentDeploymentCustomization, - FleetAgentDeploymentCustomization: fleetAgentDeploymentCustomization, - } - - if clustersConfig.PSACT != "" { - spec.DefaultPodSecurityAdmissionConfigurationTemplateName = clustersConfig.PSACT - } - - v1Cluster := &apisV1.Cluster{ - TypeMeta: typeMeta, - ObjectMeta: objectMeta, - Spec: spec, - } - - return v1Cluster -} - -// awsOutOfTreeSystemConfig constructs the proper rkeSystemConfig slice for enabling the aws cloud provider -// out-of-tree services -func awsOutOfTreeSystemConfig() (rkeConfig []rkev1.RKESystemConfig) { - roles := []string{etcdRole, controlPlaneRole, workerRole} - - for _, role := range roles { - selector := &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "rke.cattle.io/" + role: "true", - }, - } - configData := map[string]interface{}{} - - configData[kubeletArgKey] = []string{externalCloudProviderString} - - if role == controlPlaneRole { - configData[kubeletAPIServerArgKey] = []string{externalCloudProviderString} - configData[kubeControllerManagerArgKey] = []string{externalCloudProviderString} - } - - if role == workerRole || role == controlPlaneRole { - configData[disableCloudController] = true - } - - rkeConfig = append(rkeConfig, RKESystemConfigTemplate(configData, selector)) - } - - configData := map[string]interface{}{ - cloudProviderAnnotationName: provisioninginput.AWSProviderName, - protectKernelDefaults: false, - } - - rkeConfig = append(rkeConfig, RKESystemConfigTemplate(configData, nil)) - return -} - -// RKESYstemConfigTemplate constructs an RKESystemConfig object given config data and a selector -func RKESystemConfigTemplate(config map[string]interface{}, selector *metav1.LabelSelector) rkev1.RKESystemConfig { - return rkev1.RKESystemConfig{ - Config: rkev1.GenericMap{ - Data: config, - }, - MachineLabelSelector: selector, - } -} - -// ResourceConfigHelper is a "helper" function that is used to convert the management.ResourceRequirements struct -// to a corev1.ResourceRequirements struct. -func ResourceConfigHelper(advancedClusterResourceRequirements *management.ResourceRequirements) *corev1.ResourceRequirements { - agentOverrides := corev1.ResourceRequirements{} - agentOverrides.Limits = corev1.ResourceList{} - agentOverrides.Requests = corev1.ResourceList{} - if advancedClusterResourceRequirements.Limits[string(corev1.ResourceCPU)] != "" { - agentOverrides.Limits[corev1.ResourceCPU] = resource.MustParse(advancedClusterResourceRequirements.Limits[string(corev1.ResourceCPU)]) - } - if advancedClusterResourceRequirements.Limits[string(corev1.ResourceMemory)] != "" { - agentOverrides.Limits[corev1.ResourceMemory] = resource.MustParse(advancedClusterResourceRequirements.Limits[string(corev1.ResourceMemory)]) - } - if advancedClusterResourceRequirements.Requests[string(corev1.ResourceCPU)] != "" { - agentOverrides.Requests[corev1.ResourceCPU] = resource.MustParse(advancedClusterResourceRequirements.Requests[string(corev1.ResourceCPU)]) - } - if advancedClusterResourceRequirements.Requests[string(corev1.ResourceMemory)] != "" { - agentOverrides.Requests[corev1.ResourceMemory] = resource.MustParse(advancedClusterResourceRequirements.Requests[string(corev1.ResourceMemory)]) - } - return &agentOverrides -} - -// AgentAffinityConfigHelper is a "helper" function that converts a management.Affinity struct and returns a corev1.Affinity struct. -func AgentAffinityConfigHelper(advancedClusterAffinity *management.Affinity) *corev1.Affinity { - agentAffinity := &corev1.Affinity{} - if advancedClusterAffinity.NodeAffinity != nil { - agentAffinity.NodeAffinity = &corev1.NodeAffinity{} - if advancedClusterAffinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil { - agentAffinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution = &corev1.NodeSelector{} - agentAffinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms = []corev1.NodeSelectorTerm{} - for _, term := range advancedClusterAffinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms { - agentMatchExpressions := []corev1.NodeSelectorRequirement{} - if term.MatchExpressions != nil { - for _, match := range term.MatchExpressions { - newMatchExpression := corev1.NodeSelectorRequirement{} - newMatchExpression.Key = match.Key - newMatchExpression.Operator = corev1.NodeSelectorOperator(match.Operator) - newMatchExpression.Values = match.Values - agentMatchExpressions = append(agentMatchExpressions, newMatchExpression) - } - } - agentMatchFields := []corev1.NodeSelectorRequirement{} - if term.MatchFields != nil { - for _, match := range term.MatchFields { - newMatchExpression := corev1.NodeSelectorRequirement{} - newMatchExpression.Key = match.Key - newMatchExpression.Operator = corev1.NodeSelectorOperator(match.Operator) - newMatchExpression.Values = match.Values - agentMatchFields = append(agentMatchFields, newMatchExpression) - } - } - agentAffinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms = append(agentAffinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms, corev1.NodeSelectorTerm{ - MatchExpressions: agentMatchExpressions, - MatchFields: agentMatchFields, - }) - } - } - if advancedClusterAffinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution != nil { - agentAffinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution = []corev1.PreferredSchedulingTerm{} - for _, preferred := range advancedClusterAffinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution { - termPreferences := corev1.NodeSelectorTerm{} - if preferred.Preference.MatchExpressions != nil { - termPreferences.MatchExpressions = []corev1.NodeSelectorRequirement{} - for _, match := range preferred.Preference.MatchExpressions { - newMatchExpression := corev1.NodeSelectorRequirement{} - newMatchExpression.Key = match.Key - newMatchExpression.Operator = corev1.NodeSelectorOperator(match.Operator) - newMatchExpression.Values = match.Values - termPreferences.MatchExpressions = append(termPreferences.MatchExpressions, newMatchExpression) - } - } - if preferred.Preference.MatchFields != nil { - termPreferences.MatchFields = []corev1.NodeSelectorRequirement{} - for _, match := range preferred.Preference.MatchFields { - newMatchExpression := corev1.NodeSelectorRequirement{} - newMatchExpression.Key = match.Key - newMatchExpression.Operator = corev1.NodeSelectorOperator(match.Operator) - newMatchExpression.Values = match.Values - termPreferences.MatchFields = append(termPreferences.MatchFields, newMatchExpression) - } - } - agentAffinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution = append(agentAffinity.NodeAffinity.PreferredDuringSchedulingIgnoredDuringExecution, corev1.PreferredSchedulingTerm{ - Weight: int32(preferred.Weight), - Preference: termPreferences, - }) - } - } - } - if advancedClusterAffinity.PodAffinity != nil { - agentAffinity.PodAffinity = &corev1.PodAffinity{} - if advancedClusterAffinity.PodAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil { - agentAffinity.PodAffinity.RequiredDuringSchedulingIgnoredDuringExecution = []corev1.PodAffinityTerm{} - for _, term := range advancedClusterAffinity.PodAffinity.RequiredDuringSchedulingIgnoredDuringExecution { - matchExpressions := []metav1.LabelSelectorRequirement{} - if term.LabelSelector != nil { - for _, expression := range term.LabelSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchExpressions = append(matchExpressions, newExpression) - } - } - matchNamespaces := metav1.LabelSelector{} - if term.NamespaceSelector != nil { - if term.NamespaceSelector.MatchLabels != nil { - matchNamespaces.MatchLabels = term.NamespaceSelector.MatchLabels - } - for _, expression := range term.NamespaceSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchNamespaces.MatchExpressions = append(matchNamespaces.MatchExpressions, newExpression) - } - } - newAffinityTerms := corev1.PodAffinityTerm{ - TopologyKey: term.TopologyKey, - } - if len(term.Namespaces) > 0 { - newAffinityTerms.Namespaces = term.Namespaces - } - if term.LabelSelector != nil { - newAffinityTerms.LabelSelector = &metav1.LabelSelector{} - if term.LabelSelector.MatchLabels != nil { - newAffinityTerms.LabelSelector.MatchLabels = term.LabelSelector.MatchLabels - } - if len(matchExpressions) > 0 { - newAffinityTerms.LabelSelector.MatchExpressions = matchExpressions - } - } - if matchNamespaces.MatchLabels != nil || len(matchNamespaces.MatchExpressions) > 0 { - newAffinityTerms.NamespaceSelector = &matchNamespaces - } - agentAffinity.PodAffinity.RequiredDuringSchedulingIgnoredDuringExecution = append(agentAffinity.PodAffinity.RequiredDuringSchedulingIgnoredDuringExecution, newAffinityTerms) - } - } - if advancedClusterAffinity.PodAffinity.PreferredDuringSchedulingIgnoredDuringExecution != nil { - agentAffinity.PodAffinity.PreferredDuringSchedulingIgnoredDuringExecution = []corev1.WeightedPodAffinityTerm{} - for _, preferred := range advancedClusterAffinity.PodAffinity.PreferredDuringSchedulingIgnoredDuringExecution { - matchExpressions := []metav1.LabelSelectorRequirement{} - if preferred.PodAffinityTerm.LabelSelector != nil { - for _, expression := range preferred.PodAffinityTerm.LabelSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchExpressions = append(matchExpressions, newExpression) - } - } - matchNamespaces := metav1.LabelSelector{} - if preferred.PodAffinityTerm.NamespaceSelector != nil { - if preferred.PodAffinityTerm.NamespaceSelector.MatchLabels == nil { - matchNamespaces.MatchLabels = preferred.PodAffinityTerm.NamespaceSelector.MatchLabels - } - for _, expression := range preferred.PodAffinityTerm.NamespaceSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchNamespaces.MatchExpressions = append(matchNamespaces.MatchExpressions, newExpression) - } - } - newAffinityTerms := corev1.WeightedPodAffinityTerm{ - Weight: int32(preferred.Weight), - PodAffinityTerm: corev1.PodAffinityTerm{ - TopologyKey: preferred.PodAffinityTerm.TopologyKey, - }, - } - // add in optional variables if they exist - if preferred.PodAffinityTerm.Namespaces != nil { - newAffinityTerms.PodAffinityTerm.Namespaces = preferred.PodAffinityTerm.Namespaces - } - if matchNamespaces.MatchLabels != nil || matchNamespaces.MatchExpressions != nil { - newAffinityTerms.PodAffinityTerm.NamespaceSelector = &matchNamespaces - } - if preferred.PodAffinityTerm.LabelSelector != nil { - newAffinityTerms.PodAffinityTerm.LabelSelector = &metav1.LabelSelector{} - if preferred.PodAffinityTerm.LabelSelector.MatchLabels != nil { - newAffinityTerms.PodAffinityTerm.LabelSelector.MatchLabels = preferred.PodAffinityTerm.LabelSelector.MatchLabels - } - if preferred.PodAffinityTerm.LabelSelector.MatchExpressions != nil { - newAffinityTerms.PodAffinityTerm.LabelSelector.MatchExpressions = matchExpressions - } - } - agentAffinity.PodAffinity.PreferredDuringSchedulingIgnoredDuringExecution = append(agentAffinity.PodAffinity.PreferredDuringSchedulingIgnoredDuringExecution, newAffinityTerms) - } - } - } - if advancedClusterAffinity.PodAntiAffinity != nil { - agentAffinity.PodAntiAffinity = &corev1.PodAntiAffinity{} - if advancedClusterAffinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil { - agentAffinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution = []corev1.PodAffinityTerm{} - for _, term := range advancedClusterAffinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution { - matchExpressions := []metav1.LabelSelectorRequirement{} - if term.LabelSelector != nil { - for _, expression := range term.LabelSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchExpressions = append(matchExpressions, newExpression) - } - } - matchNamespaces := metav1.LabelSelector{} - if term.NamespaceSelector != nil { - if term.NamespaceSelector.MatchLabels != nil { - matchNamespaces.MatchLabels = term.NamespaceSelector.MatchLabels - } - for _, expression := range term.NamespaceSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchNamespaces.MatchExpressions = append(matchNamespaces.MatchExpressions, newExpression) - } - } - newAffinityTerms := corev1.PodAffinityTerm{ - TopologyKey: term.TopologyKey, - } - if len(term.Namespaces) > 0 { - newAffinityTerms.Namespaces = term.Namespaces - } - if term.LabelSelector != nil { - newAffinityTerms.LabelSelector = &metav1.LabelSelector{} - if term.LabelSelector.MatchLabels != nil { - newAffinityTerms.LabelSelector.MatchLabels = term.LabelSelector.MatchLabels - } - if len(matchExpressions) > 0 { - newAffinityTerms.LabelSelector.MatchExpressions = matchExpressions - } - } - if matchNamespaces.MatchLabels != nil || len(matchNamespaces.MatchExpressions) > 0 { - newAffinityTerms.NamespaceSelector = &matchNamespaces - } - agentAffinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution = append(agentAffinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution, newAffinityTerms) - } - } - if advancedClusterAffinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution != nil { - agentAffinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution = []corev1.WeightedPodAffinityTerm{} - for _, preferred := range advancedClusterAffinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution { - matchExpressions := []metav1.LabelSelectorRequirement{} - if preferred.PodAffinityTerm.LabelSelector != nil { - for _, expression := range preferred.PodAffinityTerm.LabelSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchExpressions = append(matchExpressions, newExpression) - } - } - matchNamespaces := metav1.LabelSelector{} - if preferred.PodAffinityTerm.NamespaceSelector != nil { - if preferred.PodAffinityTerm.NamespaceSelector.MatchLabels == nil { - matchNamespaces.MatchLabels = preferred.PodAffinityTerm.NamespaceSelector.MatchLabels - } - for _, expression := range preferred.PodAffinityTerm.NamespaceSelector.MatchExpressions { - newExpression := metav1.LabelSelectorRequirement{} - newExpression.Key = expression.Key - newExpression.Operator = metav1.LabelSelectorOperator(expression.Operator) - newExpression.Values = expression.Values - matchNamespaces.MatchExpressions = append(matchNamespaces.MatchExpressions, newExpression) - } - } - newAffinityTerms := corev1.WeightedPodAffinityTerm{ - Weight: int32(preferred.Weight), - PodAffinityTerm: corev1.PodAffinityTerm{ - TopologyKey: preferred.PodAffinityTerm.TopologyKey, - }, - } - // add in optional variables if they exist - if preferred.PodAffinityTerm.Namespaces != nil { - newAffinityTerms.PodAffinityTerm.Namespaces = preferred.PodAffinityTerm.Namespaces - } - if matchNamespaces.MatchLabels != nil || matchNamespaces.MatchExpressions != nil { - newAffinityTerms.PodAffinityTerm.NamespaceSelector = &matchNamespaces - } - if preferred.PodAffinityTerm.LabelSelector != nil { - newAffinityTerms.PodAffinityTerm.LabelSelector = &metav1.LabelSelector{} - if preferred.PodAffinityTerm.LabelSelector.MatchLabels != nil { - newAffinityTerms.PodAffinityTerm.LabelSelector.MatchLabels = preferred.PodAffinityTerm.LabelSelector.MatchLabels - } - if preferred.PodAffinityTerm.LabelSelector.MatchExpressions != nil { - newAffinityTerms.PodAffinityTerm.LabelSelector.MatchExpressions = matchExpressions - } - } - agentAffinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution = append(agentAffinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution, newAffinityTerms) - } - } - } - return agentAffinity -} - -// HardenK3SClusterConfig is a constructor for a apisV1.Cluster object, to be used by the rancher.Client.Provisioning client. -func HardenK3SClusterConfig(clusterName, namespace string, clustersConfig *ClusterConfig, machinePools []apisV1.RKEMachinePool, cloudCredentialSecretName string) *apisV1.Cluster { - v1Cluster := NewK3SRKE2ClusterConfig(clusterName, namespace, clustersConfig, machinePools, cloudCredentialSecretName) - - if clustersConfig.KubernetesVersion <= string(provisioninginput.PSPKubeVersionLimit) { - v1Cluster.Spec.RKEConfig.MachineGlobalConfig.Data["kube-apiserver-arg"] = []string{ - "enable-admission-plugins=NodeRestriction,PodSecurityPolicy,ServiceAccount", - "audit-policy-file=/var/lib/rancher/k3s/server/audit.yaml", - "audit-log-path=/var/lib/rancher/k3s/server/logs/audit.log", - "audit-log-maxage=30", - "audit-log-maxbackup=10", - "audit-log-maxsize=100", - "request-timeout=300s", - "service-account-lookup=true", - } - } else { - v1Cluster.Spec.RKEConfig.MachineGlobalConfig.Data["kube-apiserver-arg"] = []string{ - "admission-control-config-file=/var/lib/rancher/k3s/server/psa.yaml", - "audit-policy-file=/var/lib/rancher/k3s/server/audit.yaml", - "audit-log-path=/var/lib/rancher/k3s/server/logs/audit.log", - "audit-log-maxage=30", - "audit-log-maxbackup=10", - "audit-log-maxsize=100", - "request-timeout=300s", - "service-account-lookup=true", - } - } - - v1Cluster.Spec.RKEConfig.MachineSelectorConfig = []rkev1.RKESystemConfig{ - { - Config: rkev1.GenericMap{ - Data: map[string]interface{}{ - "kubelet-arg": []string{ - "make-iptables-util-chains=true", - }, - protectKernelDefaults: true, - }, - }, - }, - } - - return v1Cluster -} - -// HardenRKE2ClusterConfig is a constructor for a apisV1.Cluster object, to be used by the rancher.Client.Provisioning client. -func HardenRKE2ClusterConfig(clusterName, namespace string, clustersConfig *ClusterConfig, machinePools []apisV1.RKEMachinePool, cloudCredentialSecretName string) *apisV1.Cluster { - v1Cluster := NewK3SRKE2ClusterConfig(clusterName, namespace, clustersConfig, machinePools, cloudCredentialSecretName) - - if clustersConfig.KubernetesVersion <= string(provisioninginput.PSPKubeVersionLimit) { - v1Cluster.Spec.RKEConfig.MachineSelectorConfig = []rkev1.RKESystemConfig{ - { - Config: rkev1.GenericMap{ - Data: map[string]interface{}{ - "profile": "cis-1.6", - protectKernelDefaults: true, - }, - }, - }, - } - } else { - v1Cluster.Spec.RKEConfig.MachineSelectorConfig = []rkev1.RKESystemConfig{ - { - Config: rkev1.GenericMap{ - Data: map[string]interface{}{ - "profile": "cis-1.23", - "protect-kernel-defaults": true, - }, - }, - }, - } - } - - return v1Cluster -} - -// CreateRKE1Cluster is a "helper" functions that takes a rancher client, and the rke1 cluster config as parameters. This function -// registers a delete cluster fuction with a wait.WatchWait to ensure the cluster is removed cleanly. -func CreateRKE1Cluster(client *rancher.Client, rke1Cluster *management.Cluster) (*management.Cluster, error) { - cluster, err := client.Management.Cluster.Create(rke1Cluster) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - client, err = client.ReLogin() - if err != nil { - return false, err - } - - _, err = client.Management.Cluster.ByID(cluster.ID) - if err != nil { - return false, nil - } - return true, nil - }) - - if err != nil { - return nil, err - } - - client.Session.RegisterCleanupFunc(func() error { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - - clusterResp, err := client.Management.Cluster.ByID(cluster.ID) - if err != nil { - return err - } - - client, err = client.ReLogin() - if err != nil { - return err - } - - err = client.Management.Cluster.Delete(clusterResp) - if err != nil { - return err - } - - watchInterface, err := adminClient.GetManagementWatchInterface(management.ClusterType, metav1.ListOptions{ - FieldSelector: "metadata.name=" + clusterResp.ID, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error deleting cluster") - } else if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - return cluster, nil -} - -// CreateK3SRKE2Cluster is a "helper" functions that takes a rancher client, and the rke2 cluster config as parameters. This function -// registers a delete cluster fuction with a wait.WatchWait to ensure the cluster is removed cleanly. -func CreateK3SRKE2Cluster(client *rancher.Client, rke2Cluster *apisV1.Cluster) (*v1.SteveAPIObject, error) { - cluster, err := client.Steve.SteveType(ProvisioningSteveResourceType).Create(rke2Cluster) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - client, err = client.ReLogin() - if err != nil { - return false, err - } - - _, err = client.Steve.SteveType(ProvisioningSteveResourceType).ByID(cluster.ID) - if err != nil { - return false, nil - } - - return true, nil - }) - - if err != nil { - return nil, err - } - - client.Session.RegisterCleanupFunc(func() error { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - - provKubeClient, err := adminClient.GetKubeAPIProvisioningClient() - if err != nil { - return err - } - - watchInterface, err := provKubeClient.Clusters(cluster.ObjectMeta.Namespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + cluster.ObjectMeta.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - client, err = client.ReLogin() - if err != nil { - return err - } - - err = client.Steve.SteveType(ProvisioningSteveResourceType).Delete(cluster) - if err != nil { - return err - } - - return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - cluster := event.Object.(*apisV1.Cluster) - if event.Type == watch.Error { - return false, fmt.Errorf("there was an error deleting cluster") - } else if event.Type == watch.Deleted { - return true, nil - } else if cluster == nil { - return true, nil - } - return false, nil - }) - }) - - return cluster, nil -} - -// DeleteKE1Cluster is a "helper" functions that takes a rancher client, and the rke1 cluster ID as parameters to delete -// the cluster. -func DeleteRKE1Cluster(client *rancher.Client, clusterID string) error { - cluster, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return err - } - - logrus.Infof("Deleting cluster %s...", cluster.Name) - err = client.Management.Cluster.Delete(cluster) - if err != nil { - return err - } - - return nil -} - -// DeleteK3SRKE2Cluster is a "helper" functions that takes a rancher client, and the non-rke1 cluster ID as parameters to delete -// the cluster. -func DeleteK3SRKE2Cluster(client *rancher.Client, clusterID string) error { - cluster, err := client.Steve.SteveType(ProvisioningSteveResourceType).ByID(clusterID) - if err != nil { - return err - } - - logrus.Infof("Deleting cluster %s...", cluster.Name) - err = client.Steve.SteveType(ProvisioningSteveResourceType).Delete(cluster) - if err != nil { - return err - } - - return nil -} - -// UpdateK3SRKE2Cluster is a "helper" functions that takes a rancher client, old rke2/k3s cluster config, and the new rke2/k3s cluster config as parameters. -func UpdateK3SRKE2Cluster(client *rancher.Client, cluster *v1.SteveAPIObject, updatedCluster *apisV1.Cluster) (*v1.SteveAPIObject, error) { - updateCluster, err := client.Steve.SteveType(ProvisioningSteveResourceType).ByID(cluster.ID) - if err != nil { - return nil, err - } - - updatedCluster.ObjectMeta.ResourceVersion = updateCluster.ObjectMeta.ResourceVersion - - cluster, err = client.Steve.SteveType(ProvisioningSteveResourceType).Update(cluster, updatedCluster) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, 5*time.Minute, func() (done bool, err error) { - client, err = client.ReLogin() - if err != nil { - return false, err - } - - clusterResp, err := client.Steve.SteveType(ProvisioningSteveResourceType).ByID(cluster.ID) - if err != nil { - return false, err - } - - clusterStatus := &apisV1.ClusterStatus{} - err = v1.ConvertToK8sType(clusterResp.Status, clusterStatus) - if err != nil { - return false, err - } - - if clusterResp.ObjectMeta.State.Name == active { - proxyClient, err := client.Steve.ProxyDownstream(clusterStatus.ClusterName) - if err != nil { - return false, err - } - - _, err = proxyClient.SteveType(pods.PodResourceSteveType).List(nil) - if err != nil { - return false, nil - } - logrus.Infof("Cluster has been successfully updated!") - return true, nil - } - return false, nil - }) - - if err != nil { - return nil, err - } - - return cluster, nil -} - -// WaitClusterToBeInUpgrade is a helper function that takes a rancher client, and the cluster id as parameters. -// Waits cluster to be in upgrade state. -// Cluster error states that declare control plane is inaccessible and cluster object modified are ignored. -// Same cluster summary information logging is ignored. -func WaitClusterToBeInUpgrade(client *rancher.Client, clusterID string) (err error) { - var clusterInfo string - opts := metav1.ListOptions{ - FieldSelector: "metadata.name=" + clusterID, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - } - - watchInterface, err := client.GetManagementWatchInterface(management.ClusterType, opts) - if err != nil { - return - } - checkFuncWaitToBeInUpgrade := func(event watch.Event) (bool, error) { - clusterUnstructured := event.Object.(*unstructured.Unstructured) - summarizedCluster := summary.Summarize(clusterUnstructured) - - clusterInfo = logClusterInfoWithChanges(clusterID, clusterInfo, summarizedCluster) - - if summarizedCluster.Transitioning && !summarizedCluster.Error && (summarizedCluster.State == clusterStateUpdating || summarizedCluster.State == clusterStateUpgrading) { - return true, nil - } else if summarizedCluster.Error && isClusterInaccessible(summarizedCluster.Message) { - return false, nil - } else if summarizedCluster.Error && !isClusterInaccessible(summarizedCluster.Message) { - return false, errors.Wrap(err, clusterErrorStateMessage) - } - - return false, nil - } - err = wait.WatchWait(watchInterface, checkFuncWaitToBeInUpgrade) - if err != nil { - return - } - - return -} - -// WaitClusterUntilUpgrade is a helper function that takes a rancher client, and the cluster id as parameters. -// Waits until cluster is ready. -// Cluster error states that declare control plane is inaccessible and cluster object modified are ignored. -// Same cluster summary information logging is ignored. -func WaitClusterUntilUpgrade(client *rancher.Client, clusterID string) (err error) { - var clusterInfo string - opts := metav1.ListOptions{ - FieldSelector: "metadata.name=" + clusterID, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - } - - watchInterfaceWaitUpgrade, err := client.GetManagementWatchInterface(management.ClusterType, opts) - if err != nil { - return - } - checkFuncWaitUpgrade := func(event watch.Event) (bool, error) { - clusterUnstructured := event.Object.(*unstructured.Unstructured) - summarizedCluster := summary.Summarize(clusterUnstructured) - - clusterInfo = logClusterInfoWithChanges(clusterID, clusterInfo, summarizedCluster) - - if summarizedCluster.IsReady() { - return true, nil - } else if summarizedCluster.Error && isClusterInaccessible(summarizedCluster.Message) { - return false, nil - } else if summarizedCluster.Error && !isClusterInaccessible(summarizedCluster.Message) { - return false, errors.Wrap(err, clusterErrorStateMessage) - - } - - return false, nil - } - - err = wait.WatchWait(watchInterfaceWaitUpgrade, checkFuncWaitUpgrade) - if err != nil { - return err - } - - return -} - -// WaitForClusterToBeUpgraded is a "helper" functions that takes a rancher client, and the cluster id as parameters. This function -// contains two stages. First stage is to wait to be cluster in upgrade state. And the other is to wait until cluster is ready. -// Cluster error states that declare control plane is inaccessible and cluster object modified are ignored. -// Same cluster summary information logging is ignored. -func WaitClusterToBeUpgraded(client *rancher.Client, clusterID string) (err error) { - err = WaitClusterToBeInUpgrade(client, clusterID) - if err != nil { - return err - } - - err = WaitClusterUntilUpgrade(client, clusterID) - if err != nil { - return err - } - - return -} - -func isClusterInaccessible(messages []string) (isInaccessible bool) { - clusterCPErrorMessage := "Cluster health check failed: Failed to communicate with API server during namespace check" // For GKE - clusterModifiedErrorMessage := "the object has been modified" // For provisioning node driver K3s and RKE2 - - for _, message := range messages { - if strings.Contains(message, clusterCPErrorMessage) || strings.Contains(message, clusterModifiedErrorMessage) { - isInaccessible = true - break - } - } - - return -} - -func logClusterInfoWithChanges(clusterID, clusterInfo string, summary summary.Summary) string { - newClusterInfo := fmt.Sprintf("ClusterID: %v, Message: %v, Error: %v, State: %v, Transitioning: %v", clusterID, summary.Message, summary.Error, summary.State, summary.Transitioning) - - if clusterInfo != newClusterInfo { - logrus.Infof(newClusterInfo) - clusterInfo = newClusterInfo - } - - return clusterInfo -} - -// WatchAndWaitForCluster is function that waits for a cluster to go unactive before checking its active state. -func WatchAndWaitForCluster(client *rancher.Client, steveID string) error { - var clusterResp *v1.SteveAPIObject - err := kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - clusterResp, err = client.Steve.SteveType(ProvisioningSteveResourceType).ByID(steveID) - if err != nil { - return false, err - } - state := clusterResp.ObjectMeta.State.Name - return state != "active", nil - }) - if err != nil { - return err - } - logrus.Infof("waiting for cluster to be up.............") - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return err - } - kubeProvisioningClient, err := adminClient.GetKubeAPIProvisioningClient() - if err != nil { - return err - } - - result, err := kubeProvisioningClient.Clusters(clusterResp.ObjectMeta.Namespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + clusterResp.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return err - } - - err = wait.WatchWait(result, IsProvisioningClusterReady) - return err -} - -// GetProvisioningClusterByName is a helper function to get cluster object with the cluster name -func GetProvisioningClusterByName(client *rancher.Client, clusterName string, namespace string) (*apisV1.Cluster, *v1.SteveAPIObject, error) { - clusterObj, err := client.Steve.SteveType(ProvisioningSteveResourceType).ByID(namespace + "/" + clusterName) - if err != nil { - return nil, nil, err - } - - cluster := new(apisV1.Cluster) - err = v1.ConvertToK8sType(clusterObj, &cluster) - if err != nil { - return nil, nil, err - } - - return cluster, clusterObj, nil -} - -// WaitForActiveCluster is a "helper" function that waits for the cluster to reach the active state. -// The function accepts a Rancher client and a cluster ID as parameters. -func WaitForActiveRKE1Cluster(client *rancher.Client, clusterID string) error { - err := kwait.Poll(500*time.Millisecond, 30*time.Minute, func() (done bool, err error) { - client, err = client.ReLogin() - if err != nil { - return false, err - } - clusterResp, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return false, err - } - if clusterResp.State == active { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - return nil -} diff --git a/tests/framework/extensions/clusters/clustertypes.go b/tests/framework/extensions/clusters/clustertypes.go deleted file mode 100644 index 6bfa61f453d..00000000000 --- a/tests/framework/extensions/clusters/clustertypes.go +++ /dev/null @@ -1,13 +0,0 @@ -package clusters - -type ClusterType string - -const ( - K3SClusterType ClusterType = "k3s" - RKE1ClusterType ClusterType = "rke1" - RKE2ClusterType ClusterType = "rke2" -) - -func (p ClusterType) String() string { - return string(p) -} diff --git a/tests/framework/extensions/clusters/dynamicSchema.go b/tests/framework/extensions/clusters/dynamicSchema.go deleted file mode 100644 index ce75607fdc9..00000000000 --- a/tests/framework/extensions/clusters/dynamicSchema.go +++ /dev/null @@ -1,25 +0,0 @@ -package clusters - -type Default struct { - StringValue string `json:"stringValue"` - IntValue int `json:"intValue"` - BoolValue bool `json:"boolValue"` - StringSliceValue []int `json:"stringSliceValue"` -} - -type SSHUser struct { - Type string `json:"type"` - Default Default - Create bool `json:"create"` - Update bool `json:"update"` - Description string `json:"description"` -} - -type ResourceFields struct { - SSHUser SSHUser -} - -// DynamicSchemaSpec contains ResourceFields that contains all the data for the DynamicSchemaSpec which a type in provisioning.cattle.io.clusters this is how we get an ssh user for a node pool -type DynamicSchemaSpec struct { - ResourceFields ResourceFields `json:"resourceFields"` -} diff --git a/tests/framework/extensions/clusters/eks/create.go b/tests/framework/extensions/clusters/eks/create.go deleted file mode 100644 index 0960054b588..00000000000 --- a/tests/framework/extensions/clusters/eks/create.go +++ /dev/null @@ -1,27 +0,0 @@ -package eks - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" -) - -// CreateEKSHostedCluster is a helper function that creates an EKS hosted cluster -func CreateEKSHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) { - eksHostCluster := eksHostClusterConfig(displayName, cloudCredentialID) - cluster := &management.Cluster{ - DockerRootDir: "/var/lib/docker", - EKSConfig: eksHostCluster, - Name: displayName, - EnableClusterAlerting: enableClusterAlerting, - EnableClusterMonitoring: enableClusterMonitoring, - EnableNetworkPolicy: &enableNetworkPolicy, - Labels: labels, - WindowsPreferedCluster: windowsPreferedCluster, - } - - clusterResp, err := client.Management.Cluster.Create(cluster) - if err != nil { - return nil, err - } - return clusterResp, err -} diff --git a/tests/framework/extensions/clusters/eks/eks_cluster_config.go b/tests/framework/extensions/clusters/eks/eks_cluster_config.go deleted file mode 100644 index 032e0ccbf6c..00000000000 --- a/tests/framework/extensions/clusters/eks/eks_cluster_config.go +++ /dev/null @@ -1,116 +0,0 @@ -package eks - -import ( - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const ( - // The json/yaml config key for the EKS hosted cluster config - EKSClusterConfigConfigurationFileKey = "eksClusterConfig" -) - -// ClusterConfig is the configuration needed to create an EKS host cluster -type ClusterConfig struct { - KmsKey *string `json:"kmsKey,omitempty" yaml:"kmsKey,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` - LoggingTypes []string `json:"loggingTypes" yaml:"loggingTypes"` - NodeGroupsConfig *[]NodeGroupConfig `json:"nodeGroups,omitempty" yaml:"nodeGroups,omitempty"` - PrivateAccess *bool `json:"privateAccess,omitempty" yaml:"privateAccess,omitempty"` - PublicAccess *bool `json:"publicAccess,omitempty" yaml:"publicAccess,omitempty"` - PublicAccessSources []string `json:"publicAccessSources" yaml:"publicAccessSources"` - Region string `json:"region" yaml:"region"` - SecretsEncryption *bool `json:"secretsEncryption,omitempty" yaml:"secretsEncryption,omitempty"` - SecurityGroups []string `json:"securityGroups" yaml:"securityGroups"` - ServiceRole *string `json:"serviceRole,omitempty" yaml:"serviceRole,omitempty"` - Subnets []string `json:"subnets" yaml:"subnets"` - Tags map[string]string `json:"tags" yaml:"tags"` -} - -// NodeGroupConfig is the configuration need to create an EKS node group -type NodeGroupConfig struct { - DesiredSize *int64 `json:"desiredSize,omitempty" yaml:"desiredSize,omitempty"` - DiskSize *int64 `json:"diskSize,omitempty" yaml:"diskSize,omitempty"` - Ec2SshKey *string `json:"ec2SshKey,omitempty" yaml:"ec2SshKey,omitempty"` - Gpu *bool `json:"gpu,omitempty" yaml:"gpu,omitempty"` - ImageID *string `json:"imageId,omitempty" yaml:"imageId,omitempty"` - InstanceType *string `json:"instanceType,omitempty" yaml:"instanceType,omitempty"` - Labels map[string]string `json:"labels" yaml:"labels"` - LaunchTemplateConfig *LaunchTemplateConfig `json:"launchTemplate,omitempty" yaml:"launchTemplate,omitempty"` - MaxSize *int64 `json:"maxSize,omitempty" yaml:"maxSize,omitempty"` - MinSize *int64 `json:"minSize,omitempty" yaml:"minSize,omitempty"` - NodeRole *string `json:"nodeRole,omitempty" yaml:"nodeRole,omitempty"` - NodegroupName *string `json:"nodegroupName,omitempty" yaml:"nodegroupName,omitempty"` - RequestSpotInstances *bool `json:"requestSpotInstances,omitempty" yaml:"requestSpotInstances,omitempty"` - ResourceTags map[string]string `json:"resourceTags" yaml:"resourceTags"` - SpotInstanceTypes []string `json:"spotInstanceTypes" yaml:"spotInstanceTypes"` - Subnets []string `json:"subnets" yaml:"subnets"` - Tags map[string]string `json:"tags" yaml:"tags"` - UserData *string `json:"userData,omitempty" yaml:"userData,omitempty"` -} - -// LaunchTemplateConfig is the configuration need for a node group launch template -type LaunchTemplateConfig struct { - Name *string `json:"name,omitempty" yaml:"name,omitempty"` - Version *int64 `json:"version,omitempty" yaml:"version,omitempty"` -} - -func nodeGroupsConstructor(nodeGroupsConfig *[]NodeGroupConfig, kubernetesVersion string) []management.NodeGroup { - var nodeGroups []management.NodeGroup - for _, nodeGroupConfig := range *nodeGroupsConfig { - var launchTemplate *management.LaunchTemplate - if nodeGroupConfig.LaunchTemplateConfig != nil { - launchTemplate = &management.LaunchTemplate{ - Name: nodeGroupConfig.LaunchTemplateConfig.Name, - Version: nodeGroupConfig.LaunchTemplateConfig.Version, - } - } - nodeGroup := management.NodeGroup{ - DesiredSize: nodeGroupConfig.DesiredSize, - DiskSize: nodeGroupConfig.DiskSize, - Ec2SshKey: nodeGroupConfig.Ec2SshKey, - Gpu: nodeGroupConfig.Gpu, - ImageID: nodeGroupConfig.ImageID, - InstanceType: nodeGroupConfig.InstanceType, - Labels: &nodeGroupConfig.Labels, - LaunchTemplate: launchTemplate, - MaxSize: nodeGroupConfig.MaxSize, - MinSize: nodeGroupConfig.MinSize, - NodegroupName: nodeGroupConfig.NodegroupName, - NodeRole: nodeGroupConfig.NodeRole, - RequestSpotInstances: nodeGroupConfig.RequestSpotInstances, - ResourceTags: &nodeGroupConfig.ResourceTags, - SpotInstanceTypes: &nodeGroupConfig.SpotInstanceTypes, - Subnets: &nodeGroupConfig.Subnets, - Tags: &nodeGroupConfig.Tags, - UserData: nodeGroupConfig.UserData, - Version: &kubernetesVersion, - } - nodeGroups = append(nodeGroups, nodeGroup) - } - return nodeGroups -} - -func eksHostClusterConfig(displayName, cloudCredentialID string) *management.EKSClusterConfigSpec { - var eksClusterConfig ClusterConfig - config.LoadConfig(EKSClusterConfigConfigurationFileKey, &eksClusterConfig) - - return &management.EKSClusterConfigSpec{ - AmazonCredentialSecret: cloudCredentialID, - DisplayName: displayName, - Imported: false, - KmsKey: eksClusterConfig.KmsKey, - KubernetesVersion: eksClusterConfig.KubernetesVersion, - LoggingTypes: &eksClusterConfig.LoggingTypes, - NodeGroups: nodeGroupsConstructor(eksClusterConfig.NodeGroupsConfig, *eksClusterConfig.KubernetesVersion), - PrivateAccess: eksClusterConfig.PrivateAccess, - PublicAccess: eksClusterConfig.PublicAccess, - PublicAccessSources: &eksClusterConfig.PublicAccessSources, - Region: eksClusterConfig.Region, - SecretsEncryption: eksClusterConfig.SecretsEncryption, - SecurityGroups: &eksClusterConfig.SecurityGroups, - ServiceRole: eksClusterConfig.ServiceRole, - Subnets: &eksClusterConfig.Subnets, - Tags: &eksClusterConfig.Tags, - } -} diff --git a/tests/framework/extensions/clusters/eks/nodepools.go b/tests/framework/extensions/clusters/eks/nodepools.go deleted file mode 100644 index 3d02316918b..00000000000 --- a/tests/framework/extensions/clusters/eks/nodepools.go +++ /dev/null @@ -1,72 +0,0 @@ -package eks - -import ( - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/sirupsen/logrus" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - active = "active" -) - -// updateNodePoolQuantity is a helper method that will update the node pool with the desired quantity. -func updateNodePoolQuantity(client *rancher.Client, cluster *management.Cluster, nodePool *NodeGroupConfig) (*management.Cluster, error) { - clusterResp, err := client.Management.Cluster.ByID(cluster.ID) - if err != nil { - return nil, err - } - - var eksConfig = clusterResp.EKSConfig - *eksConfig.NodeGroups[0].DesiredSize += *nodePool.DesiredSize - - eksHostCluster := &management.Cluster{ - DockerRootDir: "/var/lib/docker", - EKSConfig: eksConfig, - EnableClusterAlerting: clusterResp.EnableClusterAlerting, - EnableClusterMonitoring: clusterResp.EnableClusterMonitoring, - EnableNetworkPolicy: clusterResp.EnableNetworkPolicy, - Labels: clusterResp.Labels, - Name: clusterResp.Name, - WindowsPreferedCluster: clusterResp.WindowsPreferedCluster, - } - - logrus.Infof("Scaling the node group to %v total nodes", *eksConfig.NodeGroups[0].DesiredSize) - updatedCluster, err := client.Management.Cluster.Update(clusterResp, eksHostCluster) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, 10*time.Minute, func() (done bool, err error) { - clusterResp, err := client.Management.Cluster.ByID(updatedCluster.ID) - if err != nil { - return false, err - } - - if clusterResp.State == active && clusterResp.NodeCount == *eksConfig.NodeGroups[0].DesiredSize { - return true, nil - } - - return false, nil - }) - if err != nil { - return nil, err - } - - return updatedCluster, nil -} - -// ScalingEKSNodePoolsNodes is a helper function that tests scaling of an EKS node pool by adding a new one and then deleting it. -func ScalingEKSNodePoolsNodes(client *rancher.Client, cluster *management.Cluster, nodePool *NodeGroupConfig) (*management.Cluster, error) { - updatedCluster, err := updateNodePoolQuantity(client, cluster, nodePool) - if err != nil { - return nil, err - } - - logrus.Infof("Node group has been scaled!") - - return updatedCluster, nil -} diff --git a/tests/framework/extensions/clusters/gke/create.go b/tests/framework/extensions/clusters/gke/create.go deleted file mode 100644 index 01c6d78be49..00000000000 --- a/tests/framework/extensions/clusters/gke/create.go +++ /dev/null @@ -1,27 +0,0 @@ -package gke - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" -) - -// CreateGKEHostedCluster is a helper function that creates an GKE hosted cluster -func CreateGKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) { - gkeHostCluster := gkeHostClusterConfig(displayName, cloudCredentialID) - cluster := &management.Cluster{ - DockerRootDir: "/var/lib/docker", - GKEConfig: gkeHostCluster, - Name: displayName, - EnableClusterAlerting: enableClusterAlerting, - EnableClusterMonitoring: enableClusterMonitoring, - EnableNetworkPolicy: &enableNetworkPolicy, - Labels: labels, - WindowsPreferedCluster: windowsPreferedCluster, - } - - clusterResp, err := client.Management.Cluster.Create(cluster) - if err != nil { - return nil, err - } - return clusterResp, err -} diff --git a/tests/framework/extensions/clusters/gke/gke_cluster_config.go b/tests/framework/extensions/clusters/gke/gke_cluster_config.go deleted file mode 100644 index 85b755d265b..00000000000 --- a/tests/framework/extensions/clusters/gke/gke_cluster_config.go +++ /dev/null @@ -1,259 +0,0 @@ -package gke - -import ( - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const ( - // The json/yaml config key for the GKE hosted cluster config - GKEClusterConfigConfigurationFileKey = "gkeClusterConfig" -) - -// ClusterConfig is the configuration needed to create an GKE host cluster -type ClusterConfig struct { - ClusterAddons *ClusterAddons `json:"clusterAddons,omitempty" yaml:"clusterAddons,omitempty"` - ClusterIpv4CidrBlock *string `json:"clusterIpv4Cidr,omitempty" yaml:"clusterIpv4Cidr,omitempty"` - EnableKubernetesAlpha *bool `json:"enableKubernetesAlpha,omitempty" yaml:"enableKubernetesAlpha,omitempty"` - IPAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty" yaml:"ipAllocationPolicy,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"` - Labels map[string]string `json:"labels" yaml:"labels"` - Locations []string `json:"locations" yaml:"locations"` - LoggingService *string `json:"loggingService,omitempty" yaml:"loggingService,omitempty"` - MaintenanceWindow *string `json:"maintenanceWindow,omitempty" yaml:"maintenanceWindow,omitempty"` - MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"masterAuthorizedNetworks,omitempty" yaml:"masterAuthorizedNetworks,omitempty"` - MonitoringService *string `json:"monitoringService,omitempty" yaml:"monitoringService,omitempty"` - Network *string `json:"network,omitempty" yaml:"network,omitempty"` - NetworkPolicyEnabled *bool `json:"networkPolicyEnabled,omitempty" yaml:"networkPolicyEnabled,omitempty"` - NodePools []NodePool `json:"nodePools" yaml:"nodePools"` - PrivateClusterConfig *PrivateClusterConfig `json:"privateClusterConfig,omitempty" yaml:"privateClusterConfig,omitempty"` - ProjectID string `json:"projectID" yaml:"projectID"` - Region string `json:"region" yaml:"region"` - Subnetwork *string `json:"subnetwork,omitempty" yaml:"subnetwork,omitempty"` - Zone string `json:"zone" yaml:"zone"` -} - -// ClusterAddons is the configuration for the ClusterConfig ClusterAddons -type ClusterAddons struct { - HTTPLoadBalancing bool `json:"httpLoadBalancing" yaml:"httpLoadBalancing"` - HorizontalPodAutoscaling bool `json:"horizontalPodAutoscaling" yaml:"horizontalPodAutoscaling"` - NetworkPolicyConfig bool `json:"networkPolicyConfig" yaml:"networkPolicyConfig"` -} - -// IPAllocationPolicy is the configuration for the ClusterConfig IPAllocationPolicy -type IPAllocationPolicy struct { - ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock" yaml:"clusterIpv4CidrBlock"` - ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName" yaml:"clusterSecondaryRangeName"` - CreateSubnetwork bool `json:"createSubnetwork" yaml:"createSubnetwork"` - NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock" yaml:"nodeIpv4CidrBlock"` - ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock" yaml:"servicesIpv4CidrBlock"` - ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName" yaml:"servicesSecondaryRangeName"` - SubnetworkName string `json:"subnetworkName" yaml:"subnetworkName"` - UseIPAliases bool `json:"useIpAliases" yaml:"useIpAliases"` -} - -// MasterAuthorizedNetworksConfig is the configuration for the ClusterConfig MasterAuthorizedNetworksConfig -type MasterAuthorizedNetworksConfig struct { - CidrBlocks []CidrBlock `json:"cidrBlocks" yaml:"cidrBlocks"` - Enabled bool `json:"enabled" yaml:"enabled"` -} - -// CidrBlock is the configuration needed for the MasterAuthorizedNetworksConfig CidrBlock -type CidrBlock struct { - CidrBlock string `json:"cidrBlock" yaml:"cidrBlock"` - DisplayName string `json:"displayName" yaml:"displayName"` -} - -// NodePool is the configuration needed for the ClusterConfig NodePools -type NodePool struct { - Autoscaling *Autoscaling `json:"autoscaling,omitempty" yaml:"autoscaling,omitempty"` - Config *NodeConfig `json:"config,omitempty" yaml:"config,omitempty"` - InitialNodeCount *int64 `json:"initialNodeCount,omitempty" yaml:"initialNodeCount,omitempty"` - Management *NodePoolManagement `json:"management,omitempty" yaml:"management,omitempty"` - MaxPodsConstraint *int64 `json:"maxPodsConstraint,omitempty" yaml:"maxPodsConstraint,omitempty"` - Name *string `json:"name,omitempty" yaml:"name,omitempty"` - Version *string `json:"version,omitempty" yaml:"version,omitempty"` -} - -// Autoscaling is the configuration needed for the NodePool Autoscaling -type Autoscaling struct { - Enabled bool `json:"enabled" yaml:"enabled"` - MaxNodeCount int64 `json:"maxNodeCount" yaml:"maxNodeCount"` - MinNodeCount int64 `json:"minNodeCount" yaml:"minNodeCount"` -} - -// NodeConfig is the configuration needed for the NodePool NodeConfig -type NodeConfig struct { - DiskSizeGb int64 `json:"diskSizeGb" yaml:"diskSizeGb"` - DiskType string `json:"diskType" yaml:"diskType"` - ImageType string `json:"imageType" yaml:"imageType"` - Labels map[string]string `json:"labels" yaml:"labels"` - LocalSsdCount int64 `json:"localSsdCount" yaml:"localSsdCount"` - MachineType string `json:"machineType" yaml:"machineType"` - OauthScopes []string `json:"oauthScopes" yaml:"oauthScopes"` - Preemptible bool `json:"preemptible" yaml:"preemptible"` - Tags []string `json:"tags" yaml:"tags"` - Taints []NodeTaintConfig `json:"taints" yaml:"taints"` -} - -// NodeTaintConfig is the configuration needed for the NodeConfig Taints -type NodeTaintConfig struct { - Effect string `json:"effect" yaml:"effect"` - Key string `json:"key" yaml:"key"` - Value string `json:"value" yaml:"value"` -} - -// NodePoolManagement is the configuration needed for the NodePool Management -type NodePoolManagement struct { - AutoRepair bool `json:"autoRepair" yaml:"autoRepair"` - AutoUpgrade bool `json:"autoUpgrade" yaml:"autoUpgrade"` -} - -// PrivateClusterConfig is the configuration needed for the ClusterConfig PrivateClusterConfig -type PrivateClusterConfig struct { - EnablePrivateEndpoint bool `json:"enablePrivateEndpoint" yaml:"enablePrivateEndpoint"` - EnablePrivateNodes bool `json:"enablePrivateNodes" yaml:"enablePrivateNodes"` - MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock" yaml:"masterIpv4CidrBlock"` -} - -func clusterAddonsBuilder(clusterAddons *ClusterAddons) *management.GKEClusterAddons { - return &management.GKEClusterAddons{ - HTTPLoadBalancing: clusterAddons.HTTPLoadBalancing, - HorizontalPodAutoscaling: clusterAddons.HorizontalPodAutoscaling, - NetworkPolicyConfig: clusterAddons.NetworkPolicyConfig, - } -} - -func ipAllocationPolicyBuilder(ipAllocationPolicy *IPAllocationPolicy) *management.GKEIPAllocationPolicy { - return &management.GKEIPAllocationPolicy{ - ClusterIpv4CidrBlock: ipAllocationPolicy.ClusterIpv4CidrBlock, - ClusterSecondaryRangeName: ipAllocationPolicy.ClusterSecondaryRangeName, - CreateSubnetwork: ipAllocationPolicy.CreateSubnetwork, - NodeIpv4CidrBlock: ipAllocationPolicy.NodeIpv4CidrBlock, - ServicesIpv4CidrBlock: ipAllocationPolicy.NodeIpv4CidrBlock, - ServicesSecondaryRangeName: ipAllocationPolicy.ServicesSecondaryRangeName, - SubnetworkName: ipAllocationPolicy.SubnetworkName, - UseIPAliases: ipAllocationPolicy.UseIPAliases, - } -} - -func masterAuthorizedNetworksConfigBuilder(masterAuthorizedNetworksConfig MasterAuthorizedNetworksConfig) *management.GKEMasterAuthorizedNetworksConfig { - return &management.GKEMasterAuthorizedNetworksConfig{ - Enabled: masterAuthorizedNetworksConfig.Enabled, - CidrBlocks: cidrBlocksBuilder(masterAuthorizedNetworksConfig.CidrBlocks), - } -} - -func cidrBlocksBuilder(cidrBlocks []CidrBlock) []management.GKECidrBlock { - var newCidrBlocks []management.GKECidrBlock - for _, circidrBlock := range cidrBlocks { - gkeCircidrBlock := management.GKECidrBlock{ - CidrBlock: circidrBlock.CidrBlock, - DisplayName: circidrBlock.DisplayName, - } - newCidrBlocks = append(newCidrBlocks, gkeCircidrBlock) - - } - return newCidrBlocks -} - -func nodePoolsBuilder(nodePools []NodePool, kubernetesVersion *string) []management.GKENodePoolConfig { - var gkeNodePoolConfigs []management.GKENodePoolConfig - for _, nodePool := range nodePools { - gkeNodePoolConfig := management.GKENodePoolConfig{ - Autoscaling: autoScallingBuilder(nodePool.Autoscaling), - Config: nodeConfigBuilder(nodePool.Config), - InitialNodeCount: nodePool.InitialNodeCount, - Management: nodePoolManagementBuilder(nodePool.Management), - MaxPodsConstraint: nodePool.MaxPodsConstraint, - Name: nodePool.Name, - Version: kubernetesVersion, - } - - gkeNodePoolConfigs = append(gkeNodePoolConfigs, gkeNodePoolConfig) - } - return gkeNodePoolConfigs -} - -func nodePoolManagementBuilder(nodePoolManagement *NodePoolManagement) *management.GKENodePoolManagement { - return &management.GKENodePoolManagement{ - AutoRepair: nodePoolManagement.AutoRepair, - AutoUpgrade: nodePoolManagement.AutoUpgrade, - } -} - -func nodeConfigBuilder(nodeConfig *NodeConfig) *management.GKENodeConfig { - return &management.GKENodeConfig{ - DiskSizeGb: nodeConfig.DiskSizeGb, - DiskType: nodeConfig.DiskType, - ImageType: nodeConfig.ImageType, - Labels: nodeConfig.Labels, - LocalSsdCount: nodeConfig.LocalSsdCount, - MachineType: nodeConfig.MachineType, - OauthScopes: nodeConfig.OauthScopes, - Preemptible: nodeConfig.Preemptible, - Tags: nodeConfig.Tags, - Taints: taintsBuilder(nodeConfig.Taints), - } -} - -func autoScallingBuilder(autoScalling *Autoscaling) *management.GKENodePoolAutoscaling { - return &management.GKENodePoolAutoscaling{ - Enabled: autoScalling.Enabled, - MaxNodeCount: autoScalling.MaxNodeCount, - MinNodeCount: autoScalling.MinNodeCount, - } -} - -func taintsBuilder(taints []NodeTaintConfig) []management.GKENodeTaintConfig { - var gkeNodeTaintConfigs []management.GKENodeTaintConfig - for _, taint := range taints { - gkeNodeTaintConfig := management.GKENodeTaintConfig{ - Effect: taint.Effect, - Key: taint.Key, - Value: taint.Value, - } - - gkeNodeTaintConfigs = append(gkeNodeTaintConfigs, gkeNodeTaintConfig) - } - - return gkeNodeTaintConfigs -} - -func privateClusterConfigBuilder(privateClusterConfig *PrivateClusterConfig) *management.GKEPrivateClusterConfig { - return &management.GKEPrivateClusterConfig{ - EnablePrivateEndpoint: privateClusterConfig.EnablePrivateEndpoint, - EnablePrivateNodes: privateClusterConfig.EnablePrivateNodes, - MasterIpv4CidrBlock: privateClusterConfig.MasterIpv4CidrBlock, - } -} - -func gkeHostClusterConfig(clusterName, cloudCredentialID string) *management.GKEClusterConfigSpec { - var gkeClusterConfig ClusterConfig - config.LoadConfig(GKEClusterConfigConfigurationFileKey, &gkeClusterConfig) - - return &management.GKEClusterConfigSpec{ - ClusterAddons: clusterAddonsBuilder(gkeClusterConfig.ClusterAddons), - ClusterIpv4CidrBlock: gkeClusterConfig.ClusterIpv4CidrBlock, - ClusterName: clusterName, - EnableKubernetesAlpha: gkeClusterConfig.EnableKubernetesAlpha, - GoogleCredentialSecret: cloudCredentialID, - Imported: false, - IPAllocationPolicy: ipAllocationPolicyBuilder(gkeClusterConfig.IPAllocationPolicy), - KubernetesVersion: gkeClusterConfig.KubernetesVersion, - Labels: &gkeClusterConfig.Labels, - Locations: &gkeClusterConfig.Locations, - LoggingService: gkeClusterConfig.LoggingService, - MaintenanceWindow: gkeClusterConfig.MaintenanceWindow, - MasterAuthorizedNetworksConfig: masterAuthorizedNetworksConfigBuilder(*gkeClusterConfig.MasterAuthorizedNetworksConfig), - MonitoringService: gkeClusterConfig.MonitoringService, - Network: gkeClusterConfig.Network, - NetworkPolicyEnabled: gkeClusterConfig.NetworkPolicyEnabled, - NodePools: nodePoolsBuilder(gkeClusterConfig.NodePools, gkeClusterConfig.KubernetesVersion), - PrivateClusterConfig: privateClusterConfigBuilder(gkeClusterConfig.PrivateClusterConfig), - ProjectID: gkeClusterConfig.ProjectID, - Region: gkeClusterConfig.Region, - Subnetwork: gkeClusterConfig.Subnetwork, - Zone: gkeClusterConfig.Zone, - } -} diff --git a/tests/framework/extensions/clusters/gke/nodepools.go b/tests/framework/extensions/clusters/gke/nodepools.go deleted file mode 100644 index 6030a6ec2c9..00000000000 --- a/tests/framework/extensions/clusters/gke/nodepools.go +++ /dev/null @@ -1,72 +0,0 @@ -package gke - -import ( - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/sirupsen/logrus" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - active = "active" -) - -// updateNodePoolQuantity is a helper method that will update the node pool with the desired quantity. -func updateNodePoolQuantity(client *rancher.Client, cluster *management.Cluster, nodePool *NodePool) (*management.Cluster, error) { - clusterResp, err := client.Management.Cluster.ByID(cluster.ID) - if err != nil { - return nil, err - } - - var gkeConfig = clusterResp.GKEConfig - *gkeConfig.NodePools[0].InitialNodeCount += *nodePool.InitialNodeCount - - gkeHostCluster := &management.Cluster{ - DockerRootDir: "/var/lib/docker", - EnableClusterAlerting: clusterResp.EnableClusterAlerting, - EnableClusterMonitoring: clusterResp.EnableClusterMonitoring, - EnableNetworkPolicy: clusterResp.EnableNetworkPolicy, - GKEConfig: gkeConfig, - Labels: clusterResp.Labels, - Name: clusterResp.Name, - WindowsPreferedCluster: clusterResp.WindowsPreferedCluster, - } - - logrus.Infof("Scaling the node pool to %v total nodes", *gkeConfig.NodePools[0].InitialNodeCount) - updatedCluster, err := client.Management.Cluster.Update(clusterResp, gkeHostCluster) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, 10*time.Minute, func() (done bool, err error) { - clusterResp, err := client.Management.Cluster.ByID(updatedCluster.ID) - if err != nil { - return false, err - } - - if clusterResp.State == active && clusterResp.NodeCount == *gkeConfig.NodePools[0].InitialNodeCount { - return true, nil - } - - return false, nil - }) - if err != nil { - return nil, err - } - - return updatedCluster, nil -} - -// ScalingGKENodePoolsNodes is a helper function that tests scaling of an EKS node pool by adding a new one and then deleting it. -func ScalingGKENodePoolsNodes(client *rancher.Client, cluster *management.Cluster, nodePool *NodePool) (*management.Cluster, error) { - updatedCluster, err := updateNodePoolQuantity(client, cluster, nodePool) - if err != nil { - return nil, err - } - - logrus.Infof("Node pool has been scaled!") - - return updatedCluster, nil -} diff --git a/tests/framework/extensions/clusters/import.go b/tests/framework/extensions/clusters/import.go deleted file mode 100644 index 75cc7c9c3f7..00000000000 --- a/tests/framework/extensions/clusters/import.go +++ /dev/null @@ -1,248 +0,0 @@ -package clusters - -import ( - "context" - "fmt" - "time" - - "github.com/rancher/norman/types" - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/dynamic" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - ext_unstructured "github.com/rancher/rancher/tests/framework/extensions/unstructured" - "github.com/rancher/rancher/tests/framework/pkg/wait" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - - apisV3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/runtime" - kwait "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/rest" -) - -const ( - // rancherShellSettingID is the setting ID that used to grab rancher/shell image - rancherShellSettingID = "shell-image" - // kubeConfig is a basic kubeconfig that uses the pod's service account - kubeConfig = ` -apiVersion: v1 -kind: Config -clusters: -- name: cluster - cluster: - certificate-authority: /run/secrets/kubernetes.io/serviceaccount/ca.crt - server: https://kubernetes.default -contexts: -- name: default - context: - cluster: cluster - user: user -current-context: default -users: -- name: user - user: - tokenFile: /run/secrets/kubernetes.io/serviceaccount/token -` -) - -var ( - importTimeout = int64(60 * 20) -) - -// ImportCluster creates a job using the given rest config that applies the import yaml from the given management cluster. -func ImportCluster(client *rancher.Client, cluster *apisV1.Cluster, rest *rest.Config) error { - // create a sub session to clean up after we apply the manifest - ts := client.Session.NewSession() - defer ts.Cleanup() - - var token management.ClusterRegistrationToken - err := kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - res, err := client.Management.ClusterRegistrationToken.List(&types.ListOpts{Filters: map[string]interface{}{ - "clusterId": cluster.Status.ClusterName, - }}) - if err != nil { - return false, err - } - - if len(res.Data) > 0 && res.Data[0].ManifestURL != "" { - token = res.Data[0] - return true, nil - } - - return false, nil - }) - if err != nil { - return err - } - - downClient, err := dynamic.NewForConfig(ts, rest) - if err != nil { - return err - } - - sa := &corev1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rancher-installer", - }, - } - _, err = downClient.Resource(corev1.SchemeGroupVersion.WithResource("serviceaccounts")).Namespace("kube-system").Create(context.TODO(), ext_unstructured.MustToUnstructured(sa), metav1.CreateOptions{}) - if err != nil { - return err - } - - rb := &rbacv1.ClusterRoleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rancher-install-cluster-admin", - }, - Subjects: []rbacv1.Subject{ - { - Kind: "ServiceAccount", - Name: sa.Name, - Namespace: "kube-system", - }, - }, - RoleRef: rbacv1.RoleRef{ - APIGroup: rbacv1.SchemeGroupVersion.Group, - Kind: "ClusterRole", - Name: "cluster-admin", - }, - } - _, err = downClient.Resource(rbacv1.SchemeGroupVersion.WithResource("clusterrolebindings")).Namespace("").Create(context.TODO(), ext_unstructured.MustToUnstructured(rb), metav1.CreateOptions{}) - if err != nil { - return err - } - - cm := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "kubeconfig", - }, - Data: map[string]string{ - "config": kubeConfig, - }, - } - _, err = downClient.Resource(corev1.SchemeGroupVersion.WithResource("configmaps")).Namespace("kube-system").Create(context.TODO(), ext_unstructured.MustToUnstructured(cm), metav1.CreateOptions{}) - if err != nil { - return err - } - - imageSetting, err := client.Management.Setting.ByID(rancherShellSettingID) - if err != nil { - return err - } - - var user int64 - var group int64 - job := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rancher-import", - }, - Spec: batchv1.JobSpec{ - Template: corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rancher-import", - }, - Spec: corev1.PodSpec{ - RestartPolicy: "Never", - ServiceAccountName: sa.Name, - Containers: []corev1.Container{ - { - Name: "kubectl", - Image: imageSetting.Value, - Command: []string{"/bin/sh", "-c"}, - Args: []string{ - fmt.Sprintf("wget -qO- --tries=10 --no-check-certificate %s | kubectl apply -f - ;", token.ManifestURL), - }, - SecurityContext: &corev1.SecurityContext{ - RunAsUser: &user, - RunAsGroup: &group, - }, - VolumeMounts: []corev1.VolumeMount{ - {Name: "config", MountPath: "/root/.kube/"}, - }, - }, - }, - Volumes: []corev1.Volume{ - { - Name: "config", - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{Name: cm.Name}, - }, - }, - }, - }, - }, - }, - }, - } - _, err = downClient.Resource(batchv1.SchemeGroupVersion.WithResource("jobs")).Namespace("kube-system").Create(context.TODO(), ext_unstructured.MustToUnstructured(job), metav1.CreateOptions{}) - if err != nil { - return err - } - - jobWatch, err := downClient.Resource(batchv1.SchemeGroupVersion.WithResource("jobs")).Namespace("kube-system").Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: fields.OneTermEqualSelector("metadata.name", job.Name).String(), - TimeoutSeconds: &importTimeout, - }) - if err != nil { - return err - } - - err = wait.WatchWait(jobWatch, func(event watch.Event) (bool, error) { - var wj batchv1.Job - _ = runtime.DefaultUnstructuredConverter.FromUnstructured(event.Object.(*unstructured.Unstructured).Object, &wj) - return wj.Status.Succeeded == 1, nil - }) - if err != nil { - return err - } - - return nil -} - -// IsClusterImported is a function to get a boolean value about if the cluster is imported or not. -// For custom and imported clusters the node driver value is different than "imported". -func IsClusterImported(client *rancher.Client, clusterID string) (isImported bool, err error) { - cluster, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return - } - - isImported = cluster.Driver == apisV3.ClusterDriverImported // For imported K3s and RKE2, driver != "imported", for custom and provisioning drive ones = "imported" - - return -} - -// IsImportedClusterReady is basic check function that would be used for the wait.WatchWait func in pkg/wait. -// This functions just waits until an imported cluster becomes ready. -func IsImportedClusterReady(event watch.Event) (ready bool, err error) { - cluster := event.Object.(*apisV1.Cluster) - var readyCondition bool - ready = cluster.Status.Ready - agentDeployed := cluster.Status.AgentDeployed - var numSuccess int - for _, condition := range cluster.Status.Conditions { - if condition.Type == "Ready" && condition.Status == corev1.ConditionTrue { - numSuccess++ - } - if condition.Type == "SystemAccountCreated" && condition.Status == corev1.ConditionTrue { - numSuccess++ - } - if condition.Type == "ServiceAccountSecretsMigrated" && condition.Status == corev1.ConditionTrue { - numSuccess++ - } - } - - if numSuccess == 3 { - readyCondition = true - } - - return ready && readyCondition && agentDeployed, nil -} diff --git a/tests/framework/extensions/clusters/kubernetesversions/all.go b/tests/framework/extensions/clusters/kubernetesversions/all.go deleted file mode 100644 index a9b7f66c53b..00000000000 --- a/tests/framework/extensions/clusters/kubernetesversions/all.go +++ /dev/null @@ -1,289 +0,0 @@ -package kubernetesversions - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "regexp" - "sort" - "strings" - - "github.com/Masterminds/semver/v3" - "github.com/rancher/rancher/tests/framework/clients/rancher" -) - -const ( - rancherVersionSetting = "server-version" - - rke1VersionsSetting = "k8s-versions-current" - rke2ReleasePath = "v1-rke2-release/releases" - k3sReleasePath = "v1-k3s-release/releases" - gkeVersionPath = "meta/gkeVersions" - aksVersionPath = "meta/aksVersions" - eksVersionsFileURL = "raw.githubusercontent.com/rancher/ui/master/lib/shared/addon/utils/amazon.js" - - eksVersionsSliceRegex = `EKS_VERSIONS = \[\s*(.*?)\s*\]\;` - eksVersionsSliceItemsRegex = `(?s)'(.*?)'` -) - -// ListRKE1AllVersions is a function that uses the management client to list and return all RKE1 versions. -func ListRKE1AllVersions(client *rancher.Client) (allAvailableVersions []string, err error) { - setting, err := client.Management.Setting.ByID(rke1VersionsSetting) - if err != nil { - return - } - allAvailableVersions = strings.Split(setting.Value, ",") - - sort.Strings(allAvailableVersions) - - return -} - -// ListRKE2AllVersions is a function that uses the management client and releases endpoint to list and return all RKE2 versions. -func ListRKE2AllVersions(client *rancher.Client) (allAvailableVersions []string, err error) { - setting, err := client.Management.Setting.ByID(rancherVersionSetting) - if err != nil { - return - } - rancherVersion, err := semver.NewVersion(setting.Value) - if err != nil { - return - } - - url := fmt.Sprintf("%s://%s/%s", "http", client.RancherConfig.Host, rke2ReleasePath) - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return - } - bearerToken := fmt.Sprintf("Bearer %s", client.RancherConfig.AdminToken) - req.Header.Add("Authorization", bearerToken) - - bodyBytes, err := getRequest(req, client) - if err != nil { - return - } - - var mapResponse map[string]interface{} - if err = json.Unmarshal([]byte(bodyBytes), &mapResponse); err != nil { - return - } - - releases := mapResponse["data"].([]interface{}) - - allAvailableVersions = sortReleases(rancherVersion, releases) - - sort.Strings(allAvailableVersions) - - return -} - -// ListK3SAllVersions is a function that uses the management client and releases endpoint to list and return all K3s versions. -func ListK3SAllVersions(client *rancher.Client) (allAvailableVersions []string, err error) { - setting, err := client.Management.Setting.ByID(rancherVersionSetting) - if err != nil { - return - } - rancherVersion, err := semver.NewVersion(setting.Value) - if err != nil { - return - } - - url := fmt.Sprintf("%s://%s/%s", "http", client.RancherConfig.Host, k3sReleasePath) - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return - } - bearerToken := fmt.Sprintf("Bearer %s", client.RancherConfig.AdminToken) - req.Header.Add("Authorization", bearerToken) - - bodyBytes, err := getRequest(req, client) - if err != nil { - return - } - - var mapResponse map[string]interface{} - if err = json.Unmarshal([]byte(bodyBytes), &mapResponse); err != nil { - return - } - - releases := mapResponse["data"].([]interface{}) - - allAvailableVersions = sortReleases(rancherVersion, releases) - - sort.Strings(allAvailableVersions) - - return -} - -// ListGKEAllVersions is a function that uses the management client base and gke meta endpoint to list and return all GKE versions. -func ListGKEAllVersions(client *rancher.Client, projectID, cloudCredentialID, zone, region string) (availableVersions []string, err error) { - url := fmt.Sprintf("%s://%s/%s", "https", client.RancherConfig.Host, gkeVersionPath) - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return - } - req.Header.Add("Authorization", "Bearer "+client.RancherConfig.AdminToken) - - q := req.URL.Query() - q.Add("cloudCredentialId", cloudCredentialID) - - if zone != "" { - q.Add("zone", zone) - } else if region != "" { - q.Add("region", region) - } - - q.Add("projectId", projectID) - req.URL.RawQuery = q.Encode() - - bodyBytes, err := getRequest(req, client) - if err != nil { - return - } - - var mapResponse map[string]interface{} - if err = json.Unmarshal([]byte(bodyBytes), &mapResponse); err != nil { - return - } - - validMasterVersionsResponse := mapResponse["validMasterVersions"].([]interface{}) - - for _, version := range validMasterVersionsResponse { - availableVersions = append(availableVersions, version.(string)) - } - - return -} - -// ListAKSAllVersions is a function that uses the management client base and aks meta endpoint to list and return all AKS versions. -func ListAKSAllVersions(client *rancher.Client, cloudCredentialID, region string) (allAvailableVersions []string, err error) { - url := fmt.Sprintf("%s://%s/%s", "https", client.RancherConfig.Host, aksVersionPath) - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return - } - req.Header.Add("Authorization", "Bearer "+client.RancherConfig.AdminToken) - - q := req.URL.Query() - q.Add("cloudCredentialId", cloudCredentialID) - q.Add("region", region) - req.URL.RawQuery = q.Encode() - - bodyBytes, err := getRequest(req, client) - if err != nil { - return - } - - var versionsSlice []interface{} - if err = json.Unmarshal([]byte(bodyBytes), &versionsSlice); err != nil { - return - } - - for _, version := range versionsSlice { - allAvailableVersions = append(allAvailableVersions, version.(string)) - } - - return -} - -// ListEKSAllVersions is a function that uses the management client base and rancher/UI repository to list and return all AKS versions. -func ListEKSAllVersions(client *rancher.Client) (allAvailableVersions []string, err error) { - url := fmt.Sprintf("%s://%s", "https", eksVersionsFileURL) - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return - } - - bodyBytes, err := getRequest(req, client) - if err != nil { - return - } - - r := regexp.MustCompile(eksVersionsSliceRegex) - match := r.FindStringSubmatch(string(bodyBytes)) - if len(match) == 0 { - return - } - versions := match[1] - rx := regexp.MustCompile(eksVersionsSliceItemsRegex) - out := rx.FindAllStringSubmatch(versions, -1) - - for _, version := range out { - if len(version) < 1 { - continue - } - - allAvailableVersions = append(allAvailableVersions, version[1]) - } - - return -} - -// sortReleases is a private function that sorts release structs that are used for K3S and RKE2. -// Sorted versions determined by these conditions: -// 1. Current rancher version is between min and max channel versions -// 2. Release struct has serverArgs and agentArgs not empty fields -// 3. Possible newest version of the minimum channel version -func sortReleases(rancherVersion *semver.Version, releases []interface{}) (allAvailableVersions []string) { - availableVersionsMap := map[string]semver.Version{} - - for _, release := range releases { - _, serverArgsOk := release.(map[string]interface{})["serverArgs"].(map[string]interface{}) - _, agentArgsOk := release.(map[string]interface{})["agentArgs"].(map[string]interface{}) - - if !serverArgsOk || !agentArgsOk { - continue - } - - maxVersion := release.(map[string]interface{})["maxChannelServerVersion"].(string) - minVersion := release.(map[string]interface{})["minChannelServerVersion"].(string) - kubernetesVersion := release.(map[string]interface{})["version"].(string) - - maxRancherVersion, err := semver.NewVersion(strings.TrimPrefix(maxVersion, "v")) - if err != nil { - continue - } - minRancherVersion, err := semver.NewVersion(strings.TrimPrefix(minVersion, "v")) - if err != nil { - continue - } - - releaseKubernetesVersion, err := semver.NewVersion(strings.TrimPrefix(kubernetesVersion, "v")) - if err != nil { - continue - } - - if !rancherVersion.GreaterThan(minRancherVersion) && !rancherVersion.LessThan(maxRancherVersion) { - continue - } - - value, ok := availableVersionsMap[minRancherVersion.String()] - - if !ok || value.LessThan(releaseKubernetesVersion) { - availableVersionsMap[minRancherVersion.String()] = *releaseKubernetesVersion - } - } - - for _, v := range availableVersionsMap { - allAvailableVersions = append(allAvailableVersions, fmt.Sprintf("v"+v.String())) - } - - return -} - -// getRequest is a private function that used to reach external endpoints when the clients aren't usable. -func getRequest(request *http.Request, client *rancher.Client) (bodyBytes []byte, err error) { - resp, err := client.Management.APIBaseClient.Ops.Client.Do(request) - if err != nil { - return - } - defer resp.Body.Close() - - bodyBytes, err = io.ReadAll(resp.Body) - if err != nil { - return - } - - return -} diff --git a/tests/framework/extensions/clusters/kubernetesversions/available.go b/tests/framework/extensions/clusters/kubernetesversions/available.go deleted file mode 100644 index a060e53ff0d..00000000000 --- a/tests/framework/extensions/clusters/kubernetesversions/available.go +++ /dev/null @@ -1,334 +0,0 @@ -package kubernetesversions - -import ( - "fmt" - "sort" - "strings" - - "github.com/Masterminds/semver/v3" - "github.com/pkg/errors" - apiv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v3 "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/sirupsen/logrus" -) - -// ListRKE1AvailableVersions is a function to list and return only available RKE1 versions for a specific cluster. -func ListRKE1AvailableVersions(client *rancher.Client, cluster *v3.Cluster) (availableVersions []string, err error) { - var allAvailableVersions []*semver.Version - allRKE1Versions, err := ListRKE1AllVersions(client) - if err != nil { - return - } - - for _, v := range allRKE1Versions { - rkeVersion, err := semver.NewVersion(strings.TrimPrefix(v, "v")) - if err != nil { - logrus.Errorf("couldn't turn %v to a semantic version", rkeVersion) - continue - } - - allAvailableVersions = append(allAvailableVersions, rkeVersion) - } - - currentVersion, err := semver.NewVersion(strings.TrimPrefix(cluster.RancherKubernetesEngineConfig.Version, "v")) - if err != nil { - return - } - - for _, v := range allAvailableVersions { - if v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - availableVersions = append(availableVersions, fmt.Sprint("v", v.String())) - } - - return -} - -// ListRKE1ImportedAvailableVersions is a function to list and return only available imported RKE1 versions for a specific cluster. -func ListRKE1ImportedAvailableVersions(client *rancher.Client, cluster *v3.Cluster) (availableVersions []string, err error) { - var allAvailableVersions []*semver.Version - allRKE1Versions, err := ListRKE1AllVersions(client) - if err != nil { - return - } - - for _, v := range allRKE1Versions { - rkeVersion, err := semver.NewVersion(strings.TrimPrefix(v, "v")) - if err != nil { - logrus.Errorf("couldn't turn %v to a semantic version", rkeVersion) - continue - } - - allAvailableVersions = append(allAvailableVersions, rkeVersion) - } - - currentVersion, err := semver.NewVersion(strings.TrimPrefix(cluster.Version.GitVersion, "v")) - if err != nil { - return - } - - for _, v := range allAvailableVersions { - if v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - availableVersions = append(availableVersions, fmt.Sprint("v", v.String())) - } - - return -} - -// ListRKE2AvailableVersions is a function to list and return only available RKE2 versions for a specific cluster. -func ListRKE2AvailableVersions(client *rancher.Client, cluster *v1.SteveAPIObject) (availableVersions []string, err error) { - var allAvailableVersions []*semver.Version - allRKE2Versions, err := ListRKE2AllVersions(client) - if err != nil { - return - } - - for _, v := range allRKE2Versions { - rke2Version, err := semver.NewVersion(strings.TrimPrefix(v, "v")) - if err != nil { - logrus.Errorf("couldn't turn %v to a semantic version", rke2Version) - continue - } - - allAvailableVersions = append(allAvailableVersions, rke2Version) - } - - clusterSpec := &apiv1.ClusterSpec{} - err = v1.ConvertToK8sType(cluster.Spec, clusterSpec) - if err != nil { - return - } - - currentVersion, err := semver.NewVersion(strings.TrimPrefix(clusterSpec.KubernetesVersion, "v")) - if err != nil { - return - } - - for _, v := range allAvailableVersions { - if v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - - availableVersions = append(availableVersions, fmt.Sprint("v", v.String())) - } - - return -} - -// ListNormanRKE2AvailableVersions is a function to list and return only available RKE2 versions for an imported specific cluster. -func ListNormanRKE2AvailableVersions(client *rancher.Client, cluster *v3.Cluster) (availableVersions []string, err error) { - var allAvailableVersions []*semver.Version - allRKE2Versions, err := ListRKE2AllVersions(client) - if err != nil { - return - } - - for _, v := range allRKE2Versions { - k3sVersion, err := semver.NewVersion(strings.TrimPrefix(v, "v")) - if err != nil { - logrus.Errorf("couldn't turn %v to a semantic version", k3sVersion) - continue - } - - allAvailableVersions = append(allAvailableVersions, k3sVersion) - } - - currentVersion, err := semver.NewVersion(strings.TrimPrefix(cluster.Rke2Config.Version, "v")) - if err != nil { - return - } - - for _, v := range allAvailableVersions { - if v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - - availableVersions = append(availableVersions, fmt.Sprint("v", v.String())) - } - - return -} - -// ListK3SAvailableVersions is a function to list and return only available K3S versions for a specific cluster. -func ListK3SAvailableVersions(client *rancher.Client, cluster *v1.SteveAPIObject) (availableVersions []string, err error) { - var allAvailableVersions []*semver.Version - allK3sVersions, err := ListK3SAllVersions(client) - if err != nil { - return - } - - for _, v := range allK3sVersions { - rkeVersion, err := semver.NewVersion(strings.TrimPrefix(v, "v")) - if err != nil { - logrus.Errorf("couldn't turn %v to a semantic version", rkeVersion) - continue - } - - allAvailableVersions = append(allAvailableVersions, rkeVersion) - } - - clusterSpec := &apiv1.ClusterSpec{} - err = v1.ConvertToK8sType(cluster.Spec, clusterSpec) - if err != nil { - return - } - - currentVersion, err := semver.NewVersion(strings.TrimPrefix(clusterSpec.KubernetesVersion, "v")) - if err != nil { - return - } - - for _, v := range allAvailableVersions { - if v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - - availableVersions = append(availableVersions, fmt.Sprint("v", v.String())) - } - - return -} - -// ListNormanK3SAvailableVersions is a function to list and return only available K3S versions for an imported specific cluster. -func ListNormanK3SAvailableVersions(client *rancher.Client, cluster *v3.Cluster) (availableVersions []string, err error) { - var allAvailableVersions []*semver.Version - allK3sVersions, err := ListK3SAllVersions(client) - if err != nil { - return - } - - for _, v := range allK3sVersions { - rkeVersion, err := semver.NewVersion(strings.TrimPrefix(v, "v")) - if err != nil { - logrus.Errorf("couldn't turn %v to a semantic version", rkeVersion) - continue - } - - allAvailableVersions = append(allAvailableVersions, rkeVersion) - } - - currentVersion, err := semver.NewVersion(strings.TrimPrefix(cluster.K3sConfig.Version, "v")) - if err != nil { - return - } - - for _, v := range allAvailableVersions { - if v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - - availableVersions = append(availableVersions, fmt.Sprint("v", v.String())) - } - - return -} - -// ListGKEAvailableVersions is a function to list and return only available GKE versions for a specific cluster. -func ListGKEAvailableVersions(client *rancher.Client, cluster *v3.Cluster) (availableVersions []string, err error) { - currentVersion, err := semver.NewVersion(cluster.Version.GitVersion) - if err != nil { - return - } - - if cluster.GKEConfig == nil { - return nil, errors.Wrapf(err, "cluster %s has no gke config", cluster.Name) - } - - var validMasterVersions []*semver.Version - allAvailableVersions, err := ListGKEAllVersions(client, cluster.GKEConfig.ProjectID, cluster.GKEConfig.GoogleCredentialSecret, cluster.GKEConfig.Zone, cluster.GKEConfig.Region) - - for _, version := range allAvailableVersions { - v, err := semver.NewVersion(version) - if err != nil { - continue - } - validMasterVersions = append(validMasterVersions, v) - } - - for _, v := range validMasterVersions { - if v.Minor()-1 > currentVersion.Minor() || v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - availableVersions = append(availableVersions, v.String()) - } - - reverseSlice(availableVersions) - - return -} - -// ListAKSAvailableVersions is a function to list and return only available AKS versions for a specific cluster. -func ListAKSAvailableVersions(client *rancher.Client, cluster *v3.Cluster) (availableVersions []string, err error) { - currentVersion, err := semver.NewVersion(cluster.Version.GitVersion) - if err != nil { - return - } - - var validMasterVersions []*semver.Version - allAvailableVersions, err := ListAKSAllVersions(client, cluster.AKSConfig.AzureCredentialSecret, cluster.AKSConfig.ResourceLocation) - - for _, version := range allAvailableVersions { - v, err := semver.NewVersion(version) - if err != nil { - continue - } - validMasterVersions = append(validMasterVersions, v) - } - - for _, v := range validMasterVersions { - if v.Minor()-1 > currentVersion.Minor() || v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - availableVersions = append(availableVersions, v.String()) - } - - return -} - -// ListEKSAvailableVersions is a function to list and return only available EKS versions for a specific cluster. -func ListEKSAvailableVersions(client *rancher.Client, cluster *v3.Cluster) (availableVersions []string, err error) { - currentVersion, err := semver.NewVersion(cluster.Version.GitVersion) - if err != nil { - return - } - - var validMasterVersions []*semver.Version - - allAvailableVersions, err := ListEKSAllVersions(client) - if err != nil { - return - } - - for _, version := range allAvailableVersions { - v, err := semver.NewVersion(version) - if err != nil { - continue - } - - validMasterVersions = append(validMasterVersions, v) - } - - for _, v := range validMasterVersions { - if v.Minor()-1 > currentVersion.Minor() || v.Compare(currentVersion) == 0 || v.Compare(currentVersion) == -1 { - continue - } - version := fmt.Sprintf("%v.%v", v.Major(), v.Minor()) - availableVersions = append(availableVersions, version) - } - - reverseSlice(availableVersions) - - return -} - -// reverseSlice is a private function that used to rever slice of strings. -func reverseSlice(stringSlice []string) []string { - sort.SliceStable(stringSlice, func(i, j int) bool { return i > j }) - - return stringSlice -} diff --git a/tests/framework/extensions/clusters/kubernetesversions/default.go b/tests/framework/extensions/clusters/kubernetesversions/default.go deleted file mode 100644 index 040327c976f..00000000000 --- a/tests/framework/extensions/clusters/kubernetesversions/default.go +++ /dev/null @@ -1,83 +0,0 @@ -package kubernetesversions - -import ( - "fmt" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/sirupsen/logrus" -) - -// Default is a helper function that returns the latest version if kubernetes version of a specific cluster type -func Default(client *rancher.Client, provider string, kubernetesVersions []string) ([]string, error) { - - switch { - case provider == clusters.RKE1ClusterType.String(): - defaultVersionData, err := client.Management.Setting.ByID("k8s-version") - - if err != nil { - return nil, err - } - - defaultVersion := defaultVersionData.Value - logrus.Infof("default rke1 kubernetes version is: %v", defaultVersion) - - if kubernetesVersions == nil { - kubernetesVersions = append(kubernetesVersions, defaultVersion) - logrus.Infof("no version found in kubernetesVersions; default rke1 kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } else if len(kubernetesVersions) == 0 { - kubernetesVersions = append(kubernetesVersions, defaultVersion) - logrus.Infof("empty list found in kubernetesVersions; default rke1 kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } else if kubernetesVersions[0] == "" { - kubernetesVersions[0] = defaultVersion - logrus.Infof("empty string value found in kubernetesVersions; default rke1 kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } - - case provider == clusters.RKE2ClusterType.String(): - defaultVersionData, err := client.Management.Setting.ByID("rke2-default-version") - - if err != nil { - return nil, err - } - - defaultVersion := `v` + defaultVersionData.Value - logrus.Infof("default rke2 kubernetes version is: %v", defaultVersion) - - if kubernetesVersions == nil { - kubernetesVersions = append(kubernetesVersions, defaultVersion) - logrus.Infof("no version found in kubernetesVersions; default rke2 kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } else if len(kubernetesVersions) == 0 { - kubernetesVersions = append(kubernetesVersions, defaultVersion) - logrus.Infof("empty list found in kubernetesVersions; default rke2 kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } else if kubernetesVersions[0] == "" { - kubernetesVersions[0] = defaultVersion - logrus.Infof("empty string value found in kubernetesVersions; default rke2 kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } - - case provider == clusters.K3SClusterType.String(): - defaultVersionData, err := client.Management.Setting.ByID("k3s-default-version") - - if err != nil { - return nil, err - } - - defaultVersion := `v` + defaultVersionData.Value - logrus.Infof("default k3s kubernetes version is: %v", defaultVersion) - - if kubernetesVersions == nil { - kubernetesVersions = append(kubernetesVersions, defaultVersion) - logrus.Infof("no version found in kubernetesVersions; default k3s kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } else if len(kubernetesVersions) == 0 { - kubernetesVersions = append(kubernetesVersions, defaultVersion) - logrus.Infof("empty list found in kubernetesVersions; default k3s kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } else if kubernetesVersions[0] == "" { - kubernetesVersions[0] = defaultVersion - logrus.Infof("empty string value found in kubernetesVersions; default k3s kubernetes version %v will be used: %v", defaultVersion, kubernetesVersions) - } - - default: - return nil, fmt.Errorf("invalid provider: %v; valid providers: rke1, rke2, k3s", provider) - } - - return kubernetesVersions, nil -} diff --git a/tests/framework/extensions/codecoverage/codecoverage.go b/tests/framework/extensions/codecoverage/codecoverage.go deleted file mode 100644 index 0357c5234d3..00000000000 --- a/tests/framework/extensions/codecoverage/codecoverage.go +++ /dev/null @@ -1,185 +0,0 @@ -package codecoverage - -import ( - "context" - "fmt" - "strings" - "time" - - apiv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/kubeconfig" - "github.com/rancher/rancher/tests/framework/pkg/killserver" - "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" - k8sErrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/dynamic" -) - -var podGroupVersionResource = corev1.SchemeGroupVersion.WithResource("pods") - -const ( - cattleSystemNameSpace = "cattle-system" - localCluster = "local" - rancherCoverFile = "ranchercoverage" - agentCoverFile = "agentcoverage" - outputDir = "cover" -) - -func checkServiceIsRunning(dynamicClient dynamic.Interface) error { - return kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - _, err = dynamicClient.Resource(podGroupVersionResource).Namespace(cattleSystemNameSpace).List(context.Background(), metav1.ListOptions{}) - if k8sErrors.IsInternalError(err) || k8sErrors.IsServiceUnavailable(err) { - return false, nil - } else if err != nil { - return false, err - } - return true, nil - }) -} - -func killTestServices(client *rancher.Client, clusterID string, podNames []string) error { - cmd := []string{ - "/bin/sh", - "-c", - fmt.Sprintf("curl -s localhost%s", killserver.Port), - } - - kubeConfig, err := kubeconfig.GetKubeconfig(client, clusterID) - if err != nil { - return err - } - - restConfig, err := (*kubeConfig).ClientConfig() - if err != nil { - return err - } - - for _, podName := range podNames { - _, err := kubeconfig.KubectlExec(restConfig, podName, cattleSystemNameSpace, cmd) - if err != nil { - logrus.Errorf("error killing pod container %v", err) - } - } - - return nil -} - -func retrieveCodeCoverageFile(client *rancher.Client, clusterID, coverageFilename string, podNames []string) error { - kubeConfig, err := kubeconfig.GetKubeconfig(client, clusterID) - if err != nil { - return err - } - - restConfig, err := (*kubeConfig).ClientConfig() - if err != nil { - return err - } - - for _, podName := range podNames { - fileName := fmt.Sprintf("%s%s", podName, coverageFilename) - dst := fmt.Sprintf("%s/%s", outputDir, fileName) - - err := kubeconfig.CopyFileFromPod(restConfig, *kubeConfig, podName, cattleSystemNameSpace, coverageFilename, dst) - if err != nil { - return err - } - } - - return nil -} - -// KillRancherTestServicesRetrieveCoverage is a function that kills the rancher service of the local cluster -// inorder for the code coverage report to be written, and then copies over the coverage reports from the pods -// to a local destination. The custom code coverage rancher image must be running in the local cluster. -func KillRancherTestServicesRetrieveCoverage(client *rancher.Client) error { - var podNames []string - dynamicClient, err := client.GetRancherDynamicClient() - if err != nil { - return err - } - - pods, err := dynamicClient.Resource(podGroupVersionResource).Namespace(cattleSystemNameSpace).List(context.Background(), metav1.ListOptions{}) - if err != nil { - return err - } - - for _, pod := range pods.Items { - name := pod.GetName() - if strings.Contains(name, "rancher") && !strings.Contains(name, "webhook") { - podNames = append(podNames, pod.GetName()) - } - } - - err = killTestServices(client, localCluster, podNames) - if err != nil { - return err - } - - err = checkServiceIsRunning(dynamicClient) - if err != nil { - return err - } - - return retrieveCodeCoverageFile(client, localCluster, rancherCoverFile, podNames) -} - -// KillAgentTestServicesRetrieveCoverage is a function that kills the cattle-cluster-agent service of a downstream cluster -// inorder for the code coverage report to be written, and then copies over the coverage reports from the pods -// to a local destination. The custom code coverage rancher-agent image must be running in the downstream cluster. -func KillAgentTestServicesRetrieveCoverage(client *rancher.Client) error { - clusters, err := client.Steve.SteveType(clusters.ProvisioningSteveResourceType).ListAll(nil) - if err != nil { - return err - } - - for _, cluster := range clusters.Data { - clusterStatus := &apiv1.ClusterStatus{} - err = v1.ConvertToK8sType(cluster.Status, clusterStatus) - if err != nil { - return err - } - clusterID := clusterStatus.ClusterName - if clusterID != localCluster { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - logrus.Errorf("could not connect to downstream cluster") - continue - } - - pods, err := dynamicClient.Resource(podGroupVersionResource).Namespace(cattleSystemNameSpace).List(context.Background(), metav1.ListOptions{}) - if err != nil { - logrus.Errorf("could not list pods") - continue - } - - var podNames []string - for _, pod := range pods.Items { - if strings.Contains(pod.GetName(), "cattle-cluster-agent") { - podNames = append(podNames, pod.GetName()) - } - } - - err = killTestServices(client, clusterID, podNames) - if err != nil { - return err - } - - err = checkServiceIsRunning(dynamicClient) - if err != nil { - return err - } - - err = retrieveCodeCoverageFile(client, clusterID, agentCoverFile, podNames) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/tests/framework/extensions/configmaps/configmaps.go b/tests/framework/extensions/configmaps/configmaps.go deleted file mode 100644 index 36cca3a8ebc..00000000000 --- a/tests/framework/extensions/configmaps/configmaps.go +++ /dev/null @@ -1,16 +0,0 @@ -package configmaps - -import ( - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - ConfigMapSteveType = "configmap" -) - -type SteveConfigMap struct { - metav1.TypeMeta `json:",inline"` - steveV1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Data map[string]any `json:"data"` -} diff --git a/tests/framework/extensions/defaults/defaults.go b/tests/framework/extensions/defaults/defaults.go deleted file mode 100644 index 572d8d969e8..00000000000 --- a/tests/framework/extensions/defaults/defaults.go +++ /dev/null @@ -1,11 +0,0 @@ -package defaults - -import "time" - -var ( - WatchTimeoutSeconds = int64(60 * 30) // 30 minutes. - FiveMinuteTimeout = 5 * time.Minute - TenMinuteTimeout = 10 * time.Minute - FifteenMinuteTimeout = 15 * time.Minute - ThirtyMinuteTimeout = 30 * time.Minute -) diff --git a/tests/framework/extensions/etcdsnapshot/config.go b/tests/framework/extensions/etcdsnapshot/config.go deleted file mode 100644 index f9928f03558..00000000000 --- a/tests/framework/extensions/etcdsnapshot/config.go +++ /dev/null @@ -1,15 +0,0 @@ -package etcdsnapshot - -const ( - ConfigurationFileKey = "snapshotInput" -) - -type Config struct { - UpgradeKubernetesVersion string `json:"upgradeKubernetesVersion" yaml:"upgradeKubernetesVersion"` - SnapshotRestore string `json:"snapshotRestore" yaml:"snapshotRestore"` - ControlPlaneConcurrencyValue string `json:"controlPlaneConcurrencyValue" yaml:"controlPlaneConcurrencyValue"` - ControlPlaneUnavailableValue string `json:"controlPlaneUnavailableValue" yaml:"controlPlaneUnavailableValue"` - WorkerConcurrencyValue string `json:"workerConcurrencyValue" yaml:"workerConcurrencyValue"` - WorkerUnavailableValue string `json:"workerUnavailableValue" yaml:"workerUnavailableValue"` - RecurringRestores int `json:"recurringRestores" yaml:"recurringRestores"` -} diff --git a/tests/framework/extensions/etcdsnapshot/etcdsnapshot.go b/tests/framework/extensions/etcdsnapshot/etcdsnapshot.go deleted file mode 100644 index 046de6f87e1..00000000000 --- a/tests/framework/extensions/etcdsnapshot/etcdsnapshot.go +++ /dev/null @@ -1,242 +0,0 @@ -package etcdsnapshot - -import ( - "strings" - "time" - - "github.com/rancher/norman/types" - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - ProvisioningSteveResouceType = "provisioning.cattle.io.cluster" - fleetNamespace = "fleet-default" - active = "active" -) - -func MatchNodeToAnyEtcdRole(client *rancher.Client, clusterID string) (int, *management.Node) { - machines, err := client.Management.Node.List(&types.ListOpts{Filters: map[string]interface{}{ - "clusterId": clusterID, - }}) - if err != nil { - return 0, nil - } - - numOfNodes := 0 - lastMatchingNode := &management.Node{} - - for _, machine := range machines.Data { - if machine.Etcd { - lastMatchingNode = &machine - numOfNodes++ - } - } - - return numOfNodes, lastMatchingNode -} - -// GetRKE1Snapshots is a helper function to get the existing snapshots for a downstream RKE1 cluster. -func GetRKE1Snapshots(client *rancher.Client, clusterName string) ([]string, error) { - clusterID, err := clusters.GetClusterIDByName(client, clusterName) - if err != nil { - return nil, err - } - - snapshotSteveObjList, err := client.Management.EtcdBackup.ListAll(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": clusterID, - }, - }) - if err != nil { - return nil, err - } - - snapshots := []string{} - for _, snapshot := range snapshotSteveObjList.Data { - if strings.Contains(snapshot.Name, clusterID) { - snapshots = append(snapshots, snapshot.ID) - } - } - - return snapshots, nil -} - -// GetRKE2K3SSnapshots is a helper function to get the existing snapshots for a downstream RKE2/K3S cluster. -func GetRKE2K3SSnapshots(client *rancher.Client, localclusterID string, clusterName string) ([]string, error) { - steveclient, err := client.Steve.ProxyDownstream(localclusterID) - if err != nil { - return nil, err - } - - snapshotSteveObjList, err := steveclient.SteveType("rke.cattle.io.etcdsnapshot").List(nil) - if err != nil { - return nil, err - } - - snapshots := []string{} - for _, snapshot := range snapshotSteveObjList.Data { - if strings.Contains(snapshot.ObjectMeta.Name, clusterName) { - snapshots = append(snapshots, snapshot.Name) - } - } - - return snapshots, nil -} - -// CreateRKE1Snapshot is a helper function to create a snapshot on an RKE1 cluster. Returns error if any. -func CreateRKE1Snapshot(client *rancher.Client, clusterName string) error { - clusterID, err := clusters.GetClusterIDByName(client, clusterName) - if err != nil { - return err - } - - clusterResp, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return err - } - - logrus.Infof("Creating snapshot...") - err = client.Management.Cluster.ActionBackupEtcd(clusterResp) - if err != nil { - return err - } - - err = wait.Poll(1*time.Second, defaults.FiveMinuteTimeout, func() (bool, error) { - snapshotSteveObjList, err := client.Management.EtcdBackup.ListAll(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": clusterID, - }, - }) - if err != nil { - return false, nil - } - - for _, snapshot := range snapshotSteveObjList.Data { - snapshotObj, err := client.Management.EtcdBackup.ByID(snapshot.ID) - if err != nil { - return false, nil - } - - if snapshotObj.State != active { - return false, nil - } - } - - logrus.Infof("All snapshots in the cluster are in an active state!") - return true, nil - }) - if err != nil { - return err - } - - return nil -} - -// CreateRKE2K3SSnapshot is a helper function to create a snapshot on an RKE2 or k3s cluster. Returns error if any. -func CreateRKE2K3SSnapshot(client *rancher.Client, clusterName string) error { - clusterObject, clusterSteveObject, err := clusters.GetProvisioningClusterByName(client, clusterName, fleetNamespace) - if err != nil { - return err - } - - if clusterObject.Spec.RKEConfig != nil { - if clusterObject.Spec.RKEConfig.ETCDSnapshotCreate == nil { - clusterObject.Spec.RKEConfig.ETCDSnapshotCreate = &rkev1.ETCDSnapshotCreate{ - Generation: 1, - } - } else { - clusterObject.Spec.RKEConfig.ETCDSnapshotCreate = &rkev1.ETCDSnapshotCreate{ - Generation: clusterObject.Spec.RKEConfig.ETCDSnapshotCreate.Generation + 1, - } - } - } else { - clusterObject.Spec.RKEConfig = &apisV1.RKEConfig{ - ETCDSnapshotCreate: &rkev1.ETCDSnapshotCreate{ - Generation: 1, - }, - } - } - - logrus.Infof("Creating snapshot...") - _, err = client.Steve.SteveType(clusters.ProvisioningSteveResourceType).Update(clusterSteveObject, clusterObject) - if err != nil { - return err - } - - err = wait.Poll(1*time.Second, defaults.FiveMinuteTimeout, func() (bool, error) { - snapshotSteveObjList, err := client.Steve.SteveType("rke.cattle.io.etcdsnapshot").List(nil) - if err != nil { - return false, nil - } - - _, clusterSteveObject, err := clusters.GetProvisioningClusterByName(client, clusterName, fleetNamespace) - if err != nil { - return false, nil - } - - for _, snapshot := range snapshotSteveObjList.Data { - snapshotObj, err := client.Steve.SteveType("rke.cattle.io.etcdsnapshot").ByID(snapshot.ID) - if err != nil { - return false, nil - } - - if snapshotObj.ObjectMeta.State.Name == active && clusterSteveObject.ObjectMeta.State.Name == active { - logrus.Infof("All snapshots in the cluster are in an active state!") - return true, nil - } - } - - return false, nil - }) - if err != nil { - return err - } - - return nil -} - -// RestoreRKE1Snapshot is a helper function to restore a snapshot on an RKE1 cluster. Returns error if any. -func RestoreRKE1Snapshot(client *rancher.Client, clusterName string, snapshotRestore *management.RestoreFromEtcdBackupInput) error { - clusterID, err := clusters.GetClusterIDByName(client, clusterName) - if err != nil { - return err - } - - clusterResp, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return err - } - - logrus.Infof("Restoring snapshot: %v", snapshotRestore.EtcdBackupID) - err = client.Management.Cluster.ActionRestoreFromEtcdBackup(clusterResp, snapshotRestore) - if err != nil { - return err - } - - return nil -} - -// CreateRKE2K3SSnapshot is a helper function to restore a snapshot on an RKE2 or k3s cluster. Returns error if any. -func RestoreRKE2K3SSnapshot(client *rancher.Client, clusterName string, snapshotRestore *rkev1.ETCDSnapshotRestore) error { - clusterObject, existingSteveAPIObject, err := clusters.GetProvisioningClusterByName(client, clusterName, fleetNamespace) - if err != nil { - return err - } - - clusterObject.Spec.RKEConfig.ETCDSnapshotRestore = snapshotRestore - - logrus.Infof("Restoring snapshot: %v", snapshotRestore.Name) - _, err = client.Steve.SteveType(ProvisioningSteveResouceType).Update(existingSteveAPIObject, clusterObject) - if err != nil { - return err - } - - return nil -} diff --git a/tests/framework/extensions/hardening/k3s/audit.yaml b/tests/framework/extensions/hardening/k3s/audit.yaml deleted file mode 100644 index 9ec0d3c11a0..00000000000 --- a/tests/framework/extensions/hardening/k3s/audit.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: audit.k8s.io/v1 -kind: Policy -rules: -- level: Metadata \ No newline at end of file diff --git a/tests/framework/extensions/hardening/k3s/harden_nodes.go b/tests/framework/extensions/hardening/k3s/harden_nodes.go deleted file mode 100644 index b03eaa4d77f..00000000000 --- a/tests/framework/extensions/hardening/k3s/harden_nodes.go +++ /dev/null @@ -1,106 +0,0 @@ -package hardening - -import ( - "os/user" - "path/filepath" - "strings" - - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/nodes" - "github.com/sirupsen/logrus" -) - -func HardenNodes(nodes []*nodes.Node, nodeRoles []string, kubeVersion string) error { - logrus.Infof("Starting to harden nodes") - for key, node := range nodes { - logrus.Infof("Setting kernel parameters on node %s", node.NodeID) - _, err := node.ExecuteCommand("sudo bash -c 'echo vm.panic_on_oom=0 >> /etc/sysctl.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'echo kernel.panic=10 >> /etc/sysctl.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'echo kernel.panic_on_oops=1 >> /etc/sysctl.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'echo kernel.keys.root_maxbytes=25000000 >> /etc/sysctl.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'sysctl -p /etc/sysctl.conf'") - if err != nil { - return err - } - - if strings.Contains(nodeRoles[key], "--controlplane") { - logrus.Infof("Copying over files to node %s", node.NodeID) - user, err := user.Current() - if err != nil { - return nil - } - - dirPath := filepath.Join(user.HomeDir, "go/src/github.com/rancher/rancher/tests/framework/extensions/hardening/k3s") - err = node.SCPFileToNode(dirPath+"/audit.yaml", "/home/"+node.SSHUser+"/audit.yaml") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'mv /home/" + node.SSHUser + "/audit.yaml /var/lib/rancher/k3s/server/audit.yaml'") - if err != nil { - return err - } - - if kubeVersion <= string(provisioninginput.PSPKubeVersionLimit) { - err = node.SCPFileToNode(dirPath+"/psp.yaml", "/home/"+node.SSHUser+"/psp.yaml") - if err != nil { - return err - } - - err = node.SCPFileToNode(dirPath+"/system-policy.yaml", "/home/"+node.SSHUser+"/system-policy.yaml") - if err != nil { - return err - } - - logrus.Infof("Applying hardened YAML files to node: %s", node.NodeID) - _, err = node.ExecuteCommand("sudo bash -c 'mv /home/" + node.SSHUser + "/psp.yaml /var/lib/rancher/k3s/psp.yaml'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'mv /home/" + node.SSHUser + "/system-policy.yaml /var/lib/rancher/k3s/system-policy.yaml'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'export KUBECONFIG=/etc/rancher/k3s/k3s.yaml && kubectl apply -f /var/lib/rancher/k3s/psp.yaml'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'export KUBECONFIG=/etc/rancher/k3s/k3s.yaml && kubectl apply -f /var/lib/rancher/k3s/system-policy.yaml'") - if err != nil { - return err - } - } else { - err = node.SCPFileToNode(dirPath+"/psa.yaml", "/home/"+node.SSHUser+"/psa.yaml") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'mv /home/" + node.SSHUser + "/psa.yaml /var/lib/rancher/k3s/server/psa.yaml'") - if err != nil { - return err - } - } - } - } - - return nil -} diff --git a/tests/framework/extensions/hardening/k3s/psa.yaml b/tests/framework/extensions/hardening/k3s/psa.yaml deleted file mode 100644 index 7ca145739af..00000000000 --- a/tests/framework/extensions/hardening/k3s/psa.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: apiserver.config.k8s.io/v1 -kind: AdmissionConfiguration -plugins: -- name: PodSecurity - configuration: - apiVersion: pod-security.admission.config.k8s.io/v1beta1 - kind: PodSecurityConfiguration - defaults: - enforce: "privileged" - enforce-version: "latest" - audit: "privileged" - audit-version: "latest" - warn: "privileged" - warn-version: "latest" - exemptions: - usernames: [] - runtimeClasses: [] - namespaces: [] \ No newline at end of file diff --git a/tests/framework/extensions/hardening/k3s/psp.yaml b/tests/framework/extensions/hardening/k3s/psp.yaml deleted file mode 100644 index 851992190d1..00000000000 --- a/tests/framework/extensions/hardening/k3s/psp.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: restricted-psp -spec: - privileged: false # CIS - 5.2.1 - allowPrivilegeEscalation: false # CIS - 5.2.5 - requiredDropCapabilities: # CIS - 5.2.7/8/9 - - ALL - volumes: - - 'configMap' - - 'emptyDir' - - 'projected' - - 'secret' - - 'downwardAPI' - - 'csi' - - 'persistentVolumeClaim' - - 'ephemeral' - hostNetwork: false # CIS - 5.2.4 - hostIPC: false # CIS - 5.2.3 - hostPID: false # CIS - 5.2.2 - runAsUser: - rule: 'MustRunAsNonRoot' # CIS - 5.2.6 - seLinux: - rule: 'RunAsAny' - supplementalGroups: - rule: 'MustRunAs' - ranges: - - min: 1 - max: 65535 - fsGroup: - rule: 'MustRunAs' - ranges: - - min: 1 - max: 65535 - readOnlyRootFilesystem: false \ No newline at end of file diff --git a/tests/framework/extensions/hardening/k3s/system-policy.yaml b/tests/framework/extensions/hardening/k3s/system-policy.yaml deleted file mode 100644 index 7f98fcd36ba..00000000000 --- a/tests/framework/extensions/hardening/k3s/system-policy.yaml +++ /dev/null @@ -1,117 +0,0 @@ -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: restricted-psp -spec: - privileged: false - allowPrivilegeEscalation: false - requiredDropCapabilities: - - ALL - volumes: - - 'configMap' - - 'emptyDir' - - 'projected' - - 'secret' - - 'downwardAPI' - - 'csi' - - 'persistentVolumeClaim' - - 'ephemeral' - hostNetwork: false - hostIPC: false - hostPID: false - runAsUser: - rule: 'MustRunAsNonRoot' - seLinux: - rule: 'RunAsAny' - supplementalGroups: - rule: 'MustRunAs' - ranges: - - min: 1 - max: 65535 - fsGroup: - rule: 'MustRunAs' - ranges: - - min: 1 - max: 65535 - readOnlyRootFilesystem: false ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: psp:restricted-psp - labels: - addonmanager.kubernetes.io/mode: EnsureExists -rules: -- apiGroups: ['extensions'] - resources: ['podsecuritypolicies'] - verbs: ['use'] - resourceNames: - - restricted-psp ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: default:restricted-psp - labels: - addonmanager.kubernetes.io/mode: EnsureExists -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: psp:restricted-psp -subjects: -- kind: Group - name: system:authenticated - apiGroup: rbac.authorization.k8s.io ---- -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: system-unrestricted-psp -spec: - allowPrivilegeEscalation: true - allowedCapabilities: - - '*' - fsGroup: - rule: RunAsAny - hostIPC: true - hostNetwork: true - hostPID: true - hostPorts: - - max: 65535 - min: 0 - privileged: true - runAsUser: - rule: RunAsAny - seLinux: - rule: RunAsAny - supplementalGroups: - rule: RunAsAny - volumes: - - '*' ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: system-unrestricted-node-psp-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system-unrestricted-psp-role -subjects: -- apiGroup: rbac.authorization.k8s.io - kind: Group - name: system:nodes ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: system-unrestricted-psp-role -rules: -- apiGroups: - - policy - resourceNames: - - system-unrestricted-psp - resources: - - podsecuritypolicies - verbs: - - use \ No newline at end of file diff --git a/tests/framework/extensions/hardening/rke2/account-update.sh b/tests/framework/extensions/hardening/rke2/account-update.sh deleted file mode 100644 index e723d0fe145..00000000000 --- a/tests/framework/extensions/hardening/rke2/account-update.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -e - -for namespace in $(kubectl get namespaces -A -o=jsonpath="{.items[*]['metadata.name']}"); do - echo -n "Patching namespace $namespace - " - kubectl patch serviceaccount default -n ${namespace} -p "$(cat /var/lib/rancher/rke2/server/account-update.yaml)" -done \ No newline at end of file diff --git a/tests/framework/extensions/hardening/rke2/account-update.yaml b/tests/framework/extensions/hardening/rke2/account-update.yaml deleted file mode 100644 index 7176ccb9928..00000000000 --- a/tests/framework/extensions/hardening/rke2/account-update.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: default -automountServiceAccountToken: false \ No newline at end of file diff --git a/tests/framework/extensions/hardening/rke2/harden_nodes.go b/tests/framework/extensions/hardening/rke2/harden_nodes.go deleted file mode 100644 index 8d3c4f87713..00000000000 --- a/tests/framework/extensions/hardening/rke2/harden_nodes.go +++ /dev/null @@ -1,88 +0,0 @@ -package hardening - -import ( - "os/user" - "path/filepath" - "strings" - - "github.com/rancher/rancher/tests/framework/pkg/nodes" - "github.com/sirupsen/logrus" -) - -func HardenNodes(nodes []*nodes.Node, nodeRoles []string) error { - logrus.Infof("Starting to harden nodes") - for key, node := range nodes { - logrus.Infof("Setting kernel parameters on node %s", node.NodeID) - _, err := node.ExecuteCommand("sudo bash -c 'echo vm.panic_on_oom=0 >> /etc/sysctl.d/90-kubelet.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'echo vm.overcommit_memory=1 >> /etc/sysctl.d/90-kubelet.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'echo kernel.panic=10 >> /etc/sysctl.d/90-kubelet.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'echo kernel.panic_on_oops=1 >> /etc/sysctl.d/90-kubelet.conf'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'sysctl -p /etc/sysctl.d/90-kubelet.conf'") - if err != nil { - return err - } - - if strings.Contains(nodeRoles[key], "--etcd") { - _, err = node.ExecuteCommand("sudo useradd -r -c \"etcd user\" -s /sbin/nologin -M etcd -U") - if err != nil { - return err - } - } - - if strings.Contains(nodeRoles[key], "--controlplane") { - logrus.Infof("Copying over files to node %s", node.NodeID) - user, err := user.Current() - if err != nil { - return nil - } - - dirPath := filepath.Join(user.HomeDir, "go/src/github.com/rancher/rancher/tests/framework/extensions/hardening/rke2") - err = node.SCPFileToNode(dirPath+"/account-update.yaml", "/home/"+node.SSHUser+"/account-update.yaml") - if err != nil { - return err - } - - err = node.SCPFileToNode(dirPath+"/account-update.sh", "/home/"+node.SSHUser+"/account-update.sh") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'mv /home/" + node.SSHUser + "/account-update.yaml /var/lib/rancher/rke2/server/account-update.yaml'") - if err != nil { - return err - } - _, err = node.ExecuteCommand("sudo bash -c 'mv /home/" + node.SSHUser + "/account-update.sh /var/lib/rancher/rke2/server/account-update.sh'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'chmod +x /var/lib/rancher/rke2/server/account-update.sh'") - if err != nil { - return err - } - - _, err = node.ExecuteCommand("sudo bash -c 'export KUBECONFIG=/etc/rancher/rke2/rke2.yaml && /var/lib/rancher/rke2/server/account-update.sh'") - if err != nil { - return err - } - } - } - - return nil -} diff --git a/tests/framework/extensions/ingresses/ingresses.go b/tests/framework/extensions/ingresses/ingresses.go deleted file mode 100644 index 2d12ddfb431..00000000000 --- a/tests/framework/extensions/ingresses/ingresses.go +++ /dev/null @@ -1,101 +0,0 @@ -package ingresses - -import ( - "fmt" - "net/http" - "strings" - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - "github.com/sirupsen/logrus" - networking "k8s.io/api/networking/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - IngressSteveType = "networking.k8s.io.ingress" - pod = "pod" - IngressNginx = "ingress-nginx" - RancherWebhook = "rancher-webhook" -) - -// GetExternalIngressResponse gets a response from a specific hostname and path. -// Returns the response and an error if any. -func GetExternalIngressResponse(client *rancher.Client, hostname string, path string, isWithTLS bool) (*http.Response, error) { - protocol := "http" - - if isWithTLS { - protocol = "https" - } - - url := fmt.Sprintf("%s://%s/%s", protocol, hostname, path) - - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - - req.Header.Add("Authorization", "Bearer "+client.RancherConfig.AdminToken) - - resp, err := client.Management.APIBaseClient.Ops.Client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - return resp, nil -} - -// IsIngressExternallyAccessible checks if the ingress is accessible externally, -// it returns true if the ingress is accessible, false if it is not, and an error if there is an error. -func IsIngressExternallyAccessible(client *rancher.Client, hostname string, path string, isWithTLS bool) (bool, error) { - resp, err := GetExternalIngressResponse(client, hostname, path, isWithTLS) - if err != nil { - return false, err - } - - return resp.StatusCode == http.StatusOK, nil -} - -// CreateIngress will create an Ingress object in the downstream cluster. -func CreateIngress(client *v1.Client, ingressName string, ingressTemplate networking.Ingress) (*v1.SteveAPIObject, error) { - podClient := client.SteveType(pod) - err := kwait.Poll(15*time.Second, defaults.FiveMinuteTimeout, func() (done bool, err error) { - newPods, err := podClient.List(nil) - if err != nil { - return false, nil - } - if len(newPods.Data) != 0 { - return true, nil - } - for _, pod := range newPods.Data { - if strings.Contains(pod.Name, IngressNginx) || strings.Contains(pod.Name, RancherWebhook) { - isReady, podError := pods.IsPodReady(&pod) - - if podError != nil { - return false, nil - } - - return isReady, nil - } - } - return false, nil - }) - if err != nil { - return nil, err - } - - logrus.Infof("Create Ingress: %v", ingressName) - ingressResp, err := client.SteveType(IngressSteveType).Create(ingressTemplate) - if err != nil { - logrus.Errorf("Failed to create ingress: %v", err) - return nil, err - } - - logrus.Infof("Successfully created ingress: %v", ingressName) - - return ingressResp, err -} diff --git a/tests/framework/extensions/ingresses/template.go b/tests/framework/extensions/ingresses/template.go deleted file mode 100644 index a81d19fb6a5..00000000000 --- a/tests/framework/extensions/ingresses/template.go +++ /dev/null @@ -1,43 +0,0 @@ -package ingresses - -import ( - networkingv1 "k8s.io/api/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NewIngressTemplate is a constructor that creates the ingress template for ingresses -func NewIngressTemplate(ingressName, namespaceName string, hostName string, paths []networkingv1.HTTPIngressPath) networkingv1.Ingress { - return networkingv1.Ingress{ - ObjectMeta: metav1.ObjectMeta{ - Name: ingressName, - Namespace: namespaceName, - }, - Spec: networkingv1.IngressSpec{ - Rules: []networkingv1.IngressRule{ - { - Host: hostName, - IngressRuleValue: networkingv1.IngressRuleValue{ - HTTP: &networkingv1.HTTPIngressRuleValue{ - Paths: paths, - }, - }, - }, - }, - }, - } -} - -func NewIngressPathTemplate(pathType networkingv1.PathType, path string, serviceName string, servicePort int32) networkingv1.HTTPIngressPath { - return networkingv1.HTTPIngressPath{ - Path: path, - PathType: &pathType, - Backend: networkingv1.IngressBackend{ - Service: &networkingv1.IngressServiceBackend{ - Name: serviceName, - Port: networkingv1.ServiceBackendPort{ - Number: servicePort, - }, - }, - }, - } -} diff --git a/tests/framework/extensions/kubeapi/authorization/authorization.go b/tests/framework/extensions/kubeapi/authorization/authorization.go deleted file mode 100644 index 071701897b8..00000000000 --- a/tests/framework/extensions/kubeapi/authorization/authorization.go +++ /dev/null @@ -1,67 +0,0 @@ -package authorization - -import ( - "context" - "fmt" - "time" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - authzv1 "k8s.io/api/authorization/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -// WaitForAllowed verifies access to resources using the SelfSubjectAccessReview -// API. It returns nil when all have been granted within some defined timeout, -// otherwise it returns an error. -func WaitForAllowed(client *rancher.Client, clusterID string, attrs []*authzv1.ResourceAttributes) error { - // 40 seconds ought to do it - backoff := kwait.Backoff{ - Duration: 500 * time.Millisecond, - Factor: 1, - Jitter: 0, - Steps: 81, - } - err := kwait.ExponentialBackoff(backoff, func() (done bool, err error) { - for _, attr := range attrs { - selfReview := &authzv1.SelfSubjectAccessReview{ - Spec: authzv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: attr, - }, - } - - selfSARResource, err := kubeapi.ResourceForClient(client, clusterID, "", schema.GroupVersionResource{ - Group: "authorization.k8s.io", - Version: "v1", - Resource: "selfsubjectaccessreviews", - }) - if err != nil { - return false, err - } - - respUnstructured, err := selfSARResource.Create(context.TODO(), unstructured.MustToUnstructured(selfReview), metav1.CreateOptions{}) - if err != nil { - return false, nil - } - - selfReviewResp := &authzv1.SelfSubjectAccessReview{} - err = scheme.Scheme.Convert(respUnstructured, selfReviewResp, respUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - - if !selfReviewResp.Status.Allowed { - return false, nil - } - } - return true, nil - }) - if err != nil { - return fmt.Errorf("not all access were granted: %w", err) - } - return nil -} diff --git a/tests/framework/extensions/kubeapi/cluster/summary.go b/tests/framework/extensions/kubeapi/cluster/summary.go deleted file mode 100644 index 0c952e6e275..00000000000 --- a/tests/framework/extensions/kubeapi/cluster/summary.go +++ /dev/null @@ -1,27 +0,0 @@ -package cluster - -import ( - "context" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/wrangler/pkg/summary" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// IsClusterActive is a helper function that uses the dynamic client to return cluster's ready state. -func IsClusterActive(client *rancher.Client, clusterID string) (ready bool, err error) { - dynamic, err := client.GetRancherDynamicClient() - if err != nil { - return - } - - unstructuredCluster, err := dynamic.Resource(schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusters"}).Get(context.TODO(), clusterID, metav1.GetOptions{}) - if err != nil { - return - } - - summarized := summary.Summarize(unstructuredCluster) - - return summarized.IsReady(), nil -} diff --git a/tests/framework/extensions/kubeapi/configmaps/configmaps.go b/tests/framework/extensions/kubeapi/configmaps/configmaps.go deleted file mode 100644 index 2aebf75fc74..00000000000 --- a/tests/framework/extensions/kubeapi/configmaps/configmaps.go +++ /dev/null @@ -1,55 +0,0 @@ -package configmaps - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - coreV1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// ConfigMapGroupVersionResource is the required Group Version Resource for accessing config maps in a cluster, -// using the dynamic client. -var ConfigMapGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "configmaps", -} - -// CreateConfigMap is a helper function that uses the dynamic client to create a config map on a namespace for a specific cluster. -// It registers a delete fuction. -func CreateConfigMap(client *rancher.Client, clusterName, configMapName, description, namespace string, data, labels, annotations map[string]string) (*coreV1.ConfigMap, error) { - // ConfigMap object for a namespace in a cluster - annotations["field.cattle.io/description"] = description - configMap := &coreV1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: configMapName, - Annotations: annotations, - Namespace: namespace, - Labels: labels, - }, - Data: data, - } - - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - configMapResource := dynamicClient.Resource(ConfigMapGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := configMapResource.Create(context.TODO(), unstructured.MustToUnstructured(configMap), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newConfig := &coreV1.ConfigMap{} - err = scheme.Scheme.Convert(unstructuredResp, newConfig, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - return newConfig, nil -} diff --git a/tests/framework/extensions/kubeapi/customresourcedefinitions/customresourcedefinitions.go b/tests/framework/extensions/kubeapi/customresourcedefinitions/customresourcedefinitions.go deleted file mode 100644 index d24233b7907..00000000000 --- a/tests/framework/extensions/kubeapi/customresourcedefinitions/customresourcedefinitions.go +++ /dev/null @@ -1,28 +0,0 @@ -package customresourcedefinitions - -import ( - "strings" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var CustomResourceDefinitions = schema.GroupVersionResource{ - Group: "apiextensions.k8s.io", - Version: "v1", - Resource: "customresourcedefinitions", -} - -// gets a list of names of custom resource definitions that contain the input string name from an Unstructured List -func GetCustomResourceDefinitionsListByName(CRDList *unstructured.UnstructuredList, name string) []string { - var CRDNameList []string - CRDs := *CRDList - for _, unstructuredCRD := range CRDs.Items { - CRDName := unstructuredCRD.GetName() - if strings.Contains(CRDName, name) { - CRDNameList = append(CRDNameList, CRDName) - } - } - - return CRDNameList -} diff --git a/tests/framework/extensions/kubeapi/customresourcedefinitions/delete.go b/tests/framework/extensions/kubeapi/customresourcedefinitions/delete.go deleted file mode 100644 index 016524a8084..00000000000 --- a/tests/framework/extensions/kubeapi/customresourcedefinitions/delete.go +++ /dev/null @@ -1,44 +0,0 @@ -package customresourcedefinitions - -import ( - "context" - - "github.com/hashicorp/go-multierror" - "github.com/rancher/rancher/tests/framework/clients/rancher" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// deletes a single custom resource definition by name -func DeleteCustomResourceDefinition(client *rancher.Client, clusterID string, namespace string, name string) error { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return err - } - - customResourceDefinitionResource := dynamicClient.Resource(CustomResourceDefinitions).Namespace(namespace) - - err = customResourceDefinitionResource.Delete(context.TODO(), name, metav1.DeleteOptions{}) - - return err -} - -// deletes a list of custom resource definitions by name -func BatchDeleteCustomResourceDefinition(client *rancher.Client, clusterID string, namespace string, list []string) error { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return err - } - - customResourceDefinitionResource := dynamicClient.Resource(CustomResourceDefinitions).Namespace(namespace) - - var errs error - for _, crd := range list { - err = customResourceDefinitionResource.Delete(context.TODO(), crd, metav1.DeleteOptions{}) - if err != nil { - errs = multierror.Append(errs, err) - continue - } - } - - return errs -} diff --git a/tests/framework/extensions/kubeapi/customresourcedefinitions/list.go b/tests/framework/extensions/kubeapi/customresourcedefinitions/list.go deleted file mode 100644 index d9b460e7b02..00000000000 --- a/tests/framework/extensions/kubeapi/customresourcedefinitions/list.go +++ /dev/null @@ -1,24 +0,0 @@ -package customresourcedefinitions - -import ( - "context" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -// helper function that returns a pointer to an unstructured list of custom resource definitions -func ListCustomResourceDefinitions(client *rancher.Client, clusterID string, namespace string) (*unstructured.UnstructuredList, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - customResourceDefinitionResource := dynamicClient.Resource(CustomResourceDefinitions).Namespace(namespace) - CRDs, err := customResourceDefinitionResource.List(context.TODO(), metav1.ListOptions{}) - if err != nil { - return nil, err - } - return CRDs, err -} diff --git a/tests/framework/extensions/kubeapi/helm/helm.go b/tests/framework/extensions/kubeapi/helm/helm.go deleted file mode 100644 index 5b30f4da0da..00000000000 --- a/tests/framework/extensions/kubeapi/helm/helm.go +++ /dev/null @@ -1,96 +0,0 @@ -package helm - -import ( - "context" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - - "github.com/rancher/rancher/tests/framework/clients/helm" - "github.com/rancher/rancher/tests/framework/pkg/session" -) - -// InstallRancher installs latest version of rancher including cert-manager -// using helm CLI with some predefined values set such as -// - BootstrapPassword : admin -// - Hostname : Localhost -// - BundledMode : True -// - Replicas : 1 -func InstallRancher(ts *session.Session, restConfig *rest.Config) error { - // ClientSet of kubernetes - clientset, err := kubernetes.NewForConfig(restConfig) - if err != nil { - return err - } - - // Create namespace cattle-system - namespace := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "cattle-system"}} - _, err = clientset.CoreV1().Namespaces().Create(context.Background(), namespace, metav1.CreateOptions{}) - if err != nil { - return err - } - - // Install cert-manager chart - err = InstallCertManager(ts, restConfig) - if err != nil { - return err - } - - // Add Rancher helm repo - err = helm.AddHelmRepo("rancher-stable", "https://releases.rancher.com/server-charts/stable") - if err != nil { - return err - } - - // Install Rancher Chart - err = helm.InstallChart(ts, "rancher", - "rancher-stable/rancher", - "cattle-system", - "", - "--set", - "hostname=localhost", - "--set", - "bootstrapPassword=admin", - "--set", - "useBundledSystemChart=true", - "--set", - "replicas=1") - if err != nil { - return err - } - - return nil -} - -// InstallCertManager installs latest version cert manager available through helm -// CLI. It sets the installCRDs as true to install crds as well. -func InstallCertManager(ts *session.Session, restConfig *rest.Config) error { - // ClientSet of kubernetes - clientset, err := kubernetes.NewForConfig(restConfig) - if err != nil { - return err - } - - // Create namespace cert-manager - namespace := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "cert-manager"}} - _, err = clientset.CoreV1().Namespaces().Create(context.Background(), namespace, metav1.CreateOptions{}) - if err != nil { - return err - } - - // Add cert-manager Helm Repo - err = helm.AddHelmRepo("jetstack", "https://charts.jetstack.io") - if err != nil { - return err - } - - // Install cert-manager Chart - err = helm.InstallChart(ts, "cert-manager", "jetstack/cert-manager", "cert-manager", "", "--set", "installCRDs=true") - if err != nil { - return err - } - - return nil -} diff --git a/tests/framework/extensions/kubeapi/ingresses/create.go b/tests/framework/extensions/kubeapi/ingresses/create.go deleted file mode 100644 index bdfcb52e4b5..00000000000 --- a/tests/framework/extensions/kubeapi/ingresses/create.go +++ /dev/null @@ -1,42 +0,0 @@ -package ingresses - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - networkingv1 "k8s.io/api/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CreateIngress is a helper function that uses the dynamic client to create an ingress on a namespace for a specific cluster. -func CreateIngress(client *rancher.Client, clusterID, ingressName, namespace string, ingressSpec *networkingv1.IngressSpec) (*networkingv1.Ingress, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - ingress := &networkingv1.Ingress{ - ObjectMeta: metav1.ObjectMeta{ - Name: ingressName, - Namespace: namespace, - }, - Spec: *ingressSpec, - } - - ingressResource := dynamicClient.Resource(IngressesGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := ingressResource.Create(context.TODO(), unstructured.MustToUnstructured(ingress), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newIngress := &networkingv1.Ingress{} - err = scheme.Scheme.Convert(unstructuredResp, newIngress, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newIngress, nil -} diff --git a/tests/framework/extensions/kubeapi/ingresses/ingresses.go b/tests/framework/extensions/kubeapi/ingresses/ingresses.go deleted file mode 100644 index d5c8d69b041..00000000000 --- a/tests/framework/extensions/kubeapi/ingresses/ingresses.go +++ /dev/null @@ -1,39 +0,0 @@ -package ingresses - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - networkingv1 "k8s.io/api/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// IngressesGroupVersionResource is the required Group Version Resource for accessing ingresses in a cluster, -// using the dynamic client. -var IngressesGroupVersionResource = schema.GroupVersionResource{ - Group: "networking.k8s.io", - Version: "v1", - Resource: "ingresses", -} - -// GetIngressByName is a helper function that returns the ingress by name in a specific cluster, uses ListIngresses to get the ingress. -func GetIngressByName(client *rancher.Client, clusterID, namespaceName, ingressName string) (*networkingv1.Ingress, error) { - var ingress *networkingv1.Ingress - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return ingress, err - } - - ingressesList, err := ListIngresses(adminClient, clusterID, namespaceName, metav1.ListOptions{}) - if err != nil { - return ingress, err - } - - for i, ingress := range ingressesList.Items { - if ingress.Name == ingressName { - return &ingressesList.Items[i], nil - } - } - - return ingress, nil -} diff --git a/tests/framework/extensions/kubeapi/ingresses/list.go b/tests/framework/extensions/kubeapi/ingresses/list.go deleted file mode 100644 index 668ecae5cea..00000000000 --- a/tests/framework/extensions/kubeapi/ingresses/list.go +++ /dev/null @@ -1,55 +0,0 @@ -package ingresses - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - networkingv1 "k8s.io/api/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// IngressList is a struct that contains a list of deployments. -type IngressList struct { - Items []networkingv1.Ingress -} - -// ListIngresses is a helper function that uses the dynamic client to list ingresses on a namespace for a specific cluster with its list options. -func ListIngresses(client *rancher.Client, clusterID, namespace string, listOpts metav1.ListOptions) (*IngressList, error) { - ingressList := new(IngressList) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - ingressResource := dynamicClient.Resource(IngressesGroupVersionResource).Namespace(namespace) - ingresses, err := ingressResource.List(context.TODO(), listOpts) - if err != nil { - return nil, err - } - - for _, unstructuredIngress := range ingresses.Items { - newIngress := &networkingv1.Ingress{} - err := scheme.Scheme.Convert(&unstructuredIngress, newIngress, unstructuredIngress.GroupVersionKind()) - if err != nil { - return nil, err - } - - ingressList.Items = append(ingressList.Items, *newIngress) - } - - return ingressList, nil -} - -// Names is a method that accepts IngressList as a receiver, -// returns each ingress name in the list as a new slice of strings. -func (list *IngressList) Names() []string { - var ingressNames []string - - for _, ingress := range list.Items { - ingressNames = append(ingressNames, ingress.Name) - } - - return ingressNames -} diff --git a/tests/framework/extensions/kubeapi/namespaces/create.go b/tests/framework/extensions/kubeapi/namespaces/create.go deleted file mode 100644 index ce472a8c3ce..00000000000 --- a/tests/framework/extensions/kubeapi/namespaces/create.go +++ /dev/null @@ -1,132 +0,0 @@ -package namespaces - -import ( - "context" - "fmt" - "strings" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - "github.com/rancher/rancher/tests/framework/pkg/wait" - coreV1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kubeUnstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/watch" -) - -// CreateNamespace is a helper function that uses the dynamic client to create a namespace on a project. -// It registers a delete function with a wait.WatchWait to ensure the namspace is deleted cleanly. -func CreateNamespace(client *rancher.Client, namespaceName, containerDefaultResourceLimit string, labels, annotations map[string]string, project *management.Project) (*coreV1.Namespace, error) { - // Namespace object for a project name space - if annotations == nil { - annotations = make(map[string]string) - } - if containerDefaultResourceLimit != "" { - annotations["field.cattle.io/containerDefaultResourceLimit"] = containerDefaultResourceLimit - } - if project != nil { - annotations["field.cattle.io/projectId"] = project.ID - } - namespace := &coreV1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespaceName, - Annotations: annotations, - Labels: labels, - }, - } - - dynamicClient, err := client.GetDownStreamClusterClient(project.ClusterID) - if err != nil { - return nil, err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return nil, err - } - - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(project.ClusterID) - if err != nil { - return nil, err - } - - namespaceResource := dynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") - - unstructuredResp, err := namespaceResource.Create(context.TODO(), unstructured.MustToUnstructured(namespace), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - clusterRoleResource := adminDynamicClient.Resource(rbacv1.SchemeGroupVersion.WithResource("clusterroles")) - projectID := strings.Split(project.ID, ":")[1] - - clusterRoleWatch, err := clusterRoleResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + fmt.Sprintf("%s-namespaces-edit", projectID), - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return nil, err - } - - err = wait.WatchWait(clusterRoleWatch, func(event watch.Event) (ready bool, err error) { - clusterRole := &rbacv1.ClusterRole{} - err = scheme.Scheme.Convert(event.Object.(*kubeUnstructured.Unstructured), clusterRole, event.Object.(*kubeUnstructured.Unstructured).GroupVersionKind()) - - if err != nil { - return false, err - } - - for _, rule := range clusterRole.Rules { - for _, resourceName := range rule.ResourceNames { - if resourceName == namespaceName { - return true, nil - } - } - } - return false, nil - }) - - if err != nil { - return nil, err - } - - client.Session.RegisterCleanupFunc(func() error { - err := namespaceResource.Delete(context.TODO(), unstructuredResp.GetName(), metav1.DeleteOptions{}) - if errors.IsNotFound(err) { - return nil - } - if err != nil { - return err - } - - adminNamespaceResource := adminDynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") - watchInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + unstructuredResp.GetName(), - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - newNamespace := &coreV1.Namespace{} - err = scheme.Scheme.Convert(unstructuredResp, newNamespace, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - return newNamespace, nil -} diff --git a/tests/framework/extensions/kubeapi/namespaces/list.go b/tests/framework/extensions/kubeapi/namespaces/list.go deleted file mode 100644 index cc1b2a16f63..00000000000 --- a/tests/framework/extensions/kubeapi/namespaces/list.go +++ /dev/null @@ -1,55 +0,0 @@ -package namespaces - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NamespaceList is a struct that contains a list of namespaces. -type NamespaceList struct { - Items []corev1.Namespace -} - -// ListNamespaces is a helper function that uses the dynamic client to list namespaces in a cluster with its list options. -func ListNamespaces(client *rancher.Client, clusterID string, listOpts metav1.ListOptions) (*NamespaceList, error) { - namespaceList := new(NamespaceList) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - namespaceResource := dynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") - namespaces, err := namespaceResource.List(context.TODO(), listOpts) - if err != nil { - return nil, err - } - - for _, unstructuredNamespace := range namespaces.Items { - newNamespace := &corev1.Namespace{} - err := scheme.Scheme.Convert(&unstructuredNamespace, newNamespace, unstructuredNamespace.GroupVersionKind()) - if err != nil { - return nil, err - } - - namespaceList.Items = append(namespaceList.Items, *newNamespace) - } - - return namespaceList, nil -} - -// Names is a method that accepts NamespaceList as a receiver, -// returns each namespace name in the list as a new slice of strings. -func (list *NamespaceList) Names() []string { - var namespaceNames []string - - for _, namespace := range list.Items { - namespaceNames = append(namespaceNames, namespace.Name) - } - - return namespaceNames -} diff --git a/tests/framework/extensions/kubeapi/namespaces/namespaces.go b/tests/framework/extensions/kubeapi/namespaces/namespaces.go deleted file mode 100644 index 8335cbb7d64..00000000000 --- a/tests/framework/extensions/kubeapi/namespaces/namespaces.go +++ /dev/null @@ -1,51 +0,0 @@ -package namespaces - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// NamespaceGroupVersionResource is the required Group Version Resource for accessing namespaces in a cluster, -// using the dynamic client. -var NamespaceGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "namespaces", -} - -// ContainerDefaultResourceLimit sets the container default resource limit in a string -// limitsCPU and requestsCPU in form of "3m" -// limitsMemory and requestsMemory in the form of "3Mi" -func ContainerDefaultResourceLimit(limitsCPU, limitsMemory, requestsCPU, requestsMemory string) string { - containerDefaultResourceLimit := fmt.Sprintf("{\"limitsCpu\": \"%s\", \"limitsMemory\":\"%s\",\"requestsCpu\":\"%s\",\"requestsMemory\":\"%s\"}", - limitsCPU, limitsMemory, requestsCPU, requestsMemory) - return containerDefaultResourceLimit -} - -// GetNamespaceByName is a helper function that returns the namespace by name in a specific cluster, uses ListNamespaces to get the namespace. -func GetNamespaceByName(client *rancher.Client, clusterID, namespaceName string) (*corev1.Namespace, error) { - namespace := new(corev1.Namespace) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - namespaceResource := dynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") - unstructuredNamespace, err := namespaceResource.Get(context.TODO(), namespaceName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - if err = scheme.Scheme.Convert(unstructuredNamespace, namespace, unstructuredNamespace.GroupVersionKind()); err != nil { - return nil, err - } - - return namespace, nil -} diff --git a/tests/framework/extensions/kubeapi/nodes/nodes.go b/tests/framework/extensions/kubeapi/nodes/nodes.go deleted file mode 100644 index 7797c64b455..00000000000 --- a/tests/framework/extensions/kubeapi/nodes/nodes.go +++ /dev/null @@ -1,59 +0,0 @@ -package nodes - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// NodeGroupVersionResource is the required Group Version Resource for accessing nodes in a cluster, -// using the dynamic client. -var NodeGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "nodes", -} - -// GetNodes returns nodes with metav1.TypeMeta, metav1.ObjectMeta, NodeSpec, and NodeStatus to be used to gather more information from nodes -func GetNodes(client *rancher.Client, clusterID string, listOpts metav1.ListOptions) ([]corev1.Node, error) { - var nodesList []corev1.Node - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - nodeResource := dynamicClient.Resource(NodeGroupVersionResource) - nodes, err := nodeResource.List(context.TODO(), listOpts) - if err != nil { - return nil, err - } - - for _, unstructuredNode := range nodes.Items { - newNode := &corev1.Node{} - err := scheme.Scheme.Convert(&unstructuredNode, newNode, unstructuredNode.GroupVersionKind()) - if err != nil { - return nil, err - } - - nodesList = append(nodesList, *newNode) - } - - return nodesList, err -} - -// GetNodeIP returns node IP, user needs to pass which type they want ExternalIP, InternalIP, Hostname, check core/v1/types.go -func GetNodeIP(node *corev1.Node, nodeAddressType corev1.NodeAddressType) string { - nodeAddressList := node.Status.Addresses - for _, ip := range nodeAddressList { - if ip.Type == nodeAddressType { - return ip.Address - } - } - - return "" -} diff --git a/tests/framework/extensions/kubeapi/rbac/create.go b/tests/framework/extensions/kubeapi/rbac/create.go deleted file mode 100644 index 87df046c987..00000000000 --- a/tests/framework/extensions/kubeapi/rbac/create.go +++ /dev/null @@ -1,70 +0,0 @@ -package rbac - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CreateRole is a helper function that uses the dynamic client to create a role on a namespace for a specific cluster. -func CreateRole(client *rancher.Client, clusterName string, role *rbacv1.Role) (*rbacv1.Role, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - roleResource := dynamicClient.Resource(RoleGroupVersionResource).Namespace(role.Namespace) - - unstructuredResp, err := roleResource.Create(context.Background(), unstructured.MustToUnstructured(role), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newRole := &rbacv1.Role{} - err = scheme.Scheme.Convert(unstructuredResp, newRole, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newRole, nil -} - -// CreateRoleBinding is a helper function that uses the dynamic client to create a rolebinding on a namespace for a specific cluster. -func CreateRoleBinding(client *rancher.Client, clusterName, roleBindingName, namespace, roleName string, subject rbacv1.Subject) (*rbacv1.RoleBinding, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - roleBinding := &rbacv1.RoleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: roleBindingName, - Namespace: namespace, - }, - Subjects: []rbacv1.Subject{subject}, - RoleRef: rbacv1.RoleRef{ - APIGroup: rbacv1.SchemeGroupVersion.Group, - Kind: "Role", - Name: roleName, - }, - } - - roleBindingResource := dynamicClient.Resource(RoleBindingGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := roleBindingResource.Create(context.Background(), unstructured.MustToUnstructured(roleBinding), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newRoleBinding := &rbacv1.RoleBinding{} - err = scheme.Scheme.Convert(unstructuredResp, newRoleBinding, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newRoleBinding, nil -} diff --git a/tests/framework/extensions/kubeapi/rbac/list.go b/tests/framework/extensions/kubeapi/rbac/list.go deleted file mode 100644 index fb435294a26..00000000000 --- a/tests/framework/extensions/kubeapi/rbac/list.go +++ /dev/null @@ -1,64 +0,0 @@ -package rbac - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ListRoleBindings is a helper function that uses the dynamic client to list rolebindings on a namespace for a specific cluster. -// ListRoleBindings accepts ListOptions for specifying desired parameters for listed objects. -func ListRoleBindings(client *rancher.Client, clusterName, namespace string, listOpt metav1.ListOptions) (*rbacv1.RoleBindingList, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - unstructuredList, err := dynamicClient.Resource(RoleBindingGroupVersionResource).Namespace(namespace).List(context.Background(), listOpt) - if err != nil { - return nil, err - } - - rbList := new(rbacv1.RoleBindingList) - for _, unstructuredRB := range unstructuredList.Items { - rb := &rbacv1.RoleBinding{} - err := scheme.Scheme.Convert(&unstructuredRB, rb, unstructuredRB.GroupVersionKind()) - if err != nil { - return nil, err - } - - rbList.Items = append(rbList.Items, *rb) - } - - return rbList, nil -} - -// ListClusterRoleBindings is a helper function that uses the dynamic client to list clusterrolebindings for a specific cluster. -// ListClusterRoleBindings accepts ListOptions for specifying desired parameters for listed objects. -func ListClusterRoleBindings(client *rancher.Client, clusterName string, listOpt metav1.ListOptions) (*rbacv1.ClusterRoleBindingList, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - unstructuredList, err := dynamicClient.Resource(ClusterRoleBindingGroupVersionResource).Namespace("").List(context.Background(), listOpt) - if err != nil { - return nil, err - } - - crbList := new(rbacv1.ClusterRoleBindingList) - for _, unstructuredCRB := range unstructuredList.Items { - crb := &rbacv1.ClusterRoleBinding{} - err := scheme.Scheme.Convert(&unstructuredCRB, crb, unstructuredCRB.GroupVersionKind()) - if err != nil { - return nil, err - } - - crbList.Items = append(crbList.Items, *crb) - } - - return crbList, nil -} diff --git a/tests/framework/extensions/kubeapi/rbac/rbac.go b/tests/framework/extensions/kubeapi/rbac/rbac.go deleted file mode 100644 index afac6983f05..00000000000 --- a/tests/framework/extensions/kubeapi/rbac/rbac.go +++ /dev/null @@ -1,38 +0,0 @@ -package rbac - -import ( - rbacv1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// RoleGroupVersionResource is the required Group Version Resource for accessing roles in a cluster, -// using the dynamic client. -var RoleGroupVersionResource = schema.GroupVersionResource{ - Group: rbacv1.SchemeGroupVersion.Group, - Version: rbacv1.SchemeGroupVersion.Version, - Resource: "roles", -} - -// ClusterRoleGroupVersionResource is the required Group Version Resource for accessing clusterroles in a cluster, -// using the dynamic client. -var ClusterRoleGroupVersionResource = schema.GroupVersionResource{ - Group: rbacv1.SchemeGroupVersion.Group, - Version: rbacv1.SchemeGroupVersion.Version, - Resource: "clusterroles", -} - -// RoleBindingGroupVersionResource is the required Group Version Resource for accessing rolebindings in a cluster, -// using the dynamic client. -var RoleBindingGroupVersionResource = schema.GroupVersionResource{ - Group: rbacv1.SchemeGroupVersion.Group, - Version: rbacv1.SchemeGroupVersion.Version, - Resource: "rolebindings", -} - -// ClusterRoleBindingGroupVersionResource is the required Group Version Resource for accessing clusterrolebindings in a cluster, -// using the dynamic client. -var ClusterRoleBindingGroupVersionResource = schema.GroupVersionResource{ - Group: rbacv1.SchemeGroupVersion.Group, - Version: rbacv1.SchemeGroupVersion.Version, - Resource: "clusterrolebindings", -} diff --git a/tests/framework/extensions/kubeapi/resource.go b/tests/framework/extensions/kubeapi/resource.go deleted file mode 100644 index 473d9e9ac7f..00000000000 --- a/tests/framework/extensions/kubeapi/resource.go +++ /dev/null @@ -1,18 +0,0 @@ -package kubeapi - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/dynamic" -) - -// ResourceForClient is a helper function that creates a dynamic client and instantiates a subsequent resource interface -// in the requested cluster and namespace for said resource. -func ResourceForClient(client *rancher.Client, clusterName, namespace string, resource schema.GroupVersionResource) (dynamic.ResourceInterface, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - return dynamicClient.Resource(resource).Namespace(namespace), nil -} diff --git a/tests/framework/extensions/kubeapi/resourcequotas/list.go b/tests/framework/extensions/kubeapi/resourcequotas/list.go deleted file mode 100644 index ce193bf7c83..00000000000 --- a/tests/framework/extensions/kubeapi/resourcequotas/list.go +++ /dev/null @@ -1,43 +0,0 @@ -package resourcequotas - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ResourceQuotaList is a struct that contains a list of resource quotas. -type ResourceQuotaList struct { - Items []corev1.ResourceQuota -} - -// ListResourceQuotas is a helper function that uses the dynamic client to list resource quotas in a cluster with its list options. -func ListResourceQuotas(client *rancher.Client, clusterID string, namespace string, listOpts metav1.ListOptions) (*ResourceQuotaList, error) { - resourceQuotaList := new(ResourceQuotaList) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - resourceQuotaResource := dynamicClient.Resource(ResourceQuotaGroupVersionResource).Namespace(namespace) - quotas, err := resourceQuotaResource.List(context.TODO(), listOpts) - if err != nil { - return nil, err - } - - for _, unstructuredQuota := range quotas.Items { - newQuota := &corev1.ResourceQuota{} - err := scheme.Scheme.Convert(&unstructuredQuota, newQuota, unstructuredQuota.GroupVersionKind()) - if err != nil { - return nil, err - } - - resourceQuotaList.Items = append(resourceQuotaList.Items, *newQuota) - } - - return resourceQuotaList, nil -} diff --git a/tests/framework/extensions/kubeapi/resourcequotas/resourcequotas.go b/tests/framework/extensions/kubeapi/resourcequotas/resourcequotas.go deleted file mode 100644 index 31deea78968..00000000000 --- a/tests/framework/extensions/kubeapi/resourcequotas/resourcequotas.go +++ /dev/null @@ -1,35 +0,0 @@ -package resourcequotas - -import ( - "fmt" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// ResourceQuotaGroupVersionResource is the required Group Version Resource for accessing resource quotas in a cluster, -// using the dynamic client. -var ResourceQuotaGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "resourcequotas", -} - -// GetResourceQuotaByName is a helper function that returns the resource quota by name in a specific cluster. -func GetResourceQuotaByName(client *rancher.Client, clusterID, name string) (*corev1.ResourceQuota, error) { - resourceQuotaList, err := ListResourceQuotas(client, clusterID, "", metav1.ListOptions{}) - if err != nil { - return nil, err - } - - for i, q := range resourceQuotaList.Items { - if name == q.Name { - quota := &resourceQuotaList.Items[i] - return quota, nil - } - } - - return nil, fmt.Errorf("quota %s not found in %s cluster", name, clusterID) -} diff --git a/tests/framework/extensions/kubeapi/secrets/basicAuth.go b/tests/framework/extensions/kubeapi/secrets/basicAuth.go deleted file mode 100644 index c9800797358..00000000000 --- a/tests/framework/extensions/kubeapi/secrets/basicAuth.go +++ /dev/null @@ -1,21 +0,0 @@ -package secrets - -import ( - coreV1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NewBasicAuthSecret is a constructor for a Basic Auth secret type -func NewBasicAuthSecret(name, namespace, username, password string) *coreV1.Secret { - return &coreV1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Data: map[string][]byte{ - "username": []byte(username), - "password": []byte(password), - }, - Type: "kubernetes.io/basic-auth", - } -} diff --git a/tests/framework/extensions/kubeapi/secrets/create.go b/tests/framework/extensions/kubeapi/secrets/create.go deleted file mode 100644 index 1e6894d4209..00000000000 --- a/tests/framework/extensions/kubeapi/secrets/create.go +++ /dev/null @@ -1,38 +0,0 @@ -package secrets - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/dynamic" -) - -// CreateSecretForCluster is a helper function that uses the rancher client to create a secret in a namespace for a specific cluster. -func CreateSecretForCluster(client *rancher.Client, secret *corev1.Secret, clusterID, namespace string) (*corev1.Secret, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) - - return CreateSecret(secretResource, secret) -} - -// CreateSecret is a helper function that uses the dynamic client to create a secret in a namespace for a specific cluster. -func CreateSecret(secretResource dynamic.ResourceInterface, secret *corev1.Secret) (*corev1.Secret, error) { - unstructuredResp, err := secretResource.Create(context.TODO(), unstructured.MustToUnstructured(secret), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newSecret := &corev1.Secret{} - err = scheme.Scheme.Convert(unstructuredResp, newSecret, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - return newSecret, nil -} diff --git a/tests/framework/extensions/kubeapi/secrets/list.go b/tests/framework/extensions/kubeapi/secrets/list.go deleted file mode 100644 index 2e897f2faff..00000000000 --- a/tests/framework/extensions/kubeapi/secrets/list.go +++ /dev/null @@ -1,56 +0,0 @@ -package secrets - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// SecretList is a struct that contains a list of secrets. -type SecretList struct { - Items []corev1.Secret -} - -// ListSecrets is a helper function that uses the dynamic client to list secrets in a cluster with its list options. -func ListSecrets(client *rancher.Client, clusterID, namespace string, listOpts metav1.ListOptions) (*SecretList, error) { - secretList := new(SecretList) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) - secrets, err := secretResource.List(context.TODO(), listOpts) - if err != nil { - return nil, err - } - - for _, unstructuredSecret := range secrets.Items { - newSecret := &corev1.Secret{} - - err := scheme.Scheme.Convert(&unstructuredSecret, newSecret, unstructuredSecret.GroupVersionKind()) - if err != nil { - return nil, err - } - - secretList.Items = append(secretList.Items, *newSecret) - } - - return secretList, nil -} - -// Names is a method that accepts SecretList as a receiver, -// returns each secret name in the list as a new slice of strings. -func (list *SecretList) Names() []string { - var secretNames []string - - for _, secret := range list.Items { - secretNames = append(secretNames, secret.Name) - } - - return secretNames -} diff --git a/tests/framework/extensions/kubeapi/secrets/patchsecrets.go b/tests/framework/extensions/kubeapi/secrets/patchsecrets.go deleted file mode 100644 index 6a089bfc80e..00000000000 --- a/tests/framework/extensions/kubeapi/secrets/patchsecrets.go +++ /dev/null @@ -1,49 +0,0 @@ -package secrets - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - coreV1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" -) - -type PatchOP string - -const ( - AddPatchOP PatchOP = "add" - ReplacePatchOP PatchOP = "replace" - RemovePatchOP PatchOP = "remove" -) - -// PatchSecret is a helper function that uses the dynamic client to patch a secret in a namespace for a specific cluster. -// Different secret operations are supported: add, replace, remove. -func PatchSecret(client *rancher.Client, clusterID, secretName, namespace string, patchType types.PatchType, patchOp PatchOP, patchPath, patchData string, patchOpts metav1.PatchOptions) (*coreV1.Secret, error) { - patchJSONOperation := fmt.Sprintf(` - [ - { "op": "%v", "path": "%v", "value": "%v" } - ] - `, patchOp, patchPath, patchData) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := secretResource.Patch(context.TODO(), secretName, patchType, []byte(patchJSONOperation), patchOpts) - if err != nil { - return nil, err - } - - newSecret := &coreV1.Secret{} - err = scheme.Scheme.Convert(unstructuredResp, newSecret, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - return newSecret, nil -} diff --git a/tests/framework/extensions/kubeapi/secrets/secrets.go b/tests/framework/extensions/kubeapi/secrets/secrets.go deleted file mode 100644 index 7a842b874fe..00000000000 --- a/tests/framework/extensions/kubeapi/secrets/secrets.go +++ /dev/null @@ -1,42 +0,0 @@ -package secrets - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime/schema" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - coreV1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// SecretGroupVersionResource is the required Group Version Resource for accessing secrets in a cluster, -// using the dynamic client. -var SecretGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "secrets", -} - -// GetSecretByName is a helper function that uses the dynamic client to get a specific secret on a namespace for a specific cluster. -func GetSecretByName(client *rancher.Client, clusterID, namespace, secretName string, getOpts metav1.GetOptions) (*coreV1.Secret, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := secretResource.Get(context.TODO(), secretName, getOpts) - if err != nil { - return nil, err - } - - newSecret := &coreV1.Secret{} - err = scheme.Scheme.Convert(unstructuredResp, newSecret, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - return newSecret, nil -} diff --git a/tests/framework/extensions/kubeapi/services/create.go b/tests/framework/extensions/kubeapi/services/create.go deleted file mode 100644 index 0fc4a219021..00000000000 --- a/tests/framework/extensions/kubeapi/services/create.go +++ /dev/null @@ -1,51 +0,0 @@ -package services - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// ServiceGroupVersionResource is the required Group Version Resource for accessing services in a cluster, -// using the dynamic client. -var ServiceGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "services", -} - -// CreateService is a helper function that uses the dynamic client to create a service in a namespace for a specific cluster. -func CreateService(client *rancher.Client, clusterName, serviceName, namespace string, spec corev1.ServiceSpec) (*corev1.Service, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - service := &corev1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: serviceName, - Namespace: namespace, - }, - Spec: spec, - } - - serviceResource := dynamicClient.Resource(ServiceGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := serviceResource.Create(context.TODO(), unstructured.MustToUnstructured(service), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newService := &corev1.Service{} - err = scheme.Scheme.Convert(unstructuredResp, newService, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newService, nil -} diff --git a/tests/framework/extensions/kubeapi/storageclasses/awsebs/create.go b/tests/framework/extensions/kubeapi/storageclasses/awsebs/create.go deleted file mode 100644 index 0f0adc280f8..00000000000 --- a/tests/framework/extensions/kubeapi/storageclasses/awsebs/create.go +++ /dev/null @@ -1,56 +0,0 @@ -package awsebs - -import ( - "context" - "strconv" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/storageclasses" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - storagev1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CreateAWSEBSPersistentVolume is a helper function that uses the dynamic client to create an aws ebs persistent volume for a specific cluster. -// It registers a delete fuction. `iopsPerGB` and `encryptionKey` are optional parameters, and can just take "" -func CreateAWSEBSStorageClass(client *rancher.Client, clusterName, fsType, encryptionKey, iopsPerGB string, volumeType VolumeType, encryption bool, storageClass *storagev1.StorageClass) (*storagev1.StorageClass, error) { - storageClass.Provisioner = "kubernetes.io/aws-ebs" - storageClass.Parameters = map[string]string{ - "encrypted": strconv.FormatBool(encryption), - "fsType": fsType, - "type": string(volumeType), - } - - if encryptionKey != "" { - storageClass.Parameters["kmsKeyId"] = encryptionKey - } - - if iopsPerGB != "" { - storageClass.Parameters["iopsPerGB"] = iopsPerGB - } else { - storageClass.Parameters["iopsPerGB"] = "0" - } - - unstructuredStorageClass := unstructured.MustToUnstructured(storageClass) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - storageClassVolumesResource := dynamicClient.Resource(storageclasses.StorageClassGroupVersionResource).Namespace("") - - unstructuredResp, err := storageClassVolumesResource.Create(context.TODO(), unstructuredStorageClass, metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newStorageClass := &storagev1.StorageClass{} - err = scheme.Scheme.Convert(unstructuredResp, newStorageClass, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newStorageClass, nil -} diff --git a/tests/framework/extensions/kubeapi/storageclasses/awsebs/volumetype.go b/tests/framework/extensions/kubeapi/storageclasses/awsebs/volumetype.go deleted file mode 100644 index 3da1c0cdb42..00000000000 --- a/tests/framework/extensions/kubeapi/storageclasses/awsebs/volumetype.go +++ /dev/null @@ -1,15 +0,0 @@ -package awsebs - -// VolumeType is the type of volume for a Amazon EBS Disk storage class. -type VolumeType string - -const ( - // GP2 - General Purpose SSD - VolumeTypeGP2 VolumeType = "gp2" - // IO1 - Provisioned IOPS SSD - VolumeTypeIO1 VolumeType = "io1" - // ST1 - Throughput-Optimized HDD - VolumeTypeST1 VolumeType = "st1" - // SC1 - Cold-Storage HDD - VolumeTypeSC1 VolumeType = "ephemeral-storage" -) diff --git a/tests/framework/extensions/kubeapi/storageclasses/storageclasses.go b/tests/framework/extensions/kubeapi/storageclasses/storageclasses.go deleted file mode 100644 index 1e87179f8e3..00000000000 --- a/tests/framework/extensions/kubeapi/storageclasses/storageclasses.go +++ /dev/null @@ -1,35 +0,0 @@ -package storageclasses - -import ( - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// StorageClassGroupVersionResource is the required Group Version Resource for accessing storage classes in a cluster, -// using the dynamic client. -var StorageClassGroupVersionResource = schema.GroupVersionResource{ - Group: "storage.k8s.io", - Version: "v1", - Resource: "storageclasses", -} - -// NewStorageClass is a constructor for a *PersistentVolume object `mountOptions` is an optional parameter and can be nil. -func NewStorageClass(storageClassName, description string, mountOptions []string, reclaimPolicy corev1.PersistentVolumeReclaimPolicy, volumeBindingMode storagev1.VolumeBindingMode) *storagev1.StorageClass { - annotations := map[string]string{ - "field.cattle.io/description": description, - } - // StorageClass object - storageClass := &storagev1.StorageClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: storageClassName, - Annotations: annotations, - }, - MountOptions: mountOptions, - ReclaimPolicy: &reclaimPolicy, - VolumeBindingMode: &volumeBindingMode, - } - - return storageClass -} diff --git a/tests/framework/extensions/kubeapi/tokens/patchtokens.go b/tests/framework/extensions/kubeapi/tokens/patchtokens.go deleted file mode 100644 index a8289ec8ff7..00000000000 --- a/tests/framework/extensions/kubeapi/tokens/patchtokens.go +++ /dev/null @@ -1,49 +0,0 @@ -package tokens - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/scheme" - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/rancher/tests/framework/clients/rancher" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" -) - -var TokenGroupVersionResource = schema.GroupVersionResource{ - Group: "management.cattle.io", - Version: "v3", - Resource: "tokens", -} - -// PatchToken is a helper function that uses the dynamic client to patch a token by its name. -// Different token operations are supported: add, replace, remove. -func PatchToken(client *rancher.Client, clusterID, tokenName, patchOp, patchPath, patchData string) (*v3.Token, *unstructured.Unstructured, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, nil, err - } - - tokenResource := dynamicClient.Resource(TokenGroupVersionResource) - - patchJSONOperation := fmt.Sprintf(` - [ - { "op": "%v", "path": "%v", "value": "%v" } - ] - `, patchOp, patchPath, patchData) - - unstructuredResp, err := tokenResource.Patch(context.TODO(), tokenName, types.JSONPatchType, []byte(patchJSONOperation), metav1.PatchOptions{}) - if err != nil { - return nil, nil, err - } - - newToken := &v3.Token{} - err = scheme.Scheme.Convert(unstructuredResp, newToken, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, nil, err - } - return newToken, unstructuredResp, nil -} diff --git a/tests/framework/extensions/kubeapi/volumes/persistentvolumeclaims/persistentvolumeclaims.go b/tests/framework/extensions/kubeapi/volumes/persistentvolumeclaims/persistentvolumeclaims.go deleted file mode 100644 index c9b0908832c..00000000000 --- a/tests/framework/extensions/kubeapi/volumes/persistentvolumeclaims/persistentvolumeclaims.go +++ /dev/null @@ -1,88 +0,0 @@ -package persistentvolumeclaims - -import ( - "context" - "strconv" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1Unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// PersistentVolumeClaimGroupVersionResource is the required Group Version Resource for accessing persistent volume claims in a cluster, -// using the dynamic client. -var PersistentVolumeClaimGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "persistentvolumeclaims", -} - -// CreatePersistentVolumeClaim is a helper function that uses the dynamic client to create a persistent volume claim on a namespace for a specific cluster. -// If you pass a PersistentVolume then `storageClass` and `storage` would be optional, otherwise `persistentVolume` would be optional and `storage` and` storageClass` -// are needed. -// The function registers a delete fuction. -func CreatePersistentVolumeClaim(client *rancher.Client, clusterName, persistentVolumeClaimName, description, namespace string, storage int, accessModes []corev1.PersistentVolumeAccessMode, persistentVolume *corev1.PersistentVolume, storageClass *storagev1.StorageClass) (*corev1.PersistentVolumeClaim, error) { - var unstructuredVolumeClaim *metav1Unstructured.Unstructured - annotations := map[string]string{ - "field.cattle.io/description": description, - } - // PersistentVolumeClaim object - persistentVolumeClaim := &corev1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: persistentVolumeClaimName, - Annotations: annotations, - Namespace: namespace, - }, - Spec: corev1.PersistentVolumeClaimSpec{ - AccessModes: accessModes, - }, - } - - if persistentVolume != nil { - storageClassName := "" - persistentVolumeClaim.Spec.Resources = corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceStorage: *persistentVolume.Spec.Capacity.Storage(), - }, - } - persistentVolumeClaim.Spec.StorageClassName = &storageClassName - persistentVolumeClaim.Spec.VolumeName = persistentVolume.Name - unstructuredVolumeClaim = unstructured.MustToUnstructured(persistentVolumeClaim) - } else if storageClass != nil { - persistentVolumeClaim.Spec.VolumeName = "" - persistentVolumeClaim.Spec.StorageClassName = &storageClass.Name - - stringStorage := strconv.Itoa(storage) + "Gi" - unstructuredVolumeClaim = unstructured.MustToUnstructured(persistentVolumeClaim) - specMap := unstructuredVolumeClaim.Object["spec"].(map[string]interface{}) - specMap["resources"] = map[string]interface{}{ - "requests": map[string]interface{}{ - "storage": stringStorage, - }, - } - } - - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - PersistentVolumeClaimResource := dynamicClient.Resource(PersistentVolumeClaimGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := PersistentVolumeClaimResource.Create(context.TODO(), unstructuredVolumeClaim, metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newPersistentVolumeClaim := &corev1.PersistentVolumeClaim{} - err = scheme.Scheme.Convert(unstructuredResp, newPersistentVolumeClaim, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - return newPersistentVolumeClaim, nil -} diff --git a/tests/framework/extensions/kubeapi/volumes/persistentvolumes/awsebs/create.go b/tests/framework/extensions/kubeapi/volumes/persistentvolumes/awsebs/create.go deleted file mode 100644 index 1dd94b2d95b..00000000000 --- a/tests/framework/extensions/kubeapi/volumes/persistentvolumes/awsebs/create.go +++ /dev/null @@ -1,54 +0,0 @@ -package awsebs - -import ( - "context" - "strconv" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/volumes/persistentvolumes" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CreateAWSEBSPersistentVolume is a helper function that uses the dynamic client to create an aws ebs persistent volume for a specific cluster. -// It registers a delete fuction. -func CreateAWSEBSPersistentVolume(client *rancher.Client, clusterName, fsType, volumeID string, storage int, partition int32, readOnly bool, accessModes []corev1.PersistentVolumeAccessMode, persistentVolume *corev1.PersistentVolume) (*corev1.PersistentVolume, error) { - stringStorage := strconv.Itoa(storage) + "Gi" - unstructuredPersistentVolume := unstructured.MustToUnstructured(persistentVolume) - - specMap := unstructuredPersistentVolume.Object["spec"].(map[string]interface{}) - specMap["awsElasticBlockStore"] = corev1.AWSElasticBlockStoreVolumeSource{ - FSType: fsType, - Partition: partition, - ReadOnly: readOnly, - VolumeID: volumeID, - } - specMap["capacity"] = map[string]string{ - "storage": stringStorage, - } - - unstructuredPersistentVolume.Object["spec"] = specMap - - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - persistentVolumesResource := dynamicClient.Resource(persistentvolumes.PersistentVolumesGroupVersionResource).Namespace("") - - unstructuredResp, err := persistentVolumesResource.Create(context.TODO(), unstructuredPersistentVolume, metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newPersistentVolume := &corev1.PersistentVolume{} - err = scheme.Scheme.Convert(unstructuredResp, newPersistentVolume, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newPersistentVolume, nil -} diff --git a/tests/framework/extensions/kubeapi/volumes/persistentvolumes/nodeselectorterms.go b/tests/framework/extensions/kubeapi/volumes/persistentvolumes/nodeselectorterms.go deleted file mode 100644 index 0ae62fbfbac..00000000000 --- a/tests/framework/extensions/kubeapi/volumes/persistentvolumes/nodeselectorterms.go +++ /dev/null @@ -1,15 +0,0 @@ -package persistentvolumes - -import ( - corev1 "k8s.io/api/core/v1" -) - -// NewNodeSelectorRequirement is a constructor for a NodeSelectorRequirement config object for a Persistent Volume -// in downstream cluster. `operator` is a const from the corev1 "k8s.io/api/core/v1" package -func NewNodeSelectorRequirement(operator corev1.NodeSelectorOperator, key string, values ...string) corev1.NodeSelectorRequirement { - return corev1.NodeSelectorRequirement{ - Key: key, - Operator: operator, - Values: values, - } -} diff --git a/tests/framework/extensions/kubeapi/volumes/persistentvolumes/persistentvolumes.go b/tests/framework/extensions/kubeapi/volumes/persistentvolumes/persistentvolumes.go deleted file mode 100644 index df185d5bb8b..00000000000 --- a/tests/framework/extensions/kubeapi/volumes/persistentvolumes/persistentvolumes.go +++ /dev/null @@ -1,49 +0,0 @@ -package persistentvolumes - -import ( - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// PersistentVolumesGroupVersionResource is the required Group Version Resource for accessing persistent volumes in a cluster, -// using the dynamic client. -var PersistentVolumesGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "persistentvolumes", -} - -// NewPersistentVolume is a constructor for a *PersistentVolume object -// It registers a delete fuction. `nodeSelectorRequirement`, `mountOptions`, `storageClass` are optional parameters if those are not needed pass nil for them will suffice -func NewPersistentVolume(volumeName, description string, accessModes []corev1.PersistentVolumeAccessMode, nodeSelectorRequirement []corev1.NodeSelectorRequirement, mountOptions []string, storageClass *storagev1.StorageClass) *corev1.PersistentVolume { - annotations := map[string]string{ - "field.cattle.io/description": description, - } - - persistentVolume := &corev1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: volumeName, - Annotations: annotations, - }, - Spec: corev1.PersistentVolumeSpec{ - AccessModes: accessModes, - MountOptions: mountOptions, - NodeAffinity: &corev1.VolumeNodeAffinity{ - Required: &corev1.NodeSelector{ - NodeSelectorTerms: []corev1.NodeSelectorTerm{ - { - MatchExpressions: nodeSelectorRequirement, - }, - }, - }, - }, - }, - } - if storageClass != nil { - persistentVolume.Spec.StorageClassName = storageClass.Name - } - - return persistentVolume -} diff --git a/tests/framework/extensions/kubeapi/webhook/webhook.go b/tests/framework/extensions/kubeapi/webhook/webhook.go deleted file mode 100644 index 365dcf89974..00000000000 --- a/tests/framework/extensions/kubeapi/webhook/webhook.go +++ /dev/null @@ -1,37 +0,0 @@ -package webhook - -import ( - "context" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - clientV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - V1 "k8s.io/api/admissionregistration/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GetWebhook is a helper function that uses the dynamic client to get a list of webhooks from a cluster -func GetWebhook(client *rancher.Client, clusterID, resourceName string) (*V1.ValidatingWebhookConfiguration, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - WebHookGroupVersionResource := schema.GroupVersionResource{ - Group: "admissionregistration.k8s.io", - Version: "v1", - Resource: "validatingwebhookconfigurations", - } - - result, err := dynamicClient.Resource(WebHookGroupVersionResource).Get(context.TODO(), resourceName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - webhook := &V1.ValidatingWebhookConfiguration{} - err = clientV1.ConvertToK8sType(result.Object, webhook) - if err != nil { - return nil, err - } - return webhook, nil - -} diff --git a/tests/framework/extensions/kubeapi/workloads/cronjobs/create.go b/tests/framework/extensions/kubeapi/workloads/cronjobs/create.go deleted file mode 100644 index 02e4676905c..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/cronjobs/create.go +++ /dev/null @@ -1,92 +0,0 @@ -package cronjobs - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - "github.com/rancher/rancher/tests/framework/pkg/wait" - batchv1 "k8s.io/api/batch/v1" - "k8s.io/api/batch/v1beta1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" -) - -// CronJobGroupVersionResource is the required Group Version Resource for accessing cron jobs in a cluster, -// using the dynamic client. -var CronJobGroupVersionResource = schema.GroupVersionResource{ - Group: "batch", - Version: "v1beta1", - Resource: "cronjobs", -} - -// CreateCronJob is a helper function that uses the dynamic client to create a cronjob on a namespace for a specific cluster. -// It registers a delete fuction a wait.WatchWait to ensure the cronjob is deleted cleanly. -func CreateCronJob(client *rancher.Client, clusterName, cronJobName, namespace, schedule string, template corev1.PodTemplateSpec) (*v1beta1.CronJob, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - template.Spec.RestartPolicy = corev1.RestartPolicyNever - cronJob := &v1beta1.CronJob{ - ObjectMeta: metav1.ObjectMeta{ - Name: cronJobName, - Namespace: namespace, - }, - Spec: v1beta1.CronJobSpec{ - JobTemplate: v1beta1.JobTemplateSpec{ - Spec: batchv1.JobSpec{ - Template: template, - }, - }, - Schedule: schedule, - }, - } - - cronJobResource := dynamicClient.Resource(CronJobGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := cronJobResource.Create(context.TODO(), unstructured.MustToUnstructured(cronJob), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - client.Session.RegisterCleanupFunc(func() error { - err := cronJobResource.Delete(context.TODO(), unstructuredResp.GetName(), metav1.DeleteOptions{}) - if errors.IsNotFound(err) { - return nil - } - if err != nil { - return err - } - - watchInterface, err := cronJobResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + unstructuredResp.GetName(), - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - newcronJob := &v1beta1.CronJob{} - err = scheme.Scheme.Convert(unstructuredResp, newcronJob, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newcronJob, nil -} diff --git a/tests/framework/extensions/kubeapi/workloads/daemonsets/create.go b/tests/framework/extensions/kubeapi/workloads/daemonsets/create.go deleted file mode 100644 index ef5a6808d0d..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/daemonsets/create.go +++ /dev/null @@ -1,57 +0,0 @@ -package daemonsets - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - appv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CreateDaemonSet is a helper function that uses the dynamic client to create a daemon set on a namespace for a specific cluster. -func CreateDaemonSet(client *rancher.Client, clusterName, daemonSetName, namespace string, template corev1.PodTemplateSpec) (*appv1.DaemonSet, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - labels := map[string]string{} - labels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.daemonset-%v-%v", namespace, daemonSetName) - - template.ObjectMeta = metav1.ObjectMeta{ - Labels: labels, - } - template.Spec.RestartPolicy = corev1.RestartPolicyAlways - daemonSet := &appv1.DaemonSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: daemonSetName, - Namespace: namespace, - Labels: labels, - }, - Spec: appv1.DaemonSetSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: labels, - }, - Template: template, - }, - } - - daemonSetResource := dynamicClient.Resource(DaemonSetGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := daemonSetResource.Create(context.TODO(), unstructured.MustToUnstructured(daemonSet), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newDaemonSet := &appv1.DaemonSet{} - err = scheme.Scheme.Convert(unstructuredResp, newDaemonSet, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return daemonSet, nil -} diff --git a/tests/framework/extensions/kubeapi/workloads/daemonsets/daemonsets.go b/tests/framework/extensions/kubeapi/workloads/daemonsets/daemonsets.go deleted file mode 100644 index a8666ced42f..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/daemonsets/daemonsets.go +++ /dev/null @@ -1,41 +0,0 @@ -package daemonsets - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - appv1 "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// DaemonSetGroupVersionResource is the required Group Version Resource for accessing daemon sets in a cluster, -// using the dynamic client. -var DaemonSetGroupVersionResource = schema.GroupVersionResource{ - Group: "apps", - Version: "v1", - Resource: "daemonsets", -} - -// GetDaemonsetByName is a helper function that uses the dynamic client to get a specific daemonset on a namespace for a specific cluster. -func GetDaemonsetByName(client *rancher.Client, clusterID, namespace, daemonsetName string) (*appv1.DaemonSet, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - daemonsetResource := dynamicClient.Resource(DaemonSetGroupVersionResource).Namespace(namespace) - unstructuredResp, err := daemonsetResource.Get(context.TODO(), daemonsetName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - newDaemonset := &appv1.DaemonSet{} - err = scheme.Scheme.Convert(unstructuredResp, newDaemonset, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newDaemonset, nil -} diff --git a/tests/framework/extensions/kubeapi/workloads/daemonsets/list.go b/tests/framework/extensions/kubeapi/workloads/daemonsets/list.go deleted file mode 100644 index 768dee16057..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/daemonsets/list.go +++ /dev/null @@ -1,56 +0,0 @@ -package daemonsets - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - appv1 "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// DaemonSetList is a struct that contains a list of daemonsets. -type DaemonSetList struct { - Items []appv1.DaemonSet -} - -// ListDaemonsets is a helper function that uses the dynamic client to list daemonsets in a cluster with its list options. -func ListDaemonsets(client *rancher.Client, clusterID, namespace string, listOpts metav1.ListOptions) (*DaemonSetList, error) { - daemonsetList := new(DaemonSetList) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - - daemonsetResource := dynamicClient.Resource(DaemonSetGroupVersionResource).Namespace(namespace) - daemonsets, err := daemonsetResource.List(context.TODO(), listOpts) - if err != nil { - return nil, err - } - - for _, unstructuredDaemonset := range daemonsets.Items { - newDaemonset := &appv1.DaemonSet{} - - err := scheme.Scheme.Convert(&unstructuredDaemonset, newDaemonset, unstructuredDaemonset.GroupVersionKind()) - if err != nil { - return nil, err - } - - daemonsetList.Items = append(daemonsetList.Items, *newDaemonset) - } - - return daemonsetList, nil -} - -// Names is a method that accepts DaemonSetList as a receiver, -// returns each daemonset name in the list as a new slice of strings. -func (list *DaemonSetList) Names() []string { - var daemonsetNames []string - - for _, daemonset := range list.Items { - daemonsetNames = append(daemonsetNames, daemonset.Name) - } - - return daemonsetNames -} diff --git a/tests/framework/extensions/kubeapi/workloads/deployments/create.go b/tests/framework/extensions/kubeapi/workloads/deployments/create.go deleted file mode 100644 index 18198c2b6af..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/deployments/create.go +++ /dev/null @@ -1,66 +0,0 @@ -package deployments - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - appv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// DeploymentGroupVersionResource is the required Group Version Resource for accessing deployments in a cluster, -// using the dynamic client. -var DeploymentGroupVersionResource = schema.GroupVersionResource{ - Group: "apps", - Version: "v1", - Resource: "deployments", -} - -// CreateDeployment is a helper function that uses the dynamic client to create a deployment on a namespace for a specific cluster. -func CreateDeployment(client *rancher.Client, clusterName, deploymentName, namespace string, template corev1.PodTemplateSpec) (*appv1.Deployment, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - labels := map[string]string{} - labels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.deployment-%v-%v", namespace, deploymentName) - - template.ObjectMeta = metav1.ObjectMeta{ - Labels: labels, - } - - template.Spec.RestartPolicy = corev1.RestartPolicyAlways - deployment := &appv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: deploymentName, - Namespace: namespace, - }, - Spec: appv1.DeploymentSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: labels, - }, - Template: template, - }, - } - - deploymentResource := dynamicClient.Resource(DeploymentGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := deploymentResource.Create(context.TODO(), unstructured.MustToUnstructured(deployment), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - newDeployment := &appv1.Deployment{} - err = scheme.Scheme.Convert(unstructuredResp, newDeployment, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newDeployment, nil -} diff --git a/tests/framework/extensions/kubeapi/workloads/deployments/list.go b/tests/framework/extensions/kubeapi/workloads/deployments/list.go deleted file mode 100644 index 49a92e9fd78..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/deployments/list.go +++ /dev/null @@ -1,54 +0,0 @@ -package deployments - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - appv1 "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// DeploymentList is a struct that contains a list of deployments. -type DeploymentList struct { - Items []appv1.Deployment -} - -// ListDeployments is a helper function that uses the dynamic client to list deployments on a namespace for a specific cluster with its list options. -func ListDeployments(client *rancher.Client, clusterID, namespace string, listOpts metav1.ListOptions) (*DeploymentList, error) { - deploymentList := new(DeploymentList) - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, err - } - deploymentResource := dynamicClient.Resource(DeploymentGroupVersionResource).Namespace(namespace) - deployments, err := deploymentResource.List(context.TODO(), listOpts) - if err != nil { - return nil, err - } - - for _, unstructuredDeployment := range deployments.Items { - newDeployment := &appv1.Deployment{} - err := scheme.Scheme.Convert(&unstructuredDeployment, newDeployment, unstructuredDeployment.GroupVersionKind()) - if err != nil { - return nil, err - } - - deploymentList.Items = append(deploymentList.Items, *newDeployment) - } - - return deploymentList, nil -} - -// Names is a method that accepts DeploymentList as a receiver, -// returns each deployment name in the list as a new slice of strings. -func (list *DeploymentList) Names() []string { - var deploymentNames []string - - for _, deployment := range list.Items { - deploymentNames = append(deploymentNames, deployment.Name) - } - - return deploymentNames -} diff --git a/tests/framework/extensions/kubeapi/workloads/jobs/create.go b/tests/framework/extensions/kubeapi/workloads/jobs/create.go deleted file mode 100644 index e6eacb4db59..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/jobs/create.go +++ /dev/null @@ -1,86 +0,0 @@ -package jobs - -import ( - "context" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - "github.com/rancher/rancher/tests/framework/pkg/wait" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" -) - -// JobGroupVersionResource is the required Group Version Resource for accessing jobs in a cluster, -// using the dynamic client. -var JobGroupVersionResource = schema.GroupVersionResource{ - Group: "batch", - Version: "v1", - Resource: "jobs", -} - -// CreateJob is a helper function that uses the dynamic client to create a batch job on a namespace for a specific cluster. -// It registers a delete fuction a wait.WatchWait to ensure the job is deleted cleanly. -func CreateJob(client *rancher.Client, clusterName, jobName, namespace string, template corev1.PodTemplateSpec) (*batchv1.Job, error) { - dynamicClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - template.Spec.RestartPolicy = corev1.RestartPolicyNever - job := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: jobName, - Namespace: namespace, - }, - Spec: batchv1.JobSpec{ - Template: template, - }, - } - - jobResource := dynamicClient.Resource(JobGroupVersionResource).Namespace(namespace) - - unstructuredResp, err := jobResource.Create(context.TODO(), unstructured.MustToUnstructured(job), metav1.CreateOptions{}) - if err != nil { - return nil, err - } - - client.Session.RegisterCleanupFunc(func() error { - err := jobResource.Delete(context.TODO(), unstructuredResp.GetName(), metav1.DeleteOptions{}) - if errors.IsNotFound(err) { - return nil - } - if err != nil { - return err - } - - watchInterface, err := jobResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + unstructuredResp.GetName(), - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - - newJob := &batchv1.Job{} - err = scheme.Scheme.Convert(unstructuredResp, newJob, unstructuredResp.GroupVersionKind()) - if err != nil { - return nil, err - } - - return newJob, nil -} diff --git a/tests/framework/extensions/kubeapi/workloads/pods/podstatus.go b/tests/framework/extensions/kubeapi/workloads/pods/podstatus.go deleted file mode 100644 index 36eb276d85e..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/pods/podstatus.go +++ /dev/null @@ -1,59 +0,0 @@ -package pods - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// PodGroupVersion is the required Group Version for accessing pods in a cluster, -// using the dynamic client. -var PodGroupVersionResource = schema.GroupVersionResource{ - Group: "", - Version: "v1", - Resource: "pods", -} - -// StatusPods is a helper function that uses the dynamic client to list pods on a namespace for a specific cluster with its list options. -func StatusPods(client *rancher.Client, clusterID string, listOpts metav1.ListOptions) ([]string, []error) { - var podList []corev1.Pod - - dynamicClient, err := client.GetDownStreamClusterClient(clusterID) - if err != nil { - return nil, []error{err} - } - podResource := dynamicClient.Resource(PodGroupVersionResource) - pods, err := podResource.List(context.TODO(), listOpts) - if err != nil { - return nil, []error{err} - } - - for _, unstructuredPod := range pods.Items { - newPod := &corev1.Pod{} - err := scheme.Scheme.Convert(&unstructuredPod, newPod, unstructuredPod.GroupVersionKind()) - if err != nil { - return nil, []error{err} - } - - podList = append(podList, *newPod) - } - - var podResults []string - var podErrors []error - podResults = append(podResults, "pods Status:\n") - - for _, pod := range podList { - phase := pod.Status.Phase - if phase == corev1.PodFailed || phase == corev1.PodUnknown { - podErrors = append(podErrors, fmt.Errorf("ERROR: %s: %s", pod.Name, phase)) - } else { - podResults = append(podResults, fmt.Sprintf("INFO: %s: %s\n", pod.Name, phase)) - } - } - return podResults, podErrors -} diff --git a/tests/framework/extensions/kubeapi/workloads/template.go b/tests/framework/extensions/kubeapi/workloads/template.go deleted file mode 100644 index 3a0ee872fa5..00000000000 --- a/tests/framework/extensions/kubeapi/workloads/template.go +++ /dev/null @@ -1,43 +0,0 @@ -package workloads - -import ( - "context" - "fmt" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/secrets" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NewImagePullSecret is a contructor that creates an image pull secret for a pod template i.e. corev1.PodTemplateSpec -func NewImagePullSecret(client *rancher.Client, clusterName, namespace string) (*corev1.LocalObjectReference, error) { - k8sClient, err := client.GetDownStreamClusterClient(clusterName) - if err != nil { - return nil, err - } - - resp, err := k8sClient.Resource(secrets.SecretGroupVersionResource).Namespace(namespace).List(context.TODO(), metav1.ListOptions{}) - if err != nil { - return nil, err - } - - secrets := resp.Items - - if len(secrets) < 1 { - return nil, fmt.Errorf("chosen namespace has no secrets") - } - - secret := resp.Items[0] - - newSecret := &corev1.Secret{} - err = scheme.Scheme.Convert(&secret, newSecret, secret.GroupVersionKind()) - if err != nil { - return nil, err - } - - return &corev1.LocalObjectReference{ - Name: newSecret.Name, - }, nil -} diff --git a/tests/framework/extensions/kubeconfig/contexts.go b/tests/framework/extensions/kubeconfig/contexts.go deleted file mode 100644 index 266ed1a08f5..00000000000 --- a/tests/framework/extensions/kubeconfig/contexts.go +++ /dev/null @@ -1,16 +0,0 @@ -package kubeconfig - -import ( - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/tools/clientcmd/api" -) - -// GetContexts is a helper function that lists the contexts of a kubeconfig -func GetContexts(clientConfig *clientcmd.ClientConfig) (map[string]*api.Context, error) { - rawConfig, err := (*clientConfig).RawConfig() - if err != nil { - return nil, err - } - - return rawConfig.Contexts, nil -} diff --git a/tests/framework/extensions/kubeconfig/exec.go b/tests/framework/extensions/kubeconfig/exec.go deleted file mode 100644 index 6a6838ff042..00000000000 --- a/tests/framework/extensions/kubeconfig/exec.go +++ /dev/null @@ -1,113 +0,0 @@ -package kubeconfig - -import ( - "bytes" - "fmt" - "os" - "strings" - - "github.com/spf13/cobra" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/cli-runtime/pkg/genericclioptions" - k8Scheme "k8s.io/client-go/kubernetes/scheme" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/tools/remotecommand" - "k8s.io/kubectl/pkg/cmd/cp" - cmdutil "k8s.io/kubectl/pkg/cmd/util" -) - -const ( - apiPath = "/api" -) - -var podGroupVersion = corev1.SchemeGroupVersion.WithResource("pods").GroupVersion() - -// LogStreamer is a struct that acts like io.Writer inorder to retrieve Stdout from a kubectl exec command in pod -type LogStreamer struct { - b bytes.Buffer -} - -// String stringer for the LogStreamer -func (l *LogStreamer) String() string { - return l.b.String() -} - -// Write is function that writes to the underlying bytes.Buffer -func (l *LogStreamer) Write(p []byte) (n int, err error) { - a := strings.TrimSpace(string(p)) - l.b.WriteString(a) - return len(p), nil -} - -// KubectlExec is function that runs `kubectl exec` in a specified pod of a cluster. The function -// takes the kubeconfig in form of a restclient.Config object, the pod name, the namespace of the pod, -// and the command a user wants to run. -func KubectlExec(restConfig *restclient.Config, podName, namespace string, command []string) (*LogStreamer, error) { - restConfig.ContentConfig.NegotiatedSerializer = serializer.NewCodecFactory(k8Scheme.Scheme) - restConfig.ContentConfig.GroupVersion = &podGroupVersion - restConfig.APIPath = apiPath - - restClient, err := restclient.RESTClientFor(restConfig) - if err != nil { - return nil, err - } - - req := restClient.Post().Resource("pods").Name(podName).Namespace(namespace).SubResource("exec") - option := &corev1.PodExecOptions{ - Command: command, - Stdin: false, - Stdout: true, - Stderr: true, - TTY: true, - } - req.VersionedParams( - option, - k8Scheme.ParameterCodec, - ) - - exec, err := remotecommand.NewSPDYExecutor(restConfig, "POST", req.URL()) - if err != nil { - return nil, err - } - - logStreamer := &LogStreamer{} - err = exec.Stream(remotecommand.StreamOptions{ - Stdin: nil, - Stdout: logStreamer, - Stderr: os.Stderr, - }) - return logStreamer, err -} - -// CopyFileFromPod is function that copies files from a pod. The parameter takes -// the kubeconfig in form of a restclient.Config object, the pod name, the namespace of the pod, the filename, and then -// the local destination (dest) where the file will be copied to. -func CopyFileFromPod(restConfig *restclient.Config, clientConfig clientcmd.ClientConfig, podName, namespace, filename, dest string) error { - restConfig.ContentConfig.NegotiatedSerializer = serializer.NewCodecFactory(k8Scheme.Scheme) - restConfig.ContentConfig.GroupVersion = &podGroupVersion - restConfig.APIPath = apiPath - - ioStreams, _, _, _ := genericclioptions.NewTestIOStreams() - copyOptions := cp.NewCopyOptions(ioStreams) - - newClientGett, err := NewRestGetter(restConfig, clientConfig) - if err != nil { - return err - } - - newFactory := cmdutil.NewFactory(newClientGett) - newCobra := &cobra.Command{} - - source := fmt.Sprintf("%s/%s:%s", namespace, podName, filename) - if err := copyOptions.Complete(newFactory, newCobra, []string{source, dest}); err != nil { - return err - } - - err = copyOptions.Run() - if err != nil { - return err - } - return nil -} diff --git a/tests/framework/extensions/kubeconfig/kubeconfig.go b/tests/framework/extensions/kubeconfig/kubeconfig.go deleted file mode 100644 index 76856c24e5f..00000000000 --- a/tests/framework/extensions/kubeconfig/kubeconfig.go +++ /dev/null @@ -1,28 +0,0 @@ -package kubeconfig - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - "k8s.io/client-go/tools/clientcmd" -) - -// GetKubeconfig generates a kubeconfig froma specific cluster, and returns it in the form of a *clientcmd.ClientConfig -func GetKubeconfig(client *rancher.Client, clusterID string) (*clientcmd.ClientConfig, error) { - cluster, err := client.Management.Cluster.ByID(clusterID) - if err != nil { - return nil, err - } - - kubeConfig, err := client.Management.Cluster.ActionGenerateKubeconfig(cluster) - if err != nil { - return nil, err - } - - configBytes := []byte(kubeConfig.Config) - - clientConfig, err := clientcmd.NewClientConfigFromBytes(configBytes) - if err != nil { - return nil, err - } - - return &clientConfig, nil -} diff --git a/tests/framework/extensions/kubeconfig/podlogs.go b/tests/framework/extensions/kubeconfig/podlogs.go deleted file mode 100644 index 607ef460d01..00000000000 --- a/tests/framework/extensions/kubeconfig/podlogs.go +++ /dev/null @@ -1,61 +0,0 @@ -package kubeconfig - -import ( - "bufio" - "context" - "fmt" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime/serializer" - k8Scheme "k8s.io/client-go/kubernetes/scheme" - restclient "k8s.io/client-go/rest" -) - -// GetPodLogs is a helper function that resturns logs from a pod using rest client -func GetPodLogs(client *rancher.Client, clusterID string, podName string, namespace string) (string, error) { - var restConfig *restclient.Config - - kubeConfig, err := GetKubeconfig(client, clusterID) - if err != nil { - return "", err - } - - restConfig, err = (*kubeConfig).ClientConfig() - if err != nil { - return "", err - } - restConfig.ContentConfig.NegotiatedSerializer = serializer.NewCodecFactory(k8Scheme.Scheme) - restConfig.ContentConfig.GroupVersion = &podGroupVersion - restConfig.APIPath = apiPath - - restClient, err := restclient.RESTClientFor(restConfig) - if err != nil { - return "", err - } - - req := restClient.Get().Resource("pods").Name(podName).Namespace(namespace).SubResource("log") - option := &corev1.PodLogOptions{} - req.VersionedParams( - option, - k8Scheme.ParameterCodec, - ) - - stream, err := req.Stream(context.TODO()) - if err != nil { - return "", fmt.Errorf("error streaming pod logs for pod %s/%s: %v", namespace, podName, err) - } - - defer stream.Close() - - reader := bufio.NewScanner(stream) - var logs string - for reader.Scan() { - logs = logs + fmt.Sprintf("%s\n", reader.Text()) - } - - if err := reader.Err(); err != nil { - return "", fmt.Errorf("error reading pod logs for pod %s/%s: %v", namespace, podName, err) - } - return logs, nil -} diff --git a/tests/framework/extensions/kubeconfig/restgetter.go b/tests/framework/extensions/kubeconfig/restgetter.go deleted file mode 100644 index 4f2d5582498..00000000000 --- a/tests/framework/extensions/kubeconfig/restgetter.go +++ /dev/null @@ -1,58 +0,0 @@ -package kubeconfig - -import ( - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/cli-runtime/pkg/genericclioptions" - "k8s.io/client-go/discovery" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/restmapper" - "k8s.io/client-go/tools/clientcmd" -) - -type RestGetter struct { - genericclioptions.RESTClientGetter - restConfig *rest.Config - clientConfig clientcmd.ClientConfig - cache noCacheDiscoveryClient -} -type noCacheDiscoveryClient struct { - discovery.DiscoveryInterface -} - -// Fresh is a no-op implementation of the corresponding method of the CachedDiscoveryInterface. -// No need to re-try search in the cache, return true. -func (noCacheDiscoveryClient) Fresh() bool { return true } -func (noCacheDiscoveryClient) Invalidate() {} - -func NewRestGetter(restConfig *rest.Config, clientConfig clientcmd.ClientConfig) (*RestGetter, error) { - clientSet, err := kubernetes.NewForConfig(restConfig) - if err != nil { - return nil, err - } - return &RestGetter{ - restConfig: restConfig, - clientConfig: clientConfig, - cache: noCacheDiscoveryClient{clientSet.Discovery()}, - }, nil -} - -// ToRESTConfig returns restconfig -func (r *RestGetter) ToRESTConfig() (*rest.Config, error) { - return r.restConfig, nil -} - -// ToDiscoveryClient returns a cached discovery client. -func (r *RestGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error) { - return r.cache, nil -} - -// ToRESTMapper returns a RESTMapper. -func (r *RestGetter) ToRESTMapper() (meta.RESTMapper, error) { - return restmapper.NewDeferredDiscoveryRESTMapper(r.cache), nil -} - -// ToRawKubeConfigLoader return kubeconfig loader as-is -func (r *RestGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig { - return r.clientConfig -} diff --git a/tests/framework/extensions/kubectl/apply.go b/tests/framework/extensions/kubectl/apply.go deleted file mode 100644 index 790d4fb48e1..00000000000 --- a/tests/framework/extensions/kubectl/apply.go +++ /dev/null @@ -1,96 +0,0 @@ -package kubectl - -import ( - "fmt" - "net" - "strings" - - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeconfig" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - corev1 "k8s.io/api/core/v1" - - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" -) - -const volumeName = "config" - -// Apply is a helper function that call a helper to create a Job and executing kubectl apply by copying the yaml -// in the pod. It returns the output from the pod logs. -func Apply(client *rancher.Client, cluster *apisV1.Cluster, yamlContent *management.ImportClusterYamlInput, clusterID string) (string, error) { - var user int64 - var group int64 - imageSetting, err := client.Management.Setting.ByID(rancherShellSettingID) - if err != nil { - return "", err - } - - jobName := JobName + "-apply" - - initVolumeMount := []corev1.VolumeMount{ - { - Name: volumeName, - MountPath: "/config", - }, - } - - volumeMount := []corev1.VolumeMount{ - { - Name: volumeName, - MountPath: "/root/.kube", - }, - } - - securityContext := &corev1.SecurityContext{ - RunAsUser: &user, - RunAsGroup: &group, - } - - volumes := []corev1.Volume{ - { - Name: "config", - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - }, - } - - jobTemplate := workloads.NewJobTemplate(jobName, Namespace) - - initContainerCommand := []string{"sh", "-c", fmt.Sprintf("echo \"%s\" > /config/my-pod.yaml", strings.ReplaceAll(yamlContent.YAML, "\"", "\\\""))} - initContainer := workloads.NewContainer("copy-yaml", imageSetting.Value, corev1.PullAlways, initVolumeMount, nil, initContainerCommand, nil, nil) - jobTemplate.Spec.Template.Spec.InitContainers = append(jobTemplate.Spec.Template.Spec.InitContainers, initContainer) - - command := []string{"kubectl", "apply", "-f", "/root/.kube/my-pod.yaml"} - container := workloads.NewContainer(jobName, imageSetting.Value, corev1.PullAlways, volumeMount, nil, command, securityContext, nil) - - jobTemplate.Spec.Template.Spec.Containers = append(jobTemplate.Spec.Template.Spec.Containers, container) - jobTemplate.Spec.Template.Spec.Volumes = volumes - err = CreateJobAndRunKubectlCommands(clusterID, jobName, jobTemplate, client) - if err, ok := err.(net.Error); ok && !err.Timeout() { - return "", err - } - - steveClient := client.Steve - pods, err := steveClient.SteveType(pods.PodResourceSteveType).NamespacedSteveClient(Namespace).List(nil) - if err != nil { - return "", err - } - - var podName string - for _, pod := range pods.Data { - if strings.Contains(pod.Name, jobName) { - podName = pod.Name - break - } - } - podLogs, err := kubeconfig.GetPodLogs(client, clusterID, podName, Namespace) - if err != nil { - return "", err - } - - return podLogs, nil -} diff --git a/tests/framework/extensions/kubectl/explain.go b/tests/framework/extensions/kubectl/explain.go deleted file mode 100644 index 618bf180ec4..00000000000 --- a/tests/framework/extensions/kubectl/explain.go +++ /dev/null @@ -1,65 +0,0 @@ -package kubectl - -import ( - "fmt" - "strings" - - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeconfig" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - corev1 "k8s.io/api/core/v1" -) - -// Explain is a helper function that creates a Job by calling the helper CreateJobAndRunKubectlCommands and executing kubectl explain in the pod of the Job -// returns the output from the pod logs. -func Explain(client *rancher.Client, cluster *apisV1.Cluster, cmd, clusterID string) (string, error) { - jobName := JobName + "-explain" - - imageSetting, err := client.Management.Setting.ByID(rancherShellSettingID) - if err != nil { - return "", err - } - - jobTemplate := workloads.NewJobTemplate(jobName, Namespace) - args := []string{ - fmt.Sprintf("kubectl explain %s", cmd), - } - command := []string{"/bin/sh", "-c"} - securityContext := &corev1.SecurityContext{ - RunAsUser: &user, - RunAsGroup: &group, - } - volumeMount := []corev1.VolumeMount{ - {Name: "config", MountPath: "/root/.kube/"}, - } - container := workloads.NewContainer(jobName, imageSetting.Value, corev1.PullAlways, volumeMount, nil, command, securityContext, args) - jobTemplate.Spec.Template.Spec.Containers = append(jobTemplate.Spec.Template.Spec.Containers, container) - - err = CreateJobAndRunKubectlCommands(clusterID, jobName, jobTemplate, client) - if err != nil { - return "", err - } - - steveClient := client.Steve - pods, err := steveClient.SteveType(pods.PodResourceSteveType).NamespacedSteveClient(Namespace).List(nil) - if err != nil { - return "", err - } - - var podName string - for _, pod := range pods.Data { - if strings.Contains(pod.Name, jobName) { - podName = pod.Name - break - } - } - - podLogs, err := kubeconfig.GetPodLogs(client, clusterID, podName, Namespace) - if err != nil { - return "", err - } - - return podLogs, nil -} diff --git a/tests/framework/extensions/kubectl/template.go b/tests/framework/extensions/kubectl/template.go deleted file mode 100644 index 4a7d7372ee3..00000000000 --- a/tests/framework/extensions/kubectl/template.go +++ /dev/null @@ -1,118 +0,0 @@ -package kubectl - -import ( - "context" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeconfig" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/rancher/rancher/tests/framework/clients/dynamic" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - "github.com/rancher/rancher/tests/framework/pkg/wait" - rbacv1 "k8s.io/api/rbac/v1" - v1Unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/watch" - k8Scheme "k8s.io/client-go/kubernetes/scheme" - restclient "k8s.io/client-go/rest" -) - -const ( - // rancherShellSettingID is the setting ID that used to grab rancher/shell image - rancherShellSettingID = "shell-image" - Namespace = "kube-system" - JobName = "kubectl" -) - -var ( - importTimeout = int64(60 * 1) - group int64 - user int64 -) - -// CreateJobAndRunKubectlCommands is a helper to create a job and run the kubectl commands in the pods of the Job. -// It then returns errors or nil from the job. -func CreateJobAndRunKubectlCommands(clusterID, jobname string, job *batchv1.Job, client *rancher.Client) error { - job.ObjectMeta.Name = jobname - job.Spec.Template.ObjectMeta.Name = jobname - var restConfig *restclient.Config - - kubeConfig, err := kubeconfig.GetKubeconfig(client, clusterID) - if err != nil { - return err - } - - restConfig, err = (*kubeConfig).ClientConfig() - if err != nil { - return err - } - restConfig.ContentConfig.NegotiatedSerializer = serializer.NewCodecFactory(k8Scheme.Scheme) - - ts := client.Session.NewSession() - defer ts.Cleanup() - - downClient, err := dynamic.NewForConfig(ts, restConfig) - if err != nil { - return err - } - - sa := &corev1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rancher-installer2", - }, - } - _, err = downClient.Resource(corev1.SchemeGroupVersion.WithResource("serviceaccounts")).Namespace(Namespace).Create(context.TODO(), unstructured.MustToUnstructured(sa), metav1.CreateOptions{}) - if err != nil { - return err - } - - rb := &rbacv1.ClusterRoleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rancher-install-cluster-admin", - }, - Subjects: []rbacv1.Subject{ - { - Kind: "ServiceAccount", - Name: sa.Name, - Namespace: Namespace, - }, - }, - RoleRef: rbacv1.RoleRef{ - APIGroup: rbacv1.SchemeGroupVersion.Group, - Kind: "ClusterRole", - Name: "cluster-admin", - }, - } - _, err = downClient.Resource(rbacv1.SchemeGroupVersion.WithResource("clusterrolebindings")).Namespace("").Create(context.TODO(), unstructured.MustToUnstructured(rb), metav1.CreateOptions{}) - if err != nil { - return err - } - - job.Spec.Template.Spec.ServiceAccountName = sa.Name - - _, err = downClient.Resource(batchv1.SchemeGroupVersion.WithResource("jobs")).Namespace(Namespace).Create(context.TODO(), unstructured.MustToUnstructured(job), metav1.CreateOptions{}) - if err != nil { - return err - } - - jobWatch, err := downClient.Resource(batchv1.SchemeGroupVersion.WithResource("jobs")).Namespace(Namespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: fields.OneTermEqualSelector("metadata.name", job.Name).String(), - TimeoutSeconds: &importTimeout, - }) - if err != nil { - return err - } - - err = wait.WatchWait(jobWatch, func(event watch.Event) (bool, error) { - var wj batchv1.Job - err = runtime.DefaultUnstructuredConverter.FromUnstructured(event.Object.(*v1Unstructured.Unstructured).Object, &wj) - return wj.Status.Succeeded == 1, nil - }) - - return err -} diff --git a/tests/framework/extensions/machinepools/amazonec2_machine_config.go b/tests/framework/extensions/machinepools/amazonec2_machine_config.go deleted file mode 100644 index 9b7a9c6cf06..00000000000 --- a/tests/framework/extensions/machinepools/amazonec2_machine_config.go +++ /dev/null @@ -1,57 +0,0 @@ -package machinepools - -import ( - "github.com/rancher/rancher/tests/framework/pkg/config" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -const ( - AWSKind = "Amazonec2Config" - AWSPoolType = "rke-machine-config.cattle.io.amazonec2config" - AWSResourceConfig = "amazonec2configs" - AWSMachineConfigConfigurationFileKey = "awsMachineConfig" -) - -// AWSMachineConfig is configuration needed to create an rke-machine-config.cattle.io.amazonec2config -type AWSMachineConfig struct { - Region string `json:"region" yaml:"region"` - AMI string `json:"ami" yaml:"ami"` - IAMInstanceProfile string `json:"iamInstanceProfile" yaml:"iamInstanceProfile"` - InstanceType string `json:"instanceType" yaml:"instanceType"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - VPCID string `json:"vpcId" yaml:"vpcId"` - SubnetID string `json:"subnetId" yaml:"subnetId"` - VolumeType string `json:"volumeType" yaml:"volumeType"` - Zone string `json:"zone" yaml:"zone"` - Retries string `json:"retries" yaml:"retries"` - RootSize string `json:"rootSize" yaml:"rootSize"` - SecurityGroup []string `json:"securityGroup" yaml:"securityGroup"` -} - -// NewAWSMachineConfig is a constructor to set up rke-machine-config.cattle.io.amazonec2config. It returns an *unstructured.Unstructured -// that CreateMachineConfig uses to created the rke-machine-config -func NewAWSMachineConfig(generatedPoolName, namespace string) *unstructured.Unstructured { - var awsMachineConfig AWSMachineConfig - config.LoadConfig(AWSMachineConfigConfigurationFileKey, &awsMachineConfig) - - machineConfig := &unstructured.Unstructured{} - machineConfig.SetAPIVersion("rke-machine-config.cattle.io/v1") - machineConfig.SetKind(AWSKind) - machineConfig.SetGenerateName(generatedPoolName) - machineConfig.SetNamespace(namespace) - machineConfig.Object["region"] = awsMachineConfig.Region - machineConfig.Object["ami"] = awsMachineConfig.AMI - machineConfig.Object["iamInstanceProfile"] = awsMachineConfig.IAMInstanceProfile - machineConfig.Object["instanceType"] = awsMachineConfig.InstanceType - machineConfig.Object["sshUser"] = awsMachineConfig.SSHUser - machineConfig.Object["type"] = AWSPoolType - machineConfig.Object["vpcId"] = awsMachineConfig.VPCID - machineConfig.Object["subnetId"] = awsMachineConfig.SubnetID - machineConfig.Object["volumeType"] = awsMachineConfig.VolumeType - machineConfig.Object["zone"] = awsMachineConfig.Zone - machineConfig.Object["retries"] = awsMachineConfig.Retries - machineConfig.Object["rootSize"] = awsMachineConfig.RootSize - machineConfig.Object["securityGroup"] = awsMachineConfig.SecurityGroup - - return machineConfig -} diff --git a/tests/framework/extensions/machinepools/azure_machine_config.go b/tests/framework/extensions/machinepools/azure_machine_config.go deleted file mode 100644 index e48dbcd8dcd..00000000000 --- a/tests/framework/extensions/machinepools/azure_machine_config.go +++ /dev/null @@ -1,74 +0,0 @@ -package machinepools - -import ( - "github.com/rancher/rancher/tests/framework/pkg/config" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -const ( - AzureKind = "AzureConfig" - AzurePoolType = "rke-machine-config.cattle.io.azureconfig" - AzureResourceConfig = "azureconfigs" - AzureMachineConfigConfigurationFileKey = "azureMachineConfig" -) - -// AzureMachineConfig is configuration needed to create an rke-machine-config.cattle.io.azureconfig -type AzureMachineConfig struct { - AvailabilitySet string `json:"availabilitySet" yaml:"availabilitySet"` - DiskSize string `json:"diskSize" yaml:"diskSize"` - DNS string `json:"dns,omitempty" yaml:"dns,omitempty"` - Environment string `json:"environment" yaml:"environment"` - FaultDomainCount string `json:"faultDomainCount" yaml:"faultDomainCount"` - Image string `json:"image" yaml:"image"` - ManagedDisks bool `json:"managedDisks" yaml:"managedDisks"` - NoPublicIP bool `json:"noPublicIp" yaml:"noPublicIp"` - NSG string `json:"nsg" yaml:"nsg"` - OpenPort []string `json:"openPort" yaml:"openPort"` - PrivateIPAddress string `json:"privateIpAddress,omitempty" yaml:"privateIpAddress,omitempty"` - ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"` - Size string `json:"size" yaml:"size"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - StaticPublicIP bool `json:"staticPublicIp" yaml:"staticPublicIp"` - StorageType string `json:"storageType" yaml:"storageType"` - Subnet string `json:"subnet" yaml:"subnet"` - SubnetPrefix string `json:"subnetPrefix" yaml:"subnetPrefix"` - UpdateDomainCount string `json:"updateDomainCount" yaml:"updateDomainCount"` - UsePrivateIP bool `json:"usePrivateIp" yaml:"usePrivateIp"` - Vnet string `json:"vnet" yaml:"vnet"` -} - -// NewAzureMachineConfig is a constructor to set up rke-machine-config.cattle.io.azureconfig. It returns an *unstructured.Unstructured -// that CreateMachineConfig uses to created the rke-machine-config -func NewAzureMachineConfig(generatedPoolName, namespace string) *unstructured.Unstructured { - var azureMachineConfig AzureMachineConfig - config.LoadConfig(AzureMachineConfigConfigurationFileKey, &azureMachineConfig) - - machineConfig := &unstructured.Unstructured{} - machineConfig.SetAPIVersion("rke-machine-config.cattle.io/v1") - machineConfig.SetKind(DOKind) - machineConfig.SetGenerateName(generatedPoolName) - machineConfig.SetNamespace(namespace) - machineConfig.Object["availabilitySet"] = azureMachineConfig.AvailabilitySet - machineConfig.Object["diskSize"] = azureMachineConfig.DiskSize - machineConfig.Object["dns"] = azureMachineConfig.DNS - machineConfig.Object["environment"] = azureMachineConfig.Environment - machineConfig.Object["faultDomainCount"] = azureMachineConfig.FaultDomainCount - machineConfig.Object["image"] = azureMachineConfig.Image - machineConfig.Object["managedDisks"] = azureMachineConfig.ManagedDisks - machineConfig.Object["noPublicIp"] = azureMachineConfig.NoPublicIP - machineConfig.Object["nsg"] = azureMachineConfig.NSG - machineConfig.Object["openPort"] = azureMachineConfig.OpenPort - machineConfig.Object["privateIpAddress"] = azureMachineConfig.PrivateIPAddress - machineConfig.Object["resourceGroup"] = azureMachineConfig.ResourceGroup - machineConfig.Object["size"] = azureMachineConfig.Size - machineConfig.Object["sshUser"] = azureMachineConfig.SSHUser - machineConfig.Object["staticPublicIP"] = azureMachineConfig.StaticPublicIP - machineConfig.Object["storageType"] = azureMachineConfig.StorageType - machineConfig.Object["subnet"] = azureMachineConfig.Subnet - machineConfig.Object["subnetPrefix"] = azureMachineConfig.SubnetPrefix - machineConfig.Object["updateDomainCount"] = azureMachineConfig.UpdateDomainCount - machineConfig.Object["usePrivateIp"] = azureMachineConfig.UsePrivateIP - machineConfig.Object["vnet"] = azureMachineConfig.Vnet - machineConfig.Object["type"] = AzurePoolType - return machineConfig -} diff --git a/tests/framework/extensions/machinepools/digitalocean_machine_config.go b/tests/framework/extensions/machinepools/digitalocean_machine_config.go deleted file mode 100644 index d3295f7e553..00000000000 --- a/tests/framework/extensions/machinepools/digitalocean_machine_config.go +++ /dev/null @@ -1,59 +0,0 @@ -package machinepools - -import ( - "github.com/rancher/rancher/tests/framework/pkg/config" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -const ( - DOKind = "DigitaloceanConfig" - DOPoolType = "rke-machine-config.cattle.io.digitaloceanconfig" - DOResourceConfig = "digitaloceanconfigs" - DOMachineConfigConfigurationFileKey = "doMachineConfig" -) - -// DOMachineConfig is configuration needed to create an rke-machine-config.cattle.io.digitaloceanconfig -type DOMachineConfig struct { - Image string `json:"image" yaml:"image"` - Backups bool `json:"backups" yaml:"backups"` - IPV6 bool `json:"ipv6" yaml:"ipv6"` - Monitoring bool `json:"monitoring" yaml:"monitoring"` - PrivateNetworking bool `json:"privateNetworking" yaml:"privateNetworking"` - Region string `json:"region" yaml:"region"` - Size string `json:"size" yaml:"size"` - SSHKeyContents string `json:"sshKeyContents" yaml:"sshKeyContents"` - SSHKeyFingerprint string `json:"sshKeyFingerprint" yaml:"sshKeyFingerprint"` - SSHPort string `json:"sshPort" yaml:"sshPort"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - Tags string `json:"tags" yaml:"tags"` - Userdata string `json:"userdata" yaml:"userdata"` -} - -// NewDigitalOceanMachineConfig is a constructor to set up rke-machine-config.cattle.io.digitaloceanconfig. It returns an *unstructured.Unstructured -// that CreateMachineConfig uses to created the rke-machine-config -func NewDigitalOceanMachineConfig(generatedPoolName, namespace string) *unstructured.Unstructured { - var doMachineConfig DOMachineConfig - config.LoadConfig(DOMachineConfigConfigurationFileKey, &doMachineConfig) - - machineConfig := &unstructured.Unstructured{} - machineConfig.SetAPIVersion("rke-machine-config.cattle.io/v1") - machineConfig.SetKind(DOKind) - machineConfig.SetGenerateName(generatedPoolName) - machineConfig.SetNamespace(namespace) - machineConfig.Object["accessToken"] = "" - machineConfig.Object["image"] = doMachineConfig.Image - machineConfig.Object["backups"] = doMachineConfig.Backups - machineConfig.Object["ipv6"] = doMachineConfig.IPV6 - machineConfig.Object["monitoring"] = doMachineConfig.Monitoring - machineConfig.Object["privateNetworking"] = doMachineConfig.PrivateNetworking - machineConfig.Object["region"] = doMachineConfig.Region - machineConfig.Object["size"] = doMachineConfig.Size - machineConfig.Object["sshKeyContents"] = doMachineConfig.SSHKeyContents - machineConfig.Object["sshKeyFingerprint"] = doMachineConfig.SSHKeyFingerprint - machineConfig.Object["sshPort"] = doMachineConfig.SSHPort - machineConfig.Object["sshUser"] = doMachineConfig.SSHUser - machineConfig.Object["tags"] = doMachineConfig.Tags - machineConfig.Object["type"] = DOPoolType - machineConfig.Object["userdata"] = doMachineConfig.Userdata - return machineConfig -} diff --git a/tests/framework/extensions/machinepools/harvester_machine_config.go b/tests/framework/extensions/machinepools/harvester_machine_config.go deleted file mode 100644 index de01609e54a..00000000000 --- a/tests/framework/extensions/machinepools/harvester_machine_config.go +++ /dev/null @@ -1,49 +0,0 @@ -package machinepools - -import ( - "github.com/rancher/rancher/tests/framework/pkg/config" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -const ( - HarvesterKind = "HarvesterConfig" - HarvesterPoolType = "rke-machine-config.cattle.io.harvesterconfig" - HarvesterResourceConfig = "harvesterconfigs" - HarvesterMachineConfigConfigurationFileKey = "harvesterMachineConfig" -) - -// HarvesterMachineConfig is configuration needed to create an rke-machine-config.cattle.io.harvesterconfig -type HarvesterMachineConfig struct { - DiskSize string `json:"diskSize" yaml:"diskSize"` - CPUCount string `json:"cpuCount" yaml:"cpuCount"` - MemorySize string `json:"memorySize" yaml:"memorySize"` - NetworkName string `json:"networkName" yaml:"networkName"` - ImageName string `json:"imageName" yaml:"imageName"` - VMNamespace string `json:"vmNamespace" yaml:"vmNamespace"` - DiskBus string `json:"diskBus" yaml:"diskBus"` - SSHUser string `json:"sshUser" yaml:"sshUser"` -} - -// NewHarvesterMachineConfig is a constructor to set up rke-machine-config.cattle.io.harvesterconfig. -// It returns an *unstructured.Unstructured that CreateMachineConfig uses to created the rke-machine-config -func NewHarvesterMachineConfig(generatedPoolName, namespace string) *unstructured.Unstructured { - var harvesterMachineConfig HarvesterMachineConfig - config.LoadConfig(HarvesterMachineConfigConfigurationFileKey, &harvesterMachineConfig) - machineConfig := &unstructured.Unstructured{} - - machineConfig.SetAPIVersion("rke-machine-config.cattle.io/v1") - machineConfig.SetKind(HarvesterKind) - machineConfig.SetGenerateName(generatedPoolName) - machineConfig.SetNamespace(namespace) - - machineConfig.Object["diskSize"] = harvesterMachineConfig.DiskSize - machineConfig.Object["diskBus"] = harvesterMachineConfig.DiskBus - machineConfig.Object["cpuCount"] = harvesterMachineConfig.CPUCount - machineConfig.Object["memorySize"] = harvesterMachineConfig.MemorySize - machineConfig.Object["networkName"] = harvesterMachineConfig.NetworkName - machineConfig.Object["imageName"] = harvesterMachineConfig.ImageName - machineConfig.Object["vmNamespace"] = harvesterMachineConfig.VMNamespace - machineConfig.Object["sshUser"] = harvesterMachineConfig.SSHUser - - return machineConfig -} diff --git a/tests/framework/extensions/machinepools/linode_machine_config.go b/tests/framework/extensions/machinepools/linode_machine_config.go deleted file mode 100644 index c1851de2b1b..00000000000 --- a/tests/framework/extensions/machinepools/linode_machine_config.go +++ /dev/null @@ -1,61 +0,0 @@ -package machinepools - -import ( - "github.com/rancher/rancher/tests/framework/pkg/config" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -const ( - LinodeKind = "LinodeConfig" - LinodePoolType = "rke-machine-config.cattle.io.linodeconfig" - LinodeResourceConfig = "linodeconfigs" - LinodeMachineConfigConfigurationFileKey = "linodeMachineConfig" -) - -// LinodeMachineConfig is configuration needed to create an rke-machine-config.cattle.io.linodeconfig -type LinodeMachineConfig struct { - AuthorizedUsers string `json:"authorizedUsers" yaml:"authorizedUsers"` - DockerPort string `json:"dockerPort" yaml:"dockerPort"` - CreatePrivateIP bool `json:"createPrivateIp" yaml:"createPrivateIp"` - Image string `json:"image" yaml:"image"` - InstanceType string `json:"instanceType" yaml:"instanceType"` - Region string `json:"region" yaml:"region"` - RootPass string `json:"rootPass" yaml:"rootPass"` - SSHPort string `json:"sshPort" yaml:"sshPort"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - Stackscript string `json:"stackscript" yaml:"stackscript"` - StackscriptData string `json:"stackscriptData" yaml:"stackscriptData"` - SwapSize string `json:"swapSize" yaml:"swapSize"` - Tags string `json:"tags" yaml:"tags"` - UAPrefix string `json:"uaPrefix" yaml:"uaPrefix"` -} - -// NewLinodeMachineConfig is a constructor to set up rke-machine-config.cattle.io.linodeconfigs. It returns an *unstructured.Unstructured -// that CreateMachineConfig uses to created the rke-machine-config -func NewLinodeMachineConfig(generatedPoolName, namespace string) *unstructured.Unstructured { - var linodeMachineConfig LinodeMachineConfig - config.LoadConfig(LinodeMachineConfigConfigurationFileKey, &linodeMachineConfig) - - machineConfig := &unstructured.Unstructured{} - machineConfig.SetAPIVersion("rke-machine-config.cattle.io/v1") - machineConfig.SetKind(LinodeKind) - machineConfig.SetGenerateName(generatedPoolName) - machineConfig.SetNamespace(namespace) - machineConfig.Object["authorizedUsers"] = linodeMachineConfig.AuthorizedUsers - machineConfig.Object["createPrivateIp"] = linodeMachineConfig.CreatePrivateIP - machineConfig.Object["dockerPort"] = linodeMachineConfig.DockerPort - machineConfig.Object["image"] = linodeMachineConfig.Image - machineConfig.Object["instanceType"] = linodeMachineConfig.InstanceType - machineConfig.Object["region"] = linodeMachineConfig.Region - machineConfig.Object["rootPass"] = linodeMachineConfig.RootPass - machineConfig.Object["sshPort"] = linodeMachineConfig.SSHPort - machineConfig.Object["sshUser"] = linodeMachineConfig.SSHUser - machineConfig.Object["stackscript"] = linodeMachineConfig.Stackscript - machineConfig.Object["stackscriptData"] = linodeMachineConfig.StackscriptData - machineConfig.Object["swapSize"] = linodeMachineConfig.SwapSize - machineConfig.Object["tags"] = linodeMachineConfig.Tags - machineConfig.Object["token"] = "" - machineConfig.Object["type"] = LinodePoolType - machineConfig.Object["uaPrefix"] = linodeMachineConfig.UAPrefix - return machineConfig -} diff --git a/tests/framework/extensions/machinepools/machinepools.go b/tests/framework/extensions/machinepools/machinepools.go deleted file mode 100644 index 0e62592137f..00000000000 --- a/tests/framework/extensions/machinepools/machinepools.go +++ /dev/null @@ -1,196 +0,0 @@ -package machinepools - -import ( - "fmt" - "strconv" - "strings" - "time" - - apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - active = "active" -) - -// MatchNodeRolesToMachinePool matches the role of machinePools to the nodeRoles. -func MatchNodeRolesToMachinePool(nodeRoles NodeRoles, machinePools []apisV1.RKEMachinePool) (int, int32) { - count := int32(0) - for index, machinePoolConfig := range machinePools { - if nodeRoles.ControlPlane != machinePoolConfig.ControlPlaneRole { - continue - } - if nodeRoles.Etcd != machinePoolConfig.EtcdRole { - continue - } - if nodeRoles.Worker != machinePoolConfig.WorkerRole { - continue - } - - count += *machinePoolConfig.Quantity - - return index, count - } - - return -1, count -} - -// updateMachinePoolQuantity is a helper method that will update the desired machine pool with the latest quantity. -func updateMachinePoolQuantity(client *rancher.Client, cluster *v1.SteveAPIObject, nodeRoles NodeRoles) (*v1.SteveAPIObject, error) { - updateCluster, err := client.Steve.SteveType("provisioning.cattle.io.cluster").ByID(cluster.ID) - if err != nil { - return nil, err - } - - updatedCluster := new(apisV1.Cluster) - err = v1.ConvertToK8sType(cluster, &updatedCluster) - if err != nil { - return nil, err - } - - updatedCluster.ObjectMeta.ResourceVersion = updateCluster.ObjectMeta.ResourceVersion - machineConfig, newQuantity := MatchNodeRolesToMachinePool(nodeRoles, updatedCluster.Spec.RKEConfig.MachinePools) - - newQuantity += nodeRoles.Quantity - updatedCluster.Spec.RKEConfig.MachinePools[machineConfig].Quantity = &newQuantity - - logrus.Infof("Scaling the machine pool to %v total nodes", newQuantity) - cluster, err = client.Steve.SteveType("provisioning.cattle.io.cluster").Update(cluster, updatedCluster) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, defaults.TenMinuteTimeout, func() (done bool, err error) { - clusterResp, err := client.Steve.SteveType("provisioning.cattle.io.cluster").ByID(cluster.ID) - if err != nil { - return false, err - } - - if clusterResp.ObjectMeta.State.Name == active && nodestat.AllManagementNodeReady(client, cluster.ID, defaults.ThirtyMinuteTimeout) == nil { - return true, nil - } - - return false, nil - }) - if err != nil { - return nil, err - } - - return cluster, nil -} - -// NewRKEMachinePool is a constructor that sets up a apisV1.RKEMachinePool object to be used to provision a cluster. -func NewRKEMachinePool(controlPlaneRole, etcdRole, workerRole bool, poolName string, quantity int32, machineConfig *v1.SteveAPIObject, hostnameLengthLimit int, drainBeforeDelete bool) apisV1.RKEMachinePool { - machineConfigRef := &corev1.ObjectReference{ - Kind: machineConfig.Kind, - Name: machineConfig.Name, - } - - machinePool := apisV1.RKEMachinePool{ - ControlPlaneRole: controlPlaneRole, - EtcdRole: etcdRole, - WorkerRole: workerRole, - NodeConfig: machineConfigRef, - Name: poolName, - Quantity: &quantity, - DrainBeforeDelete: drainBeforeDelete, - } - - if hostnameLengthLimit > 0 { - machinePool.HostnameLengthLimit = hostnameLengthLimit - } - - return machinePool -} - -type NodeRoles struct { - ControlPlane bool `json:"controlplane,omitempty" yaml:"controlplane,omitempty"` - Etcd bool `json:"etcd,omitempty" yaml:"etcd,omitempty"` - Worker bool `json:"worker,omitempty" yaml:"worker,omitempty"` - Windows bool `json:"windows,omitempty" yaml:"windows,omitempty"` - Quantity int32 `json:"quantity" yaml:"quantity"` - DrainBeforeDelete bool `json:"drainBeforeDelete,omitempty" yaml:"drainBeforeDelete,omitempty"` -} - -// HostnameTruncation is a struct that is used to set the hostname length limit for a cluster or its pools during provisioning -type HostnameTruncation struct { - PoolNameLengthLimit int - ClusterNameLengthLimit int - Name string -} - -func (n NodeRoles) String() string { - result := make([]string, 0, 3) - if n.Quantity < 1 { - return "" - } - if n.ControlPlane { - result = append(result, "controlplane") - } - if n.Etcd { - result = append(result, "etcd") - } - if n.Worker { - result = append(result, "worker") - } - return fmt.Sprintf("%d %s", n.Quantity, strings.Join(result, "+")) -} - -// CreateAllMachinePools is a helper method that will loop and setup multiple node pools with the defined node roles from the `nodeRoles` parameter -// `machineConfig` is the *unstructured.Unstructured created by CreateMachineConfig -// `nodeRoles` would be in this format -// -// []NodeRoles{ -// { -// ControlPlane: true, -// Etcd: false, -// Worker: false, -// Quantity: 1, -// }, -// { -// ControlPlane: false, -// Etcd: true, -// Worker: false, -// Quantity: 1, -// }, -// } -func CreateAllMachinePools(nodeRoles []NodeRoles, machineConfig *v1.SteveAPIObject, hostnameLengthLimits []HostnameTruncation) []apisV1.RKEMachinePool { - machinePools := make([]apisV1.RKEMachinePool, 0, len(nodeRoles)) - hostnameLengthLimit := 0 - - for index, roles := range nodeRoles { - poolName := "pool" + strconv.Itoa(index) - if hostnameLengthLimits != nil && len(hostnameLengthLimits) >= index { - hostnameLengthLimit = hostnameLengthLimits[index].PoolNameLengthLimit - poolName = hostnameLengthLimits[index].Name - } - - if !roles.Windows { - machinePool := NewRKEMachinePool(roles.ControlPlane, roles.Etcd, roles.Worker, poolName, roles.Quantity, machineConfig, hostnameLengthLimit, roles.DrainBeforeDelete) - machinePools = append(machinePools, machinePool) - } else { - machinePool := NewRKEMachinePool(false, false, roles.Windows, poolName, roles.Quantity, machineConfig, hostnameLengthLimit, roles.DrainBeforeDelete) - machinePools = append(machinePools, machinePool) - } - } - return machinePools -} - -// ScaleMachinePoolNodes is a helper method that will scale the machine pool to the desired quantity. -func ScaleMachinePoolNodes(client *rancher.Client, cluster *v1.SteveAPIObject, nodeRoles NodeRoles) (*v1.SteveAPIObject, error) { - scaledClusterResp, err := updateMachinePoolQuantity(client, cluster, nodeRoles) - if err != nil { - return nil, err - } - - logrus.Infof("Machine pool has been scaled!") - - return scaledClusterResp, nil -} diff --git a/tests/framework/extensions/machinepools/vsphere_machine_config.go b/tests/framework/extensions/machinepools/vsphere_machine_config.go deleted file mode 100644 index 38507e47665..00000000000 --- a/tests/framework/extensions/machinepools/vsphere_machine_config.go +++ /dev/null @@ -1,94 +0,0 @@ -package machinepools - -import ( - "github.com/rancher/rancher/tests/framework/pkg/config" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -const ( - VmwaresphereKind = "VmwarevsphereConfig" - VmwarevsphereType = "rke-machine-config.cattle.io.vmwarevsphereconfig" - VmwarevsphereConfig = "vmwarevsphereconfigs" - VmwarevsphereMachineConfigConfigurationFileKey = "vmwarevsphereMachineConfig" -) - -// VsphereMachineConfig is configuration needed to create an rke-machine-config.cattle.io.vmwarevsphereconfig -type VmwarevsphereMachineConfig struct { - Cfgparam []string `json:"cfgparam" yaml:"cfgparam"` - CloneFrom string `json:"cloneFrom" yaml:"cloneFrom"` - CloudConfig string `json:"cloudConfig" yaml:"cloudConfig"` - Cloundinit string `json:"cloundinit" yaml:"cloundinit"` - ContentLibrary string `json:"contentLibrary" yaml:"contentLibrary"` - CPUCount string `json:"cpuCount" yaml:"cpuCount"` - CreationType string `json:"creationType" yaml:"creationType"` - CustomAttribute []string `json:"customAttribute" yaml:"customAttribute"` - DataCenter string `json:"dataCenter" yaml:"dataCenter"` - DataStore string `json:"dataStore" yaml:"dataStore"` - DatastoreCluster string `json:"datastoreCluster" yaml:"datastoreCluster"` - DiskSize string `json:"diskSize" yaml:"diskSize"` - Folder string `json:"folder" yaml:"folder"` - HostSystem string `json:"hostSystem" yaml:"hostSystem"` - MemorySize string `json:"memorySize" yaml:"memorySize"` - Network []string `json:"network" yaml:"network"` - OS string `json:"os" yaml:"os"` - Password string `json:"password" yaml:"password"` - Pool string `json:"pool" yaml:"pool"` - SSHPassword string `json:"sshPassword" yaml:"sshPassword"` - SSHPort string `json:"sshPort" yaml:"sshPort"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - SSHUserGroup string `json:"sshUserGroup" yaml:"sshUserGroup"` - Tag []string `json:"tag" yaml:"tag"` - Username string `json:"username" yaml:"username"` - VappIpallocationplicy string `json:"vappIpallocationplicy" yaml:"vappIpallocationplicy"` - VappIpprotocol string `json:"vappIpprotocol" yaml:"vappIpprotocol"` - VappProperty []string `json:"vappProperty" yaml:"vappProperty"` - VappTransport string `json:"vappTransport" yaml:"vappTransport"` - Vcenter string `json:"vcenter" yaml:"vcenter"` - VcenterPort string `json:"vcenterPort" yaml:"vcenterPort"` -} - -// NewVSphereMachineConfig is a constructor to set up rke-machine-config.cattle.io.vmwarevsphereconfig. It returns an *unstructured.Unstructured -// that CreateMachineConfig uses to created the rke-machine-config -func NewVSphereMachineConfig(generatedPoolName, namespace string) *unstructured.Unstructured { - var vmwarevsphereMachineConfig VmwarevsphereMachineConfig - config.LoadConfig(VmwarevsphereMachineConfigConfigurationFileKey, &vmwarevsphereMachineConfig) - - machineConfig := &unstructured.Unstructured{} - machineConfig.SetAPIVersion("rke-machine-config.cattle.io/v1") - machineConfig.SetKind(AWSKind) - machineConfig.SetGenerateName(generatedPoolName) - machineConfig.SetNamespace(namespace) - machineConfig.Object["cfgParam"] = vmwarevsphereMachineConfig.Cfgparam - machineConfig.Object["cloneFrom"] = vmwarevsphereMachineConfig.CloneFrom - machineConfig.Object["cloudConfig"] = vmwarevsphereMachineConfig.CloudConfig - machineConfig.Object["cloundInit"] = vmwarevsphereMachineConfig.Cloundinit - machineConfig.Object["contentLibrary"] = vmwarevsphereMachineConfig.ContentLibrary - machineConfig.Object["cpuCount"] = vmwarevsphereMachineConfig.CPUCount - machineConfig.Object["creationType"] = vmwarevsphereMachineConfig.CreationType - machineConfig.Object["customAttribute"] = vmwarevsphereMachineConfig.CustomAttribute - machineConfig.Object["dataCenter"] = vmwarevsphereMachineConfig.DataCenter - machineConfig.Object["dataStore"] = vmwarevsphereMachineConfig.DataStore - machineConfig.Object["datastoreCluster"] = vmwarevsphereMachineConfig.DatastoreCluster - machineConfig.Object["diskSize"] = vmwarevsphereMachineConfig.DiskSize - machineConfig.Object["folder"] = vmwarevsphereMachineConfig.Folder - machineConfig.Object["hostSystem"] = vmwarevsphereMachineConfig.HostSystem - machineConfig.Object["memorySize"] = vmwarevsphereMachineConfig.MemorySize - machineConfig.Object["network"] = vmwarevsphereMachineConfig.Network - machineConfig.Object["os"] = vmwarevsphereMachineConfig.OS - machineConfig.Object["password"] = vmwarevsphereMachineConfig.Password - machineConfig.Object["pool"] = vmwarevsphereMachineConfig.Pool - machineConfig.Object["sshPassword"] = vmwarevsphereMachineConfig.SSHPassword - machineConfig.Object["sshPort"] = vmwarevsphereMachineConfig.SSHPort - machineConfig.Object["sshUser"] = vmwarevsphereMachineConfig.SSHUser - machineConfig.Object["sshUserGroup"] = vmwarevsphereMachineConfig.SSHUserGroup - machineConfig.Object["tag"] = vmwarevsphereMachineConfig.Tag - machineConfig.Object["username"] = vmwarevsphereMachineConfig.Username - machineConfig.Object["vappIpallocationplicy"] = vmwarevsphereMachineConfig.VappIpallocationplicy - machineConfig.Object["vappIpprotocol"] = vmwarevsphereMachineConfig.VappIpprotocol - machineConfig.Object["vappProperty"] = vmwarevsphereMachineConfig.VappProperty - machineConfig.Object["vappTransport"] = vmwarevsphereMachineConfig.VappTransport - machineConfig.Object["vcenter"] = vmwarevsphereMachineConfig.Vcenter - machineConfig.Object["vcenterPort"] = vmwarevsphereMachineConfig.VcenterPort - - return machineConfig -} diff --git a/tests/framework/extensions/namespaces/create.go b/tests/framework/extensions/namespaces/create.go deleted file mode 100644 index 64cd6c49bd1..00000000000 --- a/tests/framework/extensions/namespaces/create.go +++ /dev/null @@ -1,149 +0,0 @@ -package namespaces - -import ( - "context" - "fmt" - "strings" - "time" - - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/wait" - coreV1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kubeUnstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - kwait "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - NamespaceSteveType = "namespace" -) - -// CreateNamespace is a helper function that uses the dynamic client to create a namespace on a project. -// It registers a delete function with a wait.WatchWait to ensure the namspace is deleted cleanly. -func CreateNamespace(client *rancher.Client, namespaceName, containerDefaultResourceLimit string, labels, annotations map[string]string, project *management.Project) (*v1.SteveAPIObject, error) { - if annotations == nil { - annotations = make(map[string]string) - } - if containerDefaultResourceLimit != "" { - annotations["field.cattle.io/containerDefaultResourceLimit"] = containerDefaultResourceLimit - } - if project != nil { - annotations["field.cattle.io/projectId"] = project.ID - } - namespace := &coreV1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespaceName, - Annotations: annotations, - Labels: labels, - }, - } - - steveClient, err := client.Steve.ProxyDownstream(project.ClusterID) - if err != nil { - return nil, err - } - - nameSpaceClient := steveClient.SteveType(NamespaceSteveType) - - resp, err := nameSpaceClient.Create(namespace) - if err != nil { - return nil, err - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return nil, err - } - - adminDynamicClient, err := adminClient.GetDownStreamClusterClient(project.ClusterID) - if err != nil { - return nil, err - } - - clusterRoleResource := adminDynamicClient.Resource(rbacv1.SchemeGroupVersion.WithResource("clusterroles")) - projectID := strings.Split(project.ID, ":")[1] - - clusterRoleWatch, err := clusterRoleResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + fmt.Sprintf("%s-namespaces-edit", projectID), - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return nil, err - } - - err = wait.WatchWait(clusterRoleWatch, func(event watch.Event) (ready bool, err error) { - clusterRole := &rbacv1.ClusterRole{} - err = scheme.Scheme.Convert(event.Object.(*kubeUnstructured.Unstructured), clusterRole, event.Object.(*kubeUnstructured.Unstructured).GroupVersionKind()) - - if err != nil { - return false, err - } - - for _, rule := range clusterRole.Rules { - for _, resourceName := range rule.ResourceNames { - if resourceName == namespaceName { - return true, nil - } - } - } - return false, nil - }) - - if err != nil { - return nil, err - } - - client.Session.RegisterCleanupFunc(func() error { - steveClient, err = client.Steve.ProxyDownstream(project.ClusterID) - if err != nil { - return err - } - - nameSpaceClient = steveClient.SteveType(NamespaceSteveType) - err := nameSpaceClient.Delete(resp) - if errors.IsNotFound(err) { - return nil - } - if err != nil { - return err - } - - adminNamespaceResource := adminDynamicClient.Resource(namespaces.NamespaceGroupVersionResource).Namespace("") - watchInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + resp.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - - if err != nil { - return err - } - - return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Deleted { - return true, nil - } - return false, nil - }) - }) - err = kwait.Poll(300*time.Millisecond, 3*time.Minute, func() (done bool, err error) { - namespaceStatus := &coreV1.NamespaceStatus{} - err = v1.ConvertToK8sType(resp.Status, namespaceStatus) - if err != nil { - return false, err - } - if namespaceStatus.Phase == "Active" { - return true, nil - } - return false, nil - }) - return resp, nil -} diff --git a/tests/framework/extensions/nodes/ec2/ec2.go b/tests/framework/extensions/nodes/ec2/ec2.go deleted file mode 100644 index f3a0b13b035..00000000000 --- a/tests/framework/extensions/nodes/ec2/ec2.go +++ /dev/null @@ -1,183 +0,0 @@ -package ec2 - -import ( - "errors" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - rancherEc2 "github.com/rancher/rancher/tests/framework/clients/ec2" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/pkg/nodes" -) - -const ( - nodeBaseName = "rancher-automation" -) - -// CreateNodes creates `quantityPerPool[n]` number of ec2 instances -func CreateNodes(client *rancher.Client, rolesPerPool []string, quantityPerPool []int32) (ec2Nodes []*nodes.Node, err error) { - ec2Client, err := client.GetEC2Client() - if err != nil { - return nil, err - } - - runningReservations := []*ec2.Reservation{} - reservationConfigs := []*rancherEc2.AWSEC2Config{} - // provisioning instances in reverse order to allow windows instances time to become ready - for i := len(quantityPerPool) - 1; i >= 0; i-- { - config := MatchRoleToConfig(rolesPerPool[i], ec2Client.ClientConfig.AWSEC2Config) - if config == nil { - return nil, errors.New("No matching nodesAndRole for AWSEC2Config with role:" + rolesPerPool[i]) - } - sshName := getSSHKeyName(config.AWSSSHKeyName) - runInstancesInput := &ec2.RunInstancesInput{ - ImageId: aws.String(config.AWSAMI), - InstanceType: aws.String(config.InstanceType), - MinCount: aws.Int64(int64(quantityPerPool[i])), - MaxCount: aws.Int64(int64(quantityPerPool[i])), - KeyName: aws.String(sshName), - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - { - DeviceName: aws.String("/dev/sda1"), - Ebs: &ec2.EbsBlockDevice{ - VolumeSize: aws.Int64(int64(config.VolumeSize)), - }, - }, - }, - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ - Name: aws.String(config.AWSIAMProfile), - }, - Placement: &ec2.Placement{ - AvailabilityZone: aws.String(config.AWSRegionAZ), - }, - NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - { - DeviceIndex: aws.Int64(0), - AssociatePublicIpAddress: aws.Bool(true), - Groups: aws.StringSlice(config.AWSSecurityGroups), - }, - }, - TagSpecifications: []*ec2.TagSpecification{ - { - ResourceType: aws.String("instance"), - Tags: []*ec2.Tag{ - { - Key: aws.String("Name"), - Value: aws.String(nodeBaseName), - }, - { - Key: aws.String("CICD"), - Value: aws.String(config.AWSCICDInstanceTag), - }, - }, - }, - }, - } - - reservation, err := ec2Client.SVC.RunInstances(runInstancesInput) - if err != nil { - return nil, err - } - // instead of waiting on each node pool to complete provisioning, add to a queue and check run status later - runningReservations = append(runningReservations, reservation) - reservationConfigs = append(reservationConfigs, config) - } - - for i := 0; i < len(quantityPerPool); i++ { - var listOfInstanceIds []*string - - for _, instance := range runningReservations[i].Instances { - listOfInstanceIds = append(listOfInstanceIds, instance.InstanceId) - } - - //wait until instance is running - err = ec2Client.SVC.WaitUntilInstanceRunning(&ec2.DescribeInstancesInput{ - InstanceIds: listOfInstanceIds, - }) - if err != nil { - return nil, err - } - - //wait until instance status is ok - err = ec2Client.SVC.WaitUntilInstanceStatusOk(&ec2.DescribeInstanceStatusInput{ - InstanceIds: listOfInstanceIds, - }) - if err != nil { - return nil, err - } - - // describe instance to get attributes - describe, err := ec2Client.SVC.DescribeInstances(&ec2.DescribeInstancesInput{ - InstanceIds: listOfInstanceIds, - }) - if err != nil { - return nil, err - } - - readyInstances := describe.Reservations[0].Instances - - sshKey, err := nodes.GetSSHKey(reservationConfigs[i].AWSSSHKeyName) - if err != nil { - return nil, err - } - - for _, readyInstance := range readyInstances { - ec2Node := &nodes.Node{ - NodeID: *readyInstance.InstanceId, - PublicIPAddress: *readyInstance.PublicIpAddress, - PrivateIPAddress: *readyInstance.PrivateIpAddress, - SSHUser: reservationConfigs[i].AWSUser, - SSHKey: sshKey, - } - // re-reverse the list so that the order is corrected - ec2Nodes = append([]*nodes.Node{ec2Node}, ec2Nodes...) - } - } - - client.Session.RegisterCleanupFunc(func() error { - return DeleteNodes(client, ec2Nodes) - }) - - return ec2Nodes, nil -} - -// MatchRoleToConfig matches the role of nodesAndRoles to the ec2Config that allows this role. -func MatchRoleToConfig(poolRole string, ec2Configs []rancherEc2.AWSEC2Config) *rancherEc2.AWSEC2Config { - for _, config := range ec2Configs { - hasMatch := false - for _, configRole := range config.Roles { - if strings.Contains(poolRole, configRole) { - hasMatch = true - } - } - if hasMatch { - return &config - } - } - return nil -} - -// DeleteNodes terminates ec2 instances that have been created. -func DeleteNodes(client *rancher.Client, nodes []*nodes.Node) error { - ec2Client, err := client.GetEC2Client() - if err != nil { - return err - } - - var instanceIDs []*string - for _, node := range nodes { - instanceIDs = append(instanceIDs, aws.String(node.NodeID)) - } - - _, err = ec2Client.SVC.TerminateInstances(&ec2.TerminateInstancesInput{ - InstanceIds: instanceIDs, - }) - - return err -} - -func getSSHKeyName(sshKeyName string) string { - stringSlice := strings.Split(sshKeyName, ".") - return stringSlice[0] -} diff --git a/tests/framework/extensions/nodes/node_status.go b/tests/framework/extensions/nodes/node_status.go deleted file mode 100644 index 236e2bdea3e..00000000000 --- a/tests/framework/extensions/nodes/node_status.go +++ /dev/null @@ -1,139 +0,0 @@ -package nodes - -import ( - "time" - - "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - activeState = "active" - runningState = "running" - errorState = "error" - machineSteveResourceType = "cluster.x-k8s.io.machine" - machineSteveAnnotation = "cluster.x-k8s.io/machine" - fleetNamespace = "fleet-default" - etcdLabel = "rke.cattle.io/etcd-role" - clusterLabel = "cluster.x-k8s.io/cluster-name" - PollInterval = time.Duration(5 * time.Second) - PollTimeout = time.Duration(15 * time.Minute) -) - -// AllManagementNodeReady is a helper method that will loop and check if the node is ready in the RKE1 cluster. -// It will return an error if the node is not ready after set amount of time. -func AllManagementNodeReady(client *rancher.Client, ClusterID string, timeout time.Duration) error { - err := wait.Poll(1*time.Second, timeout, func() (bool, error) { - nodes, err := client.Management.Node.ListAll(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": ClusterID, - }, - }) - if err != nil { - return false, nil - } - - for _, node := range nodes.Data { - node, err := client.Management.Node.ByID(node.ID) - if err != nil { - return false, nil - } - if node.State == errorState { - logrus.Warnf("node %s is in error state", node.Name) - return false, nil - } - if node.State != activeState { - return false, nil - } - } - logrus.Infof("All nodes in the cluster are in an active state!") - return true, nil - }) - - return err -} - -// AllMachineReady is a helper method that will loop and check if the machine object of every node in a cluster is ready. Typically Used for RKE2/K3s Clusters. -// It will return an error if the machine object is not ready after set amount of time. -func AllMachineReady(client *rancher.Client, clusterID string, timeout time.Duration) error { - err := wait.Poll(1*time.Second, timeout, func() (bool, error) { - nodes, err := client.Management.Node.List(&types.ListOpts{Filters: map[string]interface{}{ - "clusterId": clusterID, - }}) - if err != nil { - return false, err - } - for _, node := range nodes.Data { - machine, err := client.Steve.SteveType(machineSteveResourceType).ByID(fleetNamespace + "/" + node.Annotations[machineSteveAnnotation]) - if err != nil { - return false, err - } - if machine.State == nil { - logrus.Infof("Machine: %s state is nil", machine.Name) - return false, nil - } - if machine.State.Error { - logrus.Warnf("Machine: %s is in error state: %s", machine.Name, machine.State.Message) - return false, nil - } - if machine.State.Name != runningState { - return false, nil - } - } - logrus.Infof("All nodes in the cluster are running!") - return true, nil - }) - return err -} - -// AllNodeDeleted is a helper method that will loop and check if the node is deleted in the cluster. -func AllNodeDeleted(client *rancher.Client, ClusterID string) error { - err := wait.Poll(500*time.Millisecond, 5*time.Minute, func() (bool, error) { - nodes, err := client.Management.Node.ListAll(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": ClusterID, - }, - }) - if err != nil { - return false, err - } - - if len(nodes.Data) == 0 { - logrus.Infof("All nodes in the cluster are deleted!") - return true, nil - } - - return false, nil - }) - - return err -} - -// IsNodeReplaced is a helper method that will loop and check if the node matching its type is replaced in a cluster. -// It will return an error if the node is not replaced after set amount of time. -func IsNodeReplaced(client *rancher.Client, oldMachineID string, clusterID string, numOfNodesBeforeDeletion int, isEtcd bool, isControlPlane bool, isWorker bool) (bool, error) { - numOfNodesAfterDeletion := 0 - - err := wait.Poll(PollInterval, PollTimeout, func() (done bool, err error) { - machines, err := client.Management.Node.List(&types.ListOpts{Filters: map[string]interface{}{ - "clusterId": clusterID, - }}) - if err != nil { - return false, err - } - numOfNodesAfterDeletion = 0 - for _, machine := range machines.Data { - if machine.Etcd == isEtcd && machine.ControlPlane == isControlPlane && machine.Worker == isWorker { - if machine.ID == oldMachineID { - return false, nil - } - logrus.Info("new node : ", machine.NodeName) - numOfNodesAfterDeletion++ - } - } - return true, nil - }) - return numOfNodesBeforeDeletion == numOfNodesAfterDeletion, err -} diff --git a/tests/framework/extensions/pipeline/clustername.go b/tests/framework/extensions/pipeline/clustername.go deleted file mode 100644 index 5e3a94bc4c4..00000000000 --- a/tests/framework/extensions/pipeline/clustername.go +++ /dev/null @@ -1,15 +0,0 @@ -package pipeline - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -// UpdateConfig is function that updates the cattle config's cluster name field which is -// the child of the rancher key in the cattle configuration. -func UpdateConfigClusterName(clusterName string) { - rancherConfig := new(rancher.Config) - config.LoadAndUpdateConfig(rancher.ConfigurationFileKey, rancherConfig, func() { - rancherConfig.ClusterName = clusterName - }) -} diff --git a/tests/framework/extensions/pipeline/configuration.go b/tests/framework/extensions/pipeline/configuration.go deleted file mode 100644 index 8fc85421813..00000000000 --- a/tests/framework/extensions/pipeline/configuration.go +++ /dev/null @@ -1,178 +0,0 @@ -package pipeline - -import ( - "github.com/rancher/rancher/tests/framework/clients/ec2" - "github.com/rancher/rancher/tests/framework/extensions/clusters/aks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/eks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/gke" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/sirupsen/logrus" -) - -// UpdateRancherDownstreamClusterFields is function that updates the cattle config's providers, node providers, -// ssh user and image fields depending on the provider and cluster types. -func UpdateRancherDownstreamClusterFields(cluster *RancherCluster, isCustom, isRKE1 bool) { - UpdateProviderField(cluster.Provider, isCustom) - - if isRKE1 { - UpdateRKE1ImageFields(cluster.Provider, cluster.Image, cluster.SSHUser, cluster.VolumeType, isCustom) - } else { - UpdateRKE2ImageFields(cluster.Provider, cluster.Image, cluster.SSHUser, cluster.VolumeType, isCustom) - } -} - -// UpdateProviderField is function that updates the cattle config's provisioning input providers field -// and if custom, additionally updates nodeProviders field. -func UpdateProviderField(provider string, isCustom bool) { - switch provider { - case provisioninginput.AWSProviderName.String(): - provisioningConfig := new(provisioninginput.Config) - config.LoadAndUpdateConfig(provisioninginput.ConfigurationFileKey, provisioningConfig, func() { - provisioningConfig.Providers = []string{provisioninginput.AWSProviderName.String()} - if isCustom { - provisioningConfig.NodeProviders = []string{"ec2"} - } - }) - case provisioninginput.AzureProviderName.String(): - provisioningConfig := new(provisioninginput.Config) - config.LoadAndUpdateConfig(provisioninginput.ConfigurationFileKey, provisioningConfig, func() { - provisioningConfig.Providers = []string{provisioninginput.AzureProviderName.String()} - }) - case provisioninginput.DOProviderName.String(): - provisioningConfig := new(provisioninginput.Config) - config.LoadAndUpdateConfig(provisioninginput.ConfigurationFileKey, provisioningConfig, func() { - provisioningConfig.Providers = []string{provisioninginput.DOProviderName.String()} - }) - case provisioninginput.HarvesterProviderName.String(): - provisioningConfig := new(provisioninginput.Config) - config.LoadAndUpdateConfig(provisioninginput.ConfigurationFileKey, provisioningConfig, func() { - provisioningConfig.Providers = []string{provisioninginput.HarvesterProviderName.String()} - }) - case provisioninginput.LinodeProviderName.String(): - provisioningConfig := new(provisioninginput.Config) - config.LoadAndUpdateConfig(provisioninginput.ConfigurationFileKey, provisioningConfig, func() { - provisioningConfig.Providers = []string{provisioninginput.LinodeProviderName.String()} - }) - default: - logrus.Error("Couldn't match provider") - } -} - -// UpdateRKE1ImageFields is function that updates the cattle config's node template ssh and image fields -// depending on the provider type. -func UpdateRKE1ImageFields(provider, image, sshUser, volumeType string, isCustom bool) { - switch provider { - case provisioninginput.AWSProviderName.String(): - if !isCustom { - nodeTemplate := new(nodetemplates.AmazonEC2NodeTemplateConfig) - config.LoadAndUpdateConfig(nodetemplates.AmazonEC2NodeTemplateConfigurationFileKey, nodeTemplate, func() { - nodeTemplate.AMI = image - nodeTemplate.SSHUser = sshUser - nodeTemplate.VolumeType = volumeType - }) - } else { - ec2Configs := new(ec2.AWSEC2Configs) - config.LoadAndUpdateConfig(ec2.ConfigurationFileKey, ec2Configs, func() { - for i := range ec2Configs.AWSEC2Config { - ec2Configs.AWSEC2Config[i].AWSAMI = image - ec2Configs.AWSEC2Config[i].AWSUser = sshUser - } - }) - } - case provisioninginput.AzureProviderName.String(): - nodeTemplate := new(nodetemplates.AzureNodeTemplateConfig) - config.LoadAndUpdateConfig(nodetemplates.AzureNodeTemplateConfigurationFileKey, nodeTemplate, func() { - nodeTemplate.Image = image - nodeTemplate.SSHUser = sshUser - }) - case provisioninginput.HarvesterProviderName.String(): - nodeTemplate := new(nodetemplates.HarvesterNodeTemplateConfig) - config.LoadAndUpdateConfig(nodetemplates.HarvesterNodeTemplateConfigurationFileKey, nodeTemplate, func() { - nodeTemplate.ImageName = image - nodeTemplate.SSHUser = sshUser - }) - case provisioninginput.LinodeProviderName.String(): - nodeTemplate := new(nodetemplates.LinodeNodeTemplateConfig) - config.LoadAndUpdateConfig(nodetemplates.LinodeNodeTemplateConfigurationFileKey, nodeTemplate, func() { - nodeTemplate.Image = image - nodeTemplate.SSHUser = sshUser - }) - default: - logrus.Error("Couldn't match RKE1 image fields") - } -} - -// UpdateRKE2ImageFields is function that updates the cattle config's node template ssh and image fields -// depending on the provider type. -func UpdateRKE2ImageFields(provider, image, sshUser, volumeType string, isCustom bool) { - switch provider { - case provisioninginput.AWSProviderName.String(): - if !isCustom { - machineConfig := new(machinepools.AWSMachineConfig) - config.LoadAndUpdateConfig(machinepools.AWSMachineConfigConfigurationFileKey, machineConfig, func() { - machineConfig.AMI = image - machineConfig.SSHUser = sshUser - machineConfig.VolumeType = volumeType - }) - } else { - ec2Configs := new(ec2.AWSEC2Configs) - config.LoadAndUpdateConfig(ec2.ConfigurationFileKey, ec2Configs, func() { - for i := range ec2Configs.AWSEC2Config { - ec2Configs.AWSEC2Config[i].AWSAMI = image - ec2Configs.AWSEC2Config[i].AWSUser = sshUser - } - }) - } - case provisioninginput.AzureProviderName.String(): - machineConfig := new(machinepools.AzureMachineConfig) - config.LoadAndUpdateConfig(machinepools.AzureMachineConfigConfigurationFileKey, machineConfig, func() { - machineConfig.Image = image - machineConfig.SSHUser = sshUser - }) - case provisioninginput.DOProviderName.String(): - machineConfig := new(machinepools.DOMachineConfig) - config.LoadAndUpdateConfig(machinepools.DOMachineConfigConfigurationFileKey, machineConfig, func() { - machineConfig.Image = image - machineConfig.SSHUser = sshUser - }) - case provisioninginput.HarvesterProviderName.String(): - machineConfig := new(machinepools.HarvesterMachineConfig) - config.LoadAndUpdateConfig(machinepools.HarvesterMachineConfigConfigurationFileKey, machineConfig, func() { - machineConfig.ImageName = image - machineConfig.SSHUser = sshUser - }) - case provisioninginput.LinodeProviderName.String(): - machineConfig := new(machinepools.LinodeMachineConfig) - config.LoadAndUpdateConfig(machinepools.LinodeMachineConfigConfigurationFileKey, machineConfig, func() { - machineConfig.Image = image - machineConfig.SSHUser = sshUser - }) - default: - logrus.Error("Couldn't match RKE2 image fields") - } -} - -// UpdateHostedKubernetesVField is function that updates the cattle config's hosted cluster kubernetes version field -// depending on the provider type. -func UpdateHostedKubernetesVField(provider, kubernetesVersion string) { - switch provider { - case provisioninginput.AWSProviderName.String(): - eksClusterConfig := new(eks.ClusterConfig) - config.LoadAndUpdateConfig(eks.EKSClusterConfigConfigurationFileKey, eksClusterConfig, func() { - eksClusterConfig.KubernetesVersion = &kubernetesVersion - }) - case provisioninginput.AzureProviderName.String(): - aksClusterConfig := new(aks.ClusterConfig) - config.LoadAndUpdateConfig(aks.AKSClusterConfigConfigurationFileKey, aksClusterConfig, func() { - aksClusterConfig.KubernetesVersion = &kubernetesVersion - }) - case provisioninginput.GoogleProviderName.String(): - gkeClusterConfig := new(gke.ClusterConfig) - config.LoadAndUpdateConfig(gke.GKEClusterConfigConfigurationFileKey, gkeClusterConfig, func() { - gkeClusterConfig.KubernetesVersion = &kubernetesVersion - }) - } -} diff --git a/tests/framework/extensions/pipeline/releaseupgrade.go b/tests/framework/extensions/pipeline/releaseupgrade.go deleted file mode 100644 index be14c3461f2..00000000000 --- a/tests/framework/extensions/pipeline/releaseupgrade.go +++ /dev/null @@ -1,119 +0,0 @@ -package pipeline - -import ( - "os" - - "github.com/rancher/rancher/tests/v2/validation/upgrade" - "github.com/sirupsen/logrus" - "gopkg.in/yaml.v2" -) - -// ReleaseUpgradeConfigKey is the key name of ReleaseUpgradeConfig values in the cattle config -const ReleaseUpgradeConfigKey = "releaseUpgrade" - -// ReleaseUpgradeConfig is a struct that contains: -// - MainConfig, which is the embedded yaml fields, and built on top of it. -// - HA and Clusters inputs. -// - Provisioning and upgrade test cases and packages. -type ReleaseUpgradeConfig struct { - //metada configs - HAConfig HAConfig `yaml:"ha"` - Clusters Clusters `yaml:"clusters"` - - //test case configs - TestCases TestCases `yaml:"testCases"` -} - -// TestCasesConfigKey is the key name of TestCases values in the cattle config -const TestCasesConfigKey = "testCases" - -// TestCases is a struct that contains related information about the required package and run test strings to run go test commands. -type TestCases struct { - //provisioning test cases - ProvisioningTestPackage string `yaml:"provisioningTestPackage" json:"provisioningTestPackage"` - ProvisioningTestCase string `yaml:"provisioningTestCase" json:"provisioningTestCase"` - - //upgrade test cases - UpgradeTestPackage string `yaml:"upgradeTestCase" json:"upgradeTestCase"` - UpgradeKubernetesTestCase string `yaml:"upgradeKubernetesTestCase" json:"upgradeKubernetesTestCase"` - PreUpgradeTestCase string `yaml:"preUpgradeTestCase" json:"preUpgradeTestCase"` - PostUpgradeTestCase string `yaml:"postUpgradeTestCase" json:"postUpgradeTestCase"` - - //validation tag - Tags string `yaml:"tags" json:"tags"` - - //validation test run flag - RunFlag string `yaml:"runFlag" json:"runFlag"` -} - -// HAConfigKey is the key name of HAConfig values in the cattle config -const HAConfigKey = "ha" - -// HAConfig is a struct that contains related information about the HA that's going to be created and upgraded. -type HAConfig struct { - Host string `yaml:"host" json:"host"` - ChartVersion string `yaml:"chartVersion" json:"chartVersion"` - ChartVersionToUpgrade string `yaml:"chartVersionToUpgrade" json:"chartVersionToUpgrade"` - ImageTag string `yaml:"imageTag" json:"imageTag"` - ImageTagToUpgrade string `yaml:"imageTagToUpgrade" json:"imageTagToUpgrade"` - CertOption string `yaml:"certOption" json:"certOption"` - Insecure *bool `yaml:"insecure" json:"insecure" default:"true"` - Cleanup *bool `yaml:"cleanup" json:"cleanup" default:"true"` - HelmExtraSettings string `yaml:"helmExtraSettings" json:"helmExtraSettings"` - HelmExtraSettingsToUpgrade string `yaml:"helmExtraSettingsToUpgrade" json:"helmExtraSettingsToUpgrade"` -} - -// ClustersConfigKey is the key name of Clusters values in the cattle config -const ClustersConfigKey = "clusters" - -// Clusters is a struct that contains cluster types. -type Clusters struct { - RKE1Clusters RancherClusters `yaml:"rke1" json:"rke1"` - RKE2Clusters RancherClusters `yaml:"rke2" json:"rke2"` - K3sClusters RancherClusters `yaml:"k3s" json:"k3s"` - HostedClusters []HostedCluster `yaml:"hosted" json:"hosted"` -} - -// RancherClusters is a struct that contains slice of custom and node providers as ProviderCluster type. -type RancherClusters struct { - CustomClusters []RancherCluster `yaml:"custom" json:"custom"` - NodeProviderClusters []RancherCluster `yaml:"nodeProvider" json:"nodeProvider"` -} - -// RancherCluster is a struct that contains related information about the downstream cluster that's going to be created and upgraded. -type RancherCluster struct { - Provider string `yaml:"provider" json:"provider"` - KubernetesVersion string `yaml:"kubernetesVersion" json:"kubernetesVersion"` - KubernetesVersionToUpgrade string `yaml:"kubernetesVersionToUpgrade" json:"kubernetesVersionToUpgrade"` - Image string `yaml:"image" json:"image"` - CNIs []string `yaml:"cni" json:"cni"` - FeaturesToTest upgrade.Features `yaml:"enabledFeatures" json:"enabledFeatures" default:""` - Tags string `yaml:"tags" json:"tags" default:""` - RunFlag string `yaml:"runFlag" json:"runFlag" default:""` - SSHUser string `yaml:"sshUser" json:"sshUser" default:""` - VolumeType string `yaml:"volumeType" json:"volumeType" default:""` -} - -// HostedCluster is a struct that contains related information about the downstream cluster that's going to be created and upgraded. -type HostedCluster struct { - Provider string `yaml:"provider" json:"provider"` - KubernetesVersion string `yaml:"kubernetesVersion" json:"kubernetesVersion"` - KubernetesVersionToUpgrade string `yaml:"kubernetesVersionToUpgrade" json:"kubernetesVersionToUpgrade"` - FeaturesToTest upgrade.Features `yaml:"enabledFeatures" json:"enabledFeatures" default:""` -} - -// GenerateDefaultReleaseUpgradeConfig is a function that creates the ReleaseUpgradeConfig with its default values. -func GenerateDefaultReleaseUpgradeConfig() { - configFileName := "default-release-upgrade.yaml" - - config := new(ReleaseUpgradeConfig) - - configData, err := yaml.Marshal(&config) - if err != nil { - logrus.Fatalf("error marshaling: %v", err) - } - err = os.WriteFile(configFileName, configData, 0644) - if err != nil { - logrus.Fatalf("error writing yaml: %v", err) - } -} diff --git a/tests/framework/extensions/pipeline/setup.go b/tests/framework/extensions/pipeline/setup.go deleted file mode 100644 index 4c7761b5801..00000000000 --- a/tests/framework/extensions/pipeline/setup.go +++ /dev/null @@ -1,155 +0,0 @@ -package pipeline - -import ( - "fmt" - "strings" - "time" - - "github.com/rancher/norman/types" - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/token" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - clusterName = "local" -) - -// CreateAdminToken is a function that creates a new admin token -func CreateAdminToken(password string, rancherConfig *rancher.Config) (string, error) { - adminUser := &management.User{ - Username: "admin", - Password: password, - } - - hostURL := rancherConfig.Host - var userToken *management.Token - err := kwait.Poll(500*time.Millisecond, 5*time.Minute, func() (done bool, err error) { - userToken, err = token.GenerateUserToken(adminUser, hostURL) - if err != nil { - return false, nil - } - return true, nil - }) - - if err != nil { - return "", err - } - - return userToken.Token, nil -} - -// PostRancherInstall is a function that updates EULA after the rancher installation -// and sets new admin password to the admin user -func PostRancherInstall(adminClient *rancher.Client, adminPassword string) error { - err := UpdateEULA(adminClient) - if err != nil { - return err - } - - var userList *management.UserCollection - err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - userList, err = adminClient.Management.User.List(&types.ListOpts{ - Filters: map[string]interface{}{ - "username": "admin", - }, - }) - if err != nil { - return false, err - } else if len(userList.Data) == 0 { - return false, nil - } - return true, nil - }) - if err != nil { - return err - } - - adminUser := &userList.Data[0] - setPasswordInput := management.SetPasswordInput{ - NewPassword: adminPassword, - } - _, err = adminClient.Management.User.ActionSetpassword(adminUser, &setPasswordInput) - - return err -} - -// UpdateEULA is a function that updates EULA after the rancher installation -func UpdateEULA(adminClient *rancher.Client) error { - steveClient, err := adminClient.Steve.ProxyDownstream(clusterName) - if err != nil { - return err - } - - urlSetting := &v3.Setting{} - var urlSettingResp *v1.SteveAPIObject - var serverURL error - err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - urlSettingResp, err = steveClient.SteveType("management.cattle.io.setting").ByID("server-url") - if err != nil { - serverURL = err - return false, nil - } - return true, nil - }) - if err != nil { - return fmt.Errorf("%v and %v", err, serverURL) - } - - err = v1.ConvertToK8sType(urlSettingResp.JSONResp, urlSetting) - if err != nil { - return err - } - - urlSetting.Value = fmt.Sprintf("https://%s", adminClient.RancherConfig.Host) - - _, err = steveClient.SteveType("management.cattle.io.setting").Update(urlSettingResp, urlSetting) - if err != nil { - return err - } - - timeStamp := time.Now().Format(time.RFC3339) - settingEULA := v3.Setting{ - ObjectMeta: metav1.ObjectMeta{ - Name: "eula-agreed", - }, - Default: timeStamp, - Value: timeStamp, - } - - var pollError error - err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - _, err = steveClient.SteveType("management.cattle.io.setting").Create(settingEULA) - - if err != nil && !strings.Contains(err.Error(), "409 Conflict") { - pollError = err - return false, nil - } - - urlSetting := &v3.Setting{} - urlSettingResp, err := steveClient.SteveType("management.cattle.io.setting").ByID("server-url") - if err != nil { - return false, err - } - - err = v1.ConvertToK8sType(urlSettingResp.JSONResp, urlSetting) - if err != nil { - return false, err - } - - if urlSetting.Value == fmt.Sprintf("https://%s", adminClient.RancherConfig.Host) { - return true, nil - } - - return false, nil - }) - if err != nil { - return fmt.Errorf("%v and %v", err, pollError) - } - - return nil -} diff --git a/tests/framework/extensions/pipeline/testcommand.go b/tests/framework/extensions/pipeline/testcommand.go deleted file mode 100644 index e822fdef483..00000000000 --- a/tests/framework/extensions/pipeline/testcommand.go +++ /dev/null @@ -1,15 +0,0 @@ -package pipeline - -import ( - "fmt" - "strings" - - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" -) - -// WrapWithAdminRunCommand is a function that returns the go test run command with -// only admin client regex option. -func WrapWithAdminRunCommand(testCase string) string { - adminUserRegex := strings.ReplaceAll(provisioninginput.AdminClientName.String(), " ", "_") - return fmt.Sprintf(`-run \"%s/^%s\"`, testCase, adminUserRegex) -} diff --git a/tests/framework/extensions/prime/primechecks.go b/tests/framework/extensions/prime/primechecks.go deleted file mode 100644 index af6e8287501..00000000000 --- a/tests/framework/extensions/prime/primechecks.go +++ /dev/null @@ -1,41 +0,0 @@ -package primechecks - -import ( - "fmt" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - client "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/rancherversion" -) - -const ( - PodResourceSteveType = "pod" - rancherImage = "rancher" -) - -// CheckUIBrand checks the UI brand of Rancher Prime. If the Rancher instance is not Rancher Prime, the UI brand should be blank. -func CheckUIBrand(client *rancher.Client, isPrime bool, rancherBrand *client.Setting, brand string) error { - if isPrime && brand != rancherBrand.Value { - return fmt.Errorf("error: Rancher Prime UI brand %s does not match defined UI brand %s", rancherBrand.Value, brand) - } - - return nil -} - -// CheckVersion checks the if Rancher Prime is set to true and the version of Rancher. -func CheckVersion(isPrime bool, rancherVersion string, serverConfig *rancherversion.Config) error { - if isPrime && rancherVersion != serverConfig.RancherVersion { - return fmt.Errorf("error: Rancher Prime: %t | Version: %s", isPrime, serverConfig.RancherVersion) - } - - return nil -} - -// CheckSystemDefaultRegistry checks if the system default registry is set to the expected value. -func CheckSystemDefaultRegistry(isPrime bool, primeRegistry string, registry *client.Setting) error { - if isPrime && primeRegistry != registry.Value { - return fmt.Errorf("error: Rancher Prime system default registry %s does not match user defined registry %s", registry.Value, primeRegistry) - } - - return nil -} diff --git a/tests/framework/extensions/projects/projects.go b/tests/framework/extensions/projects/projects.go deleted file mode 100644 index d3dc0e77bff..00000000000 --- a/tests/framework/extensions/projects/projects.go +++ /dev/null @@ -1,69 +0,0 @@ -package projects - -import ( - "sort" - - "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" -) - -// GetProjectByName is a helper function that returns the project by name in a specific cluster. -func GetProjectByName(client *rancher.Client, clusterID, projectName string) (*management.Project, error) { - var project *management.Project - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return project, err - } - - projectsList, err := adminClient.Management.Project.List(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": clusterID, - }, - }) - if err != nil { - return project, err - } - - for i, p := range projectsList.Data { - if p.Name == projectName { - project = &projectsList.Data[i] - break - } - } - - return project, nil -} - -// GetProjectList is a helper function that returns all the project in a specific cluster -func GetProjectList(client *rancher.Client, clusterID string) (*management.ProjectCollection, error) { - var projectsList *management.ProjectCollection - - projectsList, err := client.Management.Project.List(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": clusterID, - }, - }) - if err != nil { - return projectsList, err - } - - return projectsList, nil -} - -// ListProjectNames is a helper which returns a sorted list of project names -func ListProjectNames(client *rancher.Client, clusterID string) ([]string, error) { - projectList, err := GetProjectList(client, clusterID) - if err != nil { - return nil, err - } - - projectNames := make([]string, len(projectList.Data)) - - for idx, project := range projectList.Data { - projectNames[idx] = project.Name - } - sort.Strings(projectNames) - return projectNames, nil -} diff --git a/tests/framework/extensions/projects/template.go b/tests/framework/extensions/projects/template.go deleted file mode 100644 index 13cb4776fd0..00000000000 --- a/tests/framework/extensions/projects/template.go +++ /dev/null @@ -1,16 +0,0 @@ -package projects - -import ( - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" -) - -const projectName = "testproject-" - -// NewProjectConfig is a constructor that creates a project template -func NewProjectConfig(clusterID string) *management.Project { - return &management.Project{ - ClusterID: clusterID, - Name: namegen.AppendRandomString(projectName), - } -} diff --git a/tests/framework/extensions/provisioning/creates.go b/tests/framework/extensions/provisioning/creates.go deleted file mode 100644 index f285e7985b1..00000000000 --- a/tests/framework/extensions/provisioning/creates.go +++ /dev/null @@ -1,927 +0,0 @@ -package provisioning - -import ( - "context" - "fmt" - "strings" - "time" - - "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/sirupsen/logrus" - - apiv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/aws" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/azure" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/google" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/aks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/eks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/gke" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/etcdsnapshot" - k3sHardening "github.com/rancher/rancher/tests/framework/extensions/hardening/k3s" - rke2Hardening "github.com/rancher/rancher/tests/framework/extensions/hardening/rke2" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/rancher/rancher/tests/framework/extensions/pipeline" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - nodepools "github.com/rancher/rancher/tests/framework/extensions/rke1/nodepools" - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - "github.com/rancher/rancher/tests/framework/extensions/secrets" - "github.com/rancher/rancher/tests/framework/extensions/tokenregistration" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/nodes" - "github.com/rancher/rancher/tests/framework/pkg/wait" - - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - active = "active" - internalIP = "rke2.io/internal-ip" - namespace = "fleet-default" - - rke2k3sAirgapCustomCluster = "rke2k3sairgapcustomcluster" - rke2k3sNodeCorralName = "rke2k3sregisterNode" - corralPackageAirgapCustomClusterName = "airgapCustomCluster" - rke1AirgapCustomCluster = "rke1airgapcustomcluster" - rke1NodeCorralName = "rke1registerNode" -) - -// CreateProvisioningCluster provisions a non-rke1 cluster, then runs verify checks -func CreateProvisioningCluster(client *rancher.Client, provider Provider, clustersConfig *clusters.ClusterConfig, hostnameTruncation []machinepools.HostnameTruncation) (*v1.SteveAPIObject, error) { - cloudCredential, err := provider.CloudCredFunc(client) - if err != nil { - return nil, err - } - - if clustersConfig.PSACT == string(provisioninginput.RancherBaseline) { - err = clusters.CreateRancherBaselinePSACT(client, clustersConfig.PSACT) - if err != nil { - return nil, err - } - } - - clusterName := namegen.AppendRandomString(provider.Name.String()) - generatedPoolName := fmt.Sprintf("nc-%s-pool1-", clusterName) - machinePoolConfig := provider.MachinePoolFunc(generatedPoolName, namespace) - - machineConfigResp, err := client.Steve.SteveType(provider.MachineConfigPoolResourceSteveType).Create(machinePoolConfig) - if err != nil { - return nil, err - } - if clustersConfig.Registries != nil { - if clustersConfig.Registries.RKE2Registries != nil { - if clustersConfig.Registries.RKE2Username != "" && clustersConfig.Registries.RKE2Password != "" { - steveClient, err := client.Steve.ProxyDownstream("local") - if err != nil { - return nil, err - } - secretName := fmt.Sprintf("priv-reg-sec-%s", clusterName) - secretTemplate := secrets.NewSecretTemplate(secretName, namespace, map[string][]byte{ - "password": []byte(clustersConfig.Registries.RKE2Password), - "username": []byte(clustersConfig.Registries.RKE2Username), - }, - corev1.SecretTypeBasicAuth, - ) - - registrySecret, err := steveClient.SteveType(secrets.SecretSteveType).Create(secretTemplate) - if err != nil { - return nil, err - } - for registryName, registry := range clustersConfig.Registries.RKE2Registries.Configs { - registry.AuthConfigSecretName = registrySecret.Name - clustersConfig.Registries.RKE2Registries.Configs[registryName] = registry - } - } - } - } - var nodeRoles []machinepools.NodeRoles - for _, pools := range clustersConfig.MachinePools { - nodeRoles = append(nodeRoles, pools.NodeRoles) - } - machinePools := machinepools.CreateAllMachinePools(nodeRoles, machineConfigResp, hostnameTruncation) - cluster := clusters.NewK3SRKE2ClusterConfig(clusterName, namespace, clustersConfig, machinePools, cloudCredential.ID) - - for _, truncatedPool := range hostnameTruncation { - if truncatedPool.PoolNameLengthLimit > 0 || truncatedPool.ClusterNameLengthLimit > 0 { - cluster.GenerateName = "t-" - if truncatedPool.ClusterNameLengthLimit > 0 { - cluster.Spec.RKEConfig.MachinePoolDefaults.HostnameLengthLimit = truncatedPool.ClusterNameLengthLimit - } - break - } - } - - _, err = clusters.CreateK3SRKE2Cluster(client, cluster) - if err != nil { - return nil, err - } - - if client.Flags.GetValue(environmentflag.UpdateClusterName) { - pipeline.UpdateConfigClusterName(clusterName) - } - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - if err != nil { - return nil, err - } - - createdCluster, err := adminClient.Steve.SteveType(clusters.ProvisioningSteveResourceType).ByID(namespace + "/" + clusterName) - return createdCluster, err -} - -// CreateProvisioningCustomCluster provisions a non-rke1 cluster using a 3rd party client for its nodes, then runs verify checks -func CreateProvisioningCustomCluster(client *rancher.Client, externalNodeProvider *ExternalNodeProvider, clustersConfig *clusters.ClusterConfig) (*v1.SteveAPIObject, error) { - setLogrusFormatter() - rolesPerNode := []string{} - quantityPerPool := []int32{} - rolesPerPool := []string{} - for _, pool := range clustersConfig.MachinePools { - var finalRoleCommand string - if pool.NodeRoles.ControlPlane { - finalRoleCommand += " --controlplane" - } - if pool.NodeRoles.Etcd { - finalRoleCommand += " --etcd" - } - if pool.NodeRoles.Worker { - finalRoleCommand += " --worker" - } - if pool.NodeRoles.Windows { - finalRoleCommand += " --windows" - } - quantityPerPool = append(quantityPerPool, pool.NodeRoles.Quantity) - rolesPerPool = append(rolesPerPool, finalRoleCommand) - for i := int32(0); i < pool.NodeRoles.Quantity; i++ { - rolesPerNode = append(rolesPerNode, finalRoleCommand) - } - } - - if clustersConfig.PSACT == string(provisioninginput.RancherBaseline) { - err := clusters.CreateRancherBaselinePSACT(client, clustersConfig.PSACT) - if err != nil { - return nil, err - } - } - - nodes, err := externalNodeProvider.NodeCreationFunc(client, rolesPerPool, quantityPerPool) - if err != nil { - return nil, err - } - - clusterName := namegen.AppendRandomString(externalNodeProvider.Name) - - cluster := clusters.NewK3SRKE2ClusterConfig(clusterName, namespace, clustersConfig, nil, "") - - clusterResp, err := clusters.CreateK3SRKE2Cluster(client, cluster) - if err != nil { - return nil, err - } - - if client.Flags.GetValue(environmentflag.UpdateClusterName) { - pipeline.UpdateConfigClusterName(clusterName) - } - - client, err = client.ReLogin() - if err != nil { - return nil, err - } - - customCluster, err := client.Steve.SteveType(etcdsnapshot.ProvisioningSteveResouceType).ByID(clusterResp.ID) - if err != nil { - return nil, err - } - - clusterStatus := &apiv1.ClusterStatus{} - err = v1.ConvertToK8sType(customCluster.Status, clusterStatus) - if err != nil { - return nil, err - } - - token, err := tokenregistration.GetRegistrationToken(client, clusterStatus.ClusterName) - if err != nil { - return nil, err - } - - kubeProvisioningClient, err := client.GetKubeAPIProvisioningClient() - if err != nil { - return nil, err - } - - result, err := kubeProvisioningClient.Clusters(namespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + clusterName, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - if err != nil { - return nil, err - } - - checkFunc := clusters.IsProvisioningClusterReady - var command string - totalNodesObserved := 0 - for poolIndex, poolRole := range rolesPerPool { - if strings.Contains(poolRole, "windows") { - totalNodesObserved += int(quantityPerPool[poolIndex]) - continue - } - for nodeIndex := 0; nodeIndex < int(quantityPerPool[poolIndex]); nodeIndex++ { - node := nodes[totalNodesObserved+nodeIndex] - - logrus.Infof("Execute Registration Command for node %s", node.NodeID) - logrus.Infof("Linux pool detected, using bash...") - - command = fmt.Sprintf("%s %s", token.InsecureNodeCommand, poolRole) - if clustersConfig.MachinePools[poolIndex].IsSecure { - command = fmt.Sprintf("%s %s", token.NodeCommand, poolRole) - } - command = createRegistrationCommand(command, node.PublicIPAddress, node.PrivateIPAddress, clustersConfig.MachinePools[poolIndex]) - logrus.Infof("Command: %s", command) - - output, err := node.ExecuteCommand(command) - if err != nil { - return nil, err - } - logrus.Infof(output) - } - totalNodesObserved += int(quantityPerPool[poolIndex]) - } - - err = wait.WatchWait(result, checkFunc) - if err != nil { - return nil, err - } - totalNodesObserved = 0 - for poolIndex := 0; poolIndex < len(rolesPerPool); poolIndex++ { - if strings.Contains(rolesPerPool[poolIndex], "windows") { - for nodeIndex := 0; nodeIndex < int(quantityPerPool[poolIndex]); nodeIndex++ { - node := nodes[totalNodesObserved+nodeIndex] - - logrus.Infof("Execute Registration Command for node %s", node.NodeID) - logrus.Infof("Windows pool detected, using powershell.exe...") - command = fmt.Sprintf("powershell.exe %s ", token.InsecureWindowsNodeCommand) - if clustersConfig.MachinePools[poolIndex].IsSecure { - command = fmt.Sprintf("powershell.exe %s ", token.WindowsNodeCommand) - } - command = createWindowsRegistrationCommand(command, node.PublicIPAddress, node.PrivateIPAddress, clustersConfig.MachinePools[poolIndex]) - logrus.Infof("Command: %s", command) - - output, err := node.ExecuteCommand(command) - if err != nil { - return nil, err - } - logrus.Infof(output) - } - } - totalNodesObserved += int(quantityPerPool[poolIndex]) - } - - if clustersConfig.Hardened { - var hardenCluster *apiv1.Cluster - if strings.Contains(clustersConfig.KubernetesVersion, clusters.K3SClusterType.String()) { - err = k3sHardening.HardenNodes(nodes, rolesPerNode, clustersConfig.KubernetesVersion) - if err != nil { - return nil, err - } - - hardenCluster = clusters.HardenK3SClusterConfig(clusterName, namespace, clustersConfig, nil, "") - } else { - err = rke2Hardening.HardenNodes(nodes, rolesPerNode) - if err != nil { - return nil, err - } - - hardenCluster = clusters.HardenRKE2ClusterConfig(clusterName, namespace, clustersConfig, nil, "") - } - - _, err := clusters.UpdateK3SRKE2Cluster(client, clusterResp, hardenCluster) - if err != nil { - return nil, err - } - - logrus.Infof("Cluster has been successfully hardened!") - } - - createdCluster, err := client.Steve.SteveType(clusters.ProvisioningSteveResourceType).ByID(namespace + "/" + clusterName) - return createdCluster, err -} - -// CreateProvisioningRKE1Cluster provisions an rke1 cluster, then runs verify checks -func CreateProvisioningRKE1Cluster(client *rancher.Client, provider RKE1Provider, clustersConfig *clusters.ClusterConfig, nodeTemplate *nodetemplates.NodeTemplate) (*management.Cluster, error) { - if clustersConfig.PSACT == string(provisioninginput.RancherBaseline) { - err := clusters.CreateRancherBaselinePSACT(client, clustersConfig.PSACT) - if err != nil { - return nil, err - } - } - - clusterName := namegen.AppendRandomString(provider.Name.String()) - cluster := clusters.NewRKE1ClusterConfig(clusterName, client, clustersConfig) - clusterResp, err := clusters.CreateRKE1Cluster(client, cluster) - if err != nil { - return nil, err - } - - if client.Flags.GetValue(environmentflag.UpdateClusterName) { - pipeline.UpdateConfigClusterName(clusterName) - } - - var nodeRoles []nodepools.NodeRoles - for _, nodes := range clustersConfig.NodePools { - nodeRoles = append(nodeRoles, nodes.NodeRoles) - } - _, err = nodepools.NodePoolSetup(client, nodeRoles, clusterResp.ID, nodeTemplate.ID) - if err != nil { - return nil, err - } - - createdCluster, err := client.Management.Cluster.ByID(clusterResp.ID) - return createdCluster, err -} - -// CreateProvisioningRKE1CustomCluster provisions an rke1 cluster using a 3rd party client for its nodes, then runs verify checks -func CreateProvisioningRKE1CustomCluster(client *rancher.Client, externalNodeProvider *ExternalNodeProvider, clustersConfig *clusters.ClusterConfig) (*management.Cluster, []*nodes.Node, error) { - setLogrusFormatter() - quantityPerPool := []int32{} - rolesPerPool := []string{} - for _, pool := range clustersConfig.NodePools { - var finalRoleCommand string - if pool.NodeRoles.ControlPlane { - finalRoleCommand += " --controlplane" - } - if pool.NodeRoles.Etcd { - finalRoleCommand += " --etcd" - } - if pool.NodeRoles.Worker { - finalRoleCommand += " --worker" - } - - quantityPerPool = append(quantityPerPool, int32(pool.NodeRoles.Quantity)) - rolesPerPool = append(rolesPerPool, finalRoleCommand) - } - - if clustersConfig.PSACT == string(provisioninginput.RancherBaseline) { - err := clusters.CreateRancherBaselinePSACT(client, clustersConfig.PSACT) - if err != nil { - return nil, nil, err - } - } - - nodes, err := externalNodeProvider.NodeCreationFunc(client, rolesPerPool, quantityPerPool) - if err != nil { - return nil, nil, err - } - - clusterName := namegen.AppendRandomString(externalNodeProvider.Name) - - cluster := clusters.NewRKE1ClusterConfig(clusterName, client, clustersConfig) - clusterResp, err := clusters.CreateRKE1Cluster(client, cluster) - if err != nil { - return nil, nil, err - } - - if client.Flags.GetValue(environmentflag.UpdateClusterName) { - pipeline.UpdateConfigClusterName(clusterName) - } - - client, err = client.ReLogin() - if err != nil { - return nil, nil, err - } - - customCluster, err := client.Management.Cluster.ByID(clusterResp.ID) - if err != nil { - return nil, nil, err - } - - token, err := tokenregistration.GetRegistrationToken(client, customCluster.ID) - if err != nil { - return nil, nil, err - } - - var command string - totalNodesObserved := 0 - for poolIndex, poolRole := range rolesPerPool { - for nodeIndex := 0; nodeIndex < int(quantityPerPool[poolIndex]); nodeIndex++ { - node := nodes[totalNodesObserved+nodeIndex] - - logrus.Infof("Execute Registration Command for node %s", node.NodeID) - logrus.Infof("Linux pool detected, using bash...") - - command = fmt.Sprintf("%s %s", token.NodeCommand, poolRole) - command = createRKE1RegistrationCommand(command, node.PublicIPAddress, node.PrivateIPAddress, clustersConfig.NodePools[poolIndex]) - logrus.Infof("Command: %s", command) - - output, err := node.ExecuteCommand(command) - if err != nil { - return nil, nil, err - } - logrus.Infof(output) - } - totalNodesObserved += int(quantityPerPool[poolIndex]) - } - - createdCluster, err := client.Management.Cluster.ByID(clusterResp.ID) - - return createdCluster, nodes, err -} - -// CreateProvisioningAirgapCustomCluster provisions a non-rke1 cluster using corral to gather its nodes, then runs verify checks -func CreateProvisioningAirgapCustomCluster(client *rancher.Client, clustersConfig *clusters.ClusterConfig, corralPackages *corral.Packages) (*v1.SteveAPIObject, error) { - setLogrusFormatter() - rolesPerNode := map[int32]string{} - for _, pool := range clustersConfig.MachinePools { - var finalRoleCommand string - if pool.NodeRoles.ControlPlane { - finalRoleCommand += " --controlplane" - } - if pool.NodeRoles.Etcd { - finalRoleCommand += " --etcd" - } - if pool.NodeRoles.Worker { - finalRoleCommand += " --worker" - } - if pool.NodeRoles.Windows { - finalRoleCommand += " --windows" - } - - rolesPerNode[pool.NodeRoles.Quantity] = finalRoleCommand - } - - if clustersConfig.PSACT == string(provisioninginput.RancherBaseline) { - err := clusters.CreateRancherBaselinePSACT(client, clustersConfig.PSACT) - if err != nil { - return nil, err - } - } - - clusterName := namegen.AppendRandomString(rke2k3sAirgapCustomCluster) - - cluster := clusters.NewK3SRKE2ClusterConfig(clusterName, namespace, clustersConfig, nil, "") - - clusterResp, err := clusters.CreateK3SRKE2Cluster(client, cluster) - if err != nil { - return nil, err - } - - client, err = client.ReLogin() - if err != nil { - return nil, err - } - - customCluster, err := client.Steve.SteveType(clusters.ProvisioningSteveResourceType).ByID(clusterResp.ID) - if err != nil { - return nil, err - } - - clusterStatus := &apiv1.ClusterStatus{} - err = v1.ConvertToK8sType(customCluster.Status, clusterStatus) - if err != nil { - return nil, err - } - - token, err := tokenregistration.GetRegistrationToken(client, clusterStatus.ClusterName) - if err != nil { - return nil, err - } - - logrus.Infof("Register Custom Cluster Through Corral") - for quantity, roles := range rolesPerNode { - err = corral.UpdateCorralConfig("node_count", fmt.Sprint(quantity)) - if err != nil { - return nil, err - } - - command := fmt.Sprintf("%s %s", token.InsecureNodeCommand, roles) - logrus.Infof("registration command is %s", command) - err = corral.UpdateCorralConfig("registration_command", command) - if err != nil { - return nil, err - } - - corralName := namegen.AppendRandomString(rke2k3sNodeCorralName) - _, err = corral.CreateCorral( - client.Session, - corralName, - corralPackages.CorralPackageImages[corralPackageAirgapCustomClusterName], - corralPackages.HasDebug, - corralPackages.HasCleanup, - ) - if err != nil { - return nil, err - } - } - - createdCluster, err := client.Steve.SteveType(clusters.ProvisioningSteveResourceType).ByID(namespace + "/" + clusterName) - return createdCluster, err -} - -// CreateProvisioningRKE1AirgapCustomCluster provisions an rke1 cluster using corral to gather its nodes, then runs verify checks -func CreateProvisioningRKE1AirgapCustomCluster(client *rancher.Client, clustersConfig *clusters.ClusterConfig, corralPackages *corral.Packages) (*management.Cluster, error) { - setLogrusFormatter() - clusterName := namegen.AppendRandomString(rke1AirgapCustomCluster) - rolesPerNode := map[int64]string{} - for _, pool := range clustersConfig.NodePools { - var finalRoleCommand string - if pool.NodeRoles.ControlPlane { - finalRoleCommand += " --controlplane" - } - if pool.NodeRoles.Etcd { - finalRoleCommand += " --etcd" - } - if pool.NodeRoles.Worker { - finalRoleCommand += " --worker" - } - - rolesPerNode[pool.NodeRoles.Quantity] = finalRoleCommand - } - - if clustersConfig.PSACT == string(provisioninginput.RancherBaseline) { - err := clusters.CreateRancherBaselinePSACT(client, clustersConfig.PSACT) - if err != nil { - return nil, err - } - } - - cluster := clusters.NewRKE1ClusterConfig(clusterName, client, clustersConfig) - clusterResp, err := clusters.CreateRKE1Cluster(client, cluster) - if err != nil { - return nil, err - } - - client, err = client.ReLogin() - if err != nil { - return nil, err - } - - customCluster, err := client.Management.Cluster.ByID(clusterResp.ID) - if err != nil { - return nil, err - } - - token, err := tokenregistration.GetRegistrationToken(client, customCluster.ID) - if err != nil { - return nil, err - } - - logrus.Infof("Register Custom Cluster Through Corral") - for quantity, roles := range rolesPerNode { - err = corral.UpdateCorralConfig("node_count", fmt.Sprint(quantity)) - if err != nil { - return nil, err - } - - command := fmt.Sprintf("%s %s", token.NodeCommand, roles) - logrus.Infof("registration command is %s", command) - err = corral.UpdateCorralConfig("registration_command", command) - if err != nil { - return nil, err - } - - corralName := namegen.AppendRandomString(rke1NodeCorralName) - - _, err = corral.CreateCorral( - client.Session, - corralName, - corralPackages.CorralPackageImages[corralPackageAirgapCustomClusterName], - corralPackages.HasDebug, - corralPackages.HasCleanup, - ) - if err != nil { - return nil, err - } - } - createdCluster, err := client.Management.Cluster.ByID(clusterResp.ID) - return createdCluster, err -} - -// CreateProvisioningAKSHostedCluster provisions an AKS cluster, then runs verify checks -func CreateProvisioningAKSHostedCluster(client *rancher.Client) (*management.Cluster, error) { - cloudCredential, err := azure.CreateAzureCloudCredentials(client) - if err != nil { - return nil, err - } - - clusterName := namegen.AppendRandomString("akshostcluster") - clusterResp, err := aks.CreateAKSHostedCluster(client, clusterName, cloudCredential.ID, false, false, false, false, nil) - if err != nil { - return nil, err - } - - if client.Flags.GetValue(environmentflag.UpdateClusterName) { - pipeline.UpdateConfigClusterName(clusterName) - } - - client, err = client.ReLogin() - if err != nil { - return nil, err - } - - return client.Management.Cluster.ByID(clusterResp.ID) -} - -// CreateProvisioningEKSHostedCluster provisions an EKS cluster, then runs verify checks -func CreateProvisioningEKSHostedCluster(client *rancher.Client) (*management.Cluster, error) { - cloudCredential, err := aws.CreateAWSCloudCredentials(client) - if err != nil { - return nil, err - } - - clusterName := namegen.AppendRandomString("ekshostcluster") - clusterResp, err := eks.CreateEKSHostedCluster(client, clusterName, cloudCredential.ID, false, false, false, false, nil) - if err != nil { - return nil, err - } - - if client.Flags.GetValue(environmentflag.UpdateClusterName) { - pipeline.UpdateConfigClusterName(clusterName) - } - - client, err = client.ReLogin() - if err != nil { - return nil, err - } - - return client.Management.Cluster.ByID(clusterResp.ID) -} - -// CreateProvisioningGKEHostedCluster provisions an GKE cluster, then runs verify checks -func CreateProvisioningGKEHostedCluster(client *rancher.Client) (*management.Cluster, error) { - cloudCredential, err := google.CreateGoogleCloudCredentials(client) - if err != nil { - return nil, err - } - - clusterName := namegen.AppendRandomString("gkehostcluster") - clusterResp, err := gke.CreateGKEHostedCluster(client, clusterName, cloudCredential.ID, false, false, false, false, nil) - if err != nil { - return nil, err - } - - if client.Flags.GetValue(environmentflag.UpdateClusterName) { - pipeline.UpdateConfigClusterName(clusterName) - } - - client, err = client.ReLogin() - if err != nil { - return nil, err - } - - return client.Management.Cluster.ByID(clusterResp.ID) -} - -func setLogrusFormatter() { - formatter := &logrus.TextFormatter{} - formatter.DisableQuote = true - logrus.SetFormatter(formatter) -} - -// createRKE1RegistrationCommand is a helper for rke1 custom clusters to create the registration command with advanced options configured per node -func createRKE1RegistrationCommand(command, publicIP, privateIP string, nodePool provisioninginput.NodePools) string { - if nodePool.SpecifyCustomPublicIP { - command += fmt.Sprintf(" --address %s", publicIP) - } - if nodePool.SpecifyCustomPrivateIP { - command += fmt.Sprintf(" --internal-address %s", privateIP) - } - if nodePool.CustomNodeNameSuffix != "" { - command += fmt.Sprintf(" --node-name %s", namegen.AppendRandomString(nodePool.CustomNodeNameSuffix)) - } - for labelKey, labelValue := range nodePool.NodeLabels { - command += fmt.Sprintf(" --label %s=%s", labelKey, labelValue) - } - for _, taint := range nodePool.NodeTaints { - command += fmt.Sprintf(" --taints %s=%s:%s", taint.Key, taint.Value, taint.Effect) - } - return command -} - -// createRegistrationCommand is a helper for rke2/k3s custom clusters to create the registration command with advanced options configured per node -func createRegistrationCommand(command, publicIP, privateIP string, machinePool provisioninginput.MachinePools) string { - if machinePool.SpecifyCustomPublicIP { - command += fmt.Sprintf(" --address %s", publicIP) - } - if machinePool.SpecifyCustomPrivateIP { - command += fmt.Sprintf(" --internal-address %s", privateIP) - } - if machinePool.CustomNodeNameSuffix != "" { - command += fmt.Sprintf(" --node-name %s", namegen.AppendRandomString(machinePool.CustomNodeNameSuffix)) - } - for labelKey, labelValue := range machinePool.NodeLabels { - command += fmt.Sprintf(" --label %s=%s", labelKey, labelValue) - } - for _, taint := range machinePool.NodeTaints { - command += fmt.Sprintf(" --taints %s=%s:%s", taint.Key, taint.Value, taint.Effect) - } - return command -} - -// createWindowsRegistrationCommand is a helper for rke2 windows custom clusters to create the registration command with advanced options configured per node -func createWindowsRegistrationCommand(command, publicIP, privateIP string, machinePool provisioninginput.MachinePools) string { - if machinePool.SpecifyCustomPublicIP { - command += fmt.Sprintf(" -Address '%s'", publicIP) - } - if machinePool.SpecifyCustomPrivateIP { - command += fmt.Sprintf(" -InternalAddress '%s'", privateIP) - } - if machinePool.CustomNodeNameSuffix != "" { - command += fmt.Sprintf(" -NodeName '%s'", namegen.AppendRandomString(machinePool.CustomNodeNameSuffix)) - } - // powershell requires only 1 flag per command, so we need to append the custom labels and taints together which is different from linux - if len(machinePool.NodeLabels) > 0 { - // there is an existing label for all windows nodes, so we need to insert the custom labels after the existing label - labelIndex := strings.Index(command, " -Label '") + len(" -Label '") - customLabels := "" - for labelKey, labelValue := range machinePool.NodeLabels { - customLabels += fmt.Sprintf("%s=%s,", labelKey, labelValue) - } - command = command[:labelIndex] + customLabels + command[labelIndex:] - } - if len(machinePool.NodeTaints) > 0 { - var customTaints string - for _, taint := range machinePool.NodeTaints { - customTaints += fmt.Sprintf("%s=%s:%s,", taint.Key, taint.Value, taint.Effect) - } - wrappedTaints := fmt.Sprintf(" -Taint '%s'", customTaints) - command += wrappedTaints - } - return command -} - -// AddRKE2K3SCustomClusterNodes is a method that will add nodes to the custom RKE2/K3S custom cluster. -func AddRKE2K3SCustomClusterNodes(client *rancher.Client, cluster *v1.SteveAPIObject, nodes []*nodes.Node, rolesPerNode []string) error { - clusterStatus := &apiv1.ClusterStatus{} - err := v1.ConvertToK8sType(cluster.Status, clusterStatus) - if err != nil { - return err - } - - token, err := tokenregistration.GetRegistrationToken(client, clusterStatus.ClusterName) - if err != nil { - return err - } - - var command string - for key, node := range nodes { - logrus.Infof("Adding node %s to cluster %s", node.NodeID, cluster.Name) - if strings.Contains(rolesPerNode[key], "windows") { - command = fmt.Sprintf("powershell.exe %s -Address %s", token.InsecureWindowsNodeCommand, node.PublicIPAddress) - } else { - command = fmt.Sprintf("%s %s --address %s", token.InsecureNodeCommand, rolesPerNode[key], node.PublicIPAddress) - } - - output, err := node.ExecuteCommand(command) - if err != nil { - return err - } - - logrus.Infof(output) - } - - err = kwait.Poll(500*time.Millisecond, defaults.TenMinuteTimeout, func() (done bool, err error) { - clusterResp, err := client.Steve.SteveType(clusters.ProvisioningSteveResourceType).ByID(cluster.ID) - if err != nil { - return false, err - } - - if clusterResp.ObjectMeta.State.Name == active && nodestat.AllManagementNodeReady(client, cluster.ID, defaults.ThirtyMinuteTimeout) == nil { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - return nil -} - -// DeleteRKE2K3SCustomClusterNodes is a method that will delete nodes from the custom RKE2/K3S custom cluster. -func DeleteRKE2K3SCustomClusterNodes(client *rancher.Client, clusterID string, cluster *v1.SteveAPIObject, nodesToDelete []*nodes.Node) error { - steveclient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return err - } - - nodesSteveObjList, err := steveclient.SteveType("node").List(nil) - if err != nil { - return err - } - - for _, nodeToDelete := range nodesToDelete { - for _, node := range nodesSteveObjList.Data { - if node.Annotations[internalIP] == nodeToDelete.PrivateIPAddress { - machine, err := client.Steve.SteveType(machineSteveResourceType).ByID(namespace + "/" + node.Annotations[machineNameAnnotation]) - if err != nil { - return err - } - - logrus.Infof("Deleting node %s from cluster %s", nodeToDelete.NodeID, cluster.Name) - err = client.Steve.SteveType(machineSteveResourceType).Delete(machine) - if err != nil { - return err - } - - err = kwait.Poll(500*time.Millisecond, defaults.TenMinuteTimeout, func() (done bool, err error) { - _, err = client.Steve.SteveType(machineSteveResourceType).ByID(machine.ID) - if err != nil { - logrus.Infof("Node has successfully been deleted!") - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - } - } - } - - return nil -} - -// AddRKE1CustomClusterNodes is a helper method that will add nodes to the custom RKE1 custom cluster. -func AddRKE1CustomClusterNodes(client *rancher.Client, cluster *management.Cluster, nodes []*nodes.Node, rolesPerNode []string) error { - token, err := tokenregistration.GetRegistrationToken(client, cluster.ID) - if err != nil { - return err - } - - var command string - for key, node := range nodes { - logrus.Infof("Adding node %s to cluster %s", node.NodeID, cluster.Name) - command = fmt.Sprintf("%s %s --address %s", token.NodeCommand, rolesPerNode[key], node.PublicIPAddress) - - output, err := node.ExecuteCommand(command) - if err != nil { - return err - } - - logrus.Infof(output) - } - - err = kwait.Poll(500*time.Millisecond, defaults.TenMinuteTimeout, func() (done bool, err error) { - clusterResp, err := client.Management.Cluster.ByID(cluster.ID) - if err != nil { - return false, err - } - - if clusterResp.State == active && nodestat.AllManagementNodeReady(client, cluster.ID, defaults.ThirtyMinuteTimeout) == nil { - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - - return nil -} - -// DeleteRKE1CustomClusterNodes is a helper method that will delete nodes from the custom RKE1 custom cluster. -func DeleteRKE1CustomClusterNodes(client *rancher.Client, cluster *management.Cluster, nodesToDelete []*nodes.Node) error { - nodes, err := client.Management.Node.ListAll(&types.ListOpts{Filters: map[string]interface{}{ - "clusterId": cluster.ID, - }}) - if err != nil { - return err - } - - for _, nodeToDelete := range nodesToDelete { - for _, node := range nodes.Data { - if node.ExternalIPAddress == nodeToDelete.PublicIPAddress { - machine, err := client.Management.Node.ByID(node.ID) - if err != nil { - return err - } - - logrus.Infof("Deleting node %s from cluster %s", nodeToDelete.NodeID, cluster.Name) - err = client.Management.Node.Delete(machine) - if err != nil { - return err - } - - err = kwait.Poll(500*time.Millisecond, defaults.TenMinuteTimeout, func() (done bool, err error) { - _, err = client.Management.Node.ByID(machine.ID) - if err != nil { - logrus.Infof("Node has successfully been deleted!") - return true, nil - } - return false, nil - }) - if err != nil { - return err - } - } - } - } - - return nil -} diff --git a/tests/framework/extensions/provisioning/customcluster.go b/tests/framework/extensions/provisioning/customcluster.go deleted file mode 100644 index e2b37ee8922..00000000000 --- a/tests/framework/extensions/provisioning/customcluster.go +++ /dev/null @@ -1,14 +0,0 @@ -package provisioning - -import ( - corev1 "k8s.io/api/core/v1" -) - -type CustomClusterConfig struct { - ExternalNodeProvider ExternalNodeProvider `json:"externalNodeProvider" yaml:"externalNodeProvider"` - NodeLabels map[string]string `json:"nodeLabels" yaml:"nodeLabels"` - NodeTaints []corev1.Taint `json:"nodeTaints" yaml:"nodeTaints"` - SpecifyPrivateIP bool `json:"specifyPrivateIP" yaml:"specifyPrivateIP"` - SpecifyPublicIP bool `json:"specifyPublicIP" yaml:"specifyPublicIP"` - NodeNamePrefix string `json:"nodeNamePrefix" yaml:"nodeNamePrefix"` -} diff --git a/tests/framework/extensions/provisioning/nodeproviders.go b/tests/framework/extensions/provisioning/nodeproviders.go deleted file mode 100644 index 329d871dad8..00000000000 --- a/tests/framework/extensions/provisioning/nodeproviders.go +++ /dev/null @@ -1,63 +0,0 @@ -package provisioning - -import ( - "fmt" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/nodes/ec2" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/nodes" -) - -const ( - ec2NodeProviderName = "ec2" - fromConfig = "config" -) - -type NodeCreationFunc func(client *rancher.Client, rolesPerPool []string, quantityPerPool []int32) (nodes []*nodes.Node, err error) -type NodeDeletionFunc func(client *rancher.Client, nodes []*nodes.Node) error - -type ExternalNodeProvider struct { - Name string - NodeCreationFunc NodeCreationFunc - NodeDeletionFunc NodeDeletionFunc -} - -// ExternalNodeProviderSetup is a helper function that setups an ExternalNodeProvider object is a wrapper -// for the specific outside node provider node creator function -func ExternalNodeProviderSetup(providerType string) ExternalNodeProvider { - switch providerType { - case ec2NodeProviderName: - return ExternalNodeProvider{ - Name: providerType, - NodeCreationFunc: ec2.CreateNodes, - NodeDeletionFunc: ec2.DeleteNodes, - } - case fromConfig: - return ExternalNodeProvider{ - Name: providerType, - NodeCreationFunc: func(client *rancher.Client, rolesPerPool []string, quantityPerPool []int32) (nodesList []*nodes.Node, err error) { - var nodeConfig nodes.ExternalNodeConfig - config.LoadConfig(nodes.ExternalNodeConfigConfigurationFileKey, &nodeConfig) - - nodesList = nodeConfig.Nodes[-1] - - for _, node := range nodesList { - sshKey, err := nodes.GetSSHKey(node.SSHKeyName) - if err != nil { - return nil, err - } - - node.SSHKey = sshKey - } - return nodesList, nil - }, - NodeDeletionFunc: func(client *rancher.Client, nodes []*nodes.Node) error { - return ec2.DeleteNodes(client, nodes) - }, - } - default: - panic(fmt.Sprintf("Node Provider:%v not found", providerType)) - } - -} diff --git a/tests/framework/extensions/provisioning/providers.go b/tests/framework/extensions/provisioning/providers.go deleted file mode 100644 index 585830b1171..00000000000 --- a/tests/framework/extensions/provisioning/providers.go +++ /dev/null @@ -1,139 +0,0 @@ -package provisioning - -import ( - "fmt" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/aws" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/azure" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/digitalocean" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/harvester" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/linode" - "github.com/rancher/rancher/tests/framework/extensions/cloudcredentials/vsphere" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - r1aws "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates/aws" - r1azure "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates/azure" - r1harvester "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates/harvester" - r1linode "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates/linode" - r1vsphere "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates/vsphere" -) - -type CloudCredFunc func(rancherClient *rancher.Client) (*cloudcredentials.CloudCredential, error) -type MachinePoolFunc func(generatedPoolName, namespace string) *unstructured.Unstructured - -type Provider struct { - Name provisioninginput.ProviderName - MachineConfigPoolResourceSteveType string - MachinePoolFunc MachinePoolFunc - CloudCredFunc CloudCredFunc -} - -// CreateProvider returns all machine and cloud credential -// configs in the form of a Provider struct. Accepts a -// string of the name of the provider. -func CreateProvider(name string) Provider { - switch { - case name == provisioninginput.AWSProviderName.String(): - provider := Provider{ - Name: provisioninginput.AWSProviderName, - MachineConfigPoolResourceSteveType: machinepools.AWSPoolType, - MachinePoolFunc: machinepools.NewAWSMachineConfig, - CloudCredFunc: aws.CreateAWSCloudCredentials, - } - return provider - case name == provisioninginput.AzureProviderName.String(): - provider := Provider{ - Name: provisioninginput.AzureProviderName, - MachineConfigPoolResourceSteveType: machinepools.AzurePoolType, - MachinePoolFunc: machinepools.NewAzureMachineConfig, - CloudCredFunc: azure.CreateAzureCloudCredentials, - } - return provider - case name == provisioninginput.DOProviderName.String(): - provider := Provider{ - Name: provisioninginput.DOProviderName, - MachineConfigPoolResourceSteveType: machinepools.DOPoolType, - MachinePoolFunc: machinepools.NewDigitalOceanMachineConfig, - CloudCredFunc: digitalocean.CreateDigitalOceanCloudCredentials, - } - return provider - case name == provisioninginput.LinodeProviderName.String(): - provider := Provider{ - Name: provisioninginput.LinodeProviderName, - MachineConfigPoolResourceSteveType: machinepools.LinodePoolType, - MachinePoolFunc: machinepools.NewLinodeMachineConfig, - CloudCredFunc: linode.CreateLinodeCloudCredentials, - } - return provider - case name == provisioninginput.HarvesterProviderName.String(): - provider := Provider{ - Name: provisioninginput.HarvesterProviderName, - MachineConfigPoolResourceSteveType: machinepools.HarvesterPoolType, - MachinePoolFunc: machinepools.NewHarvesterMachineConfig, - CloudCredFunc: harvester.CreateHarvesterCloudCredentials, - } - return provider - case name == provisioninginput.VsphereProviderName.String(): - provider := Provider{ - Name: provisioninginput.VsphereProviderName, - MachineConfigPoolResourceSteveType: machinepools.VmwarevsphereType, - MachinePoolFunc: machinepools.NewVSphereMachineConfig, - CloudCredFunc: vsphere.CreateVsphereCloudCredentials, - } - return provider - default: - panic(fmt.Sprintf("Provider:%v not found", name)) - } -} - -type NodeTemplateFunc func(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) - -type RKE1Provider struct { - Name provisioninginput.ProviderName - NodeTemplateFunc NodeTemplateFunc -} - -// CreateProvider returns all node template -// configs in the form of a RKE1Provider struct. Accepts a -// string of the name of the provider. -func CreateRKE1Provider(name string) RKE1Provider { - switch { - case name == provisioninginput.AWSProviderName.String(): - provider := RKE1Provider{ - Name: provisioninginput.AWSProviderName, - NodeTemplateFunc: r1aws.CreateAWSNodeTemplate, - } - return provider - case name == provisioninginput.AzureProviderName.String(): - provider := RKE1Provider{ - Name: provisioninginput.AzureProviderName, - NodeTemplateFunc: r1azure.CreateAzureNodeTemplate, - } - return provider - case name == provisioninginput.HarvesterProviderName.String(): - provider := RKE1Provider{ - Name: provisioninginput.HarvesterProviderName, - NodeTemplateFunc: r1harvester.CreateHarvesterNodeTemplate, - } - return provider - case name == provisioninginput.LinodeProviderName.String(): - provider := RKE1Provider{ - Name: provisioninginput.LinodeProviderName, - NodeTemplateFunc: r1linode.CreateLinodeNodeTemplate, - } - return provider - case name == provisioninginput.VsphereProviderName.String(): - provider := RKE1Provider{ - Name: provisioninginput.VsphereProviderName, - NodeTemplateFunc: r1vsphere.CreateVSphereNodeTemplate, - } - return provider - default: - panic(fmt.Sprintf("RKE1Provider:%v not found", name)) - } -} diff --git a/tests/framework/extensions/provisioning/ssh.go b/tests/framework/extensions/provisioning/ssh.go deleted file mode 100644 index 0481b2ce260..00000000000 --- a/tests/framework/extensions/provisioning/ssh.go +++ /dev/null @@ -1,89 +0,0 @@ -package provisioning - -// This file contains all tests that require to ssh into a node to run commands to check things -// such as any stats, benchmarks, etc. For example, ssh is required to check the cpu usage of a -// process running on an individual node. - -import ( - "errors" - "strconv" - "strings" - - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - extnodes "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/nodes" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh" - "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - cpuUsageVar = 100 // 100 is just a placeholder until we can determine an actual number. Even with cpu usage spiking it should not go past 100% cpu usage and previous issues concerning this were hitting around 130% and above - checkCPU provisioninginput.SSHTestCase = "CheckCPU" - checkCPUCommand = "ps -C agent -o %cpu --no-header" - nodeReboot provisioninginput.SSHTestCase = "NodeReboot" - activeState = "active" - runningState = "running" - fleetNamespace = "fleet-default" -) - -// CallSSHTestByName tests the ssh tests specified in the provisioninginput config clusterSSHTests field. -// For example CheckCPU checks the cpu usage of the cluster agent. If the usage is too high the func will return a warning. -func CallSSHTestByName(testCase provisioninginput.SSHTestCase, node *nodes.Node, client *rancher.Client, clusterID string, machineName string) error { - switch testCase { - case checkCPU: - logrus.Infof("Running CheckCPU test on node %s", node.PublicIPAddress) - output, err := node.ExecuteCommand(checkCPUCommand) - if err != nil { - return err - } - strOutput := output[:strings.IndexByte(output, '\n')] - logrus.Info("CheckCPU test on node " + node.PublicIPAddress + " | Cluster agent cpu usage is: " + strOutput + "%") - - outputInt, err := strconv.ParseFloat(strings.TrimSpace(strOutput), 32) - if outputInt > cpuUsageVar { - logrus.Warn("Cluster agent cpu usage is too high on node" + node.PublicIPAddress + " | Current cpu usage is: " + strOutput + "%") - } - if err != nil { - return err - } - case nodeReboot: - logrus.Infof("Running NodeReboot test on node %s", node.PublicIPAddress) - command := "sudo reboot" - _, err := node.ExecuteCommand(command) - if err != nil && !errors.Is(err, &ssh.ExitMissingError{}) { - return err - } - // Verify machine shuts down within five minutes, shutting down should not take longer than that depending on the ami - err = wait.Poll(1*time.Second, defaults.FiveMinuteTimeout, func() (bool, error) { - newNode, err := client.Steve.SteveType(machineSteveResourceType).ByID(fleetNamespace + "/" + machineName) - if err != nil { - return false, err - } - if newNode.State.Name == runningState { - return false, nil - } - return true, nil - }) - if err != nil { - logrus.Errorf("Node %s was unable to reboot successfully | Cluster %s is still in active state", node.PublicIPAddress, clusterID) - return err - } - - err = extnodes.AllMachineReady(client, clusterID, defaults.TenMinuteTimeout) - if err != nil { - logrus.Errorf("Node %s failed to reboot successfully", node.PublicIPAddress) - return err - } - - return err - default: - err := errors.New("Invalid SSH test: " + string(testCase) + " is spelled incorrectly or does not exist.") - return err - } - return nil -} diff --git a/tests/framework/extensions/provisioning/upgrade.go b/tests/framework/extensions/provisioning/upgrade.go deleted file mode 100644 index f98ce46bf18..00000000000 --- a/tests/framework/extensions/provisioning/upgrade.go +++ /dev/null @@ -1,41 +0,0 @@ -package provisioning - -import ( - "fmt" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/bundledclusters" -) - -// UpgradeClusterK8sVersion upgrades the cluster to the specified version -func UpgradeClusterK8sVersion(client *rancher.Client, clusterName *string, upgradeVersion *string) (*bundledclusters.BundledCluster, error) { - clusterMeta, err := clusters.NewClusterMeta(client, *clusterName) - if err != nil { - return nil, err - } - if clusterMeta == nil { - return nil, fmt.Errorf("cluster %s not found", *clusterName) - } - - initCluster, err := bundledclusters.NewWithClusterMeta(clusterMeta) - if err != nil { - return nil, err - } - - cluster, err := initCluster.Get(client) - if err != nil { - return nil, err - } - - updatedCluster, err := cluster.UpdateKubernetesVersion(client, upgradeVersion) - if err != nil { - return nil, err - } - - err = clusters.WaitClusterToBeUpgraded(client, clusterMeta.ID) - if err != nil { - return nil, err - } - return updatedCluster, nil -} diff --git a/tests/framework/extensions/provisioning/verify.go b/tests/framework/extensions/provisioning/verify.go deleted file mode 100644 index 8b3f1706872..00000000000 --- a/tests/framework/extensions/provisioning/verify.go +++ /dev/null @@ -1,495 +0,0 @@ -package provisioning - -import ( - "context" - "encoding/json" - "fmt" - "net/url" - "strings" - "testing" - "time" - - provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/bundledclusters" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/etcdsnapshot" - kubeapinodes "github.com/rancher/rancher/tests/framework/extensions/kubeapi/nodes" - "github.com/rancher/rancher/tests/framework/extensions/kubeconfig" - nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - psadeploy "github.com/rancher/rancher/tests/framework/extensions/psact" - "github.com/rancher/rancher/tests/framework/extensions/registries" - "github.com/rancher/rancher/tests/framework/extensions/sshkeys" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - "github.com/rancher/rancher/tests/framework/pkg/nodes" - "github.com/rancher/rancher/tests/framework/pkg/wait" - wranglername "github.com/rancher/wrangler/pkg/name" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - kwait "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - capi "sigs.k8s.io/cluster-api/api/v1beta1" -) - -const ( - logMessageKubernetesVersion = "Validating the current version is the upgraded one" - hostnameLimit = 63 - machineNameAnnotation = "cluster.x-k8s.io/machine" - machineSteveResourceType = "cluster.x-k8s.io.machine" - onDemandPrefix = "on-demand-" -) - -// VerifyRKE1Cluster validates that the RKE1 cluster and its resources are in a good state, matching a given config. -func VerifyRKE1Cluster(t *testing.T, client *rancher.Client, clustersConfig *clusters.ClusterConfig, cluster *management.Cluster) { - client, err := client.ReLogin() - require.NoError(t, err) - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - require.NoError(t, err) - - watchInterface, err := adminClient.GetManagementWatchInterface(management.ClusterType, metav1.ListOptions{ - FieldSelector: "metadata.name=" + cluster.ID, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - require.NoError(t, err) - - checkFunc := clusters.IsHostedProvisioningClusterReady - err = wait.WatchWait(watchInterface, checkFunc) - require.NoError(t, err) - - assert.Equal(t, clustersConfig.KubernetesVersion, cluster.RancherKubernetesEngineConfig.Version) - - clusterToken, err := clusters.CheckServiceAccountTokenSecret(client, cluster.Name) - require.NoError(t, err) - assert.NotEmpty(t, clusterToken) - - err = nodestat.AllManagementNodeReady(client, cluster.ID, defaults.ThirtyMinuteTimeout) - require.NoError(t, err) - - if clustersConfig.PSACT == string(provisioninginput.RancherPrivileged) || clustersConfig.PSACT == string(provisioninginput.RancherRestricted) || clustersConfig.PSACT == string(provisioninginput.RancherBaseline) { - require.NotEmpty(t, cluster.DefaultPodSecurityAdmissionConfigurationTemplateName) - - err := psadeploy.CreateNginxDeployment(client, cluster.ID, clustersConfig.PSACT) - require.NoError(t, err) - } - if clustersConfig.Registries != nil { - if clustersConfig.Registries.RKE1Registries != nil { - for _, registry := range clustersConfig.Registries.RKE1Registries { - havePrefix, err := registries.CheckAllClusterPodsForRegistryPrefix(client, cluster.ID, registry.URL) - require.NoError(t, err) - assert.True(t, havePrefix) - } - } - } - if clustersConfig.Networking != nil { - if clustersConfig.Networking.LocalClusterAuthEndpoint != nil { - VerifyACE(t, adminClient, cluster) - } - } - - if !strings.Contains(clustersConfig.CloudProvider, "external") { - podErrors := pods.StatusPods(client, cluster.ID) - assert.Empty(t, podErrors) - } -} - -// VerifyCluster validates that a non-rke1 cluster and its resources are in a good state, matching a given config. -func VerifyCluster(t *testing.T, client *rancher.Client, clustersConfig *clusters.ClusterConfig, cluster *steveV1.SteveAPIObject) { - client, err := client.ReLogin() - require.NoError(t, err) - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - require.NoError(t, err) - - kubeProvisioningClient, err := adminClient.GetKubeAPIProvisioningClient() - require.NoError(t, err) - - watchInterface, err := kubeProvisioningClient.Clusters(namespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + cluster.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - require.NoError(t, err) - - checkFunc := clusters.IsProvisioningClusterReady - err = wait.WatchWait(watchInterface, checkFunc) - require.NoError(t, err) - - clusterToken, err := clusters.CheckServiceAccountTokenSecret(client, cluster.Name) - require.NoError(t, err) - assert.NotEmpty(t, clusterToken) - - err = nodestat.AllMachineReady(client, cluster.ID, defaults.ThirtyMinuteTimeout) - require.NoError(t, err) - - status := &provv1.ClusterStatus{} - err = steveV1.ConvertToK8sType(cluster.Status, status) - require.NoError(t, err) - - clusterSpec := &provv1.ClusterSpec{} - err = steveV1.ConvertToK8sType(cluster.Spec, clusterSpec) - require.NoError(t, err) - - configKubeVersion := clusterSpec.KubernetesVersion - require.Equal(t, configKubeVersion, clusterSpec.KubernetesVersion) - - if clusterSpec.DefaultPodSecurityAdmissionConfigurationTemplateName == string(provisioninginput.RancherPrivileged) || - clusterSpec.DefaultPodSecurityAdmissionConfigurationTemplateName == string(provisioninginput.RancherRestricted) || - clusterSpec.DefaultPodSecurityAdmissionConfigurationTemplateName == string(provisioninginput.RancherBaseline) { - - require.NotEmpty(t, clusterSpec.DefaultPodSecurityAdmissionConfigurationTemplateName) - - err := psadeploy.CreateNginxDeployment(client, status.ClusterName, clusterSpec.DefaultPodSecurityAdmissionConfigurationTemplateName) - require.NoError(t, err) - } - - if clusterSpec.RKEConfig.Registries != nil { - for registryName := range clusterSpec.RKEConfig.Registries.Configs { - havePrefix, err := registries.CheckAllClusterPodsForRegistryPrefix(client, status.ClusterName, registryName) - require.NoError(t, err) - assert.True(t, havePrefix) - } - } - - if clusterSpec.LocalClusterAuthEndpoint.Enabled { - mgmtClusterObject, err := adminClient.Management.Cluster.ByID(status.ClusterName) - require.NoError(t, err) - VerifyACE(t, adminClient, mgmtClusterObject) - } - - podErrors := pods.StatusPods(client, status.ClusterName) - assert.Empty(t, podErrors) - - if clustersConfig.ClusterSSHTests != nil { - VerifySSHTests(t, client, cluster, clustersConfig.ClusterSSHTests, status.ClusterName) - } -} - -// VerifyHostedCluster validates that the hosted cluster and its resources are in a good state, matching a given config. -func VerifyHostedCluster(t *testing.T, client *rancher.Client, cluster *management.Cluster) { - client, err := client.ReLogin() - require.NoError(t, err) - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - require.NoError(t, err) - - watchInterface, err := adminClient.GetManagementWatchInterface(management.ClusterType, metav1.ListOptions{ - FieldSelector: "metadata.name=" + cluster.ID, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - require.NoError(t, err) - - checkFunc := clusters.IsHostedProvisioningClusterReady - - err = wait.WatchWait(watchInterface, checkFunc) - require.NoError(t, err) - - clusterToken, err := clusters.CheckServiceAccountTokenSecret(client, cluster.Name) - require.NoError(t, err) - assert.NotEmpty(t, clusterToken) - - err = nodestat.AllManagementNodeReady(client, cluster.ID, defaults.ThirtyMinuteTimeout) - require.NoError(t, err) - - podErrors := pods.StatusPods(client, cluster.ID) - assert.Empty(t, podErrors) -} - -// VerifyDeleteRKE1Cluster validates that a rke1 cluster and its resources are deleted. -func VerifyDeleteRKE1Cluster(t *testing.T, client *rancher.Client, clusterID string) { - cluster, err := client.Management.Cluster.ByID(clusterID) - require.NoError(t, err) - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - require.NoError(t, err) - - watchInterface, err := adminClient.GetManagementWatchInterface(management.ClusterType, metav1.ListOptions{ - FieldSelector: "metadata.name=" + clusterID, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - require.NoError(t, err) - - err = wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - if event.Type == watch.Error { - return false, fmt.Errorf("error: unable to delete cluster %s", cluster.Name) - } else if event.Type == watch.Deleted { - logrus.Infof("Cluster %s deleted!", cluster.Name) - return true, nil - } - return false, nil - }) - require.NoError(t, err) - - err = nodestat.AllNodeDeleted(client, clusterID) - require.NoError(t, err) -} - -// VerifyDeleteRKE2K3SCluster validates that a non-rke1 cluster and its resources are deleted. -func VerifyDeleteRKE2K3SCluster(t *testing.T, client *rancher.Client, clusterID string) { - cluster, err := client.Steve.SteveType("provisioning.cattle.io.cluster").ByID(clusterID) - require.NoError(t, err) - - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - require.NoError(t, err) - - provKubeClient, err := adminClient.GetKubeAPIProvisioningClient() - require.NoError(t, err) - - watchInterface, err := provKubeClient.Clusters(namespace).Watch(context.TODO(), metav1.ListOptions{ - FieldSelector: "metadata.name=" + cluster.Name, - TimeoutSeconds: &defaults.WatchTimeoutSeconds, - }) - require.NoError(t, err) - - err = wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { - cluster := event.Object.(*provv1.Cluster) - if event.Type == watch.Error { - return false, fmt.Errorf("error: unable to delete cluster %s", cluster.ObjectMeta.Name) - } else if event.Type == watch.Deleted { - logrus.Infof("Cluster %s deleted!", cluster.ObjectMeta.Name) - return true, nil - } else if cluster == nil { - logrus.Infof("Cluster %s deleted!", cluster.ObjectMeta.Name) - return true, nil - } - return false, nil - }) - require.NoError(t, err) - - err = nodestat.AllNodeDeleted(client, clusterID) - require.NoError(t, err) -} - -// CertRotationCompleteCheckFunc returns a watch check function that checks if the certificate rotation is complete -func CertRotationCompleteCheckFunc(generation int64) wait.WatchCheckFunc { - return func(event watch.Event) (bool, error) { - controlPlane := event.Object.(*rkev1.RKEControlPlane) - return controlPlane.Status.CertificateRotationGeneration == generation, nil - } -} - -// VerifyACE validates that the ACE resources are healthy in a given cluster -func VerifyACE(t *testing.T, client *rancher.Client, cluster *management.Cluster) { - client, err := client.ReLogin() - require.NoError(t, err) - - kubeConfig, err := kubeconfig.GetKubeconfig(client, cluster.ID) - require.NoError(t, err) - - original, err := client.SwitchContext(cluster.Name, kubeConfig) - require.NoError(t, err) - - originalResp, err := original.Resource(corev1.SchemeGroupVersion.WithResource("pods")).Namespace("").List(context.TODO(), metav1.ListOptions{}) - require.NoError(t, err) - for _, pod := range originalResp.Items { - t.Logf("Pod %v", pod.GetName()) - } - - // each control plane has a context. For ACE, we should check these contexts - contexts, err := kubeconfig.GetContexts(kubeConfig) - require.NoError(t, err) - var contextNames []string - for context := range contexts { - if strings.Contains(context, "pool") { - contextNames = append(contextNames, context) - } - } - - for _, contextName := range contextNames { - dynamic, err := client.SwitchContext(contextName, kubeConfig) - assert.NoError(t, err) - resp, err := dynamic.Resource(corev1.SchemeGroupVersion.WithResource("pods")).Namespace("").List(context.TODO(), metav1.ListOptions{}) - assert.NoError(t, err) - t.Logf("Switched Context to %v", contextName) - for _, pod := range resp.Items { - t.Logf("Pod %v", pod.GetName()) - } - } -} - -// VerifyHostnameLength validates that the hostnames of the nodes in a cluster are of the correct length -func VerifyHostnameLength(t *testing.T, client *rancher.Client, clusterObject *steveV1.SteveAPIObject) { - client, err := client.ReLogin() - require.NoError(t, err) - - clusterSpec := &provv1.ClusterSpec{} - err = steveV1.ConvertToK8sType(clusterObject.Spec, clusterSpec) - require.NoError(t, err) - - for _, mp := range clusterSpec.RKEConfig.MachinePools { - n := wranglername.SafeConcatName(clusterObject.Name, mp.Name) - query, err := url.ParseQuery(fmt.Sprintf("labelSelector=%s=%s&fieldSelector=metadata.name=%s", capi.ClusterLabelName, clusterObject.Name, n)) - require.NoError(t, err) - - machineDeploymentsResp, err := client.Steve.SteveType("cluster.x-k8s.io.machinedeployment").List(query) - require.NoError(t, err) - - assert.True(t, len(machineDeploymentsResp.Data) == 1) - - md := &capi.MachineDeployment{} - require.NoError(t, steveV1.ConvertToK8sType(machineDeploymentsResp.Data[0].JSONResp, md)) - - query2, err := url.ParseQuery(fmt.Sprintf("labelSelector=%s=%s", capi.MachineDeploymentLabelName, md.Name)) - require.NoError(t, err) - - machineResp, err := client.Steve.SteveType(machineSteveResourceType).List(query2) - require.NoError(t, err) - - assert.True(t, len(machineResp.Data) > 0) - - for i := range machineResp.Data { - m := capi.Machine{} - require.NoError(t, steveV1.ConvertToK8sType(machineResp.Data[i].JSONResp, &m)) - - assert.NotNil(t, m.Status.NodeRef) - - dynamic, err := client.GetRancherDynamicClient() - require.NoError(t, err) - - gv, err := schema.ParseGroupVersion(m.Spec.InfrastructureRef.APIVersion) - require.NoError(t, err) - - gvr := schema.GroupVersionResource{ - Group: gv.Group, - Version: gv.Version, - Resource: strings.ToLower(m.Spec.InfrastructureRef.Kind) + "s", - } - - ustr, err := dynamic.Resource(gvr).Namespace(m.Namespace).Get(context.TODO(), m.Spec.InfrastructureRef.Name, metav1.GetOptions{}) - require.NoError(t, err) - - limit := hostnameLimit - if mp.HostnameLengthLimit != 0 { - limit = mp.HostnameLengthLimit - } else if clusterSpec.RKEConfig.MachinePoolDefaults.HostnameLengthLimit != 0 { - limit = clusterSpec.RKEConfig.MachinePoolDefaults.HostnameLengthLimit - } - - assert.True(t, len(m.Status.NodeRef.Name) <= limit) - if len(ustr.GetName()) < limit { - assert.True(t, m.Status.NodeRef.Name == ustr.GetName()) - } - } - t.Logf("Verified hostname length for machine pool %s", mp.Name) - } -} - -// VerifyUpgrade validates that a cluster has been upgraded to a given version -func VerifyUpgrade(t *testing.T, updatedCluster *bundledclusters.BundledCluster, upgradedVersion string) { - if updatedCluster.V3 != nil { - assert.Equalf(t, upgradedVersion, updatedCluster.V3.RancherKubernetesEngineConfig.Version, "[%v]: %v", updatedCluster.Meta.Name, logMessageKubernetesVersion) - } else { - clusterSpec := &provv1.ClusterSpec{} - err := steveV1.ConvertToK8sType(updatedCluster.V1.Spec, clusterSpec) - require.NoError(t, err) - assert.Equalf(t, upgradedVersion, clusterSpec.KubernetesVersion, "[%v]: %v", updatedCluster.Meta.Name, logMessageKubernetesVersion) - } -} - -// VerifySnapshots waits for a cluster's snapshots to be ready and validates that the correct number of snapshots have been taken -func VerifySnapshots(client *rancher.Client, localclusterID string, clusterName string, expectedSnapshotLength int, isRKE1 bool) (string, error) { - client, err := client.ReLogin() - if err != nil { - return "", err - } - var snapshotToBeRestored string - var snapshotList []string - s3Prefix := onDemandPrefix + clusterName - - err = kwait.Poll(5*time.Second, defaults.FiveMinuteTimeout, func() (done bool, err error) { - if isRKE1 { - snapshotList, err = etcdsnapshot.GetRKE1Snapshots(client, clusterName) - if err != nil { - return false, err - } - } else { - snapshotList, err = etcdsnapshot.GetRKE2K3SSnapshots(client, localclusterID, clusterName) - if err != nil { - return false, err - } - } - - if len(snapshotList) == 0 { - return false, fmt.Errorf("no snapshots found") - } - - // Indexed from 0 for S3 checks to ensure that the local backup location does not have the s3Prefix. - // Needed to ensure that the correct S3 snapshot is restored. - if strings.Contains(snapshotList[0], s3Prefix) { - snapshotToBeRestored = snapshotList[len(snapshotList)-1] - return true, nil - } - - if len(snapshotList) == expectedSnapshotLength { - snapshotToBeRestored = snapshotList[0] - return true, nil - } - - if len(snapshotList) > expectedSnapshotLength && isRKE1 { - snapshotToBeRestored = snapshotList[0] - return true, nil - } - - if len(snapshotList) > expectedSnapshotLength && !isRKE1 { - return false, fmt.Errorf("more snapshots than expected") - } - - return false, nil - }) - return snapshotToBeRestored, err -} - -// VerifySSHTests validates the ssh tests listed in the config on each node of the cluster -func VerifySSHTests(t *testing.T, client *rancher.Client, clusterObject *steveV1.SteveAPIObject, sshTests []provisioninginput.SSHTestCase, clusterID string) { - client, err := client.ReLogin() - require.NoError(t, err) - - clusterSpec := &provv1.ClusterSpec{} - err = steveV1.ConvertToK8sType(clusterObject.Spec, clusterSpec) - require.NoError(t, err) - - steveClient, err := client.Steve.ProxyDownstream(clusterID) - require.NoError(t, err) - nodesSteveObjList, err := steveClient.SteveType("node").List(nil) - require.NoError(t, err) - - dynamicSchema := clusterSpec.RKEConfig.MachinePools[0].DynamicSchemaSpec - var data clusters.DynamicSchemaSpec - err = json.Unmarshal([]byte(dynamicSchema), &data) - require.NoError(t, err) - - sshUser := data.ResourceFields.SSHUser.Default.StringValue - for _, tests := range sshTests { - for _, node := range nodesSteveObjList.Data { - machineName := node.Annotations[machineNameAnnotation] - sshkey, err := sshkeys.DownloadSSHKeys(client, machineName) - require.NoError(t, err) - assert.NotEmpty(t, sshkey) - - newNode := &corev1.Node{} - err = steveV1.ConvertToK8sType(node.JSONResp, newNode) - require.NoError(t, err) - nodeIP := kubeapinodes.GetNodeIP(newNode, corev1.NodeExternalIP) - - clusterNode := &nodes.Node{ - NodeID: node.ID, - PublicIPAddress: nodeIP, - SSHUser: sshUser, - SSHKey: sshkey, - } - - err = CallSSHTestByName(tests, clusterNode, client, clusterID, machineName) - require.NoError(t, err) - - } - } - -} diff --git a/tests/framework/extensions/provisioninginput/config.go b/tests/framework/extensions/provisioninginput/config.go deleted file mode 100644 index 129239dec71..00000000000 --- a/tests/framework/extensions/provisioninginput/config.go +++ /dev/null @@ -1,222 +0,0 @@ -package provisioninginput - -import ( - rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - nodepools "github.com/rancher/rancher/tests/framework/extensions/rke1/nodepools" - corev1 "k8s.io/api/core/v1" -) - -type Version string -type PSACT string -type SSHTestCase string - -const ( - Namespace = "fleet-default" - defaultRandStringLength = 5 - ConfigurationFileKey = "provisioningInput" - PSPKubeVersionLimit Version = "v1.24.99" - RancherPrivileged PSACT = "rancher-privileged" - RancherRestricted PSACT = "rancher-restricted" - RancherBaseline PSACT = "rancher-baseline" -) - -// ProviderName is string enum for provider names used in provisioning tests. -type ProviderName string - -const ( - AWSProviderName ProviderName = "aws" - AzureProviderName ProviderName = "azure" - DOProviderName ProviderName = "do" - HarvesterProviderName ProviderName = "harvester" - LinodeProviderName ProviderName = "linode" - GoogleProviderName ProviderName = "google" - VsphereProviderName ProviderName = "vsphere" - ExternalProviderName ProviderName = "external" -) - -var AllRolesMachinePool = MachinePools{ - NodeRoles: machinepools.NodeRoles{ - Etcd: true, - ControlPlane: true, - Worker: true, - Quantity: 1, - }, -} - -var EtcdControlPlaneMachinePool = MachinePools{ - NodeRoles: machinepools.NodeRoles{ - Etcd: true, - ControlPlane: true, - Quantity: 1, - }, -} - -var EtcdMachinePool = MachinePools{ - NodeRoles: machinepools.NodeRoles{ - Etcd: true, - Quantity: 1, - }, -} - -var ControlPlaneMachinePool = MachinePools{ - NodeRoles: machinepools.NodeRoles{ - ControlPlane: true, - Quantity: 1, - }, -} - -var WorkerMachinePool = MachinePools{ - NodeRoles: machinepools.NodeRoles{ - Worker: true, - Quantity: 1, - }, -} - -var WindowsMachinePool = MachinePools{ - NodeRoles: machinepools.NodeRoles{ - Windows: true, - Quantity: 1, - }, -} - -var AllRolesNodePool = NodePools{ - NodeRoles: nodepools.NodeRoles{ - Etcd: true, - ControlPlane: true, - Worker: true, - Quantity: 1, - }, -} - -var EtcdControlPlaneNodePool = NodePools{ - NodeRoles: nodepools.NodeRoles{ - Etcd: true, - ControlPlane: true, - Quantity: 1, - }, -} - -var EtcdNodePool = NodePools{ - NodeRoles: nodepools.NodeRoles{ - Etcd: true, - Quantity: 1, - }, -} - -var ControlPlaneNodePool = NodePools{ - NodeRoles: nodepools.NodeRoles{ - ControlPlane: true, - Quantity: 1, - }, -} - -var WorkerNodePool = NodePools{ - NodeRoles: nodepools.NodeRoles{ - Worker: true, - Quantity: 1, - }, -} - -// String stringer for the ProviderName -func (p ProviderName) String() string { - return string(p) -} - -// TestClientName is string enum for client/user names used in provisioning tests. -type TestClientName string - -const ( - AdminClientName TestClientName = "Admin User" - StandardClientName TestClientName = "Standard User" -) - -// String stringer for the TestClientName -func (c TestClientName) String() string { - return string(c) -} - -type AddOnConfig struct { - ChartValues *rkev1.GenericMap `json:"chartValues,omitempty" yaml:"chartValues,omitempty"` - AdditionalManifest string `json:"additionalManifest,omitempty" yaml:"additionalManifest,omitempty"` -} - -type LabelsAndAnnotations struct { - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` -} - -type Networking struct { - ClusterCIDR string `json:"clusterCIDR,omitempty" yaml:"clusterCIDR,omitempty"` - ClusterDNS string `json:"clusterDNS,omitempty" yaml:"clusterDNS,omitempty"` - ClusterDomain string `json:"clusterDomain,omitempty" yaml:"clusterDomain,omitempty"` - ServiceCIDR string `json:"serviceCIDR,omitempty" yaml:"serviceCIDR,omitempty"` - NodePortServicePortRange string `json:"nodePortServicePortRange,omitempty" yaml:"nodePortServicePortRange,omitempty"` - TLSSan []string `json:"tlsSan,omitempty" yaml:"tlsSan,omitempty"` - LocalClusterAuthEndpoint *rkev1.LocalClusterAuthEndpoint `json:"localClusterAuthEndpoint,omitempty" yaml:"localClusterAuthEndpoint,omitempty"` -} - -type Advanced struct { - // examples of machineSelector configs: "protect-kernel-defaults": false, "system-default-registry": registryHostname, - MachineSelectors *[]rkev1.RKESystemConfig `json:"machineSelectors,omitempty" yaml:"machineSelectors,omitempty"` - MachineGlobalConfig *rkev1.GenericMap `json:"machineGlobalConfig,omitempty" yaml:"machineGlobalConfig,omitempty"` - KubeControllerManagerArgs []string `json:"kubeControllerManagerArgs,omitempty" yaml:"kubeControllerManagerArgs,omitempty"` - KubeSchedulerArgs []string `json:"kubeSchedulerArgs,omitempty" yaml:"kubeSchedulerArgs,omitempty"` - KubeAPIServerArgs []string `json:"kubeAPIServerArgs,omitempty" yaml:"kubeAPIServerArgs,omitempty"` -} - -type Registries struct { - RKE1Registries []management.PrivateRegistry `json:"rke1Registries,omitempty" yaml:"rke1Registries,omitempty"` - RKE2Registries *rkev1.Registry `json:"rke2Registries,omitempty" yaml:"rke2Registries,omitempty"` - RKE2Password string `json:"rke2Password,omitempty" yaml:"rke2Password,omitempty"` - RKE2Username string `json:"rke2Username,omitempty" yaml:"rke2Username,omitempty"` -} - -type Pools struct { - NodeLabels map[string]string `json:"nodeLabels,omitempty" yaml:"nodeLabels,omitempty"` - NodeTaints []corev1.Taint `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"` - SpecifyCustomPrivateIP bool `json:"specifyPrivateIP,omitempty" yaml:"specifyPrivateIP,omitempty"` - SpecifyCustomPublicIP bool `json:"specifyPublicIP,omitempty" yaml:"specifyPublicIP,omitempty" default:"true"` - CustomNodeNameSuffix string `json:"nodeNameSuffix,omitempty" yaml:"nodeNameSuffix,omitempty"` -} - -type MachinePools struct { - Pools - NodeRoles machinepools.NodeRoles `json:"nodeRoles,omitempty" yaml:"nodeRoles,omitempty" default:"[]"` - IsSecure bool `json:"isSecure,omitempty" yaml:"isSecure,omitempty" default:"false"` -} - -type NodePools struct { - Pools - NodeRoles nodepools.NodeRoles `json:"nodeRoles,omitempty" yaml:"nodeRoles,omitempty" default:"[]"` -} - -type Config struct { - NodePools []NodePools `json:"nodePools,omitempty" yaml:"nodePools,omitempty"` - MachinePools []MachinePools `json:"machinePools,omitempty" yaml:"machinePools,omitempty"` - CloudProvider string `json:"cloudProvider,omitempty" yaml:"cloudProvider,omitempty"` - Providers []string `json:"providers,omitempty" yaml:"providers,omitempty"` - NodeProviders []string `json:"nodeProviders,omitempty" yaml:"nodeProviders,omitempty"` - Hardened bool `json:"hardened,omitempty" yaml:"hardened,omitempty"` - AddOnConfig *AddOnConfig `json:"addonConfig,omitempty" yaml:"addonConfig,omitempty"` - K3SKubernetesVersions []string `json:"k3sKubernetesVersion,omitempty" yaml:"k3sKubernetesVersion,omitempty"` - RKE1KubernetesVersions []string `json:"rke1KubernetesVersion,omitempty" yaml:"rke1KubernetesVersion,omitempty"` - RKE2KubernetesVersions []string `json:"rke2KubernetesVersion,omitempty" yaml:"rke2KubernetesVersion,omitempty"` - CNIs []string `json:"cni,omitempty" yaml:"cni,omitempty"` - PSACT string `json:"psact,omitempty" yaml:"psact,omitempty"` - PNI bool `json:"pni,omitempty" yaml:"pni,omitempty"` - AgentEnvVars *[]rkev1.EnvVar `json:"agentEnvVars,omitempty" yaml:"agentEnvVars,omitempty"` - AgentEnvVarsRKE1 *[]management.EnvVar `json:"agentEnvVarsRKE1,omitempty" yaml:"agentEnvVarsRKE1,omitempty"` - ClusterAgent *management.AgentDeploymentCustomization `json:"clusterAgent,omitempty" yaml:"clusterAgent,omitempty"` - FleetAgent *management.AgentDeploymentCustomization `json:"fleetAgent,omitempty" yaml:"fleetAgent,omitempty"` - ETCD *rkev1.ETCD `json:"etcd,omitempty" yaml:"etcd,omitempty"` - ETCDRKE1 *management.ETCDService `json:"etcdRKE1,omitempty" yaml:"etcdRKE1,omitempty"` - LabelsAndAnnotations *LabelsAndAnnotations `json:"labelsAndAnnotations,omitempty" yaml:"labelsAndAnnotations,omitempty"` - Networking *Networking `json:"networking,omitempty" yaml:"networking,omitempty"` - Registries *Registries `json:"registries,omitempty" yaml:"registries,omitempty"` - UpgradeStrategy *rkev1.ClusterUpgradeStrategy `json:"upgradeStrategy,omitempty" yaml:"upgradeStrategy,omitempty"` - Advanced *Advanced `json:"advanced,omitempty" yaml:"advanced,omitempty"` - ClusterSSHTests []SSHTestCase `json:"clusterSSHTests,omitempty" yaml:"clusterSSHTests,omitempty"` - CRIDockerd bool `json:"criDockerd,omitempty" yaml:"criDockerd,omitempty"` -} diff --git a/tests/framework/extensions/psact/createdeployment.go b/tests/framework/extensions/psact/createdeployment.go deleted file mode 100644 index 49e0fe6a139..00000000000 --- a/tests/framework/extensions/psact/createdeployment.go +++ /dev/null @@ -1,103 +0,0 @@ -package psact - -import ( - "fmt" - "strings" - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - namegenerator "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/sirupsen/logrus" - appv1 "k8s.io/api/apps/v1" - v1 "k8s.io/api/core/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - containerName = "nginx" - deploymentName = "nginx" - imageName = "nginx" - namespace = "default" - workload = "workload" - podFailureMessage = `forbidden: violates PodSecurity "restricted:latest"` -) - -// CreateTestDeployment will create an nginx deployment into the default namespace. If the PSACT value is rancher-privileged, then the -// deployment should successfully create. If the PSACT value is rancher-unprivileged, then the deployment should fail to create. -func CreateNginxDeployment(client *rancher.Client, clusterID string, psact string) error { - labels := map[string]string{} - labels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.deployment-%v-%v", namespace, workload) - - containerTemplate := workloads.NewContainer(containerName, imageName, v1.PullAlways, []v1.VolumeMount{}, []v1.EnvFromSource{}, nil, nil, nil) - podTemplate := workloads.NewPodTemplate([]v1.Container{containerTemplate}, []v1.Volume{}, []v1.LocalObjectReference{}, labels) - deploymentTemplate := workloads.NewDeploymentTemplate(deploymentName, namespace, podTemplate, true, labels) - - steveclient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return err - } - - // If the deployment already exists, then create a new deployment with a different name to avoid a naming conflict. - if _, err := steveclient.SteveType(workloads.DeploymentSteveType).ByID(deploymentTemplate.Namespace + "/" + deploymentTemplate.Name); err == nil { - deploymentTemplate.Name = deploymentTemplate.Name + "-" + namegenerator.RandStringLower(5) - } - - logrus.Infof("Creating deployment %s", deploymentTemplate.Name) - _, err = steveclient.SteveType(workloads.DeploymentSteveType).Create(deploymentTemplate) - if err != nil { - return err - } - - err = kwait.Poll(5*time.Second, 5*time.Minute, func() (done bool, err error) { - steveclient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return false, err - } - - deploymentResp, err := steveclient.SteveType(workloads.DeploymentSteveType).ByID(deploymentTemplate.Namespace + "/" + deploymentTemplate.Name) - if err != nil { - // We don't want to return the error so we don't exit the poll too soon. - // There could be delay of when the deployment is created. - return false, nil - } - - deployment := &appv1.Deployment{} - err = steveV1.ConvertToK8sType(deploymentResp.JSONResp, deployment) - if err != nil { - return false, err - } - - if psact == string(provisioninginput.RancherRestricted) { - for _, condition := range deployment.Status.Conditions { - if strings.Contains(condition.Message, podFailureMessage) { - logrus.Infof("Deployment %s failed to create; this is expected for %s!", deployment.Name, psact) - return true, nil - } - } - } else if *deployment.Spec.Replicas == deployment.Status.AvailableReplicas { - logrus.Infof("Deployment %s successfully created; this is expected for %s!", deployment.Name, psact) - return true, nil - } - - return false, nil - }) - if err != nil { - return err - } - - deploymentResp, err := steveclient.SteveType(workloads.DeploymentSteveType).ByID(deploymentTemplate.Namespace + "/" + deploymentTemplate.Name) - if err != nil { - return err - } - - logrus.Infof("Deleting deployment %s", deploymentResp.Name) - err = steveclient.SteveType(workloads.DeploymentSteveType).Delete(deploymentResp) - if err != nil { - return err - } - - return nil -} diff --git a/tests/framework/extensions/rancherversion/config.go b/tests/framework/extensions/rancherversion/config.go deleted file mode 100644 index 1cfdc04b829..00000000000 --- a/tests/framework/extensions/rancherversion/config.go +++ /dev/null @@ -1,13 +0,0 @@ -package rancherversion - -const ( - ConfigurationFileKey = "prime" -) - -type Config struct { - Brand string `json:"brand" yaml:"brand"` - GitCommit string `json:"gitCommit" yaml:"gitCommit"` - IsPrime bool `json:"isPrime" yaml:"isPrime" default:"false"` - RancherVersion string `json:"rancherVersion" yaml:"rancherVersion"` - Registry string `json:"registry" yaml:"registry"` -} diff --git a/tests/framework/extensions/rancherversion/rancherversion.go b/tests/framework/extensions/rancherversion/rancherversion.go deleted file mode 100644 index 897c5a843fd..00000000000 --- a/tests/framework/extensions/rancherversion/rancherversion.go +++ /dev/null @@ -1,35 +0,0 @@ -package rancherversion - -import ( - "encoding/json" - "io" - "net/http" - "strconv" -) - -// RequestRancherVersion Requests the rancher version from the rancher server, parses the returned json and returns a -// Config object, or an error. -func RequestRancherVersion(rancherURL string) (*Config, error) { - var httpURL = "https://" + rancherURL + "/rancherversion" - req, err := http.Get(httpURL) - if err != nil { - return nil, err - } - byteObject, err := io.ReadAll(req.Body) - if err != nil || byteObject == nil { - return nil, err - } - - var jsonObject map[string]interface{} - err = json.Unmarshal(byteObject, &jsonObject) - if err != nil { - return nil, err - } - - configObject := new(Config) - configObject.IsPrime, _ = strconv.ParseBool(jsonObject["RancherPrime"].(string)) - configObject.RancherVersion = jsonObject["Version"].(string) - configObject.GitCommit = jsonObject["GitCommit"].(string) - - return configObject, nil -} diff --git a/tests/framework/extensions/rbac/config.go b/tests/framework/extensions/rbac/config.go deleted file mode 100644 index e7a17337299..00000000000 --- a/tests/framework/extensions/rbac/config.go +++ /dev/null @@ -1,11 +0,0 @@ -package rbac - -const ( - ConfigurationFileKey = "rbacInput" -) - -type Config struct { - Role string `json:"role" yaml:"role"` - Username string `json:"username" yaml:"username"` - Password string `json:"password" yaml:"password"` -} diff --git a/tests/framework/extensions/rbac/verify.go b/tests/framework/extensions/rbac/verify.go deleted file mode 100644 index 250031c6fae..00000000000 --- a/tests/framework/extensions/rbac/verify.go +++ /dev/null @@ -1,255 +0,0 @@ -package rbac - -import ( - "fmt" - "net/url" - "regexp" - "strings" - "testing" - - apiV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/projects" - "github.com/rancher/rancher/tests/framework/extensions/users" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - coreV1 "k8s.io/api/core/v1" -) - -const ( - roleOwner = "cluster-owner" - roleMember = "cluster-member" - roleProjectOwner = "project-owner" - roleProjectMember = "project-member" - roleCustomManageProjectMember = "projectroletemplatebindings-manage" - roleCustomCreateNS = "create-ns" - roleProjectReadOnly = "read-only" - restrictedAdmin = "restricted-admin" - standardUser = "user" - activeStatus = "active" - forbiddenError = "403 Forbidden" -) - -var rgx = regexp.MustCompile(`\[(.*?)\]`) - -// VerifyGlobalRoleBindingsForUser validates that a global role bindings is created for a user when the user is created -func VerifyGlobalRoleBindingsForUser(t *testing.T, user *management.User, adminClient *rancher.Client) { - query := url.Values{"filter": {"userName=" + user.ID}} - grbs, err := adminClient.Steve.SteveType("management.cattle.io.globalrolebinding").List(query) - require.NoError(t, err) - assert.Equal(t, 1, len(grbs.Data)) -} - -// VerifyUserCanListCluster validates a user with the required global permissions are able to/not able to list the clusters in rancher server -func VerifyUserCanListCluster(t *testing.T, client, standardClient *rancher.Client, clusterID, role string) { - clusterList, err := standardClient.Steve.SteveType(clusters.ProvisioningSteveResourceType).ListAll(nil) - require.NoError(t, err) - - clusterStatus := &apiV1.ClusterStatus{} - err = v1.ConvertToK8sType(clusterList.Data[0].Status, clusterStatus) - require.NoError(t, err) - - if role == restrictedAdmin { - adminClusterList, err := client.Steve.SteveType(clusters.ProvisioningSteveResourceType).ListAll(nil) - require.NoError(t, err) - assert.Equal(t, (len(adminClusterList.Data) - 1), len(clusterList.Data)) - } - assert.Equal(t, 1, len(clusterList.Data)) - actualClusterID := clusterStatus.ClusterName - assert.Equal(t, clusterID, actualClusterID) - -} - -// VerifyUserCanListProject validates a user with the required cluster permissions are able/not able to list projects in the downstream cluster -func VerifyUserCanListProject(t *testing.T, client, standardClient *rancher.Client, clusterID, role, adminProjectName string) { - projectListNonAdmin, err := projects.ListProjectNames(standardClient, clusterID) - require.NoError(t, err) - projectListAdmin, err := projects.ListProjectNames(client, clusterID) - require.NoError(t, err) - - switch role { - case roleOwner, restrictedAdmin: - assert.Equal(t, len(projectListAdmin), len(projectListNonAdmin)) - assert.Equal(t, projectListAdmin, projectListNonAdmin) - case roleMember: - assert.Equal(t, 0, len(projectListNonAdmin)) - case roleProjectOwner, roleProjectMember: - assert.Equal(t, 1, len(projectListNonAdmin)) - assert.Equal(t, adminProjectName, projectListNonAdmin[0]) - } -} - -// VerifyUserCanCreateProjects validates a user with the required cluster permissions are able/not able to create projects in the downstream cluster -func VerifyUserCanCreateProjects(t *testing.T, client, standardClient *rancher.Client, clusterID, role string) { - memberProject, err := standardClient.Management.Project.Create(projects.NewProjectConfig(clusterID)) - switch role { - case roleOwner, roleMember, restrictedAdmin: - require.NoError(t, err) - log.Info("Created project as a ", role, " is ", memberProject.Name) - actualStatus := fmt.Sprintf("%v", memberProject.State) - assert.Equal(t, activeStatus, strings.ToLower(actualStatus)) - case roleProjectOwner, roleProjectMember: - require.Error(t, err) - errStatus := strings.Split(err.Error(), ".")[1] - errorMsg := rgx.FindStringSubmatch(errStatus) - assert.Equal(t, forbiddenError, errorMsg[1]) - } -} - -// VerifyUserCanCreateNamespace validates a user with the required cluster permissions are able/not able to create namespaces in the project they do not own -func VerifyUserCanCreateNamespace(t *testing.T, client, standardClient *rancher.Client, project *management.Project, clusterID, role string) { - var checkErr error - namespaceName := namegen.AppendRandomString("testns-") - standardClient, err := standardClient.ReLogin() - require.NoError(t, err) - - createdNamespace, checkErr := namespaces.CreateNamespace(standardClient, namespaceName, "{}", map[string]string{}, map[string]string{}, project) - - switch role { - case roleOwner, roleProjectOwner, roleProjectMember, restrictedAdmin: - require.NoError(t, checkErr) - log.Info("Created a namespace as role ", role, createdNamespace.Name) - assert.Equal(t, namespaceName, createdNamespace.Name) - - namespaceStatus := &coreV1.NamespaceStatus{} - err = v1.ConvertToK8sType(createdNamespace.Status, namespaceStatus) - require.NoError(t, err) - actualStatus := fmt.Sprintf("%v", namespaceStatus.Phase) - assert.Equal(t, activeStatus, strings.ToLower(actualStatus)) - case roleMember: - require.Error(t, checkErr) - errStatus := strings.Split(checkErr.Error(), ".")[1] - errorMsg := rgx.FindStringSubmatch(errStatus) - assert.Equal(t, forbiddenError, errorMsg[1]) - } -} - -// VerifyUserCanListNamespace validates a user with the required cluster permissions are able/not able to list namespaces in the project they do not own -func VerifyUserCanListNamespace(t *testing.T, client, standardClient *rancher.Client, project *management.Project, clusterID, role string) { - log.Info("Validating if ", role, " can lists all namespaces in a cluster.") - - steveAdminClient, err := client.Steve.ProxyDownstream(clusterID) - require.NoError(t, err) - steveStandardClient, err := standardClient.Steve.ProxyDownstream(clusterID) - require.NoError(t, err) - - namespaceListAdmin, err := steveAdminClient.SteveType(namespaces.NamespaceSteveType).List(nil) - require.NoError(t, err) - sortedNamespaceListAdmin := namespaceListAdmin.Names() - - namespaceListNonAdmin, err := steveStandardClient.SteveType(namespaces.NamespaceSteveType).List(nil) - require.NoError(t, err) - sortedNamespaceListNonAdmin := namespaceListNonAdmin.Names() - - switch role { - case roleOwner, restrictedAdmin: - require.NoError(t, err) - assert.Equal(t, len(sortedNamespaceListAdmin), len(sortedNamespaceListNonAdmin)) - assert.Equal(t, sortedNamespaceListAdmin, sortedNamespaceListNonAdmin) - case roleMember: - require.NoError(t, err) - assert.Equal(t, 0, len(sortedNamespaceListNonAdmin)) - case roleProjectOwner, roleProjectMember: - require.NoError(t, err) - assert.NotEqual(t, len(sortedNamespaceListAdmin), len(sortedNamespaceListNonAdmin)) - assert.Equal(t, 1, len(sortedNamespaceListNonAdmin)) - } -} - -// VerifyUserCanDeleteNamespace validates a user with the required cluster permissions are able/not able to delete namespaces in the project they do not own -func VerifyUserCanDeleteNamespace(t *testing.T, client, standardClient *rancher.Client, project *management.Project, clusterID, role string) { - - log.Info("Validating if ", role, " cannot delete a namespace from a project they own.") - steveAdminClient, err := client.Steve.ProxyDownstream(clusterID) - require.NoError(t, err) - steveStandardClient, err := standardClient.Steve.ProxyDownstream(clusterID) - require.NoError(t, err) - - namespaceName := namegen.AppendRandomString("testns-") - adminNamespace, err := namespaces.CreateNamespace(client, namespaceName+"-admin", "{}", map[string]string{}, map[string]string{}, project) - require.NoError(t, err) - - namespaceID, err := steveAdminClient.SteveType(namespaces.NamespaceSteveType).ByID(adminNamespace.ID) - require.NoError(t, err) - err = steveStandardClient.SteveType(namespaces.NamespaceSteveType).Delete(namespaceID) - - switch role { - case roleOwner, roleProjectOwner, roleProjectMember, restrictedAdmin: - require.NoError(t, err) - case roleMember: - require.Error(t, err) - errMessage := strings.Split(err.Error(), ":")[0] - assert.Equal(t, "Resource type [namespace] can not be deleted", errMessage) - } -} - -// VerifyUserCanAddClusterRoles validates a user with the required cluster permissions are able/not able to add other users in the cluster -func VerifyUserCanAddClusterRoles(t *testing.T, client, memberClient *rancher.Client, cluster *management.Cluster, role string) { - additionalClusterUser, err := users.CreateUserWithRole(client, users.UserConfig(), standardUser) - require.NoError(t, err) - - errUserRole := users.AddClusterRoleToUser(memberClient, cluster, additionalClusterUser, roleOwner, nil) - - switch role { - case roleProjectOwner, roleProjectMember: - require.Error(t, errUserRole) - errStatus := strings.Split(errUserRole.Error(), ".")[1] - errorMsg := rgx.FindStringSubmatch(errStatus) - assert.Equal(t, forbiddenError, errorMsg[1]) - case restrictedAdmin: - require.NoError(t, errUserRole) - } - -} - -// VerifyUserCanAddProjectRoles validates a user with the required cluster permissions are able/not able to add other users in a project on the downstream cluster -func VerifyUserCanAddProjectRoles(t *testing.T, client *rancher.Client, project *management.Project, additionalUser *management.User, projectRole, clusterID, role string) { - - errUserRole := users.AddProjectMember(client, project, additionalUser, projectRole, nil) - projectList, errProjectList := projects.ListProjectNames(client, clusterID) - require.NoError(t, errProjectList) - - switch role { - case roleProjectOwner: - require.NoError(t, errUserRole) - assert.Equal(t, 1, len(projectList)) - assert.Equal(t, project.Name, projectList[0]) - - case restrictedAdmin: - require.NoError(t, errUserRole) - assert.Contains(t, projectList, project.Name) - - case roleProjectMember: - require.Error(t, errUserRole) - } - -} - -// VerifyUserCanDeleteProject validates a user with the required cluster/project permissions are able/not able to delete projects in the downstream cluster -func VerifyUserCanDeleteProject(t *testing.T, client *rancher.Client, project *management.Project, role string) { - err := client.Management.Project.Delete(project) - - switch role { - case roleOwner, roleProjectOwner: - require.NoError(t, err) - case roleMember: - require.Error(t, err) - errStatus := strings.Split(err.Error(), ".")[1] - errorMsg := rgx.FindStringSubmatch(errStatus) - assert.Equal(t, forbiddenError, errorMsg[1]) - case roleProjectMember: - require.Error(t, err) - } -} - -// VerifyUserCanRemoveClusterRoles validates a user with the required cluster/project permissions are able/not able to remove cluster roles in the downstream cluster -func VerifyUserCanRemoveClusterRoles(t *testing.T, client *rancher.Client, user *management.User) { - err := users.RemoveClusterRoleFromUser(client, user) - require.NoError(t, err) -} diff --git a/tests/framework/extensions/registries/registries.go b/tests/framework/extensions/registries/registries.go deleted file mode 100644 index 68bf20c85ba..00000000000 --- a/tests/framework/extensions/registries/registries.go +++ /dev/null @@ -1,70 +0,0 @@ -package registries - -import ( - "fmt" - "strings" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - log "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" -) - -// CheckAllClusterPodsForRegistryPrefix checks the pods of a cluster and checks to see if they're coming from the -// expected registry fqdn. -func CheckAllClusterPodsForRegistryPrefix(client *rancher.Client, clusterID, registryPrefix string) (bool, error) { - downstreamClient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return false, err - } - - steveClient := downstreamClient.SteveType(pods.PodResourceSteveType) - podsList, err := steveClient.List(nil) - if err != nil { - return false, err - } - - for _, pod := range podsList.Data { - podSpec := &corev1.PodSpec{} - err := v1.ConvertToK8sType(pod.Spec, podSpec) - if err != nil { - return false, err - } - for _, container := range podSpec.Containers { - if !strings.Contains(container.Image, registryPrefix) { - log.Warnf("pod/containerImage %s/%s is not using the correct registry prefix", pod.Name, container.Image) - return false, nil - } - log.Infoln(container.Image) - } - } - return true, nil -} - -// CheckPodStatusImageSource is an extension that will check if the pod images are pulled from the -// correct registry and checks to see if pod status are in a ready nonerror state. -// Func will return a true if both checks are successful -func CheckPodStatusImageSource(client *rancher.Client, clusterName, registryFQDN string) (bool, []error) { - clusterID, err := clusters.GetClusterIDByName(client, clusterName) - if err != nil { - return false, []error{err} - } - - podErrors := pods.StatusPods(client, clusterID) - if len(podErrors) != 0 { - return false, []error{fmt.Errorf("error: pod(s) are in an error state %v", podErrors)} - } - - correctRegistryFQDN, err := CheckAllClusterPodsForRegistryPrefix(client, clusterID, registryFQDN) - if err != nil { - return false, []error{fmt.Errorf("error: with checking cluster pod registry prefix: %v", err)} - } - - if !correctRegistryFQDN { - return false, []error{fmt.Errorf("error: pod images were not pulled from the correct registry")} - } - - return true, nil -} diff --git a/tests/framework/extensions/resourcequotas/resourcequotas.go b/tests/framework/extensions/resourcequotas/resourcequotas.go deleted file mode 100644 index 1f103e3e2c5..00000000000 --- a/tests/framework/extensions/resourcequotas/resourcequotas.go +++ /dev/null @@ -1,26 +0,0 @@ -package resourcequotas - -import ( - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - ResourceQuotasSteveType = "resourcequota" -) - -// CheckResourceActiveState is a function that uses the Steve API to check if the resource quota is in an active state -func CheckResourceActiveState(client *rancher.Client, resourceQuotaID string) error { - return kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - steveResourceQuota, err := client.Steve.SteveType(ResourceQuotasSteveType).ByID(resourceQuotaID) - if err != nil { - return false, err - } else if steveResourceQuota.State.Name == "active" { - return true, nil - } - - return false, nil - }) -} diff --git a/tests/framework/extensions/rke1/componentchecks/etcdversion.go b/tests/framework/extensions/rke1/componentchecks/etcdversion.go deleted file mode 100644 index 5788b83c67f..00000000000 --- a/tests/framework/extensions/rke1/componentchecks/etcdversion.go +++ /dev/null @@ -1,46 +0,0 @@ -package componentchecks - -import ( - "strings" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/pkg/nodes" - "github.com/sirupsen/logrus" -) - -// CheckETCDVersion will check the etcd version on the etcd node in the provisioned RKE1 cluster. -func CheckETCDVersion(client *rancher.Client, nodes []*nodes.Node, clusterID string) ([]string, error) { - steveClient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return nil, err - } - - nodesList, err := steveClient.SteveType("node").List(nil) - if err != nil { - return nil, err - } - - var etcdResult []string - - for _, rancherNode := range nodesList.Data { - externalIP := rancherNode.Annotations["rke.cattle.io/external-ip"] - etcdRole := rancherNode.Labels["node-role.kubernetes.io/etcd"] - - if etcdRole == "true" { - for _, node := range nodes { - if strings.Contains(node.PublicIPAddress, externalIP) { - command := "docker exec etcd etcdctl version" - output, err := node.ExecuteCommand(command) - if err != nil { - return []string{}, err - } - - etcdResult = append(etcdResult, output) - logrus.Infof(output) - } - } - } - } - - return etcdResult, nil -} diff --git a/tests/framework/extensions/rke1/nodepools/nodepools.go b/tests/framework/extensions/rke1/nodepools/nodepools.go deleted file mode 100644 index ada0ed9999f..00000000000 --- a/tests/framework/extensions/rke1/nodepools/nodepools.go +++ /dev/null @@ -1,142 +0,0 @@ -package rke1 - -import ( - "strconv" - "time" - - "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/sirupsen/logrus" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - active = "active" -) - -type NodeRoles struct { - ControlPlane bool `json:"controlplane,omitempty" yaml:"controlplane,omitempty"` - Etcd bool `json:"etcd,omitempty" yaml:"etcd,omitempty"` - Worker bool `json:"worker,omitempty" yaml:"worker,omitempty"` - Quantity int64 `json:"quantity" yaml:"quantity"` - DrainBeforeDelete bool `json:"drainBeforeDelete,omitempty" yaml:"drainBeforeDelete,omitempty"` -} - -// NodePoolSetup is a helper method that will loop and setup multiple node pools with the defined node roles from the `nodeRoles` parameter -// `nodeRoles` would be in this format -// -// []map[string]bool{ -// { -// ControlPlane: true, -// Etcd: false, -// Worker: false, -// Quantity: 1, -// }, -// { -// ControlPlane: false, -// Etcd: true, -// Worker: false, -// Quantity: 1, -// }, -// } -func NodePoolSetup(client *rancher.Client, nodeRoles []NodeRoles, ClusterID, NodeTemplateID string) (*management.NodePool, error) { - nodePoolConfig := management.NodePool{ - ClusterID: ClusterID, - DeleteNotReadyAfterSecs: 0, - NodeTemplateID: NodeTemplateID, - } - - for index, roles := range nodeRoles { - nodePoolConfig.ControlPlane = roles.ControlPlane - nodePoolConfig.Etcd = roles.Etcd - nodePoolConfig.Worker = roles.Worker - nodePoolConfig.Quantity = roles.Quantity - nodePoolConfig.HostnamePrefix = "auto-rke1-" + strconv.Itoa(index) + ClusterID - nodePoolConfig.DrainBeforeDelete = roles.DrainBeforeDelete - - _, err := client.Management.NodePool.Create(&nodePoolConfig) - - if err != nil { - return nil, err - } - } - - return &nodePoolConfig, nil -} - -// MatchRKE1NodeRoles is a helper method that will return the desired node in the cluster, based on the node role. -func MatchRKE1NodeRoles(client *rancher.Client, cluster *management.Cluster, nodeRoles NodeRoles) (*management.Node, error) { - nodes, err := client.Management.Node.ListAll(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": cluster.ID, - }, - }) - if err != nil { - return nil, err - } - - for _, node := range nodes.Data { - if nodeRoles.ControlPlane != node.ControlPlane { - continue - } - if nodeRoles.Etcd != node.Etcd { - continue - } - if nodeRoles.Worker != node.Worker { - continue - } - - return &node, nil - } - - return nil, nil -} - -// updateNodePoolQuantity is a helper method that will update the node pool with the desired quantity. -func updateNodePoolQuantity(client *rancher.Client, cluster *management.Cluster, node *management.Node, nodeRoles NodeRoles) (*management.NodePool, error) { - updatedNodePool, err := client.Management.NodePool.ByID(node.NodePoolID) - if err != nil { - return nil, err - } - - updatedNodePool.Quantity += nodeRoles.Quantity - - logrus.Infof("Scaling the machine pool to %v total nodes", updatedNodePool.Quantity) - _, err = client.Management.NodePool.Update(updatedNodePool, &updatedNodePool) - if err != nil { - return nil, err - } - - err = kwait.Poll(500*time.Millisecond, defaults.TenMinuteTimeout, func() (done bool, err error) { - clusterResp, err := client.Management.Cluster.ByID(cluster.ID) - if err != nil { - return false, err - } - - if clusterResp.State == active && nodestat.AllManagementNodeReady(client, clusterResp.ID, defaults.ThirtyMinuteTimeout) == nil { - logrus.Infof("Node pool is scaled!") - return true, nil - } - return false, nil - }) - if err != nil { - return nil, err - } - - return updatedNodePool, nil -} - -// ScaleNodePoolNodes is a helper method that will scale the node pool to the desired quantity. -func ScaleNodePoolNodes(client *rancher.Client, cluster *management.Cluster, node *management.Node, nodeRoles NodeRoles) (*management.NodePool, error) { - updatedNodePool, err := updateNodePoolQuantity(client, cluster, node, nodeRoles) - if err != nil { - return nil, err - } - - logrus.Infof("Node pool has been scaled!") - - return updatedNodePool, nil -} diff --git a/tests/framework/extensions/rke1/nodetemplates/aws/create.go b/tests/framework/extensions/rke1/nodetemplates/aws/create.go deleted file mode 100644 index 5383a3100e4..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/aws/create.go +++ /dev/null @@ -1,30 +0,0 @@ -package nodetemplates - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const awsEC2NodeTemplateNameBase = "awsNodeConfig" - -// CreateAWSNodeTemplate is a helper function that takes the rancher Client as a parameter and creates -// an AWS node template and returns the NodeTemplate response -func CreateAWSNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) { - var amazonEC2NodeTemplateConfig nodetemplates.AmazonEC2NodeTemplateConfig - config.LoadConfig(nodetemplates.AmazonEC2NodeTemplateConfigurationFileKey, &amazonEC2NodeTemplateConfig) - - nodeTemplate := nodetemplates.NodeTemplate{ - EngineInstallURL: "https://releases.rancher.com/install-docker/24.0.sh", - Name: awsEC2NodeTemplateNameBase, - AmazonEC2NodeTemplateConfig: &amazonEC2NodeTemplateConfig, - } - - resp := &nodetemplates.NodeTemplate{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.NodeTemplateType, nodeTemplate, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/rke1/nodetemplates/aws_config.go b/tests/framework/extensions/rke1/nodetemplates/aws_config.go deleted file mode 100644 index 674d91d8f80..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/aws_config.go +++ /dev/null @@ -1,42 +0,0 @@ -package nodetemplates - -// The json/yaml config key for the Amazon node template config -const AmazonEC2NodeTemplateConfigurationFileKey = "awsNodeTemplate" - -// AmazonNodeTemplateConfig is configuration need to create a Amazon node template -type AmazonEC2NodeTemplateConfig struct { - AccessKey string `json:"accessKey" yaml:"accessKey"` - AMI string `json:"ami" yaml:"ami"` - BlockDurationMinutes string `json:"blockDurationMinutes" yaml:"blockDurationMinutes"` - DeviceName string `json:"deviceName" yaml:"deviceName"` - EncryptEBSVolume bool `json:"encryptEbsVolume" yaml:"encryptEbsVolume"` - Endpoint string `json:"endpoint" yaml:"endpoint"` - HTTPEndpoint string `json:"httpEndpoint" yaml:"httpEndpoint"` - HTTPTokens string `json:"httpTokens" yaml:"httpTokens"` - IAMInstanceProfile string `json:"iamInstanceProfile" yaml:"iamInstanceProfile"` - InsecureTransport bool `json:"insecureTransport" yaml:"insecureTransport"` - InstanceType string `json:"instanceType" yaml:"instanceType"` - KeyPairName string `json:"keyPairName" yaml:"keyPairName"` - KMSKey string `json:"kmsKey" yaml:"kmsKey"` - Monitoring bool `json:"monitoring" yaml:"monitoring"` - PrivateAddressOnly bool `json:"privateAddressOnly" yaml:"privateAddressOnly"` - Region string `json:"region" yaml:"region"` - RequestSpotInstance bool `json:"requestSpotInstance" yaml:"requestSpotInstance"` - Retries string `json:"retries" yaml:"retries"` - RootSize string `json:"rootSize" yaml:"rootSize"` - SecretKey string `json:"secretKey" yaml:"secretKey"` - SecurityGroup []string `json:"securityGroup" yaml:"securityGroup"` - SecurityGroupReadonly bool `json:"securityGroupReadonly" yaml:"securityGroupReadonly"` - SessionToken string `json:"sessionToken" yaml:"sessionToken"` - SpotPrice string `json:"spotPrice" yaml:"spotPrice"` - SSHKeyContexts string `json:"sshKeyContexts" yaml:"sshKeyContexts"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - SubnetID string `json:"subnetId" yaml:"subnetId"` - Tags string `json:"tags" yaml:"tags"` - Type string `json:"type" yaml:"type"` - UsePrivateAddress bool `json:"usePrivateAddress" yaml:"usePrivateAddress"` - UseEbsOptimizedInstance bool `json:"useEbsOptimizedInstance" yaml:"useEbsOptimizedInstance"` - VolumeType string `json:"volumeType" yaml:"volumeType"` - VPCId string `json:"vpcId" yaml:"vpcId"` - Zone string `json:"zone" yaml:"zone"` -} diff --git a/tests/framework/extensions/rke1/nodetemplates/azure/create.go b/tests/framework/extensions/rke1/nodetemplates/azure/create.go deleted file mode 100644 index 4c0f3af8ce0..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/azure/create.go +++ /dev/null @@ -1,30 +0,0 @@ -package nodetemplates - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const azureNodeTemplateNameBase = "azureNodeConfig" - -// CreateAzureNodeTemplate is a helper function that takes the rancher Client as a parameter and creates -// an Azure node template and returns the NodeTemplate response -func CreateAzureNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) { - var azureNodeTemplateConfig nodetemplates.AzureNodeTemplateConfig - config.LoadConfig(nodetemplates.AzureNodeTemplateConfigurationFileKey, &azureNodeTemplateConfig) - - nodeTemplate := nodetemplates.NodeTemplate{ - EngineInstallURL: "https://releases.rancher.com/install-docker/23.0.sh", - Name: azureNodeTemplateNameBase, - AzureNodeTemplateConfig: &azureNodeTemplateConfig, - } - - resp := &nodetemplates.NodeTemplate{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.NodeTemplateType, nodeTemplate, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/rke1/nodetemplates/azure_config.go b/tests/framework/extensions/rke1/nodetemplates/azure_config.go deleted file mode 100644 index 1d10596b0dd..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/azure_config.go +++ /dev/null @@ -1,37 +0,0 @@ -package nodetemplates - -// The json/yaml config key for the Azure node template config -const AzureNodeTemplateConfigurationFileKey = "azureNodeTemplate" - -// AzureNodeTemplateConfig is configuration need to create a Azure node template -type AzureNodeTemplateConfig struct { - AvailabilitySet string `json:"availabilitySet" yaml:"availabilitySet"` - ClientID string `json:"clientId" yaml:"clientId"` - ClientSecret string `json:"clientSecret" yaml:"clientSecret"` - CustomData string `json:"customData" yaml:"customData"` - DiskSize string `json:"diskSize" yaml:"diskSize"` - DNS string `json:"dns" yaml:"dns"` - DockerPort string `json:"dockerPort" yaml:"dockerPort"` - Environment string `json:"environment" yaml:"environment"` - FaultDomainCount string `json:"faultDomainCount" yaml:"faultDomainCount"` - Image string `json:"image" yaml:"image"` - Location string `json:"location" yaml:"location"` - ManagedDisks bool `json:"managedDisks" yaml:"managedDisks"` - NoPublicIP bool `json:"noPublicIp" yaml:"noPublicIp"` - OpenPort []string `json:"openPort" yaml:"openPort"` - Plan string `json:"plan" yaml:"plan"` - PrivateIPAddress string `json:"privateIpAddress" yaml:"privateIpAddress"` - ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"` - Size string `json:"size" yaml:"size"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - StaticPublicIP bool `json:"staticPublicIp" yaml:"staticPublicIp"` - StorageType string `json:"storageType" yaml:"storageType"` - Subnet string `json:"subnet" yaml:"subnet"` - SubnetPrefix string `json:"subnetPrefix" yaml:"subnetPrefix"` - SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"` - TenantID string `json:"tenantId" yaml:"tenantId"` - Type string `json:"type" yaml:"type"` - UpdateDomainCount string `json:"updateDomainCount" yaml:"updateDomainCount"` - UsePrivateIP bool `json:"usePrivateIp" yaml:"usePrivateIp"` - VNET string `json:"vnet" yaml:"vnet"` -} diff --git a/tests/framework/extensions/rke1/nodetemplates/harvester/create.go b/tests/framework/extensions/rke1/nodetemplates/harvester/create.go deleted file mode 100644 index 1cfe22738a7..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/harvester/create.go +++ /dev/null @@ -1,30 +0,0 @@ -package nodetemplates - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const harvesterNodeTemplateNameBase = "harvesterNodeConfig" - -// CreateHarvesterNodeTemplate is a helper function that takes the rancher Client as a parameter and creates -// an Harvester node template and returns the NodeTemplate response -func CreateHarvesterNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) { - var harvesterNodeTemplateConfig nodetemplates.HarvesterNodeTemplateConfig - config.LoadConfig(nodetemplates.HarvesterNodeTemplateConfigurationFileKey, &harvesterNodeTemplateConfig) - - nodeTemplate := nodetemplates.NodeTemplate{ - EngineInstallURL: "https://releases.rancher.com/install-docker/24.0.sh", - Name: harvesterNodeTemplateNameBase, - HarvesterNodeTemplateConfig: &harvesterNodeTemplateConfig, - } - - resp := &nodetemplates.NodeTemplate{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.NodeTemplateType, nodeTemplate, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/rke1/nodetemplates/harvester_config.go b/tests/framework/extensions/rke1/nodetemplates/harvester_config.go deleted file mode 100644 index 97e9621d068..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/harvester_config.go +++ /dev/null @@ -1,30 +0,0 @@ -package nodetemplates - -// The json/yaml config key for the Harvester node template config -const HarvesterNodeTemplateConfigurationFileKey = "harvesterNodeTemplate" - -// HarvesterNodeTemplateConfig is configuration need to create a Harvester node template -type HarvesterNodeTemplateConfig struct { - CloudConfig string `json:"cloudConfig" yaml:"cloudConfig"` - ClusterID string `json:"clusterId" yaml:"clusterId"` - ClusterType string `json:"clusterType" yaml:"clusterType"` - CPUCount string `json:"cpuCount" yaml:"cpuCount"` - DiskBus string `json:"diskBus" yaml:"diskBus"` - DiskSize string `json:"diskSize" yaml:"diskSize"` - ImageName string `json:"imageName" yaml:"imageName"` - KeyPairName string `json:"keyPairName" yaml:"keyPairName"` - KubeconfigContent string `json:"kubeconfigContent" yaml:"kubeconfigContent"` - MemorySize string `json:"memorySize" yaml:"memorySize"` - NetworkData string `json:"networkData" yaml:"networkData"` - NetworkModel string `json:"networkModel" yaml:"networkModel"` - NetworkName string `json:"networkName" yaml:"networkName"` - NetworkType string `json:"networkType" yaml:"networkType"` - SSHPassword string `json:"sshPassword" yaml:"sshPassword"` - SSHPort string `json:"sshPort" yaml:"sshPort"` - SSHPrivateKeyPath string `json:"sshPrivateKeyPath" yaml:"sshPrivateKeyPath"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - Type string `json:"type" yaml:"type"` - UserData string `json:"userData" yaml:"userData"` - VMAffinity string `json:"vmAffinity" yaml:"vmAffinity"` - VMNamespace string `json:"vmNamespace" yaml:"vmNamespace"` -} diff --git a/tests/framework/extensions/rke1/nodetemplates/linode/create.go b/tests/framework/extensions/rke1/nodetemplates/linode/create.go deleted file mode 100644 index 5555626c727..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/linode/create.go +++ /dev/null @@ -1,30 +0,0 @@ -package nodetemplates - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const linodeNodeTemplateNameBase = "linodeNodeConfig" - -// CreateLinodeNodeTemplate is a helper function that takes the rancher Client as a parameter and creates -// an Linode node template and returns the NodeTemplate response -func CreateLinodeNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) { - var linodeNodeTemplateConfig nodetemplates.LinodeNodeTemplateConfig - config.LoadConfig(nodetemplates.LinodeNodeTemplateConfigurationFileKey, &linodeNodeTemplateConfig) - - nodeTemplate := nodetemplates.NodeTemplate{ - EngineInstallURL: "https://releases.rancher.com/install-docker/24.0.sh", - Name: linodeNodeTemplateNameBase, - LinodeNodeTemplateConfig: &linodeNodeTemplateConfig, - } - - resp := &nodetemplates.NodeTemplate{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.NodeTemplateType, nodeTemplate, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/rke1/nodetemplates/linode_config.go b/tests/framework/extensions/rke1/nodetemplates/linode_config.go deleted file mode 100644 index a757a78993f..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/linode_config.go +++ /dev/null @@ -1,25 +0,0 @@ -package nodetemplates - -// The json/yaml config key for the Linode node template config -const LinodeNodeTemplateConfigurationFileKey = "linodeNodeTemplate" - -// LinodeNodeTemplateConfig is configuration need to create a Linode node template -type LinodeNodeTemplateConfig struct { - AuthorizedUsers string `json:"authorizedUsers" yaml:"authorizedUsers"` - CreatePrivateIP bool `json:"createPrivateIP" yaml:"createPrivateIP"` - DockerPort string `json:"dockerPort" yaml:"dockerPort"` - Image string `json:"image" yaml:"image"` - InstanceType string `json:"instanceType" yaml:"instanceType"` - Label string `json:"label" yaml:"label"` - Region string `json:"region" yaml:"region"` - RootPass string `json:"rootPass" yaml:"rootPass"` - SSHPort string `json:"sshPort" yaml:"sshPort"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - Stackscript string `json:"stackscript" yaml:"stackscript"` - StackscriptData string `json:"stackscriptData" yaml:"stackscriptData"` - SwapSize string `json:"swapSize" yaml:"swapSize"` - Tags string `json:"tags" yaml:"tags"` - Token string `json:"token" yaml:"token"` - Type string `json:"type" yaml:"type"` - UAPrefix string `json:"uaPrefix" yaml:"uaPrefix"` -} diff --git a/tests/framework/extensions/rke1/nodetemplates/nodetemplates.go b/tests/framework/extensions/rke1/nodetemplates/nodetemplates.go deleted file mode 100644 index 0462dc24274..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/nodetemplates.go +++ /dev/null @@ -1,41 +0,0 @@ -package nodetemplates - -import ( - "github.com/rancher/norman/types" -) - -// NodeTemplate is the main struct needed to create a node template for an RKE1 cluster -type NodeTemplate struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"authCertificateAuthority,omitempty"` - AuthKey string `json:"authKey,omitempty" yaml:"authKey,omitempty"` - CloudCredentialID string `json:"cloudCredentialId,omitempty" yaml:"cloudCredentialId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DockerVersion string `json:"dockerVersion,omitempty" yaml:"dockerVersion,omitempty"` - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - EngineEnv map[string]string `json:"engineEnv,omitempty" yaml:"engineEnv,omitempty"` - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engineInsecureRegistry,omitempty"` - EngineInstallURL string `json:"engineInstallURL,omitempty" yaml:"engineInstallURL,omitempty"` - EngineLabel map[string]string `json:"engineLabel,omitempty" yaml:"engineLabel,omitempty"` - EngineOpt map[string]string `json:"engineOpt,omitempty" yaml:"engineOpt,omitempty"` - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engineRegistryMirror,omitempty"` - EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engineStorageDriver,omitempty"` - Label map[string]string `json:"label,omitempty" yaml:"label,omitempty"` - AmazonEC2NodeTemplateConfig *AmazonEC2NodeTemplateConfig `json:"amazonec2Config" yaml:"amazonec2Config,omitempty"` - AzureNodeTemplateConfig *AzureNodeTemplateConfig `json:"azureConfig" yaml:"azureConfig,omitempty"` - HarvesterNodeTemplateConfig *HarvesterNodeTemplateConfig `json:"harvesterConfig" yaml:"harvesterConfig,omitempty"` - LinodeNodeTemplateConfig *LinodeNodeTemplateConfig `json:"linodeConfig" yaml:"linodeConfig,omitempty"` - VmwareVsphereNodeTemplateConfig *VmwareVsphereNodeTemplateConfig `json:"vmwarevsphereConfig" yaml:"vmwarevsphereConfig,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceID string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UseInternalIPAddress *bool `json:"useInternalIpAddress,omitempty" yaml:"useInternalIpAddress,omitempty"` -} diff --git a/tests/framework/extensions/rke1/nodetemplates/vsphere/create.go b/tests/framework/extensions/rke1/nodetemplates/vsphere/create.go deleted file mode 100644 index ecc6bdae909..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/vsphere/create.go +++ /dev/null @@ -1,30 +0,0 @@ -package nodetemplates - -import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates" - "github.com/rancher/rancher/tests/framework/pkg/config" -) - -const vmwarevsphereNodeTemplateNameBase = "vmwarevsphereNodeConfig" - -// CreateVSphereNodeTemplate is a helper function that takes the rancher Client as a parameter and creates -// an VSphere node template and returns the NodeTemplate response -func CreateVSphereNodeTemplate(rancherClient *rancher.Client) (*nodetemplates.NodeTemplate, error) { - var vmwarevsphereNodeTemplateConfig nodetemplates.VmwareVsphereNodeTemplateConfig - config.LoadConfig(nodetemplates.VmwareVsphereNodeTemplateConfigurationFileKey, &vmwarevsphereNodeTemplateConfig) - - nodeTemplate := nodetemplates.NodeTemplate{ - EngineInstallURL: "https://releases.rancher.com/install-docker/20.10.sh", - Name: vmwarevsphereNodeTemplateNameBase, - VmwareVsphereNodeTemplateConfig: &vmwarevsphereNodeTemplateConfig, - } - - resp := &nodetemplates.NodeTemplate{} - err := rancherClient.Management.APIBaseClient.Ops.DoCreate(management.NodeTemplateType, nodeTemplate, resp) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/tests/framework/extensions/rke1/nodetemplates/vsphere_config.go b/tests/framework/extensions/rke1/nodetemplates/vsphere_config.go deleted file mode 100644 index e1e990b6dff..00000000000 --- a/tests/framework/extensions/rke1/nodetemplates/vsphere_config.go +++ /dev/null @@ -1,39 +0,0 @@ -package nodetemplates - -// The json/yaml config key for the VSphere node template config -const VmwareVsphereNodeTemplateConfigurationFileKey = "vmwarevsphereNodeTemplate" - -// VmwareVsphereNodeTemplateConfig is configuration need to create a VSphere node template -type VmwareVsphereNodeTemplateConfig struct { - Cfgparam []string `json:"cfgparam" yaml:"cfgparam"` - CloneFrom string `json:"cloneFrom" yaml:"cloneFrom"` - CloudConfig string `json:"cloudConfig" yaml:"cloudConfig"` - Cloundinit string `json:"cloundinit" yaml:"cloundinit"` - ContentLibrary string `json:"contentLibrary" yaml:"contentLibrary"` - CPUCount string `json:"cpuCount" yaml:"cpuCount"` - CreationType string `json:"creationType" yaml:"creationType"` - CustomAttribute []string `json:"customAttribute" yaml:"customAttribute"` - DataCenter string `json:"dataCenter" yaml:"dataCenter"` - DataStore string `json:"dataStore" yaml:"dataStore"` - DatastoreCluster string `json:"datastoreCluster" yaml:"datastoreCluster"` - DiskSize string `json:"diskSize" yaml:"diskSize"` - Folder string `json:"folder" yaml:"folder"` - HostSystem string `json:"hostSystem" yaml:"hostSystem"` - MemorySize string `json:"memorySize" yaml:"memorySize"` - Network []string `json:"network" yaml:"network"` - OS string `json:"os" yaml:"os"` - Password string `json:"password" yaml:"password"` - Pool string `json:"pool" yaml:"pool"` - SSHPassword string `json:"sshPassword" yaml:"sshPassword"` - SSHPort string `json:"sshPort" yaml:"sshPort"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - SSHUserGroup string `json:"sshUserGroup" yaml:"sshUserGroup"` - Tag []string `json:"tag" yaml:"tag"` - Username string `json:"username" yaml:"username"` - VappIpallocationplicy string `json:"vappIpallocationplicy" yaml:"vappIpallocationplicy"` - VappIpprotocol string `json:"vappIpprotocol" yaml:"vappIpprotocol"` - VappProperty []string `json:"vappProperty" yaml:"vappProperty"` - VappTransport string `json:"vappTransport" yaml:"vappTransport"` - Vcenter string `json:"vcenter" yaml:"vcenter"` - VcenterPort string `json:"vcenterPort" yaml:"vcenterPort"` -} diff --git a/tests/framework/extensions/scalinginput/config.go b/tests/framework/extensions/scalinginput/config.go deleted file mode 100644 index 79dbee1bf30..00000000000 --- a/tests/framework/extensions/scalinginput/config.go +++ /dev/null @@ -1,42 +0,0 @@ -package scalinginput - -import ( - "github.com/rancher/rancher/tests/framework/extensions/clusters/aks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/eks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/gke" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - nodepools "github.com/rancher/rancher/tests/framework/extensions/rke1/nodepools" - corev1 "k8s.io/api/core/v1" -) - -const ( - ConfigurationFileKey = "scalingInput" -) - -type Pools struct { - NodeLabels map[string]string `json:"nodeLabels" yaml:"nodeLabels"` - NodeTaints []corev1.Taint `json:"nodeTaints" yaml:"nodeTaints"` - SpecifyCustomPrivateIP bool `json:"specifyPrivateIP" yaml:"specifyPrivateIP"` - SpecifyCustomPublicIP bool `json:"specifyPublicIP" yaml:"specifyPublicIP" default:"true"` - CustomNodeNameSuffix string `json:"nodeNameSuffix" yaml:"nodeNameSuffix"` -} - -type MachinePools struct { - Pools - NodeRoles *machinepools.NodeRoles `json:"nodeRoles" yaml:"nodeRoles"` - IsSecure bool `json:"isSecure" yaml:"isSecure" default:"false"` -} - -type NodePools struct { - Pools - NodeRoles *nodepools.NodeRoles `json:"nodeRoles" yaml:"nodeRoles"` -} - -type Config struct { - NodePools *NodePools `json:"nodePools" yaml:"nodePools"` - MachinePools *MachinePools `json:"machinePools" yaml:"machinePools"` - AKSNodePool *aks.NodePool `json:"aksNodePool" yaml:"aksNodePool"` - EKSNodePool *eks.NodeGroupConfig `json:"eksNodePool" yaml:"eksNodePool"` - GKENodePool *gke.NodePool `json:"gkeNodePool" yaml:"gkeNodePool"` - NodeProvider string `json:"nodeProvider" yaml:"nodeProvider"` -} diff --git a/tests/framework/extensions/secrets/secrets.go b/tests/framework/extensions/secrets/secrets.go deleted file mode 100644 index 5883d16b1ec..00000000000 --- a/tests/framework/extensions/secrets/secrets.go +++ /dev/null @@ -1,5 +0,0 @@ -package secrets - -const ( - SecretSteveType = "secret" -) diff --git a/tests/framework/extensions/secrets/template.go b/tests/framework/extensions/secrets/template.go deleted file mode 100644 index 78158c4fef9..00000000000 --- a/tests/framework/extensions/secrets/template.go +++ /dev/null @@ -1,18 +0,0 @@ -package secrets - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NewSecretTemplate is a constructor that creates the secret template for secrets -func NewSecretTemplate(secretName, namespaceName string, data map[string][]byte, secType corev1.SecretType) corev1.Secret { - return corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: secretName, - Namespace: namespaceName, - }, - Data: data, - Type: secType, - } -} diff --git a/tests/framework/extensions/serviceaccounts/serviceaccounts.go b/tests/framework/extensions/serviceaccounts/serviceaccounts.go deleted file mode 100644 index 8fe183a36df..00000000000 --- a/tests/framework/extensions/serviceaccounts/serviceaccounts.go +++ /dev/null @@ -1,38 +0,0 @@ -package serviceaccounts - -import ( - "fmt" - "strings" - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - ServiceAccountSteveType = "serviceaccount" -) - -func IsServiceAccountReady(rancherClient *rancher.Client, clusterID, namespace, serviceAccountName string) error { - userAccountID := fmt.Sprintf("%s/%s", namespace, serviceAccountName) - steveClient, err := rancherClient.Steve.ProxyDownstream(clusterID) - if err != nil { - return err - } - - err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - serviceAccount, err := steveClient.SteveType(ServiceAccountSteveType).ByID(userAccountID) - if err != nil { - if strings.Contains(err.Error(), "Status [404 Not Found]") { - return false, nil - } - return false, err - } else if serviceAccount.State.Name == "active" { - return true, nil - } - - return false, nil - }) - - return err -} diff --git a/tests/framework/extensions/services/services.go b/tests/framework/extensions/services/services.go deleted file mode 100644 index 8952e020238..00000000000 --- a/tests/framework/extensions/services/services.go +++ /dev/null @@ -1,5 +0,0 @@ -package services - -const ( - ServiceSteveType = "service" -) diff --git a/tests/framework/extensions/services/template.go b/tests/framework/extensions/services/template.go deleted file mode 100644 index 82f0b375147..00000000000 --- a/tests/framework/extensions/services/template.go +++ /dev/null @@ -1,21 +0,0 @@ -package services - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NewServiceTemplate is a constructor that creates the service template for services -func NewServiceTemplate(serviceName, namespaceName string, serviceType corev1.ServiceType, ports []corev1.ServicePort, selector map[string]string) corev1.Service { - return corev1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: serviceName, - Namespace: namespaceName, - }, - Spec: corev1.ServiceSpec{ - Type: serviceType, - Ports: ports, - Selector: selector, - }, - } -} diff --git a/tests/framework/extensions/services/verify.go b/tests/framework/extensions/services/verify.go deleted file mode 100644 index d142aa2ac97..00000000000 --- a/tests/framework/extensions/services/verify.go +++ /dev/null @@ -1,61 +0,0 @@ -package services - -import ( - "strings" - "testing" - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - noSuchHostSubString = "no such host" -) - -// VerifyAWSLoadBalancer validates that an AWS loadbalancer service is created and working properly -func VerifyAWSLoadBalancer(t *testing.T, client *rancher.Client, serviceLB *v1.SteveAPIObject, clusterName string) { - adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) - require.NoError(t, err) - - steveclient, err := adminClient.Steve.ProxyDownstream(clusterName) - require.NoError(t, err) - - lbHostname := "" - err = kwait.Poll(5*time.Second, 1*time.Minute, func() (done bool, err error) { - updateService, err := steveclient.SteveType("service").ByID(serviceLB.ID) - if err != nil { - return false, nil - } - - serviceStatus := &corev1.ServiceStatus{} - err = v1.ConvertToK8sType(updateService.Status, serviceStatus) - if err != nil { - return false, err - } - if len(serviceStatus.LoadBalancer.Ingress) == 0 { - return false, nil - } - - lbHostname = serviceStatus.LoadBalancer.Ingress[0].Hostname - return true, nil - }) - require.NoError(t, err) - - err = kwait.Poll(5*time.Second, 3*time.Minute, func() (done bool, err error) { - isIngressAccessible, err := ingresses.IsIngressExternallyAccessible(client, lbHostname, "", false) - if err != nil { - if strings.Contains(err.Error(), noSuchHostSubString) { - return false, nil - } - return false, err - } - - return isIngressAccessible, nil - }) - require.NoError(t, err) -} diff --git a/tests/framework/extensions/settings/shell.go b/tests/framework/extensions/settings/shell.go deleted file mode 100644 index 42f54d96feb..00000000000 --- a/tests/framework/extensions/settings/shell.go +++ /dev/null @@ -1,30 +0,0 @@ -package settings - -import ( - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" -) - -// ShellVersion is a helper that gets the shell setting json based on the ID and return the shell image value. -func ShellVersion(client *rancher.Client, clusterID, resourceName string) (string, error) { - steveClient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return "", err - } - - shellSetting := &v3.Setting{} - shellSettingResp, err := steveClient.SteveType("management.cattle.io.setting").ByID("shell-image") - if err != nil { - return "", err - } - - err = v1.ConvertToK8sType(shellSettingResp.JSONResp, shellSetting) - if err != nil { - return "", err - } - image := shellSetting.Value - - return image, nil - -} diff --git a/tests/framework/extensions/sshkeys/downloadsshkeys.go b/tests/framework/extensions/sshkeys/downloadsshkeys.go deleted file mode 100644 index 16687d508ca..00000000000 --- a/tests/framework/extensions/sshkeys/downloadsshkeys.go +++ /dev/null @@ -1,50 +0,0 @@ -package sshkeys - -import ( - "fmt" - "io" - "net/http" - "regexp" - - "github.com/rancher/rancher/tests/framework/clients/rancher" -) - -const ( - privateKeySSHKeyRegExPattern = `-----BEGIN RSA PRIVATE KEY-{3,}\n([\s\S]*?)\n-{3,}END RSA PRIVATE KEY-----` - ClusterMachineConstraintResourceSteveType = "cluster.x-k8s.io.machine" -) - -// DownloadSSHKeys is a helper function that takes a client, the machinePoolNodeName to download -// the ssh key for a particular node. -func DownloadSSHKeys(client *rancher.Client, machinePoolNodeName string) ([]byte, error) { - machinePoolNodeNameName := fmt.Sprintf("fleet-default/%s", machinePoolNodeName) - machine, err := client.Steve.SteveType(ClusterMachineConstraintResourceSteveType).ByID(machinePoolNodeNameName) - if err != nil { - return nil, err - } - - sshKeyLink := machine.Links["sshkeys"] - - req, err := http.NewRequest("GET", sshKeyLink, nil) - if err != nil { - return nil, err - } - - req.Header.Add("Authorization", "Bearer "+client.RancherConfig.AdminToken) - - resp, err := client.Management.APIBaseClient.Ops.Client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - bodyBytes, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - privateSSHKeyRegEx := regexp.MustCompile(privateKeySSHKeyRegExPattern) - privateSSHKey := privateSSHKeyRegEx.FindString(string(bodyBytes)) - - return []byte(privateSSHKey), err -} diff --git a/tests/framework/extensions/token/create.go b/tests/framework/extensions/token/create.go deleted file mode 100644 index 161365c839b..00000000000 --- a/tests/framework/extensions/token/create.go +++ /dev/null @@ -1,78 +0,0 @@ -package token - -import ( - "bytes" - "crypto/tls" - "encoding/json" - "fmt" - "io" - "net/http" - - "github.com/rancher/norman/httperror" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" -) - -// GenerateUserToken is a helper function that generates a bearer token for a specified user using the -// username and password -func GenerateUserToken(user *management.User, url string) (*management.Token, error) { - token := &management.Token{} - - bodyContent, err := json.Marshal(struct { - Username string `json:"username"` - Password string `json:"password"` - }{ - Username: user.Username, - Password: user.Password, - }) - - if err != nil { - return nil, err - } - - err = postAction("/v3-public/localProviders/local", "login", url, bodyContent, token) - if err != nil { - return nil, err - } - - return token, nil -} - -func postAction(endpoint, action, host string, body []byte, output interface{}) error { - url := "https://" + host + endpoint + "?action=" + action - req, err := http.NewRequest("POST", url, bytes.NewBuffer(body)) - if err != nil { - return err - } - - tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - } - client := &http.Client{Transport: tr} - - req.Header.Set("Content-Type", "application/json") - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return httperror.NewAPIErrorLong(resp.StatusCode, resp.Status, url) - } - - byteContent, err := io.ReadAll(resp.Body) - if err != nil { - return err - } - - if len(byteContent) > 0 { - err = json.Unmarshal(byteContent, output) - if err != nil { - return err - } - return nil - } - return fmt.Errorf("received empty response") -} diff --git a/tests/framework/extensions/tokenregistration/tokenregistration.go b/tests/framework/extensions/tokenregistration/tokenregistration.go deleted file mode 100644 index a3c70ed41dd..00000000000 --- a/tests/framework/extensions/tokenregistration/tokenregistration.go +++ /dev/null @@ -1,39 +0,0 @@ -package tokenregistration - -import ( - "time" - - "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -// GetRegistrationToken is function that gets a specific ClusterRegistrationToken using a Client object with a specified clusterStatusName and token name. -// It is done using a poll wait to make sure the tokens have been created by rancher. -func GetRegistrationToken(client *rancher.Client, clusterID string) (*management.ClusterRegistrationToken, error) { - var clusterRegistrationTokens []management.ClusterRegistrationToken - - kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - collection, err := client.Management.ClusterRegistrationToken.List(&types.ListOpts{ - Filters: map[string]interface{}{ - "clusterId": clusterID, - }, - }) - - if err != nil { - return false, err - } - - if len(collection.Data) == 0 { - return false, err - } - - clusterRegistrationTokens = collection.Data - return true, nil - }) - - registrationToken := clusterRegistrationTokens[0] - - return ®istrationToken, nil -} diff --git a/tests/framework/extensions/unstructured/unstructured.go b/tests/framework/extensions/unstructured/unstructured.go deleted file mode 100644 index 9f5ae7233e8..00000000000 --- a/tests/framework/extensions/unstructured/unstructured.go +++ /dev/null @@ -1,29 +0,0 @@ -package unstructured - -import ( - "github.com/rancher/rancher/pkg/api/scheme" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" -) - -// MustToUnstructured is a helper function that converts a runtime.Object to an unstructured.Unstructured -// to be used by the dynamic client. The dynamic client only uses *unstructured.Unstructured when accessing specific resources. -// e.g. for namespaces -// -// namespace := &coreV1.Namespace{ -// ObjectMeta: metav1.ObjectMeta{ -// Name: "namespaceName", -// Annotations: annotations, -// Labels: labels, -// }, -// } -// namespaceUnstructured := unstructured.MustToUnstructured(namespace) -func MustToUnstructured(obj runtime.Object) *unstructured.Unstructured { - var out unstructured.Unstructured - err := scheme.Scheme.Convert(obj, &out, nil) - if err != nil { - panic(err) - } - - return &out -} diff --git a/tests/framework/extensions/users/passwordgenerator/passwordgenerator.go b/tests/framework/extensions/users/passwordgenerator/passwordgenerator.go deleted file mode 100644 index f47b4e3a84c..00000000000 --- a/tests/framework/extensions/users/passwordgenerator/passwordgenerator.go +++ /dev/null @@ -1,13 +0,0 @@ -package users - -import ( - "github.com/rancher/rancher/tests/framework/pkg/namegenerator" -) - -const ( - defaultPasswordLength = 12 -) - -func GenerateUserPassword(password string) string { - return namegenerator.RandStringLower(defaultPasswordLength) -} diff --git a/tests/framework/extensions/users/users.go b/tests/framework/extensions/users/users.go deleted file mode 100644 index 0f83f3c90ae..00000000000 --- a/tests/framework/extensions/users/users.go +++ /dev/null @@ -1,382 +0,0 @@ -package users - -import ( - "fmt" - "strings" - "time" - - "github.com/rancher/norman/types" - "github.com/rancher/rancher/pkg/api/scheme" - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/rancher/pkg/ref" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - extauthz "github.com/rancher/rancher/tests/framework/extensions/kubeapi/authorization" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/rbac" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/wait" - authzv1 "k8s.io/api/authorization/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/selection" - kwait "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" -) - -const ( - rtbOwnerLabel = "authz.cluster.cattle.io/rtb-owner-updated" -) - -var timeout = int64(60 * 3) - -// UserConfig sets and returns username and password of the user -func UserConfig() (user *management.User) { - enabled := true - var username = namegen.AppendRandomString("testuser-") - var testpassword = password.GenerateUserPassword("testpass-") - user = &management.User{ - Username: username, - Password: testpassword, - Name: username, - Enabled: &enabled, - } - - return -} - -// CreateUserWithRole is helper function that creates a user with a role or multiple roles -func CreateUserWithRole(rancherClient *rancher.Client, user *management.User, roles ...string) (*management.User, error) { - createdUser, err := rancherClient.Management.User.Create(user) - if err != nil { - return nil, err - } - - createdUser.Password = user.Password - - for _, role := range roles { - roleBinding := &management.GlobalRoleBinding{ - GlobalRoleID: role, - UserID: createdUser.ID, - } - - _, err = rancherClient.Management.GlobalRoleBinding.Create(roleBinding) - if err != nil { - return nil, err - } - } - - return createdUser, nil -} - -// AddProjectMember is a helper function that adds a project role to `user`. It uses the watch.WatchWait to ensure BackingNamespaceCreated is true. -// If a list of ResourceAttributes is given, then the function blocks until all -// attributes are allowed by SelfSubjectAccessReviews OR the function times out. -func AddProjectMember(rancherClient *rancher.Client, project *management.Project, - user *management.User, projectRole string, attrs []*authzv1.ResourceAttributes) error { - - role := &management.ProjectRoleTemplateBinding{ - ProjectID: project.ID, - UserPrincipalID: user.PrincipalIDs[0], - RoleTemplateID: projectRole, - } - - name := strings.Split(project.ID, ":")[1] - - adminClient, err := rancher.NewClient(rancherClient.RancherConfig.AdminToken, rancherClient.Session) - if err != nil { - return err - } - - opts := metav1.ListOptions{ - FieldSelector: "metadata.name=" + name, - TimeoutSeconds: &timeout, - } - watchInterface, err := adminClient.GetManagementWatchInterface(management.ProjectType, opts) - if err != nil { - return err - } - - checkFunc := func(event watch.Event) (ready bool, err error) { - projectUnstructured := event.Object.(*unstructured.Unstructured) - project := &v3.Project{} - err = scheme.Scheme.Convert(projectUnstructured, project, projectUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - if v3.NamespaceBackedResource.IsTrue(project) { - return true, nil - } - - return false, nil - } - - err = wait.WatchWait(watchInterface, checkFunc) - if err != nil { - return err - } - - roleTemplateResp, err := rancherClient.Management.ProjectRoleTemplateBinding.Create(role) - if err != nil { - return err - } - - var prtb *management.ProjectRoleTemplateBinding - err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { - prtb, err = rancherClient.Management.ProjectRoleTemplateBinding.ByID(roleTemplateResp.ID) - if err != nil { - return false, err - } - if prtb != nil && prtb.UserID == user.ID && prtb.ProjectID == project.ID { - return true, nil - } - - return false, nil - }) - if err != nil { - return err - } - - err = waitForPRTBRollout(adminClient, prtb, createOp) - if err != nil { - return err - } - - err = waitForAllowed(rancherClient, project.ClusterID, user, attrs) - if err != nil { - return fmt.Errorf("waiting for privileges: %w", err) - } - return nil -} - -// RemoveProjectMember is a helper function that removes the project role from `user` -func RemoveProjectMember(rancherClient *rancher.Client, user *management.User) error { - roles, err := rancherClient.Management.ProjectRoleTemplateBinding.List(&types.ListOpts{}) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(rancherClient.RancherConfig.AdminToken, rancherClient.Session) - if err != nil { - return err - } - - var roleToDelete management.ProjectRoleTemplateBinding - - for _, role := range roles.Data { - if role.UserID == user.ID { - roleToDelete = role - break - } - } - - err = rancherClient.Management.ProjectRoleTemplateBinding.Delete(&roleToDelete) - if err != nil { - return err - } - return waitForPRTBRollout(adminClient, &roleToDelete, deleteOp) -} - -// AddClusterRoleToUser is a helper function that adds a cluster role to `user`. -// If a list of ResourceAttributes is given, then the function blocks until all -// attributes are allowed by SelfSubjectAccessReviews OR the function times out. -func AddClusterRoleToUser(rancherClient *rancher.Client, cluster *management.Cluster, - user *management.User, clusterRole string, attrs []*authzv1.ResourceAttributes) error { - - role := &management.ClusterRoleTemplateBinding{ - ClusterID: cluster.Resource.ID, - UserPrincipalID: user.PrincipalIDs[0], - RoleTemplateID: clusterRole, - } - - adminClient, err := rancher.NewClient(rancherClient.RancherConfig.AdminToken, rancherClient.Session) - if err != nil { - return err - } - - opts := metav1.ListOptions{ - FieldSelector: "metadata.name=" + cluster.ID, - TimeoutSeconds: &timeout, - } - watchInterface, err := adminClient.GetManagementWatchInterface(management.ClusterType, opts) - if err != nil { - return err - } - - checkFunc := func(event watch.Event) (ready bool, err error) { - clusterUnstructured := event.Object.(*unstructured.Unstructured) - cluster := &v3.Cluster{} - - err = scheme.Scheme.Convert(clusterUnstructured, cluster, clusterUnstructured.GroupVersionKind()) - if err != nil { - return false, err - } - if cluster.Annotations == nil || cluster.Annotations["field.cattle.io/creatorId"] == "" { - // no cluster creator, no roles to populate. This will be the case for the "local" cluster. - return true, nil - } - - v3.ClusterConditionInitialRolesPopulated.CreateUnknownIfNotExists(cluster) - if v3.ClusterConditionInitialRolesPopulated.IsUnknown(cluster) || v3.ClusterConditionInitialRolesPopulated.IsTrue(cluster) { - return true, nil - } - return false, nil - } - - err = wait.WatchWait(watchInterface, checkFunc) - if err != nil { - return err - } - - roleTemplateResp, err := rancherClient.Management.ClusterRoleTemplateBinding.Create(role) - if err != nil { - return err - } - - var crtb *management.ClusterRoleTemplateBinding - err = kwait.Poll(600*time.Millisecond, 3*time.Minute, func() (done bool, err error) { - crtb, err = rancherClient.Management.ClusterRoleTemplateBinding.ByID(roleTemplateResp.ID) - if err != nil { - return false, err - } - if crtb != nil { - return true, nil - } - - return false, nil - }) - if err != nil { - return err - } - - err = waitForCRTBRollout(adminClient, crtb, createOp) - if err != nil { - return err - } - - err = waitForAllowed(rancherClient, cluster.ID, user, attrs) - if err != nil { - return fmt.Errorf("waiting for privileges: %w", err) - } - return nil -} - -// RemoveClusterRoleFromUser is a helper function that removes the user from cluster -func RemoveClusterRoleFromUser(rancherClient *rancher.Client, user *management.User) error { - roles, err := rancherClient.Management.ClusterRoleTemplateBinding.List(&types.ListOpts{}) - if err != nil { - return err - } - - adminClient, err := rancher.NewClient(rancherClient.RancherConfig.AdminToken, rancherClient.Session) - if err != nil { - return err - } - - var roleToDelete management.ClusterRoleTemplateBinding - - for _, role := range roles.Data { - if role.UserID == user.ID { - roleToDelete = role - break - } - } - - if err = rancherClient.Management.ClusterRoleTemplateBinding.Delete(&roleToDelete); err != nil { - return err - } - return waitForCRTBRollout(adminClient, &roleToDelete, deleteOp) -} - -// GetUserIDByName is a helper function that returns the user ID by name -func GetUserIDByName(client *rancher.Client, username string) (string, error) { - userList, err := client.Management.User.List(&types.ListOpts{}) - if err != nil { - return "", err - } - - if err != nil { - return "", err - } - - for _, user := range userList.Data { - if user.Username == username { - return user.ID, nil - } - } - - return "", nil -} - -type operationType int - -const ( - createOp operationType = iota - deleteOp -) - -func waitForCRTBRollout(client *rancher.Client, crtb *management.ClusterRoleTemplateBinding, opType operationType) error { - crtbNamespace, crtbName := ref.Parse(crtb.ID) - req, err := labels.NewRequirement(rtbOwnerLabel, selection.In, []string{fmt.Sprintf("%s_%s", crtbNamespace, crtbName)}) - if err != nil { - return fmt.Errorf("unable to form label requirement for %s/%s: %w", crtbNamespace, crtbName, err) - } - selector := labels.NewSelector().Add(*req) - return waitForRTBRollout(client, crtbNamespace, crtbName, selector, crtb.ClusterID, opType) -} - -func waitForPRTBRollout(client *rancher.Client, prtb *management.ProjectRoleTemplateBinding, opType operationType) error { - clusterID, _ := ref.Parse(prtb.ProjectID) - prtbNamespace, prtbName := ref.Parse(prtb.ID) - req, err := labels.NewRequirement(fmt.Sprintf("%s_%s", prtbNamespace, prtbName), selection.Exists, nil) - if err != nil { - return fmt.Errorf("unable to form label requirement for %s/%s: %w", prtbNamespace, prtbName, err) - } - selector := labels.NewSelector().Add(*req) - return waitForRTBRollout(client, prtbNamespace, prtbName, selector, clusterID, opType) -} - -func waitForRTBRollout(client *rancher.Client, rtbNamespace string, rtbName string, selector labels.Selector, clusterID string, opType operationType) error { - // we expect rollout to happen within 5 seconds total - backoff := kwait.Backoff{ - Duration: 500 * time.Millisecond, - Factor: 1, - Jitter: 0, - Steps: 11, - } - err := kwait.ExponentialBackoff(backoff, func() (done bool, err error) { - downstreamCRBs, err := rbac.ListClusterRoleBindings(client, clusterID, metav1.ListOptions{ - LabelSelector: selector.String(), - }) - if err != nil { - return false, err - } - switch opType { - case createOp: - return len(downstreamCRBs.Items) > 0, nil - case deleteOp: - return len(downstreamCRBs.Items) == 0, nil - default: - // unknown operation type, don't poll infinitely - return true, nil - } - }) - if err != nil { - return fmt.Errorf("unable to determine the status of backing rbac for %s/%s in alloted duration: %w", rtbNamespace, rtbName, err) - } - return nil -} - -func waitForAllowed(rancherClient *rancher.Client, clusterID string, user *management.User, attrs []*authzv1.ResourceAttributes) error { - if len(attrs) == 0 { - return nil - } - - userClient, err := rancherClient.AsUser(user) - if err != nil { - return fmt.Errorf("client as user %s: %w", user.Name, err) - } - - return extauthz.WaitForAllowed(userClient, clusterID, attrs) -} diff --git a/tests/framework/extensions/workloads/create.go b/tests/framework/extensions/workloads/create.go deleted file mode 100644 index 47981c682b4..00000000000 --- a/tests/framework/extensions/workloads/create.go +++ /dev/null @@ -1,37 +0,0 @@ -package workloads - -import ( - v1 "github.com/rancher/rancher/pkg/generated/norman/apps/v1" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" -) - -const ( - defaultNamespace = "default" - port = "port" - ServiceType = "service" -) - -// CreateDeploymentWithService is a helper function to create a deployment and service in the downstream cluster. -func CreateDeploymentWithService(steveclient *steveV1.Client, wlName string, deployment *v1.Deployment, service corev1.Service) (*steveV1.SteveAPIObject, *steveV1.SteveAPIObject, error) { - logrus.Infof("Creating deployment: %s", wlName) - deploymentResp, err := steveclient.SteveType(DeploymentSteveType).Create(deployment) - if err != nil { - logrus.Errorf("Failed to create deployment: %s", wlName) - return nil, nil, err - } - - logrus.Infof("Successfully created deployment: %s", wlName) - - logrus.Infof("Creating service: %s", service.Name) - serviceResp, err := steveclient.SteveType(ServiceType).Create(service) - if err != nil { - logrus.Errorf("Failed to create service: %s", service.Name) - return nil, nil, err - } - - logrus.Infof("Successfully created service: %s", service.Name) - - return deploymentResp, serviceResp, err -} diff --git a/tests/framework/extensions/workloads/pods/pod_status.go b/tests/framework/extensions/workloads/pods/pod_status.go deleted file mode 100644 index 7c097b2632b..00000000000 --- a/tests/framework/extensions/workloads/pods/pod_status.go +++ /dev/null @@ -1,93 +0,0 @@ -package pods - -import ( - "fmt" - "time" - - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - corev1 "k8s.io/api/core/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - PodResourceSteveType = "pod" -) - -// StatusPods is a helper function that uses the steve client to list pods on a namespace for a specific cluster -// and return the statuses in a list of strings -func StatusPods(client *rancher.Client, clusterID string) []error { - downstreamClient, err := client.Steve.ProxyDownstream(clusterID) - if err != nil { - return []error{err} - } - - var podErrors []error - - steveClient := downstreamClient.SteveType(PodResourceSteveType) - err = kwait.Poll(5*time.Second, defaults.FifteenMinuteTimeout, func() (done bool, err error) { - // emptying pod errors every time we poll so that we don't return stale errors - podErrors = []error{} - - pods, err := steveClient.List(nil) - if err != nil { - // not returning the error in this case, as it could cause a false positive if we start polling too early. - return false, nil - } - - for _, pod := range pods.Data { - isReady, err := IsPodReady(&pod) - if !isReady { - // not returning the error in this case, as it could cause a false positive if we start polling too early. - return false, nil - } - - if err != nil { - podErrors = append(podErrors, err) - } - } - return true, nil - }) - - if err != nil { - podErrors = append(podErrors, err) - } - - return podErrors -} - -func IsPodReady(pod *v1.SteveAPIObject) (bool, error) { - podStatus := &corev1.PodStatus{} - err := v1.ConvertToK8sType(pod.Status, podStatus) - if err != nil { - return false, err - } - - if podStatus.ContainerStatuses == nil || len(podStatus.ContainerStatuses) == 0 { - return false, nil - } - - phase := podStatus.Phase - - if phase == corev1.PodPending { - return false, nil - } - - if phase == corev1.PodFailed || phase == corev1.PodUnknown { - var errorMessage string - for _, containerStatus := range podStatus.ContainerStatuses { - // Rancher deploys multiple hlem-operation jobs to do the same task. If one job succeeds, the others end in a terminated status. - if containerStatus.State.Terminated == nil { - errorMessage += fmt.Sprintf("ERROR: %s: %s\n", pod.Name, podStatus) - } - } - - if errorMessage != "" { - return true, fmt.Errorf(errorMessage) - } - } - - // Pod is running or has succeeded - return true, nil -} diff --git a/tests/framework/extensions/workloads/pods/verify.go b/tests/framework/extensions/workloads/pods/verify.go deleted file mode 100644 index 5a11600c583..00000000000 --- a/tests/framework/extensions/workloads/pods/verify.go +++ /dev/null @@ -1,56 +0,0 @@ -package pods - -import ( - "testing" - "time" - - provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - projectv3 "github.com/rancher/rancher/pkg/client/generated/project/v3" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/util/wait" -) - -const ( - DaemonsetSteveType = "apps.daemonset" -) - -// VerifyReadyDaemonsetPods tries to poll the Steve API to verify the expected number of daemonset pods are in the Ready -// state -func VerifyReadyDaemonsetPods(t *testing.T, client *rancher.Client, cluster *v1.SteveAPIObject) { - status := &provv1.ClusterStatus{} - err := v1.ConvertToK8sType(cluster.Status, status) - require.NoError(t, err) - - daemonsetequals := false - - err = wait.Poll(500*time.Millisecond, 5*time.Minute, func() (dameonsetequals bool, err error) { - daemonsets, err := client.Steve.SteveType(DaemonsetSteveType).ByID(status.ClusterName) - require.NoError(t, err) - - daemonsetsStatusType := &projectv3.DaemonSetStatus{} - err = v1.ConvertToK8sType(daemonsets.Status, daemonsetsStatusType) - require.NoError(t, err) - - if daemonsetsStatusType.DesiredNumberScheduled == daemonsetsStatusType.NumberAvailable { - return true, nil - } - return false, nil - }) - require.NoError(t, err) - - daemonsets, err := client.Steve.SteveType(DaemonsetSteveType).ByID(status.ClusterName) - require.NoError(t, err) - - daemonsetsStatusType := &projectv3.DaemonSetStatus{} - err = v1.ConvertToK8sType(daemonsets.Status, daemonsetsStatusType) - require.NoError(t, err) - - if daemonsetsStatusType.DesiredNumberScheduled == daemonsetsStatusType.NumberAvailable { - daemonsetequals = true - } - - assert.Truef(t, daemonsetequals, "Ready Daemonset Pods didn't match expected") -} diff --git a/tests/framework/extensions/workloads/template.go b/tests/framework/extensions/workloads/template.go deleted file mode 100644 index c51c9d29a2c..00000000000 --- a/tests/framework/extensions/workloads/template.go +++ /dev/null @@ -1,120 +0,0 @@ -package workloads - -import ( - "fmt" - - appv1 "k8s.io/api/apps/v1" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NewContainer is a contructor that creates a container for a pod template i.e. corev1.PodTemplateSpec -func NewContainer(containerName, image string, imagePullPolicy corev1.PullPolicy, volumeMounts []corev1.VolumeMount, envFrom []corev1.EnvFromSource, command []string, securityContext *corev1.SecurityContext, args []string) corev1.Container { - return corev1.Container{ - Name: containerName, - Image: image, - ImagePullPolicy: imagePullPolicy, - VolumeMounts: volumeMounts, - EnvFrom: envFrom, - Command: command, - Args: args, - SecurityContext: securityContext, - } -} - -// NewPodTemplate is a constructor that creates the pod template for all types of workloads e.g. cronjobs, daemonsets, deployments, and batch jobs -func NewPodTemplate(containers []corev1.Container, volumes []corev1.Volume, imagePullSecrets []corev1.LocalObjectReference, labels map[string]string) corev1.PodTemplateSpec { - if labels == nil { - labels = make(map[string]string) - } - - return corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: labels, - }, - Spec: corev1.PodSpec{ - Containers: containers, - Volumes: volumes, - ImagePullSecrets: imagePullSecrets, - }, - } -} - -// NewDeploymentTemplate is a constructor that creates a deployment template. If the isCattleLabeled true, workloadselector labels are assigned to the deployment and the pod template. -func NewDeploymentTemplate(deploymentName string, namespace string, template corev1.PodTemplateSpec, isCattleLabeled bool, matchLabels map[string]string) *appv1.Deployment { - if matchLabels == nil { - matchLabels = make(map[string]string) - } - - if isCattleLabeled { - matchLabels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.deployment-%v-%v", namespace, deploymentName) - template.ObjectMeta.Labels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.deployment-%v-%v", namespace, deploymentName) - } - - return &appv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: deploymentName, - Namespace: namespace, - }, - Spec: appv1.DeploymentSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: matchLabels, - }, - Template: template, - }, - } - -} - -// NewDeploymentTemplate is a constructor that creates a daemonset template. If the isCattleLabeled true, workloadselector labels are assigned to the daemonset and the pod template. -func NewDaemonSetTemplate(daemonsetName string, namespace string, template corev1.PodTemplateSpec, isCattleLabeled bool, matchLabels map[string]string) *appv1.DaemonSet { - if matchLabels == nil { - matchLabels = map[string]string{} - } - - if isCattleLabeled { - matchLabels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.daemonset-%v-%v", namespace, daemonsetName) - template.ObjectMeta.Labels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.daemonset-%v-%v", namespace, daemonsetName) - } - - return &appv1.DaemonSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: daemonsetName, - Namespace: namespace, - }, - Spec: appv1.DaemonSetSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: matchLabels, - }, - Template: template, - }, - } -} - -// NewJobTemplate is a constructor that creates a job template. -func NewJobTemplate(jobName string, namespace string) *batchv1.Job { - return &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: jobName, - }, - Spec: batchv1.JobSpec{ - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - RestartPolicy: "Never", - ServiceAccountName: "", - Containers: []corev1.Container{}, - Volumes: []corev1.Volume{ - { - Name: "config", - VolumeSource: corev1.VolumeSource{ - EmptyDir: &corev1.EmptyDirVolumeSource{}, - }, - }, - }, - }, - }, - }, - } - -} diff --git a/tests/framework/extensions/workloads/verify.go b/tests/framework/extensions/workloads/verify.go deleted file mode 100644 index 0e6df766f32..00000000000 --- a/tests/framework/extensions/workloads/verify.go +++ /dev/null @@ -1,32 +0,0 @@ -package workloads - -import ( - "time" - - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - appv1 "k8s.io/api/apps/v1" - kwait "k8s.io/apimachinery/pkg/util/wait" -) - -// VerifyDeployment waits for a deployment to be ready -func VerifyDeployment(steveClient *steveV1.Client, deployment *steveV1.SteveAPIObject) error { - err := kwait.Poll(5*time.Second, 5*time.Minute, func() (done bool, err error) { - if err != nil { - return false, nil - } - deploymentResp, err := steveClient.SteveType(DeploymentSteveType).ByID(deployment.Namespace + "/" + deployment.Name) - if err != nil { - return false, nil - } - deployment := &appv1.Deployment{} - err = steveV1.ConvertToK8sType(deploymentResp.JSONResp, deployment) - if err != nil { - return false, nil - } - if *deployment.Spec.Replicas == deployment.Status.AvailableReplicas { - return true, nil - } - return false, nil - }) - return err -} diff --git a/tests/framework/extensions/workloads/workloads.go b/tests/framework/extensions/workloads/workloads.go deleted file mode 100644 index af1ddc710cc..00000000000 --- a/tests/framework/extensions/workloads/workloads.go +++ /dev/null @@ -1,6 +0,0 @@ -package workloads - -const ( - DeploymentSteveType = "apps.deployment" - DaemonsetSteveType = "apps.daemonset" -) diff --git a/tests/framework/generator.go b/tests/framework/generator.go deleted file mode 100644 index db49fcfd242..00000000000 --- a/tests/framework/generator.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:generate go run codegen/generator/cleanup/main.go -//go:generate go run codegen/main.go - -package main diff --git a/tests/framework/pkg/clientbase/common.go b/tests/framework/pkg/clientbase/common.go deleted file mode 100644 index d6c098d39c0..00000000000 --- a/tests/framework/pkg/clientbase/common.go +++ /dev/null @@ -1,395 +0,0 @@ -package clientbase - -import ( - "bytes" - "crypto/tls" - "crypto/x509" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "os" - "time" - - "github.com/gorilla/websocket" - "github.com/pkg/errors" - "github.com/rancher/norman/types" -) - -const ( - SELF = "self" - COLLECTION = "collection" -) - -var ( - Debug = false -) - -type APIBaseClientInterface interface { - Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) - List(schemaType string, opts *types.ListOpts, respObject interface{}) error - Post(url string, createObj interface{}, respObject interface{}) error - GetLink(resource types.Resource, link string, respObject interface{}) error - Create(schemaType string, createObj interface{}, respObject interface{}) error - Update(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error - Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error - ByID(schemaType string, id string, respObject interface{}) error - Delete(existing *types.Resource) error - Reload(existing *types.Resource, output interface{}) error - Action(schemaType string, action string, existing *types.Resource, inputObject, respObject interface{}) error -} - -type APIBaseClient struct { - Ops *APIOperations - Opts *ClientOpts - Types map[string]types.Schema -} - -type ClientOpts struct { - URL string - AccessKey string - SecretKey string - TokenKey string - Timeout time.Duration - HTTPClient *http.Client - WSDialer *websocket.Dialer - CACerts string - Insecure bool -} - -func (c *ClientOpts) getAuthHeader() string { - if c.TokenKey != "" { - return "Bearer " + c.TokenKey - } - if c.AccessKey != "" && c.SecretKey != "" { - s := c.AccessKey + ":" + c.SecretKey - return "Basic " + base64.StdEncoding.EncodeToString([]byte(s)) - } - return "" -} - -type APIError struct { - StatusCode int - URL string - Msg string - Status string - Body string -} - -func (e *APIError) Error() string { - return e.Msg -} - -func IsNotFound(err error) bool { - apiError, ok := err.(*APIError) - if !ok { - return false - } - - return apiError.StatusCode == http.StatusNotFound -} - -func NewAPIError(resp *http.Response, url string) *APIError { - contents, err := io.ReadAll(resp.Body) - var body string - if err != nil { - body = "Unreadable body." - } else { - body = string(contents) - } - - data := map[string]interface{}{} - if json.Unmarshal(contents, &data) == nil { - delete(data, "id") - delete(data, "links") - delete(data, "actions") - delete(data, "type") - delete(data, "status") - buf := &bytes.Buffer{} - for k, v := range data { - if v == nil { - continue - } - if buf.Len() > 0 { - buf.WriteString(", ") - } - fmt.Fprintf(buf, "%s=%v", k, v) - } - body = buf.String() - } - formattedMsg := fmt.Sprintf("Bad response statusCode [%d]. Status [%s]. Body: [%s] from [%s]", - resp.StatusCode, resp.Status, body, url) - return &APIError{ - URL: url, - Msg: formattedMsg, - StatusCode: resp.StatusCode, - Status: resp.Status, - Body: body, - } -} - -func contains(array []string, item string) bool { - for _, check := range array { - if check == item { - return true - } - } - - return false -} - -func appendFilters(urlString string, filters map[string]interface{}) (string, error) { - if len(filters) == 0 { - return urlString, nil - } - - u, err := url.Parse(urlString) - if err != nil { - return "", err - } - - q := u.Query() - for k, v := range filters { - if l, ok := v.([]string); ok { - for _, v := range l { - q.Add(k, v) - } - } else { - q.Add(k, fmt.Sprintf("%v", v)) - } - } - - u.RawQuery = q.Encode() - return u.String(), nil -} - -func NewAPIClient(opts *ClientOpts) (APIBaseClient, error) { - var err error - - result := APIBaseClient{ - Types: map[string]types.Schema{}, - } - - client := opts.HTTPClient - if client == nil { - client = &http.Client{} - } - - if opts.Timeout == 0 { - opts.Timeout = time.Minute - } - - client.Timeout = opts.Timeout - - if opts.CACerts != "" { - if Debug { - fmt.Println("Some CAcerts are provided.") - } - roots := x509.NewCertPool() - ok := roots.AppendCertsFromPEM([]byte(opts.CACerts)) - if !ok { - return result, err - } - tr := &http.Transport{ - TLSClientConfig: &tls.Config{ - RootCAs: roots, - }, - Proxy: http.ProxyFromEnvironment, - } - client.Transport = tr - } - - if opts.Insecure { - if Debug { - fmt.Println("Insecure TLS set.") - } - tr := &http.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: opts.Insecure, - }, - Proxy: http.ProxyFromEnvironment, - } - client.Transport = tr - } - - if !(opts.Insecure) && (opts.CACerts == "") { - if Debug { - fmt.Println("Insecure TLS not set and no CAcerts is provided.") - } - tr := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - } - client.Transport = tr - } - - req, err := http.NewRequest("GET", opts.URL, nil) - if err != nil { - return result, err - } - req.Header.Add("Authorization", opts.getAuthHeader()) - - resp, err := client.Do(req) - if err != nil { - return result, err - } - defer func(closer io.Closer) { - closer.Close() - }(resp.Body) - - if resp.StatusCode != 200 { - return result, NewAPIError(resp, opts.URL) - } - - schemasURLs := resp.Header.Get("X-API-Schemas") - if len(schemasURLs) == 0 { - return result, errors.New("Failed to find schema at [" + opts.URL + "]") - } - - if schemasURLs != opts.URL { - req, err = http.NewRequest("GET", schemasURLs, nil) - if err != nil { - return result, err - } - req.Header.Add("Authorization", opts.getAuthHeader()) - - if Debug { - fmt.Println("GET " + req.URL.String()) - } - - resp, err = client.Do(req) - if err != nil { - return result, err - } - defer func(closer io.Closer) { - closer.Close() - }(resp.Body) - - if resp.StatusCode != 200 { - return result, NewAPIError(resp, schemasURLs) - } - } - - var schemas types.SchemaCollection - bytes, err := io.ReadAll(resp.Body) - if err != nil { - return result, err - } - - if Debug { - fmt.Println("Response <= " + string(bytes)) - } - - err = json.Unmarshal(bytes, &schemas) - if err != nil { - return result, err - } - - for _, schema := range schemas.Data { - result.Types[schema.ID] = schema - } - - result.Opts = opts - result.Ops = &APIOperations{ - Opts: opts, - Client: client, - Dialer: &websocket.Dialer{HandshakeTimeout: 10 * time.Second}, - Types: result.Types, - } - - if result.Opts.WSDialer != nil { - result.Ops.Dialer = result.Opts.WSDialer - } - - ht, ok := client.Transport.(*http.Transport) - if ok { - result.Ops.Dialer.TLSClientConfig = ht.TLSClientConfig - } - - return result, nil -} - -func NewListOpts() *types.ListOpts { - return &types.ListOpts{ - Filters: map[string]interface{}{}, - } -} - -func (a *APIBaseClient) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) { - httpHeaders := http.Header{} - for k, v := range httpHeaders { - httpHeaders[k] = v - } - - if a.Opts != nil { - httpHeaders.Add("Authorization", a.Opts.getAuthHeader()) - } - - if Debug { - fmt.Println("WS " + url) - } - - return a.Ops.Dialer.Dial(url, http.Header(httpHeaders)) -} - -func (a *APIBaseClient) List(schemaType string, opts *types.ListOpts, respObject interface{}) error { - return a.Ops.DoList(schemaType, opts, respObject) -} - -func (a *APIBaseClient) Post(url string, createObj interface{}, respObject interface{}) error { - return a.Ops.DoModify("POST", url, createObj, respObject) -} - -func (a *APIBaseClient) GetLink(resource types.Resource, link string, respObject interface{}) error { - url := resource.Links[link] - if url == "" { - return fmt.Errorf("failed to find link: %s", link) - } - - return a.Ops.DoGet(url, &types.ListOpts{}, respObject) -} - -func (a *APIBaseClient) Create(schemaType string, createObj interface{}, respObject interface{}) error { - return a.Ops.DoCreate(schemaType, createObj, respObject) -} - -func (a *APIBaseClient) Update(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error { - return a.Ops.DoUpdate(schemaType, existing, updates, respObject) -} - -func (a *APIBaseClient) Replace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error { - return a.Ops.DoReplace(schemaType, existing, updates, respObject) -} - -func (a *APIBaseClient) ByID(schemaType string, id string, respObject interface{}) error { - return a.Ops.DoByID(schemaType, id, respObject) -} - -func (a *APIBaseClient) Delete(existing *types.Resource) error { - if existing == nil { - return nil - } - return a.Ops.DoResourceDelete(existing.Type, existing) -} - -func (a *APIBaseClient) Reload(existing *types.Resource, output interface{}) error { - selfURL, ok := existing.Links[SELF] - if !ok { - return fmt.Errorf("failed to find self URL of [%v]", existing) - } - - return a.Ops.DoGet(selfURL, NewListOpts(), output) -} - -func (a *APIBaseClient) Action(schemaType string, action string, - existing *types.Resource, inputObject, respObject interface{}) error { - return a.Ops.DoAction(schemaType, action, existing, inputObject, respObject) -} - -func init() { - Debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true" - if Debug { - fmt.Println("Rancher client debug on") - } -} diff --git a/tests/framework/pkg/clientbase/ops.go b/tests/framework/pkg/clientbase/ops.go deleted file mode 100644 index f9da0c326b0..00000000000 --- a/tests/framework/pkg/clientbase/ops.go +++ /dev/null @@ -1,432 +0,0 @@ -package clientbase - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "reflect" - "regexp" - "strings" - - "github.com/gorilla/websocket" - "github.com/pkg/errors" - "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/pkg/session" -) - -type APIOperations struct { - Opts *ClientOpts - Types map[string]types.Schema - Client *http.Client - Dialer *websocket.Dialer - Session *session.Session -} - -func (a *APIOperations) SetupRequest(req *http.Request) { - req.Header.Add("Authorization", a.Opts.getAuthHeader()) -} - -func (a *APIOperations) DoDelete(url string) error { - req, err := http.NewRequest("DELETE", url, nil) - if err != nil { - return err - } - - a.SetupRequest(req) - - resp, err := a.Client.Do(req) - if err != nil { - return err - } - defer func() { - io.Copy(io.Discard, resp.Body) - resp.Body.Close() - }() - - if resp.StatusCode >= 300 { - return NewAPIError(resp, url) - } - - return nil -} - -func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject interface{}) error { - if opts == nil { - opts = NewListOpts() - } - url, err := appendFilters(url, opts.Filters) - if err != nil { - return err - } - - if Debug { - fmt.Println("GET " + url) - } - - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return err - } - - a.SetupRequest(req) - - resp, err := a.Client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return NewAPIError(resp, url) - } - - byteContent, err := io.ReadAll(resp.Body) - if err != nil { - return err - } - - if Debug { - fmt.Println("Response <= " + string(byteContent)) - } - - if err := json.Unmarshal(byteContent, respObject); err != nil { - return errors.Wrap(err, fmt.Sprintf("Failed to parse: %s", byteContent)) - } - - return nil -} - -func (a *APIOperations) DoList(schemaType string, opts *types.ListOpts, respObject interface{}) error { - collectionURL, err := a.GetCollectionURL(schemaType, "GET") - if err != nil { - return err - } - return a.DoGet(collectionURL, opts, respObject) -} - -func (a *APIOperations) GetCollectionURL(schemaType, method string) (string, error) { - schema, ok := a.Types[schemaType] - if !ok { - return "", errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.CollectionMethods, method) { - return "", errors.New("Resource type [" + schemaType + "] has no method " + method) - } - - collectionURL, ok := schema.Links["collection"] - if !ok { - return "", errors.New("Resource type [" + schemaType + "] does not have a collection URL") - } - return collectionURL, nil -} - -func (a *APIOperations) DoNext(nextURL string, respObject interface{}) error { - return a.DoGet(nextURL, nil, respObject) -} - -func (a *APIOperations) DoModify(method string, url string, createObj interface{}, respObject interface{}) error { - if createObj == nil { - createObj = map[string]string{} - } - if respObject == nil { - respObject = &map[string]interface{}{} - } - bodyContent, err := json.Marshal(createObj) - if err != nil { - return err - } - - if Debug { - fmt.Println(method + " " + url) - fmt.Println("Request => " + string(bodyContent)) - } - - req, err := http.NewRequest(method, url, bytes.NewBuffer(bodyContent)) - if err != nil { - return err - } - - a.SetupRequest(req) - req.Header.Set("Content-Type", "application/json") - - resp, err := a.Client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return NewAPIError(resp, url) - } - - byteContent, err := io.ReadAll(resp.Body) - if err != nil { - return err - } - - if len(byteContent) > 0 { - if Debug { - fmt.Println("Response <= " + string(byteContent)) - } - return json.Unmarshal(byteContent, respObject) - } - - return nil -} - -func (a *APIOperations) DoCreate(schemaType string, createObj interface{}, respObject interface{}) error { - if createObj == nil { - createObj = map[string]string{} - } - if respObject == nil { - respObject = &map[string]interface{}{} - } - schema, ok := a.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.CollectionMethods, "POST") { - return errors.New("Resource type [" + schemaType + "] is not creatable") - } - - var collectionURL string - collectionURL, ok = schema.Links[COLLECTION] - if !ok { - // return errors.New("Failed to find collection URL for [" + schemaType + "]") - // This is a hack to address https://github.com/rancher/cattle/issues/254 - re := regexp.MustCompile("schemas.*") - collectionURL = re.ReplaceAllString(schema.Links[SELF], schema.PluralName) - } - - err := a.DoModify("POST", collectionURL, createObj, respObject) - if err != nil { - return err - } - v := reflect.ValueOf(respObject) - - var resource types.Resource - if v.Type().String() == "*map[string]interface {}" { - resourcePointer := &types.Resource{} - jsonResp := *(respObject.(*map[string]any)) - if jsonResp["id"] != nil { - resourcePointer.ID = jsonResp["id"].(string) - resourcePointer.Type = jsonResp["type"].(string) - resourcePointer.Links = convertMap(jsonResp["links"].(map[string]any)) - if jsonResp["actions"] != nil { - resourcePointer.Actions = convertMap(jsonResp["actions"].(map[string]any)) - } - resource = *resourcePointer - } - - } else { - resource = reflect.Indirect(v).FieldByName("Resource").Interface().(types.Resource) - } - - a.Session.RegisterCleanupFunc(func() error { - if !(schemaType == "cloudCredential") { // Skip resource deletion if resource is a cloud credential - err := a.DoResourceDelete(schemaType, &resource) - if err != nil && (strings.Contains(err.Error(), "404 Not Found") || strings.Contains(err.Error(), "failed to find self URL of [&{ map[] map[]}]")) { - return nil - } - return err - } - return nil - }) - - return nil -} - -func (a *APIOperations) DoReplace(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error { - return a.doUpdate(schemaType, true, existing, updates, respObject) -} - -func (a *APIOperations) DoUpdate(schemaType string, existing *types.Resource, updates interface{}, respObject interface{}) error { - return a.doUpdate(schemaType, false, existing, updates, respObject) -} - -func (a *APIOperations) doUpdate(schemaType string, replace bool, existing *types.Resource, updates interface{}, respObject interface{}) error { - if existing == nil { - return errors.New("Existing object is nil") - } - - selfURL, ok := existing.Links[SELF] - if !ok { - return fmt.Errorf("failed to find self URL of [%v]", existing) - } - - if replace { - u, err := url.Parse(selfURL) - if err != nil { - return fmt.Errorf("failed to parse url %s: %v", selfURL, err) - } - q := u.Query() - q.Set("_replace", "true") - u.RawQuery = q.Encode() - selfURL = u.String() - } - - if updates == nil { - updates = map[string]string{} - } - - if respObject == nil { - respObject = &map[string]interface{}{} - } - - schema, ok := a.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "PUT") { - return errors.New("Resource type [" + schemaType + "] is not updatable") - } - - return a.DoModify("PUT", selfURL, updates, respObject) -} - -func (a *APIOperations) DoByID(schemaType string, id string, respObject interface{}) error { - schema, ok := a.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "GET") { - return errors.New("Resource type [" + schemaType + "] can not be looked up by ID") - } - - collectionURL, ok := schema.Links[COLLECTION] - if !ok { - return errors.New("Failed to find collection URL for [" + schemaType + "]") - } - - return a.DoGet(collectionURL+"/"+id, nil, respObject) -} - -func (a *APIOperations) DoResourceDelete(schemaType string, existing *types.Resource) error { - schema, ok := a.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "DELETE") { - return errors.New("Resource type [" + schemaType + "] can not be deleted") - } - - selfURL, ok := existing.Links[SELF] - if !ok { - return fmt.Errorf("failed to find self URL of [%v]", existing) - } - - return a.DoDelete(selfURL) -} - -func (a *APIOperations) DoAction(schemaType string, action string, - existing *types.Resource, inputObject, respObject interface{}) error { - - if existing == nil { - return errors.New("Existing object is nil") - } - - actionURL, ok := existing.Actions[action] - if !ok { - return fmt.Errorf("action [%v] not available on [%v]", action, existing) - } - - return a.doAction(schemaType, action, actionURL, inputObject, respObject) -} - -func (a *APIOperations) DoCollectionAction(schemaType string, action string, - existing *types.Collection, inputObject, respObject interface{}) error { - - if existing == nil { - return errors.New("Existing object is nil") - } - - actionURL, ok := existing.Actions[action] - if !ok { - return fmt.Errorf("action [%v] not available on [%v]", action, existing) - } - - return a.doAction(schemaType, action, actionURL, inputObject, respObject) -} - -func (a *APIOperations) doAction( - schemaType string, - action string, - actionURL string, - inputObject interface{}, - respObject interface{}, -) error { - _, ok := a.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - var input io.Reader - - if Debug { - fmt.Println("POST " + actionURL) - } - - if inputObject != nil { - bodyContent, err := json.Marshal(inputObject) - if err != nil { - return err - } - if Debug { - fmt.Println("Request => " + string(bodyContent)) - } - input = bytes.NewBuffer(bodyContent) - } - - req, err := http.NewRequest("POST", actionURL, input) - if err != nil { - return err - } - - a.SetupRequest(req) - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Content-Length", "0") - - resp, err := a.Client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return NewAPIError(resp, actionURL) - } - - byteContent, err := io.ReadAll(resp.Body) - if err != nil { - return err - } - - if Debug { - fmt.Println("Response <= " + string(byteContent)) - } - - if nil != respObject { - return json.Unmarshal(byteContent, respObject) - } - return nil -} - -func convertMap(anyMap map[string]any) map[string]string { - stringMap := make(map[string]string) - for key, value := range anyMap { - stringMap[key] = value.(string) - } - - return stringMap -} diff --git a/tests/framework/pkg/config/config.go b/tests/framework/pkg/config/config.go deleted file mode 100644 index f5e2f5ac196..00000000000 --- a/tests/framework/pkg/config/config.go +++ /dev/null @@ -1,121 +0,0 @@ -package config - -import ( - "errors" - "fmt" - "os" - - "github.com/creasty/defaults" - "sigs.k8s.io/yaml" -) - -// ConfigEnvironmentKey is a const that stores cattle config's environment key. -const ConfigEnvironmentKey = "CATTLE_TEST_CONFIG" - -// LoadConfig reads the file defined by the `CATTLE_TEST_CONFIG` environment variable and loads the object found at the given key onto the given configuration reference. -// The functions takes a pointer of the object. -func LoadConfig(key string, config interface{}) { - configPath := os.Getenv(ConfigEnvironmentKey) - - if configPath == "" { - yaml.Unmarshal([]byte("{}"), config) - return - } - - allString, err := os.ReadFile(configPath) - if err != nil { - panic(err) - } - - var all map[string]interface{} - err = yaml.Unmarshal(allString, &all) - if err != nil { - panic(err) - } - - scoped := all[key] - scopedString, err := yaml.Marshal(scoped) - if err != nil { - panic(err) - } - - err = yaml.Unmarshal(scopedString, config) - if err != nil { - panic(err) - } - - if err := defaults.Set(config); err != nil { - panic(err) - } - -} - -// UpdateConfig is function that updates the CATTLE_TEST_CONFIG yaml/json that the framework uses. -func UpdateConfig(key string, config interface{}) { - configPath := os.Getenv(ConfigEnvironmentKey) - - if configPath == "" { - yaml.Unmarshal([]byte("{}"), config) - return - } - - // Read json buffer from jsonFile - byteValue, err := os.ReadFile(configPath) - if err != nil { - panic(err) - } - - // We have known the outer json object is a map, so we define result as map. - // otherwise, result could be defined as slice if outer is an array - var result map[string]interface{} - err = yaml.Unmarshal(byteValue, &result) - if err != nil { - panic(err) - } - - result[key] = config - - yamlConfig, err := yaml.Marshal(result) - - if err != nil { - panic(err) - } - - err = os.WriteFile(configPath, yamlConfig, 0644) - if err != nil { - panic(err) - } -} - -// LoadAndUpdateConfig is function that loads and updates the CATTLE_TEST_CONFIG yaml/json that the framework uses, -// accepts a func to update the configuration file. -func LoadAndUpdateConfig(key string, config any, updateFunc func()) { - LoadConfig(key, config) - - updateFunc() - - UpdateConfig(key, config) -} - -// WriteConfig writes a CATTLE_TEST_CONFIG config file when one is not previously written. -func WriteConfig(key string, config interface{}) error { - configPath := os.Getenv("CATTLE_TEST_CONFIG") - if configPath == "" { - return errors.New("cannot write config because environment variable CATTLE_TEST_CONFIG is not set") - } - - all := map[string]interface{}{} - all[key] = config - - yamlConfig, err := yaml.Marshal(all) - if err != nil { - return fmt.Errorf("error marshalling config as YAML: %w", err) - } - - err = os.WriteFile(configPath, yamlConfig, 0644) - if err != nil { - return fmt.Errorf("error writing config to file: %w", err) - } - - return nil -} diff --git a/tests/framework/pkg/config/file.go b/tests/framework/pkg/config/file.go deleted file mode 100644 index d0e46c1885f..00000000000 --- a/tests/framework/pkg/config/file.go +++ /dev/null @@ -1,18 +0,0 @@ -package config - -import ( - "fmt" - "strings" - - "github.com/rancher/rancher/tests/framework/pkg/file" -) - -// NewConfigFileName is a constructor function that creates a configuration yaml file name -// that returns ConfigFileName. -func NewConfigFileName(dirName string, params ...string) file.Name { - fileName := strings.Join(params, "-") - - fileNameFull := fmt.Sprintf("%v/%v.yaml", dirName, fileName) - - return file.Name(fileNameFull) -} diff --git a/tests/framework/pkg/environmentflag/environmentflag.go b/tests/framework/pkg/environmentflag/environmentflag.go deleted file mode 100644 index 9a6f9164598..00000000000 --- a/tests/framework/pkg/environmentflag/environmentflag.go +++ /dev/null @@ -1,45 +0,0 @@ -package environmentflag - -import ( - "strings" - - "github.com/rancher/rancher/tests/framework/pkg/config" - "k8s.io/utils/strings/slices" -) - -const ( - ConfigurationFileKey = "flags" -) - -// EnvironmentFlags is a map of environment flags. The key is the flag enum and the value is true if the flag is set. -type EnvironmentFlags map[EnvironmentFlag]bool - -type Config struct { - DesiredFlags string `json:"desiredflags" yaml:"desiredflags" default:""` -} - -// NewEnvironmentFlags creates a new EnvironmentFlags. -func NewEnvironmentFlags() EnvironmentFlags { - return make(EnvironmentFlags) -} - -// LoadEnvironmentFlags loads the environment flags from the configuration file. -// If the flags field does not exist, it returns an empty map. -func LoadEnvironmentFlags(configurationFileKey string, e EnvironmentFlags) { - flagsConfig := new(Config) - config.LoadConfig(configurationFileKey, flagsConfig) - - flags := strings.Split(strings.ToLower(flagsConfig.DesiredFlags), "|") - - for i := EnvironmentFlag(0); i < environmentFlagLastItem; i++ { - doesContainItem := slices.Contains(flags, strings.ToLower(i.String())) - - e[EnvironmentFlag(i)] = doesContainItem - } -} - -// GetValue returns the value of the flag. -// If the flag is not set, it returns false. -func (e EnvironmentFlags) GetValue(flag EnvironmentFlag) bool { - return e[flag] -} diff --git a/tests/framework/pkg/environmentflag/environmentflags.go b/tests/framework/pkg/environmentflag/environmentflags.go deleted file mode 100644 index 6e391955ff3..00000000000 --- a/tests/framework/pkg/environmentflag/environmentflags.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:generate go run golang.org/x/tools/cmd/stringer -type=EnvironmentFlag -output=zz_environmentflags.go -linecomment -package environmentflag - -// EnvironmentFlag is integer enum for environment flags. -type EnvironmentFlag int - -// EnvironmentFlag represents a flag that can be set within configuration file. -// To add a new flag, add it to the enum before environmentFlagLastItem. -// And run `go generate` in the tests/framework/pkg/environmentflag directory. -const ( - KubernetesUpgradeAllClusters EnvironmentFlag = iota - WorkloadUpgradeAllClusters - UpdateClusterName - GatekeeperAllowedNamespaces - UpgradeAllClusters - UseExistingRegistries - InstallRancher - Long - Short - environmentFlagLastItem // This is used to determine the number of items in the enum -) diff --git a/tests/framework/pkg/environmentflag/zz_environmentflags.go b/tests/framework/pkg/environmentflag/zz_environmentflags.go deleted file mode 100644 index 94fe6497447..00000000000 --- a/tests/framework/pkg/environmentflag/zz_environmentflags.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by "stringer -type=EnvironmentFlag -output=zz_environmentflags.go -linecomment"; DO NOT EDIT. - -package environmentflag - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[KubernetesUpgradeAllClusters-0] - _ = x[WorkloadUpgradeAllClusters-1] - _ = x[UpdateClusterName-2] - _ = x[GatekeeperAllowedNamespaces-3] - _ = x[UpgradeAllClusters-4] - _ = x[UseExistingRegistries-5] - _ = x[InstallRancher-6] - _ = x[Long-7] - _ = x[Short-8] - _ = x[environmentFlagLastItem-9] -} - -const _EnvironmentFlag_name = "KubernetesUpgradeAllClustersWorkloadUpgradeAllClustersUpdateClusterNameGatekeeperAllowedNamespacesUpgradeAllClustersUseExistingRegistriesInstallRancherLongShortThis is used to determine the number of items in the enum" - -var _EnvironmentFlag_index = [...]uint8{0, 28, 54, 71, 98, 116, 137, 151, 155, 160, 217} - -func (i EnvironmentFlag) String() string { - if i < 0 || i >= EnvironmentFlag(len(_EnvironmentFlag_index)-1) { - return "EnvironmentFlag(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _EnvironmentFlag_name[_EnvironmentFlag_index[i]:_EnvironmentFlag_index[i+1]] -} diff --git a/tests/framework/pkg/file/file.go b/tests/framework/pkg/file/file.go deleted file mode 100644 index e85a2f753fe..00000000000 --- a/tests/framework/pkg/file/file.go +++ /dev/null @@ -1,64 +0,0 @@ -package file - -import ( - "fmt" - "os" - "strings" - - "github.com/sirupsen/logrus" -) - -// NewDir is a function that creates a directory with given directory name. -// Ignores the returned error if the directory already exists. -func NewDir(dirName string) (err error) { - err = os.Mkdir(dirName, 0777) - if err != nil && strings.Contains(err.Error(), "file exists") { - logrus.Infof("dir already exists: %v", err) - return nil - } - - return -} - -type Name string - -// NewFile is a method that creates a file with the received file name. -func (f Name) NewFile(data []byte) (wdPath string, err error) { - err = os.WriteFile(string(f), data, 0644) - if err != nil { - return - } - - wdPath, err = f.GetWDFilePath() - if err != nil { - return - } - - return -} - -// GetWDFilePath is a method that returns the received file name joined with wd path. -func (f Name) GetWDFilePath() (string, error) { - wd, err := os.Getwd() - logrus.Info("wd:", wd) - if err != nil { - return "", err - } - - path := fmt.Sprintf("%v/%v", wd, string(f)) - - return path, nil -} - -// SetEnvironmentKey is a method that sets given environment variable to the received file name. -func (f Name) SetEnvironmentKey(envKey string) (err error) { - configPath, err := f.GetWDFilePath() - if err != nil { - return - } - - err = os.Setenv(envKey, configPath) - logrus.Info(envKey, " is set to ", configPath) - - return -} diff --git a/tests/framework/pkg/killserver/killserver.go b/tests/framework/pkg/killserver/killserver.go deleted file mode 100644 index 973b60e4ea2..00000000000 --- a/tests/framework/pkg/killserver/killserver.go +++ /dev/null @@ -1,47 +0,0 @@ -package killserver - -import ( - "context" - "net/http" - - "github.com/sirupsen/logrus" -) - -const ( - Port = ":19999" -) - -// KillServer is struct used to cancel a context of web service, that listens on a specific port. -type KillServer struct { - Server http.Server - cancel context.CancelFunc -} - -// NewKillServer initializes a KillServer at a specific address/port and the cancel context of said web service. -func NewKillServer(addr string, cancel context.CancelFunc) *KillServer { - return &KillServer{ - Server: http.Server{ - Addr: addr, - }, - cancel: cancel, - } -} - -// Start starts the ListenAndServe of the KillServer server -func (s *KillServer) Start() { - s.Server.Handler = s - - err := s.Server.ListenAndServe() - if err != nil { - logrus.Errorf("KillServer error: %v", err) - } -} - -// ServeHTTP should write reply headers and data to the ResponseWriter -// and then return. -func (s *KillServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - - // cancel the context - s.cancel() -} diff --git a/tests/framework/pkg/namegenerator/namegenerator.go b/tests/framework/pkg/namegenerator/namegenerator.go deleted file mode 100644 index 030987cfc5b..00000000000 --- a/tests/framework/pkg/namegenerator/namegenerator.go +++ /dev/null @@ -1,46 +0,0 @@ -package namegenerator - -import ( - "math/rand" - "time" -) - -const lowerLetterBytes = "abcdefghijklmnopqrstuvwxyz" -const upperLetterBytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -const numberBytes = "0123456789" -const defaultRandStringLength = 5 - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -// RandStringLower returns a random string with lower case alpha -// chars with the length depending on `n`. Used for creating a random string for resource names, such as clusters. -func RandStringLower(n int) string { - b := make([]byte, n) - for i := range b { - b[i] = lowerLetterBytes[rand.Intn(len(lowerLetterBytes))] - } - return string(b) -} - -// RandStringWithCharset returns a random string with specifc characters from the `charset` parameter -// with the length depending on `n`. Used for creating a random string for resource names, such as clusters. -func RandStringWithCharset(length int, charset string) string { - b := make([]byte, length) - for i := range b { - b[i] = charset[rand.Intn(len(charset))] - } - return string(b) -} - -// RandStringLower returns a random string with all alpha-numeric chars -// with the length depending on `n`. Used for creating a random string for resource names, such as clusters. -func RandStringAll(length int) string { - return RandStringWithCharset(length, lowerLetterBytes+upperLetterBytes+numberBytes) -} - -func AppendRandomString(baseClusterName string) string { - clusterName := "auto-" + baseClusterName + "-" + RandStringLower(defaultRandStringLength) - return clusterName -} diff --git a/tests/framework/pkg/nodes/nodes.go b/tests/framework/pkg/nodes/nodes.go deleted file mode 100644 index 33ed7bc80ce..00000000000 --- a/tests/framework/pkg/nodes/nodes.go +++ /dev/null @@ -1,153 +0,0 @@ -package nodes - -import ( - "os" - "os/user" - "path/filepath" - - "github.com/pkg/sftp" - "github.com/rancher/rancher/tests/framework/pkg/config" - "golang.org/x/crypto/ssh" -) - -const ( - // The json/yaml config key for the config of nodes of outside cloud provider e.g. linode or ec2 - ExternalNodeConfigConfigurationFileKey = "externalNodes" - SSHPathConfigurationKey = "sshPath" - defaultSSHPath = ".ssh" -) - -// SSHPath is the path to the ssh key used in external node functionality. This be used if the ssh keys exists -// in a location not in /.ssh -type SSHPath struct { - SSHPath string `json:"sshPath" yaml:"sshPath"` -} - -// Node is a configuration of node that is from an outside cloud provider -type Node struct { - NodeID string `json:"nodeID" yaml:"nodeID"` - PublicIPAddress string `json:"publicIPAddress" yaml:"publicIPAddress"` - PrivateIPAddress string `json:"privateIPAddress" yaml:"privateIPAddress"` - SSHUser string `json:"sshUser" yaml:"sshUser"` - SSHKeyName string `json:"sshKeyName" yaml:"sshKeyName"` - SSHKey []byte -} - -// ExternalNodeConfig is a struct that is a collection of the node configurations -type ExternalNodeConfig struct { - Nodes map[int][]*Node `json:"nodes" yaml:"nodes"` -} - -// SCPFileToNode copies a file from the local machine to the specific node created. -func (n *Node) SCPFileToNode(localPath, remotePath string) error { - signer, err := ssh.ParsePrivateKey(n.SSHKey) - - if err != nil { - return err - } - - auths := []ssh.AuthMethod{ssh.PublicKeys([]ssh.Signer{signer}...)} - - cfg := &ssh.ClientConfig{ - User: n.SSHUser, - Auth: auths, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), - } - cfg.SetDefaults() - - client, err := ssh.Dial("tcp", n.PublicIPAddress+":22", cfg) - if err != nil { - return err - } - defer client.Close() - - sftp, err := sftp.NewClient(client) - if err != nil { - return err - } - defer sftp.Close() - - localFile, err := os.Open(localPath) - if err != nil { - return err - } - defer localFile.Close() - - remoteFile, err := sftp.Create(remotePath) - if err != nil { - return err - } - defer remoteFile.Close() - - if _, err := remoteFile.ReadFrom(localFile); err != nil { - return err - } - - return err -} - -// ExecuteCommand executes `command` in the specific node created. -func (n *Node) ExecuteCommand(command string) (string, error) { - signer, err := ssh.ParsePrivateKey(n.SSHKey) - var output []byte - var outputString string - - if err != nil { - return outputString, err - } - - auths := []ssh.AuthMethod{ssh.PublicKeys([]ssh.Signer{signer}...)} - - cfg := &ssh.ClientConfig{ - User: n.SSHUser, - Auth: auths, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), - } - cfg.SetDefaults() - - client, err := ssh.Dial("tcp", n.PublicIPAddress+":22", cfg) - if err != nil { - return outputString, err - } - - session, err := client.NewSession() - if err != nil { - return outputString, err - } - - output, err = session.Output(command) - outputString = string(output) - return outputString, err -} - -// GetSSHKey reads in the ssh file from the .ssh directory, returns the key in []byte format -func GetSSHKey(sshKeyname string) ([]byte, error) { - var keyPath string - - sshPathConfig := GetSSHPath() - if sshPathConfig.SSHPath == "" { - user, err := user.Current() - if err != nil { - return nil, err - } - - keyPath = filepath.Join(user.HomeDir, defaultSSHPath, sshKeyname) - } else { - keyPath = filepath.Join(sshPathConfig.SSHPath, sshKeyname) - } - content, err := os.ReadFile(keyPath) - if err != nil { - return []byte{}, err - } - - return content, nil -} - -// GetSSHPath gets ssh path from the config -func GetSSHPath() *SSHPath { - sshPathConfig := new(SSHPath) - - config.LoadConfig(SSHPathConfigurationKey, sshPathConfig) - - return sshPathConfig -} diff --git a/tests/framework/pkg/portforward/portforward.go b/tests/framework/pkg/portforward/portforward.go deleted file mode 100644 index 45a40f44a71..00000000000 --- a/tests/framework/pkg/portforward/portforward.go +++ /dev/null @@ -1,82 +0,0 @@ -package portforward - -import ( - "fmt" - "io" - "net/http" - "net/url" - "os" - "strings" - "time" - - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/portforward" - "k8s.io/client-go/transport/spdy" -) - -// ForwardPorts spawns a goroutine that does the equivalent of -// "kubectl port-forward -n [portMapping]". -// The connection will remain open until stopChan is closed. Use errChan for receiving errors from the port-forward -// goroutine. -// -// Example: -// -// stopCh := make(chan struct{}, 1) -// errCh := make(chan error) -// if err = ForwardPorts(conf, "my-ns", "my-pod", []string{"5000:5000"}, stopCh, errCh, time.Minute); err != nil { -// return err -// } -// defer func() { -// close(stopCh) -// close(errCh) -// }() -func ForwardPorts( - conf *rest.Config, - namespace string, - podName string, - portMapping []string, - stopChan <-chan struct{}, - errChan chan error, - timeout time.Duration, -) error { - transport, upgrader, err := spdy.RoundTripperFor(conf) - if err != nil { - return fmt.Errorf("error creating roundtripper: %w", err) - } - - dialer := spdy.NewDialer( - upgrader, - &http.Client{Transport: transport}, - http.MethodPost, - &url.URL{ - Scheme: "https", - Path: fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/portforward", namespace, podName), - Host: strings.TrimLeft(conf.Host, "htps:/"), - }, - ) - - // Create a new port-forwarder with localhost as the listen address. Standard output from the forwarder will be - // discarded, but errors will go to stderr. - readyChan := make(chan struct{}) - fw, err := portforward.New(dialer, portMapping, stopChan, readyChan, io.Discard, os.Stderr) - if err != nil { - return fmt.Errorf("error creating port-forwarder: %w", err) - } - - // Start the port-forward - go func() { - if err := fw.ForwardPorts(); err != nil { - errChan <- err - } - }() - - // Wait for the port-forward to be ready for use before returning - select { - case <-readyChan: - return nil - case <-time.After(timeout): - return fmt.Errorf("timed out after %s waiting for port-forward to be ready", timeout) - case err = <-errChan: - return fmt.Errorf("error from port-forwarder: %w", err) - } -} diff --git a/tests/framework/pkg/schemas/management.cattle.io/v3/schema.go b/tests/framework/pkg/schemas/management.cattle.io/v3/schema.go deleted file mode 100644 index bad3bc88fdc..00000000000 --- a/tests/framework/pkg/schemas/management.cattle.io/v3/schema.go +++ /dev/null @@ -1,1039 +0,0 @@ -package schema - -import ( - "net/http" - - rketypes "github.com/rancher/rke/types" - - eksv1 "github.com/rancher/eks-operator/pkg/apis/eks.cattle.io/v1" - gkev1 "github.com/rancher/gke-operator/pkg/apis/gke.cattle.io/v1" - "github.com/rancher/norman/types" - m "github.com/rancher/norman/types/mapper" - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/rancher/pkg/schemas/factory" - "github.com/rancher/rancher/pkg/schemas/mapper" - v1 "k8s.io/api/core/v1" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" -) - -var ( - Version = types.APIVersion{ - Version: "v3", - Group: "management.cattle.io", - Path: "/v3", - } - - AuthSchemas = factory.Schemas(&Version). - Init(authnTypes). - Init(tokens). - Init(userTypes) - - Schemas = factory.Schemas(&Version). - Init(nativeNodeTypes). - Init(nodeTypes). - Init(authzTypes). - Init(clusterTypes). - Init(catalogTypes). - Init(authnTypes). - Init(tokens). - Init(schemaTypes). - Init(userTypes). - Init(projectNetworkPolicyTypes). - Init(logTypes). - Init(globalTypes). - Init(rkeTypes). - Init(alertTypes). - Init(composeType). - Init(projectCatalogTypes). - Init(clusterCatalogTypes). - Init(multiClusterAppTypes). - Init(globalDNSTypes). - Init(kontainerTypes). - Init(etcdBackupTypes). - Init(monitorTypes). - Init(credTypes). - Init(mgmtSecretTypes). - Init(clusterTemplateTypes). - Init(driverMetadataTypes). - Init(encryptionTypes). - Init(fleetTypes). - Init(notificationTypes) - - TokenSchemas = factory.Schemas(&Version). - Init(tokens) -) - -func fleetTypes(schemas *types.Schemas) *types.Schemas { - return schemas.MustImport(&Version, v3.FleetWorkspace{}) -} - -func rkeTypes(schemas *types.Schemas) *types.Schemas { - return schemas.AddMapperForType(&Version, rketypes.BaseService{}, m.Drop{Field: "image"}). - AddMapperForType(&Version, v1.Taint{}, - m.Enum{Field: "effect", Options: []string{ - string(v1.TaintEffectNoSchedule), - string(v1.TaintEffectPreferNoSchedule), - string(v1.TaintEffectNoExecute), - }}, - m.Required{Fields: []string{ - "effect", - "value", - "key", - }}, - m.ReadOnly{Field: "timeAdded"}, - ). - MustImport(&Version, rketypes.ExtraEnv{}). - MustImport(&Version, rketypes.ExtraVolume{}). - MustImport(&Version, rketypes.ExtraVolumeMount{}). - MustImport(&Version, rketypes.LinearAutoscalerParams{}). - MustImport(&Version, rketypes.DeploymentStrategy{}). - MustImport(&Version, rketypes.DaemonSetUpdateStrategy{}) -} - -func schemaTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - MustImport(&Version, v3.DynamicSchema{}) -} - -func credTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.CloudCredential{}, - &m.DisplayName{}, - &mapper.CredentialMapper{}, - &m.AnnotationField{Field: "name"}, - &m.AnnotationField{Field: "description"}, - &m.Drop{Field: "namespaceId"}). - MustImport(&Version, v3.CloudCredential{}) -} - -func mgmtSecretTypes(schemas *types.Schemas) *types.Schemas { - return schemas.MustImportAndCustomize(&Version, v1.Secret{}, func(schema *types.Schema) { - schema.ID = "managementSecret" - schema.PluralName = "managementSecrets" - schema.CodeName = "ManagementSecret" - schema.CodeNamePlural = "ManagementSecrets" - schema.MustCustomizeField("name", func(field types.Field) types.Field { - field.Type = "hostname" - field.Nullable = false - field.Required = true - return field - }) - }) -} - -func driverMetadataTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.RkeK8sSystemImage{}, m.Drop{Field: "namespaceId"}). - AddMapperForType(&Version, v3.RkeK8sServiceOption{}, m.Drop{Field: "namespaceId"}). - AddMapperForType(&Version, v3.RkeAddon{}, m.Drop{Field: "namespaceId"}). - MustImport(&Version, v3.RkeK8sSystemImage{}). - MustImport(&Version, v3.RkeK8sServiceOption{}). - MustImport(&Version, v3.RkeAddon{}) -} - -func catalogTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.Catalog{}, - &m.Move{From: "catalogKind", To: "kind"}, - &m.Embed{Field: "status"}, - &m.Drop{Field: "helmVersionCommits"}, - ). - MustImport(&Version, v3.CatalogRefresh{}). - MustImportAndCustomize(&Version, v3.Catalog{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - schema.CollectionActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - }). - AddMapperForType(&Version, v3.Template{}, - m.DisplayName{}, - ). - MustImport(&Version, v3.Template{}, struct { - VersionLinks map[string]string - }{}). - AddMapperForType(&Version, v3.CatalogTemplate{}, - m.DisplayName{}, - m.Drop{Field: "namespaceId"}, - ). - MustImport(&Version, v3.CatalogTemplate{}, struct { - VersionLinks map[string]string - }{}). - AddMapperForType(&Version, v3.CatalogTemplateVersion{}, - m.Drop{Field: "namespaceId"}, - ). - MustImport(&Version, v3.CatalogTemplateVersion{}). - MustImport(&Version, v3.TemplateVersion{}). - MustImport(&Version, v3.TemplateContent{}) -} - -func nativeNodeTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - TypeName("internalNodeStatus", v1.NodeStatus{}). - TypeName("internalNodeSpec", v1.NodeSpec{}). - AddMapperForType(&Version, v1.NodeStatus{}, - &mapper.NodeAddressMapper{}, - &mapper.OSInfo{}, - &m.Drop{Field: "addresses"}, - &m.Drop{Field: "daemonEndpoints"}, - &m.Drop{Field: "images"}, - &m.Drop{Field: "nodeInfo"}, - &m.Move{From: "conditions", To: "nodeConditions"}, - &m.Drop{Field: "phase"}, - &m.SliceToMap{Field: "volumesAttached", Key: "devicePath"}, - ). - AddMapperForType(&Version, v1.NodeSpec{}, - &m.Drop{Field: "externalID"}, - &m.Drop{Field: "configSource"}, - &m.Move{From: "providerID", To: "providerId"}, - &m.Move{From: "podCIDR", To: "podCidr"}, - &m.Move{From: "podCIDRs", To: "podCidrs"}, - m.Access{Fields: map[string]string{ - "podCidr": "r", - "podCidrs": "r", - "providerId": "r", - "taints": "ru", - "unschedulable": "ru", - }}). - AddMapperForType(&Version, v1.Node{}, - &mapper.NodeAddressAnnotationMapper{}). - MustImportAndCustomize(&Version, v1.NodeSpec{}, func(schema *types.Schema) { - schema.CodeName = "InternalNodeSpec" - schema.CodeNamePlural = "InternalNodeSpecs" - }). - MustImportAndCustomize(&Version, v1.NodeStatus{}, func(schema *types.Schema) { - schema.CodeName = "InternalNodeStatus" - schema.CodeNamePlural = "InternalNodeStatuses" - }, struct { - IPAddress string - ExternalIPAddress string `json:"externalIpAddress,omitempty"` - Hostname string - Info NodeInfo - }{}) -} - -func clusterTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.Cluster{}, - &m.Embed{Field: "status"}, - mapper.NewDropFromSchema("genericEngineConfig"), - mapper.NewDropFromSchema("googleKubernetesEngineConfig"), - mapper.NewDropFromSchema("azureKubernetesServiceConfig"), - mapper.NewDropFromSchema("amazonElasticContainerServiceConfig"), - m.DisplayName{}, - ). - AddMapperForType(&Version, v3.ClusterStatus{}, - m.Drop{Field: "serviceAccountToken"}, - ). - AddMapperForType(&Version, v3.ClusterRegistrationToken{}, - &m.Embed{Field: "status"}, - ). - AddMapperForType(&Version, rketypes.RancherKubernetesEngineConfig{}, - m.Drop{Field: "systemImages"}, - ). - MustImport(&Version, v3.Cluster{}). - MustImport(&Version, v3.ClusterRegistrationToken{}). - MustImport(&Version, v3.GenerateKubeConfigOutput{}). - MustImport(&Version, v3.ImportClusterYamlInput{}). - MustImport(&Version, v3.RotateCertificateInput{}). - MustImport(&Version, v3.RotateCertificateOutput{}). - MustImport(&Version, v3.RotateEncryptionKeyOutput{}). - MustImport(&Version, v3.ImportYamlOutput{}). - MustImport(&Version, v3.ExportOutput{}). - MustImport(&Version, v3.MonitoringInput{}). - MustImport(&Version, v3.MonitoringOutput{}). - MustImport(&Version, v3.RestoreFromEtcdBackupInput{}). - MustImport(&Version, v3.SaveAsTemplateInput{}). - MustImport(&Version, v3.SaveAsTemplateOutput{}). - AddMapperForType(&Version, v1.EnvVar{}, - &m.Move{ - From: "envVar", - To: "agentEnvVar", - }). - MustImportAndCustomize(&Version, rketypes.ETCDService{}, func(schema *types.Schema) { - schema.MustCustomizeField("extraArgs", func(field types.Field) types.Field { - field.Default = map[string]interface{}{ - "election-timeout": "5000", - "heartbeat-interval": "500"} - return field - }) - }). - MustImportAndCustomize(&Version, gkev1.GKEClusterConfigSpec{}, func(schema *types.Schema) { - schema.MustCustomizeField("labels", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("locations", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - }). - MustImportAndCustomize(&Version, eksv1.EKSClusterConfigSpec{}, func(schema *types.Schema) { - schema.MustCustomizeField("publicAccessSources", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("loggingTypes", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("subnets", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("securityGroups", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("tags", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - }). - MustImportAndCustomize(&Version, eksv1.NodeGroup{}, func(schema *types.Schema) { - schema.MustCustomizeField("labels", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("resourceTags", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("subnets", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("spotInstanceTypes", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - schema.MustCustomizeField("tags", func(field types.Field) types.Field { - field.Pointer = true - return field - }) - }). - MustImportAndCustomize(&Version, v3.Cluster{}, func(schema *types.Schema) { - schema.MustCustomizeField("name", func(field types.Field) types.Field { - field.Type = "dnsLabel" - field.Nullable = true - field.Required = false - return field - }) - schema.ResourceActions[v3.ClusterActionGenerateKubeconfig] = types.Action{ - Output: "generateKubeConfigOutput", - } - schema.ResourceActions[v3.ClusterActionImportYaml] = types.Action{ - Input: "importClusterYamlInput", - Output: "importYamlOutput", - } - schema.ResourceActions[v3.ClusterActionExportYaml] = types.Action{ - Output: "exportOutput", - } - schema.ResourceActions[v3.ClusterActionEnableMonitoring] = types.Action{ - Input: "monitoringInput", - } - schema.ResourceActions[v3.ClusterActionDisableMonitoring] = types.Action{} - schema.ResourceActions[v3.ClusterActionViewMonitoring] = types.Action{ - Output: "monitoringOutput", - } - schema.ResourceActions[v3.ClusterActionEditMonitoring] = types.Action{ - Input: "monitoringInput", - } - schema.ResourceActions[v3.ClusterActionBackupEtcd] = types.Action{} - schema.ResourceActions[v3.ClusterActionRestoreFromEtcdBackup] = types.Action{ - Input: "restoreFromEtcdBackupInput", - } - schema.ResourceActions[v3.ClusterActionRotateCertificates] = types.Action{ - Input: "rotateCertificateInput", - Output: "rotateCertificateOutput", - } - schema.ResourceActions[v3.ClusterActionRotateEncryptionKey] = types.Action{ - Output: "rotateEncryptionKeyOutput", - } - schema.ResourceActions[v3.ClusterActionSaveAsTemplate] = types.Action{ - Input: "saveAsTemplateInput", - Output: "saveAsTemplateOutput", - } - }) -} - -func authzTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - MustImport(&Version, v3.ProjectStatus{}). - AddMapperForType(&Version, v3.Project{}, - m.DisplayName{}, - &m.Embed{Field: "status"}, - ). - AddMapperForType(&Version, v3.GlobalRole{}, m.DisplayName{}). - AddMapperForType(&Version, v3.RoleTemplate{}, m.DisplayName{}). - AddMapperForType(&Version, - v3.PodSecurityPolicyTemplateProjectBinding{}, - &mapper.NamespaceIDMapper{}). - AddMapperForType(&Version, v3.ProjectRoleTemplateBinding{}, - &mapper.NamespaceIDMapper{}, - ). - MustImport(&Version, v3.SetPodSecurityPolicyTemplateInput{}). - MustImport(&Version, v3.ImportYamlOutput{}). - MustImport(&Version, v3.MonitoringInput{}). - MustImport(&Version, v3.MonitoringOutput{}). - MustImportAndCustomize(&Version, v3.Project{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "setpodsecuritypolicytemplate": { - Input: "setPodSecurityPolicyTemplateInput", - Output: "project", - }, - "exportYaml": {}, - "enableMonitoring": { - Input: "monitoringInput", - }, - "disableMonitoring": {}, - "viewMonitoring": { - Output: "monitoringOutput", - }, - "editMonitoring": { - Input: "monitoringInput", - }, - } - }). - MustImport(&Version, v3.GlobalRole{}). - MustImport(&Version, v3.GlobalRoleBinding{}). - MustImport(&Version, v3.RoleTemplate{}). - MustImport(&Version, v3.PodSecurityPolicyTemplate{}). - MustImportAndCustomize(&Version, v3.PodSecurityPolicyTemplateProjectBinding{}, func(schema *types.Schema) { - schema.CollectionMethods = []string{http.MethodGet, http.MethodPost} - schema.ResourceMethods = []string{} - }). - MustImport(&Version, v3.ClusterRoleTemplateBinding{}). - MustImport(&Version, v3.ProjectRoleTemplateBinding{}). - MustImport(&Version, v3.GlobalRoleBinding{}) -} - -func nodeTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.NodeSpec{}, &m.Embed{Field: "internalNodeSpec"}). - AddMapperForType(&Version, v3.NodeStatus{}, - &m.Drop{Field: "nodeTemplateSpec"}, - &m.Embed{Field: "internalNodeStatus"}, - &m.Drop{Field: "config"}, - &m.SliceMerge{From: []string{"conditions", "nodeConditions"}, To: "conditions"}). - AddMapperForType(&Version, v3.Node{}, - &m.Embed{Field: "status"}, - &m.Move{From: "rkeNode/user", To: "sshUser"}, - &m.ReadOnly{Field: "sshUser"}, - &m.Drop{Field: "rkeNode"}, - &m.Drop{Field: "labels"}, - &m.Drop{Field: "annotations"}, - &m.Move{From: "nodeLabels", To: "labels"}, - &m.Move{From: "nodeAnnotations", To: "annotations"}, - &m.Drop{Field: "desiredNodeTaints"}, - &m.Drop{Field: "metadataUpdate"}, - &m.Drop{Field: "updateTaintsFromAPI"}, - &m.Drop{Field: "desiredNodeUnschedulable"}, - &m.Drop{Field: "nodeDrainInput"}, - &m.AnnotationField{Field: "publicEndpoints", List: true}, - m.Copy{From: "namespaceId", To: "clusterName"}, - m.DisplayName{}). - AddMapperForType(&Version, v3.NodeDriver{}, m.DisplayName{}). - AddMapperForType(&Version, v3.NodeTemplate{}, m.DisplayName{}). - MustImport(&Version, v3.PublicEndpoint{}). - MustImportAndCustomize(&Version, v3.NodePool{}, func(schema *types.Schema) { - schema.ResourceFields["driver"] = types.Field{ - Type: "string", - CodeName: "Driver", - Create: false, - Update: false, - } - }). - MustImport(&Version, v3.NodeDrainInput{}). - MustImportAndCustomize(&Version, v3.Node{}, func(schema *types.Schema) { - labelField := schema.ResourceFields["labels"] - labelField.Create = true - labelField.Update = true - schema.ResourceFields["labels"] = labelField - annotationField := schema.ResourceFields["annotations"] - annotationField.Create = true - annotationField.Update = true - schema.ResourceFields["annotations"] = annotationField - unschedulable := schema.ResourceFields["unschedulable"] - unschedulable.Create = false - unschedulable.Update = false - schema.ResourceFields["unschedulable"] = unschedulable - clusterField := schema.ResourceFields["clusterId"] - clusterField.Type = "reference[cluster]" - schema.ResourceFields["clusterId"] = clusterField - schema.ResourceActions["cordon"] = types.Action{} - schema.ResourceActions["uncordon"] = types.Action{} - schema.ResourceActions["stopDrain"] = types.Action{} - schema.ResourceActions["scaledown"] = types.Action{} - schema.ResourceActions["drain"] = types.Action{ - Input: "nodeDrainInput", - } - }, struct { - PublicEndpoints string `json:"publicEndpoints" norman:"type=array[publicEndpoint],nocreate,noupdate"` - }{}). - MustImportAndCustomize(&Version, v3.NodeDriver{}, func(schema *types.Schema) { - schema.ResourceActions["activate"] = types.Action{ - Output: "nodeDriver", - } - schema.ResourceActions["deactivate"] = types.Action{ - Output: "nodeDriver", - } - }). - MustImportAndCustomize(&Version, v3.NodeTemplate{}, func(schema *types.Schema) { - delete(schema.ResourceFields, "namespaceId") - }) -} - -func tokens(schemas *types.Schemas) *types.Schemas { - return schemas. - MustImportAndCustomize(&Version, v3.Token{}, func(schema *types.Schema) { - schema.CollectionActions = map[string]types.Action{ - "logout": {}, - } - }) -} - -func authnTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.User{}, m.DisplayName{}, - &m.Embed{Field: "status"}). - AddMapperForType(&Version, v3.Group{}, m.DisplayName{}). - MustImport(&Version, v3.Group{}). - MustImport(&Version, v3.GroupMember{}). - MustImport(&Version, v3.SamlToken{}). - AddMapperForType(&Version, v3.Principal{}, m.DisplayName{}). - MustImportAndCustomize(&Version, v3.Principal{}, func(schema *types.Schema) { - schema.CollectionMethods = []string{http.MethodGet} - schema.ResourceMethods = []string{http.MethodGet} - schema.CollectionActions = map[string]types.Action{ - "search": { - Input: "searchPrincipalsInput", - Output: "collection", - }, - } - }). - MustImport(&Version, v3.SearchPrincipalsInput{}). - MustImport(&Version, v3.ChangePasswordInput{}). - MustImport(&Version, v3.SetPasswordInput{}). - MustImportAndCustomize(&Version, v3.User{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "setpassword": { - Input: "setPasswordInput", - Output: "user", - }, - "refreshauthprovideraccess": {}, - } - schema.CollectionActions = map[string]types.Action{ - "changepassword": { - Input: "changePasswordInput", - }, - "refreshauthprovideraccess": {}, - } - }). - MustImportAndCustomize(&Version, v3.AuthConfig{}, func(schema *types.Schema) { - schema.CollectionMethods = []string{http.MethodGet} - }). - // Local Config - MustImportAndCustomize(&Version, v3.LocalConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet} - }). - //Github Config - MustImportAndCustomize(&Version, v3.GithubConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "configureTest": { - Input: "githubConfig", - Output: "githubConfigTestOutput", - }, - "testAndApply": { - Input: "githubConfigApplyInput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - }). - MustImport(&Version, v3.GithubConfigTestOutput{}). - MustImport(&Version, v3.GithubConfigApplyInput{}). - //AzureAD Config - MustImportAndCustomize(&Version, v3.AzureADConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "configureTest": { - Input: "azureADConfig", - Output: "azureADConfigTestOutput", - }, - "testAndApply": { - Input: "azureADConfigApplyInput", - }, - "upgrade": {}, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - }). - MustImport(&Version, v3.AzureADConfigTestOutput{}). - MustImport(&Version, v3.AzureADConfigApplyInput{}). - // Active Directory Config - MustImportAndCustomize(&Version, v3.ActiveDirectoryConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "testAndApply": { - Input: "activeDirectoryTestAndApplyInput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - }). - MustImport(&Version, v3.ActiveDirectoryTestAndApplyInput{}). - // OpenLdap Config - MustImportAndCustomize(&Version, v3.OpenLdapConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "testAndApply": { - Input: "openLdapTestAndApplyInput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - }). - MustImport(&Version, v3.OpenLdapTestAndApplyInput{}). - // FreeIpa Config - AddMapperForType(&Version, v3.FreeIpaConfig{}, m.Drop{Field: "nestedGroupMembershipEnabled"}). - MustImportAndCustomize(&Version, v3.FreeIpaConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "testAndApply": { - Input: "freeIpaTestAndApplyInput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - schema.MustCustomizeField("groupObjectClass", func(f types.Field) types.Field { - f.Default = "groupofnames" - return f - }) - schema.MustCustomizeField("userNameAttribute", func(f types.Field) types.Field { - f.Default = "givenName" - return f - }) - schema.MustCustomizeField("userObjectClass", func(f types.Field) types.Field { - f.Default = "inetorgperson" - return f - }) - schema.MustCustomizeField("groupDNAttribute", func(f types.Field) types.Field { - f.Default = "entrydn" - return f - }) - schema.MustCustomizeField("groupMemberUserAttribute", func(f types.Field) types.Field { - f.Default = "entrydn" - return f - }) - }). - MustImport(&Version, v3.FreeIpaTestAndApplyInput{}). - // Saml Config - // Ping-Saml Config - // KeyCloak-Saml Configs - MustImportAndCustomize(&Version, v3.PingConfig{}, configSchema). - MustImportAndCustomize(&Version, v3.ADFSConfig{}, configSchema). - MustImportAndCustomize(&Version, v3.KeyCloakConfig{}, configSchema). - MustImportAndCustomize(&Version, v3.OKTAConfig{}, configSchema). - MustImportAndCustomize(&Version, v3.ShibbolethConfig{}, configSchema). - MustImport(&Version, v3.SamlConfigTestInput{}). - MustImport(&Version, v3.SamlConfigTestOutput{}). - //GoogleOAuth Config - MustImportAndCustomize(&Version, v3.GoogleOauthConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "configureTest": { - Input: "googleOauthConfig", - Output: "googleOauthConfigTestOutput", - }, - "testAndApply": { - Input: "googleOauthConfigApplyInput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - }). - MustImport(&Version, v3.GoogleOauthConfigApplyInput{}). - MustImport(&Version, v3.GoogleOauthConfigTestOutput{}). - //OIDC Config - MustImportAndCustomize(&Version, v3.OIDCConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "configureTest": { - Input: "oidcConfig", - Output: "oidcTestOutput", - }, - "testAndApply": { - Input: "oidcApplyInput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - }). - MustImport(&Version, v3.OIDCApplyInput{}). - MustImport(&Version, v3.OIDCTestOutput{}). - //KeyCloakOIDC Config - MustImportAndCustomize(&Version, v3.KeyCloakOIDCConfig{}, func(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "configureTest": { - Input: "keyCloakOidcConfig", - Output: "keyCloakOidcTestOutput", - }, - "testAndApply": { - Input: "keyCloakOidcApplyInput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} - }) -} - -func configSchema(schema *types.Schema) { - schema.BaseType = "authConfig" - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "testAndEnable": { - Input: "samlConfigTestInput", - Output: "samlConfigTestOutput", - }, - } - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{http.MethodGet, http.MethodPut} -} - -func userTypes(schema *types.Schemas) *types.Schemas { - return schema. - MustImportAndCustomize(&Version, v3.Preference{}, func(schema *types.Schema) { - schema.MustCustomizeField("name", func(f types.Field) types.Field { - f.Required = true - return f - }) - schema.MustCustomizeField("namespaceId", func(f types.Field) types.Field { - f.Required = false - return f - }) - }). - MustImportAndCustomize(&Version, v3.UserAttribute{}, func(schema *types.Schema) { - schema.CollectionMethods = []string{} - schema.ResourceMethods = []string{} - }) -} - -func projectNetworkPolicyTypes(schema *types.Schemas) *types.Schemas { - return schema. - MustImportAndCustomize(&Version, v3.ProjectNetworkPolicy{}, func(schema *types.Schema) { - schema.CollectionMethods = []string{http.MethodGet} - schema.ResourceMethods = []string{http.MethodGet} - }) -} - -func logTypes(schema *types.Schemas) *types.Schemas { - return schema. - AddMapperForType(&Version, v3.ClusterLogging{}, - &m.Embed{Field: "status"}, - m.DisplayName{}). - AddMapperForType(&Version, v3.ProjectLogging{}, - m.DisplayName{}). - MustImport(&Version, v3.ClusterTestInput{}). - MustImport(&Version, v3.ProjectTestInput{}). - MustImportAndCustomize(&Version, v3.ClusterLogging{}, func(schema *types.Schema) { - schema.CollectionActions = map[string]types.Action{ - "test": { - Input: "clusterTestInput", - }, - "dryRun": { - Input: "clusterTestInput", - }, - } - }). - MustImportAndCustomize(&Version, v3.ProjectLogging{}, func(schema *types.Schema) { - schema.CollectionActions = map[string]types.Action{ - "test": { - Input: "projectTestInput", - }, - "dryRun": { - Input: "projectTestInput", - }, - } - }) -} - -func globalTypes(schema *types.Schemas) *types.Schemas { - return schema. - MustImportAndCustomize(&Version, v3.Setting{}, func(schema *types.Schema) { - schema.MustCustomizeField("name", func(f types.Field) types.Field { - f.Required = true - return f - }) - }). - MustImportAndCustomize(&Version, v3.Feature{}, func(schema *types.Schema) { - schema.MustCustomizeField("name", func(f types.Field) types.Field { - f.Required = true - return f - }) - }) -} - -func alertTypes(schema *types.Schemas) *types.Schemas { - return schema. - AddMapperForType(&Version, v3.Notifier{}, - &m.Embed{Field: "status"}, - m.DisplayName{}). - MustImport(&Version, v3.ClusterAlert{}). - MustImport(&Version, v3.ProjectAlert{}). - MustImport(&Version, v3.Notification{}). - MustImportAndCustomize(&Version, v3.Notifier{}, func(schema *types.Schema) { - schema.CollectionActions = map[string]types.Action{ - "send": { - Input: "notification", - }, - } - schema.ResourceActions = map[string]types.Action{ - "send": { - Input: "notification", - }, - } - }). - MustImport(&Version, v3.AlertStatus{}). - AddMapperForType(&Version, v3.ClusterAlertGroup{}, - &m.Embed{Field: "status"}, - m.DisplayName{}). - AddMapperForType(&Version, v3.ProjectAlertGroup{}, - &m.Embed{Field: "status"}, - m.DisplayName{}). - AddMapperForType(&Version, v3.ClusterAlertRule{}, - &m.Embed{Field: "status"}, - m.DisplayName{}). - AddMapperForType(&Version, v3.ProjectAlertRule{}, - &m.Embed{Field: "status"}, - m.DisplayName{}). - MustImport(&Version, v3.ClusterAlertGroup{}). - MustImport(&Version, v3.ProjectAlertGroup{}). - MustImportAndCustomize(&Version, v3.ClusterAlertRule{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "activate": {}, - "deactivate": {}, - "mute": {}, - "unmute": {}, - } - }). - MustImportAndCustomize(&Version, v3.ProjectAlertRule{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "activate": {}, - "deactivate": {}, - "mute": {}, - "unmute": {}, - } - }) - -} - -func composeType(schemas *types.Schemas) *types.Schemas { - return schemas.MustImport(&Version, v3.ComposeConfig{}) -} - -func projectCatalogTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.ProjectCatalog{}, - &m.Move{From: "catalogKind", To: "kind"}, - &m.Embed{Field: "status"}, - &m.Drop{Field: "helmVersionCommits"}, - &mapper.NamespaceIDMapper{}). - MustImportAndCustomize(&Version, v3.ProjectCatalog{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - schema.CollectionActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - }) -} - -func clusterCatalogTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.ClusterCatalog{}, - &m.Move{From: "catalogKind", To: "kind"}, - &m.Embed{Field: "status"}, - &m.Drop{Field: "helmVersionCommits"}, - &mapper.NamespaceIDMapper{}). - MustImportAndCustomize(&Version, v3.ClusterCatalog{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - schema.CollectionActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - }) -} - -func multiClusterAppTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.MultiClusterApp{}, m.Drop{Field: "namespaceId"}). - AddMapperForType(&Version, v3.MultiClusterAppRevision{}, m.Drop{Field: "namespaceId"}). - AddMapperForType(&Version, v3.Member{}, m.Drop{Field: "userName"}, m.Drop{Field: "displayName"}). - MustImport(&Version, v3.MultiClusterApp{}). - MustImport(&Version, v3.Target{}). - MustImport(&Version, v3.UpgradeStrategy{}). - MustImport(&Version, v3.MultiClusterAppRollbackInput{}). - MustImport(&Version, v3.MultiClusterAppRevision{}). - MustImport(&Version, v3.UpdateMultiClusterAppTargetsInput{}). - MustImportAndCustomize(&Version, v3.MultiClusterApp{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "rollback": { - Input: "multiClusterAppRollbackInput", - }, - "addProjects": { - Input: "updateMultiClusterAppTargetsInput", - }, - "removeProjects": { - Input: "updateMultiClusterAppTargetsInput", - }, - } - }) -} - -func globalDNSTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - TypeName("globalDns", v3.GlobalDns{}). - TypeName("globalDnsProvider", v3.GlobalDnsProvider{}). - TypeName("globalDnsSpec", v3.GlobalDNSSpec{}). - TypeName("globalDnsStatus", v3.GlobalDNSStatus{}). - TypeName("globalDnsProviderSpec", v3.GlobalDNSProviderSpec{}). - MustImport(&Version, v3.UpdateGlobalDNSTargetsInput{}). - AddMapperForType(&Version, v3.GlobalDns{}, m.Drop{Field: "namespaceId"}). - AddMapperForType(&Version, v3.GlobalDnsProvider{}, m.Drop{Field: "namespaceId"}). - MustImportAndCustomize(&Version, v3.GlobalDns{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "addProjects": { - Input: "updateGlobalDNSTargetsInput", - }, - "removeProjects": { - Input: "updateGlobalDNSTargetsInput", - }, - } - }). - MustImportAndCustomize(&Version, v3.GlobalDnsProvider{}, func(schema *types.Schema) { - }) -} - -func kontainerTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.KontainerDriver{}, - &m.Embed{Field: "status"}, - m.DisplayName{}, - ). - MustImportAndCustomize(&Version, v3.KontainerDriver{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "activate": {}, - "deactivate": {}, - } - schema.CollectionActions = map[string]types.Action{ - "refresh": {}, - } - }) -} - -func monitorTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - MustImport(&Version, v3.QueryGraphInput{}). - MustImport(&Version, v3.QueryClusterGraphOutput{}). - MustImport(&Version, v3.QueryProjectGraphOutput{}). - MustImport(&Version, v3.QueryClusterMetricInput{}). - MustImport(&Version, v3.QueryProjectMetricInput{}). - MustImport(&Version, v3.QueryMetricOutput{}). - MustImport(&Version, v3.ClusterMetricNamesInput{}). - MustImport(&Version, v3.ProjectMetricNamesInput{}). - MustImport(&Version, v3.MetricNamesOutput{}). - MustImport(&Version, v3.TimeSeries{}). - MustImportAndCustomize(&Version, v3.MonitorMetric{}, func(schema *types.Schema) { - schema.CollectionActions = map[string]types.Action{ - "querycluster": { - Input: "queryClusterMetricInput", - Output: "queryMetricOutput", - }, - "listclustermetricname": { - Input: "clusterMetricNamesInput", - Output: "metricNamesOutput", - }, - "queryproject": { - Input: "queryProjectMetricInput", - Output: "queryMetricOutput", - }, - "listprojectmetricname": { - Input: "projectMetricNamesInput", - Output: "metricNamesOutput", - }, - } - }). - MustImportAndCustomize(&Version, v3.ClusterMonitorGraph{}, func(schema *types.Schema) { - schema.CollectionActions = map[string]types.Action{ - "query": { - Input: "queryGraphInput", - Output: "queryClusterGraphOutput", - }, - } - }). - MustImportAndCustomize(&Version, v3.ProjectMonitorGraph{}, func(schema *types.Schema) { - schema.CollectionActions = map[string]types.Action{ - "query": { - Input: "queryGraphInput", - Output: "queryProjectGraphOutput", - }, - } - }) -} - -func etcdBackupTypes(schemas *types.Schemas) *types.Schemas { - return schemas.MustImport(&Version, v3.EtcdBackup{}) -} - -func clusterTemplateTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - TypeName("clusterTemplate", v3.ClusterTemplate{}). - TypeName("clusterTemplateRevision", v3.ClusterTemplateRevision{}). - AddMapperForType(&Version, v3.ClusterTemplate{}, m.Drop{Field: "namespaceId"}, m.DisplayName{}). - AddMapperForType(&Version, v3.ClusterTemplateRevision{}, - m.Drop{Field: "namespaceId"}, - &m.Embed{Field: "status"}, - m.DisplayName{}). - MustImport(&Version, v3.ClusterTemplateQuestionsOutput{}). - MustImport(&Version, v3.ClusterTemplate{}). - MustImportAndCustomize(&Version, v3.ClusterTemplateRevision{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "disable": {}, - "enable": {}, - } - schema.CollectionActions = map[string]types.Action{ - "listquestions": { - Output: "clusterTemplateQuestionsOutput", - }, - } - }) - -} - -func encryptionTypes(schemas *types.Schemas) *types.Schemas { - return schemas.MustImport(&Version, rketypes.SecretsEncryptionConfig{}). - MustImport(&Version, apiserverconfig.Key{}, struct { - Secret string `norman:"type=password"` - }{}).MustImport(&Version, apiserverconfig.KMSConfiguration{}, struct { - Timeout string - }{}) -} - -func notificationTypes(schemas *types.Schemas) *types.Schemas { - return schemas.MustImport(&Version, v3.RancherUserNotification{}) -} diff --git a/tests/framework/pkg/schemas/management.cattle.io/v3/types.go b/tests/framework/pkg/schemas/management.cattle.io/v3/types.go deleted file mode 100644 index d0a14ccf825..00000000000 --- a/tests/framework/pkg/schemas/management.cattle.io/v3/types.go +++ /dev/null @@ -1,27 +0,0 @@ -package schema - -type NodeInfo struct { - CPU CPUInfo - Memory MemoryInfo - OS OSInfo - Kubernetes KubernetesInfo -} - -type CPUInfo struct { - Count int64 -} - -type MemoryInfo struct { - MemTotalKiB int64 -} - -type OSInfo struct { - DockerVersion string - KernelVersion string - OperatingSystem string -} - -type KubernetesInfo struct { - KubeletVersion string - KubeProxyVersion string -} diff --git a/tests/framework/pkg/session/session.go b/tests/framework/pkg/session/session.go deleted file mode 100644 index 1ac01b2ec5f..00000000000 --- a/tests/framework/pkg/session/session.go +++ /dev/null @@ -1,82 +0,0 @@ -package session - -import ( - "time" - - "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/util/wait" -) - -// CleanupFunc is the type RegisterCleanupFunc accepts -type CleanupFunc func() error - -// Session is used to track resources created by tests by having a LIFO queue the keeps track of the delete functions. -type Session struct { - CleanupEnabled bool - cleanupQueue []CleanupFunc - open bool -} - -// NewSession is a constructor instantiates a new `Session` -func NewSession() *Session { - return &Session{ - CleanupEnabled: true, - cleanupQueue: []CleanupFunc{}, - open: true, - } -} - -// RegisterCleanupFunc is function registers clean up functions in the `Session` queue. -// Functions passed to this method will be called in the order they are added when `Cleanup` is called. -// If Session is closed, it will cause a panic if a new cleanup function is registered. -func (ts *Session) RegisterCleanupFunc(f CleanupFunc) { - if ts.open { - ts.cleanupQueue = append(ts.cleanupQueue, f) - } else { - panic("attempted to register cleanup function to closed test session") - } - -} - -// Cleanup this method will call all registered cleanup functions in order and close the test session. -func (ts *Session) Cleanup() { - if ts.CleanupEnabled { - ts.open = false - - // sometimes it is necessary to retry cleanup due to the webhook validator block initial delete attempts - // due to using a stale cache - var backoff = wait.Backoff{ - Duration: 100 * time.Millisecond, - Factor: 1, - Jitter: 0, - Steps: 5, - } - - for i := len(ts.cleanupQueue) - 1; i >= 0; i-- { - var cleanupErr error - err := wait.ExponentialBackoff(backoff, func() (done bool, err error) { - cleanupErr = ts.cleanupQueue[i]() - if cleanupErr != nil { - return false, nil - } - return true, nil - }) - if err != nil { - logrus.Errorf("failed to cleanup resource. Backoff error: %v. Cleanup error: %v", err, cleanupErr) - } - } - ts.cleanupQueue = []CleanupFunc{} - } -} - -// NewSession returns a `Session` who's cleanup method is registered with this `Session` -func (ts *Session) NewSession() *Session { - sess := NewSession() - - ts.RegisterCleanupFunc(func() error { - sess.Cleanup() - return nil - }) - - return sess -} diff --git a/tests/framework/pkg/wait/watch.go b/tests/framework/pkg/wait/watch.go deleted file mode 100644 index bda5bbf7f56..00000000000 --- a/tests/framework/pkg/wait/watch.go +++ /dev/null @@ -1,52 +0,0 @@ -package wait - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/watch" -) - -// WatchCheckFunc is the function type of `check` needed for WatchWait e.g. -// -// checkFunc := func(event watch.Event) (ready bool, err error) { -// cluster := event.Object.(*apisV1.Cluster) -// ready = cluster.Status.Ready -// return ready, nil -// } -type WatchCheckFunc func(watch.Event) (bool, error) - -// WatchWait uses the `watchInterface` to wait until the `check` function to returns true. -// e.g. WatchWait for provisioning a cluster -// -// result, err := r.client.Provisioning.Clusters(namespace).Watch(context.TODO(), metav1.ListOptions{ -// FieldSelector: "metadata.name=" + clusterName, -// TimeoutSeconds: &defaults.WatchTimeoutSeconds, -// }) -// require.NoError(r.T(), err) -// err = wait.WatchWait(result, checkFunc) -func WatchWait(watchInterface watch.Interface, check WatchCheckFunc) error { - defer func() { - watchInterface.Stop() - }() - - for { - select { - case event, open := <-watchInterface.ResultChan(): - if !open { - return fmt.Errorf("timeout waiting on condition") - } - if event.Type == watch.Error { - return fmt.Errorf("error with watch connection") - } - - done, err := check(event) - if err != nil { - return err - } - - if done { - return nil - } - } - } -} diff --git a/tests/v2/codecoverage/agent/main.go b/tests/v2/codecoverage/agent/main.go index 2d2ca27e970..0bab1d0cb39 100644 --- a/tests/v2/codecoverage/agent/main.go +++ b/tests/v2/codecoverage/agent/main.go @@ -31,8 +31,8 @@ import ( "github.com/rancher/rancher/pkg/logserver" "github.com/rancher/rancher/pkg/rkenodeconfigclient" "github.com/rancher/rancher/pkg/rkenodeconfigserver" - "github.com/rancher/rancher/tests/framework/pkg/killserver" "github.com/rancher/remotedialer" + "github.com/rancher/shepherd/pkg/killserver" "github.com/rancher/wrangler/pkg/signals" "github.com/sirupsen/logrus" ) diff --git a/tests/v2/codecoverage/rancher/main.go b/tests/v2/codecoverage/rancher/main.go index 1d423fef5a6..e017f776303 100644 --- a/tests/v2/codecoverage/rancher/main.go +++ b/tests/v2/codecoverage/rancher/main.go @@ -17,7 +17,7 @@ import ( "github.com/rancher/rancher/pkg/logserver" "github.com/rancher/rancher/pkg/rancher" "github.com/rancher/rancher/pkg/version" - "github.com/rancher/rancher/tests/framework/pkg/killserver" + "github.com/rancher/shepherd/pkg/killserver" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) diff --git a/tests/v2/codecoverage/ranchercleanup/main.go b/tests/v2/codecoverage/ranchercleanup/main.go index 534d5b41fc6..427aa2498f2 100644 --- a/tests/v2/codecoverage/ranchercleanup/main.go +++ b/tests/v2/codecoverage/ranchercleanup/main.go @@ -6,12 +6,12 @@ import ( "time" apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/pkg/session" + "github.com/rancher/shepherd/pkg/wait" "github.com/sirupsen/logrus" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/tests/v2/codecoverage/ranchercover/codecoverage_test.go b/tests/v2/codecoverage/ranchercover/codecoverage_test.go index dc516214dc6..1010b32af8b 100644 --- a/tests/v2/codecoverage/ranchercover/codecoverage_test.go +++ b/tests/v2/codecoverage/ranchercover/codecoverage_test.go @@ -3,9 +3,9 @@ package main import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/codecoverage" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/codecoverage" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" ) diff --git a/tests/v2/codecoverage/rancherha/main.go b/tests/v2/codecoverage/rancherha/main.go index ba26ad5d4f0..5b27672e94d 100644 --- a/tests/v2/codecoverage/rancherha/main.go +++ b/tests/v2/codecoverage/rancherha/main.go @@ -1,8 +1,8 @@ package main import ( - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" ) diff --git a/tests/v2/codecoverage/setuprancher/main.go b/tests/v2/codecoverage/setuprancher/main.go index 0f6f1b18154..ed975b90b3f 100644 --- a/tests/v2/codecoverage/setuprancher/main.go +++ b/tests/v2/codecoverage/setuprancher/main.go @@ -6,25 +6,25 @@ import ( "time" "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/dynamic" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/workloads/deployments" - "github.com/rancher/rancher/tests/framework/extensions/pipeline" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - nodepools "github.com/rancher/rancher/tests/framework/extensions/rke1/nodepools" - aws "github.com/rancher/rancher/tests/framework/extensions/rke1/nodetemplates/aws" - "github.com/rancher/rancher/tests/framework/extensions/token" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - "github.com/rancher/rancher/tests/framework/extensions/users" - passwordgenerator "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/dynamic" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/extensions/kubeapi/workloads/deployments" + "github.com/rancher/shepherd/extensions/pipeline" + "github.com/rancher/shepherd/extensions/provisioninginput" + nodepools "github.com/rancher/shepherd/extensions/rke1/nodepools" + aws "github.com/rancher/shepherd/extensions/rke1/nodetemplates/aws" + "github.com/rancher/shepherd/extensions/token" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/extensions/users" + passwordgenerator "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" + "github.com/rancher/shepherd/pkg/wait" "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" appv1 "k8s.io/api/apps/v1" diff --git a/tests/v2/integration/catalogv2/cluster_repo_test.go b/tests/v2/integration/catalogv2/cluster_repo_test.go index 38ca0367a54..3c1cee07085 100644 --- a/tests/v2/integration/catalogv2/cluster_repo_test.go +++ b/tests/v2/integration/catalogv2/cluster_repo_test.go @@ -5,10 +5,10 @@ import ( "time" v1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - stevev1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/clients/rancher/catalog" + stevev1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/integration/catalogv2/system_charts_version_test.go b/tests/v2/integration/catalogv2/system_charts_version_test.go index 31ab3d0cff4..206c20c8130 100644 --- a/tests/v2/integration/catalogv2/system_charts_version_test.go +++ b/tests/v2/integration/catalogv2/system_charts_version_test.go @@ -9,15 +9,15 @@ import ( "github.com/rancher/rancher/pkg/api/scheme" v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - stevev1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/workloads/deployments" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/workloads/pods" - "github.com/rancher/rancher/tests/framework/extensions/kubeconfig" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" "github.com/rancher/rancher/tests/integration/pkg/defaults" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/clients/rancher/catalog" + stevev1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/kubeapi/workloads/deployments" + "github.com/rancher/shepherd/extensions/kubeapi/workloads/pods" + "github.com/rancher/shepherd/extensions/kubeconfig" + "github.com/rancher/shepherd/pkg/session" + "github.com/rancher/shepherd/pkg/wait" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/integration/projects/project_user_test.go b/tests/v2/integration/projects/project_user_test.go index b45f565cf6a..45ea6b81acf 100644 --- a/tests/v2/integration/projects/project_user_test.go +++ b/tests/v2/integration/projects/project_user_test.go @@ -3,12 +3,12 @@ package integration import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/integration/projects/resource_quota_test.go b/tests/v2/integration/projects/resource_quota_test.go index 25026fa265c..461efb232ba 100644 --- a/tests/v2/integration/projects/resource_quota_test.go +++ b/tests/v2/integration/projects/resource_quota_test.go @@ -5,14 +5,14 @@ import ( "fmt" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/resourcequotas" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - steveResourceQuotas "github.com/rancher/rancher/tests/framework/extensions/resourcequotas" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/extensions/kubeapi/resourcequotas" + "github.com/rancher/shepherd/extensions/namespaces" + steveResourceQuotas "github.com/rancher/shepherd/extensions/resourcequotas" + "github.com/rancher/shepherd/pkg/session" + "github.com/rancher/shepherd/pkg/wait" "github.com/stretchr/testify/suite" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" diff --git a/tests/v2/integration/rtbs/rtbs_test.go b/tests/v2/integration/rtbs/rtbs_test.go index e25efb02675..33ceba4f701 100644 --- a/tests/v2/integration/rtbs/rtbs_test.go +++ b/tests/v2/integration/rtbs/rtbs_test.go @@ -3,16 +3,16 @@ package integration import ( "testing" - "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - extauthz "github.com/rancher/rancher/tests/framework/extensions/kubeapi/authorization" - extnamespaces "github.com/rancher/rancher/tests/framework/extensions/kubeapi/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/secrets" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + extauthz "github.com/rancher/shepherd/extensions/kubeapi/authorization" + extnamespaces "github.com/rancher/shepherd/extensions/kubeapi/namespaces" + "github.com/rancher/shepherd/extensions/kubeapi/secrets" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/api/scheme" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" authzv1 "k8s.io/api/authorization/v1" diff --git a/tests/v2/integration/setup/main.go b/tests/v2/integration/setup/main.go index 38f8a8db14b..7001fe1115a 100644 --- a/tests/v2/integration/setup/main.go +++ b/tests/v2/integration/setup/main.go @@ -19,17 +19,17 @@ import ( "github.com/creasty/defaults" provisioningv1api "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" v1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - rancherClient "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/token" - "github.com/rancher/rancher/tests/framework/pkg/config" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - pkgpf "github.com/rancher/rancher/tests/framework/pkg/portforward" "github.com/rancher/rancher/tests/v2prov/clients" "github.com/rancher/rancher/tests/v2prov/cluster" testdefaults "github.com/rancher/rancher/tests/v2prov/defaults" "github.com/rancher/rancher/tests/v2prov/namespace" "github.com/rancher/rancher/tests/v2prov/registry" + rancherClient "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/token" + "github.com/rancher/shepherd/pkg/config" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + pkgpf "github.com/rancher/shepherd/pkg/portforward" "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" diff --git a/tests/v2/integration/steveapi/steve_api_test.go b/tests/v2/integration/steveapi/steve_api_test.go index 903a082b73e..014a0692126 100644 --- a/tests/v2/integration/steveapi/steve_api_test.go +++ b/tests/v2/integration/steveapi/steve_api_test.go @@ -15,21 +15,21 @@ import ( "time" "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - clientv1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - kubenamespaces "github.com/rancher/rancher/tests/framework/extensions/kubeapi/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/rbac" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/secrets" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - stevesecrets "github.com/rancher/rancher/tests/framework/extensions/secrets" - "github.com/rancher/rancher/tests/framework/extensions/serviceaccounts" - "github.com/rancher/rancher/tests/framework/extensions/unstructured" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + clientv1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + kubenamespaces "github.com/rancher/shepherd/extensions/kubeapi/namespaces" + "github.com/rancher/shepherd/extensions/kubeapi/rbac" + "github.com/rancher/shepherd/extensions/kubeapi/secrets" + "github.com/rancher/shepherd/extensions/namespaces" + stevesecrets "github.com/rancher/shepherd/extensions/secrets" + "github.com/rancher/shepherd/extensions/serviceaccounts" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/certrotation/cert_rotation.go b/tests/v2/validation/certrotation/cert_rotation.go index f4edd482eb2..9968460bc9a 100644 --- a/tests/v2/validation/certrotation/cert_rotation.go +++ b/tests/v2/validation/certrotation/cert_rotation.go @@ -5,12 +5,12 @@ import ( apiv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/pkg/wait" + "github.com/rancher/shepherd/clients/rancher" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/pkg/wait" "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/tests/v2/validation/certrotation/cert_rotation_test.go b/tests/v2/validation/certrotation/cert_rotation_test.go index 90b9b0eb3ba..4ea50659e9b 100644 --- a/tests/v2/validation/certrotation/cert_rotation_test.go +++ b/tests/v2/validation/certrotation/cert_rotation_test.go @@ -5,10 +5,10 @@ package certrotation import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/charts/gatekeeper.go b/tests/v2/validation/charts/gatekeeper.go index 04e542f968d..101efa30e26 100644 --- a/tests/v2/validation/charts/gatekeeper.go +++ b/tests/v2/validation/charts/gatekeeper.go @@ -3,9 +3,9 @@ package charts import ( "time" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" "k8s.io/apimachinery/pkg/util/wait" ) diff --git a/tests/v2/validation/charts/gatekeeper_test.go b/tests/v2/validation/charts/gatekeeper_test.go index f4b1109706e..2f4723c82ad 100644 --- a/tests/v2/validation/charts/gatekeeper_test.go +++ b/tests/v2/validation/charts/gatekeeper_test.go @@ -6,14 +6,14 @@ import ( "os" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/clients/rancher/catalog" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/charts/gatekeeperallowednamespaces_test.go b/tests/v2/validation/charts/gatekeeperallowednamespaces_test.go index ec4dffae2f1..adfcb09884c 100644 --- a/tests/v2/validation/charts/gatekeeperallowednamespaces_test.go +++ b/tests/v2/validation/charts/gatekeeperallowednamespaces_test.go @@ -7,10 +7,10 @@ import ( "strings" settings "github.com/rancher/rancher/pkg/settings" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/charts" - namespaces "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/charts" + namespaces "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/pkg/environmentflag" "github.com/stretchr/testify/assert" require "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/tests/v2/validation/charts/gatekeeperallowednamespacespostupgrade_test.go b/tests/v2/validation/charts/gatekeeperallowednamespacespostupgrade_test.go index 8c2592afd7a..7bdf19515db 100644 --- a/tests/v2/validation/charts/gatekeeperallowednamespacespostupgrade_test.go +++ b/tests/v2/validation/charts/gatekeeperallowednamespacespostupgrade_test.go @@ -6,8 +6,8 @@ import ( "strings" settings "github.com/rancher/rancher/pkg/settings" - namespaces "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" + namespaces "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/pkg/environmentflag" "github.com/stretchr/testify/require" ) diff --git a/tests/v2/validation/charts/istio.go b/tests/v2/validation/charts/istio.go index 278c5f15f7e..b5afc20a6c2 100644 --- a/tests/v2/validation/charts/istio.go +++ b/tests/v2/validation/charts/istio.go @@ -7,11 +7,11 @@ import ( "time" "unicode" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - "github.com/rancher/rancher/tests/framework/extensions/workloads" + "github.com/rancher/shepherd/clients/rancher" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/ingresses" + "github.com/rancher/shepherd/extensions/workloads" appv1 "k8s.io/api/apps/v1" kubewait "k8s.io/apimachinery/pkg/util/wait" ) diff --git a/tests/v2/validation/charts/istio_test.go b/tests/v2/validation/charts/istio_test.go index 85ecb4fac09..90b71fb2cba 100644 --- a/tests/v2/validation/charts/istio_test.go +++ b/tests/v2/validation/charts/istio_test.go @@ -12,14 +12,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/clients/rancher/catalog" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/ingresses" + "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/charts/monitoring.go b/tests/v2/validation/charts/monitoring.go index 440fd0da7e4..bc93f1c9dd9 100644 --- a/tests/v2/validation/charts/monitoring.go +++ b/tests/v2/validation/charts/monitoring.go @@ -12,15 +12,15 @@ import ( "github.com/pkg/errors" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/clusterrolebindings" - "github.com/rancher/rancher/tests/framework/extensions/configmaps" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - "github.com/rancher/rancher/tests/framework/extensions/serviceaccounts" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - "github.com/rancher/rancher/tests/framework/pkg/namegenerator" + "github.com/rancher/shepherd/clients/rancher" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusterrolebindings" + "github.com/rancher/shepherd/extensions/configmaps" + "github.com/rancher/shepherd/extensions/ingresses" + "github.com/rancher/shepherd/extensions/serviceaccounts" + "github.com/rancher/shepherd/extensions/workloads" + "github.com/rancher/shepherd/pkg/namegenerator" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/tests/v2/validation/charts/monitoring_test.go b/tests/v2/validation/charts/monitoring_test.go index 25a31eaf402..c2ae1625396 100644 --- a/tests/v2/validation/charts/monitoring_test.go +++ b/tests/v2/validation/charts/monitoring_test.go @@ -10,18 +10,18 @@ import ( "net/url" "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/projects" - "github.com/rancher/rancher/tests/framework/extensions/secrets" - "github.com/rancher/rancher/tests/framework/extensions/services" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/clients/rancher/catalog" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/ingresses" + "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/extensions/projects" + "github.com/rancher/shepherd/extensions/secrets" + "github.com/rancher/shepherd/extensions/services" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/charts/webhook.go b/tests/v2/validation/charts/webhook.go index 783073eab3c..4a5913fa240 100644 --- a/tests/v2/validation/charts/webhook.go +++ b/tests/v2/validation/charts/webhook.go @@ -1,8 +1,8 @@ package charts import ( - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/webhook" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/kubeapi/webhook" ) const ( diff --git a/tests/v2/validation/charts/webhook_test.go b/tests/v2/validation/charts/webhook_test.go index f9d34384fee..66ad932a7ad 100644 --- a/tests/v2/validation/charts/webhook_test.go +++ b/tests/v2/validation/charts/webhook_test.go @@ -6,15 +6,15 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/kubeconfig" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - - "github.com/rancher/rancher/tests/framework/extensions/users" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/clients/rancher/catalog" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/kubeconfig" + "github.com/rancher/shepherd/extensions/workloads/pods" + + "github.com/rancher/shepherd/extensions/users" + "github.com/rancher/shepherd/pkg/session" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/tests/v2/validation/configmaps/generatedfields.go b/tests/v2/validation/configmaps/generatedfields.go index 18f2e8b49da..61e8ced077a 100644 --- a/tests/v2/validation/configmaps/generatedfields.go +++ b/tests/v2/validation/configmaps/generatedfields.go @@ -2,8 +2,8 @@ package configmaps import ( "github.com/pkg/errors" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - cm "github.com/rancher/rancher/tests/framework/extensions/configmaps" + steveV1 "github.com/rancher/shepherd/clients/rancher/v1" + cm "github.com/rancher/shepherd/extensions/configmaps" "github.com/sirupsen/logrus" ) diff --git a/tests/v2/validation/configmaps/generatedfields_test.go b/tests/v2/validation/configmaps/generatedfields_test.go index 0f79a8e6d54..7b7f3baec74 100644 --- a/tests/v2/validation/configmaps/generatedfields_test.go +++ b/tests/v2/validation/configmaps/generatedfields_test.go @@ -7,12 +7,12 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - cm "github.com/rancher/rancher/tests/framework/extensions/configmaps" - "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + steveV1 "github.com/rancher/shepherd/clients/rancher/v1" + cm "github.com/rancher/shepherd/extensions/configmaps" + "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/deleting/delete_cluster_rke1_test.go b/tests/v2/validation/deleting/delete_cluster_rke1_test.go index f6c9bf8e845..e0acbd96c7f 100644 --- a/tests/v2/validation/deleting/delete_cluster_rke1_test.go +++ b/tests/v2/validation/deleting/delete_cluster_rke1_test.go @@ -5,10 +5,10 @@ package deleting import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/deleting/delete_cluster_test.go b/tests/v2/validation/deleting/delete_cluster_test.go index d18110ad08c..8d69b4199e7 100644 --- a/tests/v2/validation/deleting/delete_cluster_test.go +++ b/tests/v2/validation/deleting/delete_cluster_test.go @@ -5,10 +5,10 @@ package deleting import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/replace.go b/tests/v2/validation/nodescaling/replace.go index 2ceedb7d874..6e73a6371a2 100644 --- a/tests/v2/validation/nodescaling/replace.go +++ b/tests/v2/validation/nodescaling/replace.go @@ -4,12 +4,12 @@ import ( "testing" "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/defaults" + nodestat "github.com/rancher/shepherd/extensions/nodes" + "github.com/rancher/shepherd/extensions/workloads/pods" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/v2/validation/nodescaling/scale_replace_rke1_test.go b/tests/v2/validation/nodescaling/scale_replace_rke1_test.go index 31603fd5a5d..030671c56b8 100644 --- a/tests/v2/validation/nodescaling/scale_replace_rke1_test.go +++ b/tests/v2/validation/nodescaling/scale_replace_rke1_test.go @@ -5,10 +5,10 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scale_replace_test.go b/tests/v2/validation/nodescaling/scale_replace_test.go index 34427429ee2..3608b0c14ad 100644 --- a/tests/v2/validation/nodescaling/scale_replace_test.go +++ b/tests/v2/validation/nodescaling/scale_replace_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_custom_cluster_rke1_test.go b/tests/v2/validation/nodescaling/scaling_custom_cluster_rke1_test.go index c139c4c6356..c8c94bba9b9 100644 --- a/tests/v2/validation/nodescaling/scaling_custom_cluster_rke1_test.go +++ b/tests/v2/validation/nodescaling/scaling_custom_cluster_rke1_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - nodepools "github.com/rancher/rancher/tests/framework/extensions/rke1/nodepools" - "github.com/rancher/rancher/tests/framework/extensions/scalinginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + nodepools "github.com/rancher/shepherd/extensions/rke1/nodepools" + "github.com/rancher/shepherd/extensions/scalinginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_custom_cluster_test.go b/tests/v2/validation/nodescaling/scaling_custom_cluster_test.go index 876c6b47832..d8da10980b3 100644 --- a/tests/v2/validation/nodescaling/scaling_custom_cluster_test.go +++ b/tests/v2/validation/nodescaling/scaling_custom_cluster_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/scalinginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/machinepools" + "github.com/rancher/shepherd/extensions/scalinginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_node_driver_aks_test.go b/tests/v2/validation/nodescaling/scaling_node_driver_aks_test.go index bfd50895ce3..1eda2639fbd 100644 --- a/tests/v2/validation/nodescaling/scaling_node_driver_aks_test.go +++ b/tests/v2/validation/nodescaling/scaling_node_driver_aks_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/aks" - "github.com/rancher/rancher/tests/framework/extensions/scalinginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/aks" + "github.com/rancher/shepherd/extensions/scalinginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_node_driver_eks_test.go b/tests/v2/validation/nodescaling/scaling_node_driver_eks_test.go index 5faed696b53..30fcf0b5690 100644 --- a/tests/v2/validation/nodescaling/scaling_node_driver_eks_test.go +++ b/tests/v2/validation/nodescaling/scaling_node_driver_eks_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/eks" - "github.com/rancher/rancher/tests/framework/extensions/scalinginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/eks" + "github.com/rancher/shepherd/extensions/scalinginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_node_driver_gke_test.go b/tests/v2/validation/nodescaling/scaling_node_driver_gke_test.go index 25389251b23..22987f2bc85 100644 --- a/tests/v2/validation/nodescaling/scaling_node_driver_gke_test.go +++ b/tests/v2/validation/nodescaling/scaling_node_driver_gke_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/gke" - "github.com/rancher/rancher/tests/framework/extensions/scalinginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/gke" + "github.com/rancher/shepherd/extensions/scalinginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_node_driver_rke1_test.go b/tests/v2/validation/nodescaling/scaling_node_driver_rke1_test.go index 7976e400977..09323add3dc 100644 --- a/tests/v2/validation/nodescaling/scaling_node_driver_rke1_test.go +++ b/tests/v2/validation/nodescaling/scaling_node_driver_rke1_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - nodepools "github.com/rancher/rancher/tests/framework/extensions/rke1/nodepools" - "github.com/rancher/rancher/tests/framework/extensions/scalinginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + nodepools "github.com/rancher/shepherd/extensions/rke1/nodepools" + "github.com/rancher/shepherd/extensions/scalinginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_node_driver_test.go b/tests/v2/validation/nodescaling/scaling_node_driver_test.go index 09652c311dd..19ae328cfd8 100644 --- a/tests/v2/validation/nodescaling/scaling_node_driver_test.go +++ b/tests/v2/validation/nodescaling/scaling_node_driver_test.go @@ -5,12 +5,12 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/scalinginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/machinepools" + "github.com/rancher/shepherd/extensions/scalinginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/nodescaling/scaling_nodepools.go b/tests/v2/validation/nodescaling/scaling_nodepools.go index d390421ba94..e42d16ed804 100644 --- a/tests/v2/validation/nodescaling/scaling_nodepools.go +++ b/tests/v2/validation/nodescaling/scaling_nodepools.go @@ -3,15 +3,15 @@ package nodescaling import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/aks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/eks" - "github.com/rancher/rancher/tests/framework/extensions/clusters/gke" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - rke1 "github.com/rancher/rancher/tests/framework/extensions/rke1/nodepools" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/aks" + "github.com/rancher/shepherd/extensions/clusters/eks" + "github.com/rancher/shepherd/extensions/clusters/gke" + "github.com/rancher/shepherd/extensions/machinepools" + "github.com/rancher/shepherd/extensions/provisioning" + rke1 "github.com/rancher/shepherd/extensions/rke1/nodepools" + "github.com/rancher/shepherd/extensions/workloads/pods" "github.com/stretchr/testify/require" ) diff --git a/tests/v2/validation/pipeline/downstreamcleanup/main.go b/tests/v2/validation/pipeline/downstreamcleanup/main.go index 62bae713a88..6bf80693d31 100644 --- a/tests/v2/validation/pipeline/downstreamcleanup/main.go +++ b/tests/v2/validation/pipeline/downstreamcleanup/main.go @@ -6,14 +6,14 @@ import ( "time" "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/token" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/file" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/extensions/token" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/file" + "github.com/rancher/shepherd/pkg/session" + "github.com/rancher/shepherd/pkg/wait" "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/tests/v2/validation/pipeline/hapostinstall/main.go b/tests/v2/validation/pipeline/hapostinstall/main.go index 5e0ac93f0ee..4c5b170f3d4 100644 --- a/tests/v2/validation/pipeline/hapostinstall/main.go +++ b/tests/v2/validation/pipeline/hapostinstall/main.go @@ -8,13 +8,13 @@ import ( b64 "encoding/base64" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/pipeline" - "github.com/rancher/rancher/tests/framework/extensions/token" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/file" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/pipeline" + "github.com/rancher/shepherd/extensions/token" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/file" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" kwait "k8s.io/apimachinery/pkg/util/wait" diff --git a/tests/v2/validation/pipeline/qase/reporter/main.go b/tests/v2/validation/pipeline/qase/reporter/main.go index 4a2bfe41051..ec7c985d0d8 100644 --- a/tests/v2/validation/pipeline/qase/reporter/main.go +++ b/tests/v2/validation/pipeline/qase/reporter/main.go @@ -21,6 +21,7 @@ const ( automationSuiteID = int32(14) failStatus = "fail" passStatus = "pass" + skipStatus = "skip" automationTestNameID = 15 testSourceID = 14 testSource = "GoValidation" @@ -118,6 +119,8 @@ func parseCorrectTestCases(testCases []testcase.GoTestOutput) map[string]*testca } else if testCase.Action == "output" && strings.Contains(testCase.Test, "/") { goTestCase := finalTestCases[testCase.Test] goTestCase.StackTrace += testCase.Output + } else if testCase.Action == skipStatus { + delete(finalTestCases, testCase.Test) } else if (testCase.Action == failStatus || testCase.Action == passStatus) && strings.Contains(testCase.Test, "/") { goTestCase := finalTestCases[testCase.Test] @@ -194,19 +197,23 @@ func writeTestCaseToQase(client *qase.APIClient, testCase testcase.GoTestCase) ( func updateTestInRun(client *qase.APIClient, testCase testcase.GoTestCase, qaseTestCaseID, testRunID int64) error { status := fmt.Sprintf("%sed", testCase.Status) - elasedTime, err := strconv.ParseFloat(testCase.Elapsed, 64) - if err != nil { - return err + var elapsedTime float64 + if testCase.Elapsed != "" { + var err error + elapsedTime, err = strconv.ParseFloat(testCase.Elapsed, 64) + if err != nil { + return err + } } resultBody := qase.ResultCreate{ CaseId: qaseTestCaseID, Status: status, Comment: testCase.StackTrace, - Time: int64(elasedTime), + Time: int64(elapsedTime), } - _, _, err = client.ResultsApi.CreateResult(context.TODO(), resultBody, qasedefaults.RancherManagerProjectID, testRunID) + _, _, err := client.ResultsApi.CreateResult(context.TODO(), resultBody, qasedefaults.RancherManagerProjectID, testRunID) if err != nil { return err } diff --git a/tests/v2/validation/pipeline/ranchercleanup/main.go b/tests/v2/validation/pipeline/ranchercleanup/main.go index af538b50b9c..7b990eed11f 100644 --- a/tests/v2/validation/pipeline/ranchercleanup/main.go +++ b/tests/v2/validation/pipeline/ranchercleanup/main.go @@ -6,12 +6,12 @@ import ( "time" apisV1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/pkg/session" + "github.com/rancher/shepherd/pkg/wait" "github.com/sirupsen/logrus" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/tests/v2/validation/pipeline/rancherha/main.go b/tests/v2/validation/pipeline/rancherha/main.go index 6ff87be3f30..7c3cf509659 100644 --- a/tests/v2/validation/pipeline/rancherha/main.go +++ b/tests/v2/validation/pipeline/rancherha/main.go @@ -1,13 +1,13 @@ package main import ( - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/pipeline" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/pipeline/rancherha/corralha" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/pipeline" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" ) diff --git a/tests/v2/validation/pipeline/releaseupgrade/main.go b/tests/v2/validation/pipeline/releaseupgrade/main.go index 44f0eec60c7..f68b199a55e 100644 --- a/tests/v2/validation/pipeline/releaseupgrade/main.go +++ b/tests/v2/validation/pipeline/releaseupgrade/main.go @@ -4,13 +4,13 @@ import ( "fmt" "os" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/pipeline" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - "github.com/rancher/rancher/tests/framework/pkg/file" "github.com/rancher/rancher/tests/v2/validation/upgrade" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/pipeline" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + "github.com/rancher/shepherd/pkg/file" "github.com/sirupsen/logrus" ) diff --git a/tests/v2/validation/prime/prime_test.go b/tests/v2/validation/prime/prime_test.go index 12574d9c38d..12b378ba6de 100644 --- a/tests/v2/validation/prime/prime_test.go +++ b/tests/v2/validation/prime/prime_test.go @@ -5,12 +5,12 @@ package prime import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - prime "github.com/rancher/rancher/tests/framework/extensions/prime" - "github.com/rancher/rancher/tests/framework/extensions/rancherversion" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + prime "github.com/rancher/shepherd/extensions/prime" + "github.com/rancher/shepherd/extensions/rancherversion" + "github.com/rancher/shepherd/extensions/workloads/pods" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/airgap/k3s_custom_cluster_test.go b/tests/v2/validation/provisioning/airgap/k3s_custom_cluster_test.go index 428de63853e..3abe0911797 100644 --- a/tests/v2/validation/provisioning/airgap/k3s_custom_cluster_test.go +++ b/tests/v2/validation/provisioning/airgap/k3s_custom_cluster_test.go @@ -5,17 +5,17 @@ package airgap import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - provisioning "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/pipeline/rancherha/corralha" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" "github.com/rancher/rancher/tests/v2/validation/provisioning/registries" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + provisioning "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/airgap/rke1_custom_cluster_test.go b/tests/v2/validation/provisioning/airgap/rke1_custom_cluster_test.go index 66bc35dde1c..23e50e35d40 100644 --- a/tests/v2/validation/provisioning/airgap/rke1_custom_cluster_test.go +++ b/tests/v2/validation/provisioning/airgap/rke1_custom_cluster_test.go @@ -5,17 +5,17 @@ package airgap import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - provisioning "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/pipeline/rancherha/corralha" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" "github.com/rancher/rancher/tests/v2/validation/provisioning/registries" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + provisioning "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/airgap/rke2_custom_cluster_test.go b/tests/v2/validation/provisioning/airgap/rke2_custom_cluster_test.go index f41f128209e..c3e432bb400 100644 --- a/tests/v2/validation/provisioning/airgap/rke2_custom_cluster_test.go +++ b/tests/v2/validation/provisioning/airgap/rke2_custom_cluster_test.go @@ -5,17 +5,17 @@ package airgap import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - provisioning "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/pipeline/rancherha/corralha" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" "github.com/rancher/rancher/tests/v2/validation/provisioning/registries" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + provisioning "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/hosted/aks/hosted_provisioning_test.go b/tests/v2/validation/provisioning/hosted/aks/hosted_provisioning_test.go index 661a9e26c87..f4dc5821a03 100644 --- a/tests/v2/validation/provisioning/hosted/aks/hosted_provisioning_test.go +++ b/tests/v2/validation/provisioning/hosted/aks/hosted_provisioning_test.go @@ -5,14 +5,14 @@ package provisioning import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/hosted/eks/hosted_provisioning_test.go b/tests/v2/validation/provisioning/hosted/eks/hosted_provisioning_test.go index abbb7860b63..f176fc81548 100644 --- a/tests/v2/validation/provisioning/hosted/eks/hosted_provisioning_test.go +++ b/tests/v2/validation/provisioning/hosted/eks/hosted_provisioning_test.go @@ -5,14 +5,14 @@ package eks import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/hosted/gke/hosted_provisioning_test.go b/tests/v2/validation/provisioning/hosted/gke/hosted_provisioning_test.go index ca7d1af2b0b..313752f8a3e 100644 --- a/tests/v2/validation/provisioning/hosted/gke/hosted_provisioning_test.go +++ b/tests/v2/validation/provisioning/hosted/gke/hosted_provisioning_test.go @@ -5,14 +5,14 @@ package gke import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/hostnametruncation/hostname_truncation_test.go b/tests/v2/validation/provisioning/hostnametruncation/hostname_truncation_test.go index 336ef1373ab..f53abaadbb4 100644 --- a/tests/v2/validation/provisioning/hostnametruncation/hostname_truncation_test.go +++ b/tests/v2/validation/provisioning/hostnametruncation/hostname_truncation_test.go @@ -6,15 +6,15 @@ import ( "fmt" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/machinepools" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/k3s/custom_cluster_test.go b/tests/v2/validation/provisioning/k3s/custom_cluster_test.go index 044d943cacc..0f1a7a80442 100644 --- a/tests/v2/validation/provisioning/k3s/custom_cluster_test.go +++ b/tests/v2/validation/provisioning/k3s/custom_cluster_test.go @@ -5,18 +5,18 @@ package k3s import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/k3s/post_kdm_oob_release_test.go b/tests/v2/validation/provisioning/k3s/post_kdm_oob_release_test.go index 556b12057a8..6d62cdba940 100644 --- a/tests/v2/validation/provisioning/k3s/post_kdm_oob_release_test.go +++ b/tests/v2/validation/provisioning/k3s/post_kdm_oob_release_test.go @@ -5,12 +5,12 @@ package k3s import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/k3s/provisioning_node_driver_test.go b/tests/v2/validation/provisioning/k3s/provisioning_node_driver_test.go index cd0652c5035..0eada83c589 100644 --- a/tests/v2/validation/provisioning/k3s/provisioning_node_driver_test.go +++ b/tests/v2/validation/provisioning/k3s/provisioning_node_driver_test.go @@ -5,18 +5,18 @@ package k3s import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/permutations/permutations.go b/tests/v2/validation/provisioning/permutations/permutations.go index 807da776a1b..e248d0bfaec 100644 --- a/tests/v2/validation/provisioning/permutations/permutations.go +++ b/tests/v2/validation/provisioning/permutations/permutations.go @@ -6,21 +6,21 @@ import ( "testing" provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/projects" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/rke1/componentchecks" - "github.com/rancher/rancher/tests/framework/extensions/services" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + steveV1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/machinepools" + "github.com/rancher/shepherd/extensions/projects" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/rke1/componentchecks" + "github.com/rancher/shepherd/extensions/services" + "github.com/rancher/shepherd/extensions/workloads" + "github.com/rancher/shepherd/extensions/workloads/pods" + "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/registries/registry_test.go b/tests/v2/validation/provisioning/registries/registry_test.go index ef18f8e62b9..10abb9cf7ab 100644 --- a/tests/v2/validation/provisioning/registries/registry_test.go +++ b/tests/v2/validation/provisioning/registries/registry_test.go @@ -6,18 +6,18 @@ import ( "testing" rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/corral" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - provisioning "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/registries" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/corral" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + provisioning "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/registries" + "github.com/rancher/shepherd/extensions/workloads/pods" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/v2/validation/provisioning/rke1/custom_cluster_test.go b/tests/v2/validation/provisioning/rke1/custom_cluster_test.go index 8b307cb45e3..6f5a1cc03b0 100644 --- a/tests/v2/validation/provisioning/rke1/custom_cluster_test.go +++ b/tests/v2/validation/provisioning/rke1/custom_cluster_test.go @@ -5,18 +5,18 @@ package rke1 import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/rke1/post_kdm_oob_release_test.go b/tests/v2/validation/provisioning/rke1/post_kdm_oob_release_test.go index 2c2801170cf..9df81e51434 100644 --- a/tests/v2/validation/provisioning/rke1/post_kdm_oob_release_test.go +++ b/tests/v2/validation/provisioning/rke1/post_kdm_oob_release_test.go @@ -5,12 +5,12 @@ package rke1 import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/rke1/provisioning_node_driver_test.go b/tests/v2/validation/provisioning/rke1/provisioning_node_driver_test.go index 875dfe64ded..83c62bb3d74 100644 --- a/tests/v2/validation/provisioning/rke1/provisioning_node_driver_test.go +++ b/tests/v2/validation/provisioning/rke1/provisioning_node_driver_test.go @@ -5,18 +5,18 @@ package rke1 import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/rke2/ace_test.go b/tests/v2/validation/provisioning/rke2/ace_test.go index d5057c46f08..c98a615610d 100644 --- a/tests/v2/validation/provisioning/rke2/ace_test.go +++ b/tests/v2/validation/provisioning/rke2/ace_test.go @@ -5,16 +5,16 @@ package rke2 import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/machinepools" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/machinepools" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/rke2/custom_cluster_test.go b/tests/v2/validation/provisioning/rke2/custom_cluster_test.go index dd8e52475e5..c19efaae402 100644 --- a/tests/v2/validation/provisioning/rke2/custom_cluster_test.go +++ b/tests/v2/validation/provisioning/rke2/custom_cluster_test.go @@ -5,18 +5,18 @@ package rke2 import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/provisioning/rke2/post_kdm_oob_release_test.go b/tests/v2/validation/provisioning/rke2/post_kdm_oob_release_test.go index 49c29b0ddd6..3f1eaf12fd2 100644 --- a/tests/v2/validation/provisioning/rke2/post_kdm_oob_release_test.go +++ b/tests/v2/validation/provisioning/rke2/post_kdm_oob_release_test.go @@ -5,12 +5,12 @@ package rke2 import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/provisioning/rke2/provisioning_node_driver_test.go b/tests/v2/validation/provisioning/rke2/provisioning_node_driver_test.go index 61091de75db..4fd458510fc 100644 --- a/tests/v2/validation/provisioning/rke2/provisioning_node_driver_test.go +++ b/tests/v2/validation/provisioning/rke2/provisioning_node_driver_test.go @@ -5,18 +5,18 @@ package rke2 import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - password "github.com/rancher/rancher/tests/framework/extensions/users/passwordgenerator" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" "github.com/rancher/rancher/tests/v2/validation/provisioning/permutations" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/publicapi/crdgeneration/crd_generation.go b/tests/v2/validation/publicapi/crdgeneration/crd_generation.go index f4ffddeb20f..cd17f463ab5 100644 --- a/tests/v2/validation/publicapi/crdgeneration/crd_generation.go +++ b/tests/v2/validation/publicapi/crdgeneration/crd_generation.go @@ -6,10 +6,10 @@ import ( "testing" v1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/customresourcedefinitions" - "github.com/rancher/rancher/tests/framework/extensions/kubectl" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/kubeapi/customresourcedefinitions" + "github.com/rancher/shepherd/extensions/kubectl" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/v2/validation/publicapi/crdgeneration/crd_generation_test.go b/tests/v2/validation/publicapi/crdgeneration/crd_generation_test.go index 8e41e777af5..f77ea72d39f 100644 --- a/tests/v2/validation/publicapi/crdgeneration/crd_generation_test.go +++ b/tests/v2/validation/publicapi/crdgeneration/crd_generation_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/rbac/rbac.go b/tests/v2/validation/rbac/rbac.go index 962a9fc23d6..92ab1ae7ba0 100644 --- a/tests/v2/validation/rbac/rbac.go +++ b/tests/v2/validation/rbac/rbac.go @@ -7,14 +7,14 @@ import ( "time" v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/projects" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/extensions/projects" + "github.com/rancher/shepherd/extensions/workloads" + namegen "github.com/rancher/shepherd/pkg/namegenerator" appv1 "k8s.io/api/apps/v1" coreV1 "k8s.io/api/core/v1" kwait "k8s.io/apimachinery/pkg/util/wait" diff --git a/tests/v2/validation/rbac/rbac_additional_test.go b/tests/v2/validation/rbac/rbac_additional_test.go index b0be8025438..3bcc68749f2 100644 --- a/tests/v2/validation/rbac/rbac_additional_test.go +++ b/tests/v2/validation/rbac/rbac_additional_test.go @@ -7,17 +7,17 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - "github.com/rancher/rancher/tests/framework/extensions/projects" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - "github.com/rancher/rancher/tests/framework/extensions/users" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + "github.com/rancher/shepherd/extensions/projects" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/provisioninginput" + "github.com/rancher/shepherd/extensions/users" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/v2/validation/rbac/rbac_etcd_backup_test.go b/tests/v2/validation/rbac/rbac_etcd_backup_test.go index 1a15b1e29e4..589bf53beda 100644 --- a/tests/v2/validation/rbac/rbac_etcd_backup_test.go +++ b/tests/v2/validation/rbac/rbac_etcd_backup_test.go @@ -6,12 +6,12 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/etcdsnapshot" - "github.com/rancher/rancher/tests/framework/extensions/users" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/etcdsnapshot" + "github.com/rancher/shepherd/extensions/users" + "github.com/rancher/shepherd/pkg/session" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/v2/validation/rbac/rbac_psa_test.go b/tests/v2/validation/rbac/rbac_psa_test.go index 32f518e7bb3..8ac8d18a49b 100644 --- a/tests/v2/validation/rbac/rbac_psa_test.go +++ b/tests/v2/validation/rbac/rbac_psa_test.go @@ -7,15 +7,15 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - psadeploy "github.com/rancher/rancher/tests/framework/extensions/psact" - "github.com/rancher/rancher/tests/framework/extensions/users" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/namespaces" + psadeploy "github.com/rancher/shepherd/extensions/psact" + "github.com/rancher/shepherd/extensions/users" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/v2/validation/rbac/rbac_test.go b/tests/v2/validation/rbac/rbac_test.go index b44ba788aca..87d6bb60730 100644 --- a/tests/v2/validation/rbac/rbac_test.go +++ b/tests/v2/validation/rbac/rbac_test.go @@ -6,13 +6,13 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/rbac" - "github.com/rancher/rancher/tests/framework/extensions/users" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/rbac" + "github.com/rancher/shepherd/extensions/users" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/shell/shell_test.go b/tests/v2/validation/shell/shell_test.go index cc6ea106c95..0469b059e97 100644 --- a/tests/v2/validation/shell/shell_test.go +++ b/tests/v2/validation/shell/shell_test.go @@ -6,13 +6,13 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" + "github.com/rancher/shepherd/clients/rancher" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/pkg/session" - steveV1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/settings" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" + steveV1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/settings" + "github.com/rancher/shepherd/extensions/workloads/pods" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/snapshot/snapshot.go b/tests/v2/validation/snapshot/snapshot.go index 595d1f91614..83c26ae5d3d 100644 --- a/tests/v2/validation/snapshot/snapshot.go +++ b/tests/v2/validation/snapshot/snapshot.go @@ -6,17 +6,17 @@ import ( rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" v1 "github.com/rancher/rancher/pkg/generated/norman/apps/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/kubernetesversions" - extdefault "github.com/rancher/rancher/tests/framework/extensions/defaults" - "github.com/rancher/rancher/tests/framework/extensions/etcdsnapshot" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/rancher/rancher/tests/framework/extensions/provisioning" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" + extdefault "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/extensions/etcdsnapshot" + "github.com/rancher/shepherd/extensions/ingresses" + nodestat "github.com/rancher/shepherd/extensions/nodes" + "github.com/rancher/shepherd/extensions/provisioning" + "github.com/rancher/shepherd/extensions/workloads" + "github.com/rancher/shepherd/extensions/workloads/pods" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/v2/validation/snapshot/snapshot_restore_k8s_upgrade_test.go b/tests/v2/validation/snapshot/snapshot_restore_k8s_upgrade_test.go index 9abe871d0a8..7e75eb9e594 100644 --- a/tests/v2/validation/snapshot/snapshot_restore_k8s_upgrade_test.go +++ b/tests/v2/validation/snapshot/snapshot_restore_k8s_upgrade_test.go @@ -5,11 +5,11 @@ package snapshot import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/etcdsnapshot" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/etcdsnapshot" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/snapshot/snapshot_restore_test.go b/tests/v2/validation/snapshot/snapshot_restore_test.go index be632784b9b..37e02d5235f 100644 --- a/tests/v2/validation/snapshot/snapshot_restore_test.go +++ b/tests/v2/validation/snapshot/snapshot_restore_test.go @@ -5,11 +5,11 @@ package snapshot import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/etcdsnapshot" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/etcdsnapshot" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/snapshot/snapshot_restore_upgrade_strategy_test.go b/tests/v2/validation/snapshot/snapshot_restore_upgrade_strategy_test.go index 03b55fa390f..12d17e1fd43 100644 --- a/tests/v2/validation/snapshot/snapshot_restore_upgrade_strategy_test.go +++ b/tests/v2/validation/snapshot/snapshot_restore_upgrade_strategy_test.go @@ -5,11 +5,11 @@ package snapshot import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/etcdsnapshot" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/etcdsnapshot" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/standalone/corral_generic_test.go b/tests/v2/validation/standalone/corral_generic_test.go index ca989819987..da8c795bdef 100644 --- a/tests/v2/validation/standalone/corral_generic_test.go +++ b/tests/v2/validation/standalone/corral_generic_test.go @@ -5,10 +5,10 @@ package standalone import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/corral" + "github.com/rancher/shepherd/clients/corral" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/tests/v2/validation/token/token_test.go b/tests/v2/validation/token/token_test.go index 4072c2f46f1..35eea1fd2f8 100644 --- a/tests/v2/validation/token/token_test.go +++ b/tests/v2/validation/token/token_test.go @@ -5,11 +5,11 @@ package token import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - fv3 "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/tokens" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + fv3 "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/kubeapi/tokens" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/upgrade/config.go b/tests/v2/validation/upgrade/config.go index 9dd980ffa49..933c9d2f799 100644 --- a/tests/v2/validation/upgrade/config.go +++ b/tests/v2/validation/upgrade/config.go @@ -3,9 +3,10 @@ package upgrade import ( "github.com/pkg/errors" "github.com/rancher/norman/types" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/pkg/config" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/pipeline" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/environmentflag" ) type PSACT string @@ -17,19 +18,14 @@ const ( ) type Cluster struct { - Name string `json:"name" yaml:"name" default:""` - VersionToUpgrade string `json:"versionToUpgrade" yaml:"versionToUpgrade" default:""` - PSACT string `json:"psact" yaml:"psact" default:""` - FeaturesToTest Features `json:"enabledFeatures" yaml:"enabledFeatures" default:""` + Name string `json:"name" yaml:"name" default:""` + VersionToUpgrade string `json:"versionToUpgrade" yaml:"versionToUpgrade" default:""` + PSACT string `json:"psact" yaml:"psact" default:""` + FeaturesToTest pipeline.Features `json:"enabledFeatures" yaml:"enabledFeatures" default:""` isLatestVersion bool isUpgradeDisabled bool } -type Features struct { - Chart *bool `json:"chart" yaml:"chart" default:"false"` - Ingress *bool `json:"ingress" yaml:"ingress" default:"false"` -} - type Config struct { Clusters []Cluster `json:"clusters" yaml:"clusters" default:"[]"` } @@ -119,7 +115,7 @@ func loadUpgradeWorkloadConfig(client *rancher.Client) (clusters []Cluster, err cluster.Name = clusterList[i] ingress := false chart := false - cluster.FeaturesToTest = Features{ + cluster.FeaturesToTest = pipeline.Features{ Ingress: &ingress, Chart: &chart, } diff --git a/tests/v2/validation/upgrade/kubernetes.go b/tests/v2/validation/upgrade/kubernetes.go index c772a75e9e9..7bea02b11ca 100644 --- a/tests/v2/validation/upgrade/kubernetes.go +++ b/tests/v2/validation/upgrade/kubernetes.go @@ -9,11 +9,11 @@ import ( "github.com/stretchr/testify/require" apiv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/bundledclusters" - kcluster "github.com/rancher/rancher/tests/framework/extensions/kubeapi/cluster" + "github.com/rancher/shepherd/clients/rancher" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/bundledclusters" + kcluster "github.com/rancher/shepherd/extensions/kubeapi/cluster" kwait "k8s.io/apimachinery/pkg/util/wait" ) diff --git a/tests/v2/validation/upgrade/kubernetes_test.go b/tests/v2/validation/upgrade/kubernetes_test.go index 589ed01b54f..4a4ab98e9a9 100644 --- a/tests/v2/validation/upgrade/kubernetes_test.go +++ b/tests/v2/validation/upgrade/kubernetes_test.go @@ -6,15 +6,15 @@ import ( "strings" "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/clusters/bundledclusters" - "github.com/rancher/rancher/tests/framework/extensions/defaults" - nodestat "github.com/rancher/rancher/tests/framework/extensions/nodes" - "github.com/rancher/rancher/tests/framework/extensions/provisioninginput" - psadeploy "github.com/rancher/rancher/tests/framework/extensions/psact" - "github.com/rancher/rancher/tests/framework/extensions/workloads/pods" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/clusters/bundledclusters" + "github.com/rancher/shepherd/extensions/defaults" + nodestat "github.com/rancher/shepherd/extensions/nodes" + "github.com/rancher/shepherd/extensions/provisioninginput" + psadeploy "github.com/rancher/shepherd/extensions/psact" + "github.com/rancher/shepherd/extensions/workloads/pods" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/tests/v2/validation/upgrade/workload.go b/tests/v2/validation/upgrade/workload.go index 2d4e6ba9daf..fc9a8e77742 100644 --- a/tests/v2/validation/upgrade/workload.go +++ b/tests/v2/validation/upgrade/workload.go @@ -9,17 +9,17 @@ import ( "github.com/rancher/norman/types" "github.com/rancher/rancher/pkg/api/scheme" - "github.com/rancher/rancher/tests/framework/clients/rancher" - management "github.com/rancher/rancher/tests/framework/clients/rancher/generated/management/v3" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - kubeingress "github.com/rancher/rancher/tests/framework/extensions/kubeapi/ingresses" - "github.com/rancher/rancher/tests/framework/extensions/projects" - "github.com/rancher/rancher/tests/framework/extensions/services" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/wait" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/ingresses" + kubeingress "github.com/rancher/shepherd/extensions/kubeapi/ingresses" + "github.com/rancher/shepherd/extensions/projects" + "github.com/rancher/shepherd/extensions/services" + "github.com/rancher/shepherd/extensions/workloads" + "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/wait" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" appv1 "k8s.io/api/apps/v1" diff --git a/tests/v2/validation/upgrade/workload_test.go b/tests/v2/validation/upgrade/workload_test.go index 30be98c0722..e339c3530ad 100644 --- a/tests/v2/validation/upgrade/workload_test.go +++ b/tests/v2/validation/upgrade/workload_test.go @@ -5,17 +5,18 @@ package upgrade import ( "testing" - "github.com/rancher/rancher/tests/framework/clients/rancher" - "github.com/rancher/rancher/tests/framework/clients/rancher/catalog" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/charts" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/ingresses" - "github.com/rancher/rancher/tests/framework/extensions/namespaces" - "github.com/rancher/rancher/tests/framework/extensions/secrets" - "github.com/rancher/rancher/tests/framework/extensions/services" - "github.com/rancher/rancher/tests/framework/extensions/workloads" - "github.com/rancher/rancher/tests/framework/pkg/session" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/clients/rancher/catalog" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/charts" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/ingresses" + "github.com/rancher/shepherd/extensions/namespaces" + "github.com/rancher/shepherd/extensions/pipeline" + "github.com/rancher/shepherd/extensions/secrets" + "github.com/rancher/shepherd/extensions/services" + "github.com/rancher/shepherd/extensions/workloads" + "github.com/rancher/shepherd/pkg/session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -73,7 +74,7 @@ func TestWorkloadUpgradeTestSuite(t *testing.T) { suite.Run(t, new(UpgradeWorkloadTestSuite)) } -func (u *UpgradeWorkloadTestSuite) testPreUpgradeSingleCluster(clusterName string, featuresToTest Features, names *resourceNames) { +func (u *UpgradeWorkloadTestSuite) testPreUpgradeSingleCluster(clusterName string, featuresToTest pipeline.Features, names *resourceNames) { isCattleLabeled := true subSession := u.session.NewSession() @@ -281,7 +282,7 @@ func (u *UpgradeWorkloadTestSuite) testPreUpgradeSingleCluster(clusterName strin } } -func (u *UpgradeWorkloadTestSuite) testPostUpgradeSingleCluster(clusterName string, featuresToTest Features, names *resourceNames) { +func (u *UpgradeWorkloadTestSuite) testPostUpgradeSingleCluster(clusterName string, featuresToTest pipeline.Features, names *resourceNames) { subSession := u.session.NewSession() defer subSession.Cleanup() diff --git a/tests/v2/validation/v2prov/encryption_key_rotation_test.go b/tests/v2/validation/v2prov/encryption_key_rotation_test.go index 76415c94b1a..87084acc32b 100644 --- a/tests/v2/validation/v2prov/encryption_key_rotation_test.go +++ b/tests/v2/validation/v2prov/encryption_key_rotation_test.go @@ -11,16 +11,16 @@ import ( apiv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" - "github.com/rancher/rancher/tests/framework/clients/rancher" - v1 "github.com/rancher/rancher/tests/framework/clients/rancher/v1" - "github.com/rancher/rancher/tests/framework/extensions/clusters" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi" - "github.com/rancher/rancher/tests/framework/extensions/kubeapi/secrets" - "github.com/rancher/rancher/tests/framework/pkg/environmentflag" - namegen "github.com/rancher/rancher/tests/framework/pkg/namegenerator" - "github.com/rancher/rancher/tests/framework/pkg/session" - "github.com/rancher/rancher/tests/framework/pkg/wait" "github.com/rancher/rancher/tests/integration/pkg/defaults" + "github.com/rancher/shepherd/clients/rancher" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/kubeapi" + "github.com/rancher/shepherd/extensions/kubeapi/secrets" + "github.com/rancher/shepherd/pkg/environmentflag" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" + "github.com/rancher/shepherd/pkg/wait" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" corev1 "k8s.io/api/core/v1"