diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index b6148bc0a75..65ee0959841 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -1.66.0 +1.67.0 diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/cluster_form_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/cluster_form_dropdown.vue index f9465da6fda..3c6da43c4c4 100644 --- a/app/assets/javascripts/create_cluster/eks_cluster/components/cluster_form_dropdown.vue +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/cluster_form_dropdown.vue @@ -3,6 +3,8 @@ import DropdownSearchInput from '~/vue_shared/components/dropdown/dropdown_searc import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidden_input.vue'; import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue'; +const findItem = (items, valueProp, value) => items.find(item => item[valueProp] === value); + export default { components: { DropdownButton, @@ -26,7 +28,7 @@ export default { default: '', }, value: { - type: Object, + type: [Object, String], required: false, default: () => null, }, @@ -93,8 +95,8 @@ export default { }, data() { return { + selectedItem: findItem(this.items, this.value), searchQuery: '', - selectedItem: null, }; }, computed: { @@ -127,10 +129,15 @@ export default { return (this.selectedItem && this.selectedItem[this.valueProperty]) || ''; }, }, + watch: { + value(value) { + this.selectedItem = findItem(this.items, this.valueProperty, value); + }, + }, methods: { select(item) { this.selectedItem = item; - this.$emit('input', item); + this.$emit('input', item[this.valueProperty]); }, }, }; diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue index 6f6b9ad025a..94a446f1721 100644 --- a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue @@ -3,12 +3,15 @@ import { createNamespacedHelpers, mapState, mapActions } from 'vuex'; import { sprintf, s__ } from '~/locale'; import ClusterFormDropdown from './cluster_form_dropdown.vue'; import RegionDropdown from './region_dropdown.vue'; -import RoleNameDropdown from './role_name_dropdown.vue'; import SecurityGroupDropdown from './security_group_dropdown.vue'; +const { mapState: mapRolesState, mapActions: mapRolesActions } = createNamespacedHelpers('roles'); const { mapState: mapRegionsState, mapActions: mapRegionsActions } = createNamespacedHelpers( 'regions', ); +const { mapState: mapKeyPairsState, mapActions: mapKeyPairsActions } = createNamespacedHelpers( + 'keyPairs', +); const { mapState: mapVpcsState, mapActions: mapVpcActions } = createNamespacedHelpers('vpcs'); const { mapState: mapSubnetsState, mapActions: mapSubnetActions } = createNamespacedHelpers( 'subnets', @@ -18,16 +21,31 @@ export default { components: { ClusterFormDropdown, RegionDropdown, - RoleNameDropdown, SecurityGroupDropdown, }, computed: { - ...mapState(['selectedRegion', 'selectedVpc', 'selectedSubnet']), + ...mapState([ + 'selectedRegion', + 'selectedKeyPair', + 'selectedVpc', + 'selectedSubnet', + 'selectedRole', + ]), + ...mapRolesState({ + roles: 'items', + isLoadingRoles: 'isLoadingItems', + loadingRolesError: 'loadingItemsError', + }), ...mapRegionsState({ regions: 'items', isLoadingRegions: 'isLoadingItems', loadingRegionsError: 'loadingItemsError', }), + ...mapKeyPairsState({ + keyPairs: 'items', + isLoadingKeyPairs: 'isLoadingItems', + loadingKeyPairsError: 'loadingItemsError', + }), ...mapVpcsState({ vpcs: 'items', isLoadingVpcs: 'isLoadingItems', @@ -41,9 +59,38 @@ export default { vpcDropdownDisabled() { return !this.selectedRegion; }, + keyPairDropdownDisabled() { + return !this.selectedRegion; + }, subnetDropdownDisabled() { return !this.selectedVpc; }, + roleDropdownHelpText() { + return sprintf( + s__( + 'ClusterIntegration|Select the IAM Role to allow Amazon EKS and the Kubernetes control plane to manage AWS resources on your behalf. To use a new role name, first create one on %{startLink}Amazon Web Services%{endLink}.', + ), + { + startLink: + '', + endLink: '', + }, + false, + ); + }, + keyPairDropdownHelpText() { + return sprintf( + s__( + 'ClusterIntegration|Select the key pair name that will be used to create EC2 nodes. To use a new key pair name, first create one on %{startLink}Amazon Web Services%{endLink}.', + ), + { + startLink: + '', + endLink: '', + }, + false, + ); + }, vpcDropdownHelpText() { return sprintf( s__( @@ -73,15 +120,19 @@ export default { }, mounted() { this.fetchRegions(); + this.fetchRoles(); }, methods: { - ...mapActions(['setRegion', 'setVpc', 'setSubnet']), + ...mapActions(['setRegion', 'setVpc', 'setSubnet', 'setRole', 'setKeyPair']), ...mapRegionsActions({ fetchRegions: 'fetchItems' }), ...mapVpcActions({ fetchVpcs: 'fetchItems' }), ...mapSubnetActions({ fetchSubnets: 'fetchItems' }), - setRegionAndFetchVpcs(region) { + ...mapRolesActions({ fetchRoles: 'fetchItems' }), + ...mapKeyPairsActions({ fetchKeyPairs: 'fetchItems' }), + setRegionAndFetchVpcsAndKeyPairs(region) { this.setRegion({ region }); this.fetchVpcs({ region }); + this.fetchKeyPairs({ region }); }, setVpcAndFetchSubnets(vpc) { this.setVpc({ vpc }); @@ -93,27 +144,57 @@ export default {