Skip to content

Commit

Permalink
Remove shell
Browse files Browse the repository at this point in the history
  • Loading branch information
petersutter committed May 9, 2022
1 parent 977c718 commit cd9469f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ Object {
"terminalEnabled": false,
},
"gardenctl": Object {
"legacyCommands": true,
"shell": "bash",
"legacyCommands": false
},
"helpMenuItems": Array [
Object {
Expand Down
1 change: 0 additions & 1 deletion charts/gardener-dashboard/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ data:
{{- if .Values.frontendConfig.gardenctl }}
gardenctl:
legacyCommands: {{ .Values.frontendConfig.gardenctl.legacyCommands | default false }}
shell: {{ .Values.frontendConfig.gardenctl.shell | default "bash" }}
{{- end }}
{{- if .Values.frontendConfig.defaultNodesCIDR }}
defaultNodesCIDR: {{ .Values.frontendConfig.defaultNodesCIDR }}
Expand Down
7 changes: 3 additions & 4 deletions charts/gardener-dashboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ resources:
cpu: 100m
memory: 120Mi

# If dashboard is running in an environment with less than 1.5GB of available memory
# you should cap the maximum available "old space". In a Docker-512MB-Container,
# If dashboard is running in an environment with less than 1.5GB of available memory
# you should cap the maximum available "old space". In a Docker-512MB-Container,
# the value should not be greater than 90% of the available memory.
# nodeOptions: [--optimize-for-size, --max-old-space-size=460, --gc-interval=100]

Expand Down Expand Up @@ -251,8 +251,7 @@ frontendConfig:
# gardenctl - configure the default settings for the gardenctl commands
gardenctl:
legacyCommands: true # false to show gardenctl-v2 commands by default, true to show the legacy gardenctl commands. Can be overwritten by the user.
shell: bash # default shell. Should be one of bash, fish, powershell, zsh. Can be overwritten by the user.


defaultNodesCIDR: 10.250.0.0/16 # default CIDR used for nodes network when creating new shoots

# # github configuration of the ticket feature
Expand Down
21 changes: 0 additions & 21 deletions frontend/src/components/GardenctlSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ SPDX-License-Identifier: Apache-2.0
color="primary"
></v-radio>
</v-radio-group>
<v-select
v-show="!legacyCommands"
color="primary"
item-color="primary"
label="Shell"
:items="['bash', 'fish', 'powershell', 'zsh']"
hint="Choose for which shell the commands should be displayed"
persistent-hint
v-model="shell"
></v-select>
</v-card-text>
</v-card>
</template>
Expand All @@ -57,17 +47,6 @@ export default {
legacyCommands: value
})
}
},
shell: {
get () {
return this.gardenctlOptions.shell
},
set (value) {
this.setGardenctlOptions({
...this.$store.state.gardenctlOptions,
shell: value
})
}
}
},
methods: {
Expand Down
32 changes: 4 additions & 28 deletions frontend/src/components/ShootDetails/GardenctlCommands.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import CodeBlock from '@/components/CodeBlock'
import { shootItem } from '@/mixins/shootItem'
import { mapState, mapGetters } from 'vuex'
import get from 'lodash/get'
import includes from 'lodash/includes'
import Vue from 'vue'

export default {
Expand Down Expand Up @@ -112,17 +111,16 @@ export default {
}

const gardenctlVersion = this.legacyCommands ? 'Legacy gardenctl' : 'Gardenctl-v2'
const additionalInfo = this.legacyCommands ? '' : `(${this.shell})`
return [
{
title: 'Target Control Plane',
subtitle: `${gardenctlVersion} command to target the control plane of the shoot cluster ${additionalInfo}`,
subtitle: `${gardenctlVersion} command to target the control plane of the shoot cluster`,
value: this.targetControlPlaneCommand,
displayValue: displayValue(this.targetControlPlaneCommand)
},
{
title: 'Target Cluster',
subtitle: `${gardenctlVersion} command to target the shoot cluster ${additionalInfo}`,
subtitle: `${gardenctlVersion} command to target the shoot cluster`,
value: this.targetShootCommand,
displayValue: displayValue(this.targetShootCommand)
}
Expand All @@ -131,15 +129,6 @@ export default {
legacyCommands () {
return get(this.gardenctlOptions, 'legacyCommands', false)
},
shell () {
const shell = get(this.gardenctlOptions, 'shell')

if (!includes(['bash', 'fish', 'powershell', 'zsh'], shell)) {
return 'bash'
}

return shell
},
targetControlPlaneCommand () {
if (this.legacyCommands) {
return this.targetControlPlaneCommandV1
Expand Down Expand Up @@ -182,7 +171,7 @@ export default {

args.push('--control-plane')

return `gardenctl target ${args.join(' ')} && ${this.kubectlEnvCommandV2}`
return `gardenctl target ${args.join(' ')}`
},
targetShootCommandV1 () {
const args = []
Expand Down Expand Up @@ -210,10 +199,7 @@ export default {
args.push(`--shoot ${this.shootName}`)
}

return `gardenctl target ${args.join(' ')} && ${this.kubectlEnvCommandV2}`
},
kubectlEnvCommandV2 () {
return this.invokeCommandString(`gardenctl kubectl-env ${this.shell}`)
return `gardenctl target ${args.join(' ')}`
}
},
methods: {
Expand All @@ -225,16 +211,6 @@ export default {
},
toggle (index) {
Vue.set(this.expansionPanel, index, !this.expansionPanel[index])
},
invokeCommandString (command) {
switch (this.shell) {
case 'powershell':
return `& ${command} | Invoke-Expression`
case 'fish':
return `eval (${command})`
default:
return `eval $(${command})`
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,6 @@ const getters = {
defaultGardenctlOptions (state) {
return {
legacyCommands: false,
shell: 'bash',
...get(state, 'cfg.gardenctl')
}
},
Expand Down

0 comments on commit cd9469f

Please sign in to comment.