@rancher/shell 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/styles/base/_basic.scss +0 -1
- package/assets/styles/base/_variables.scss +2 -0
- package/assets/styles/global/_labeled-input.scss +6 -1
- package/assets/styles/global/_select.scss +9 -0
- package/assets/styles/vendor/vue-js-modal.scss +4 -0
- package/assets/translations/en-us.yaml +240 -16
- package/assets/translations/zh-hans.yaml +335 -111
- package/chart/example.vue +1 -1
- package/chart/istio.vue +2 -2
- package/chart/logging/index.vue +2 -2
- package/chart/monitoring/alerting/index.vue +2 -2
- package/chart/monitoring/grafana/index.vue +2 -2
- package/chart/monitoring/index.vue +2 -2
- package/chart/monitoring/prometheus/index.vue +4 -4
- package/chart/rancher-alerting-drivers.vue +17 -3
- package/chart/rancher-backup/S3.vue +37 -4
- package/chart/rancher-backup/index.vue +3 -3
- package/cloud-credential/aws.vue +1 -1
- package/cloud-credential/azure.vue +1 -1
- package/cloud-credential/digitalocean.vue +1 -1
- package/cloud-credential/gcp.vue +1 -1
- package/cloud-credential/generic.vue +1 -1
- package/cloud-credential/harvester.vue +2 -2
- package/cloud-credential/linode.vue +1 -1
- package/cloud-credential/s3.vue +2 -2
- package/cloud-credential/vmwarevsphere.vue +1 -1
- package/components/ActionMenu.vue +11 -1
- package/components/Alert.vue +1 -1
- package/components/AssignTo.vue +2 -2
- package/components/AsyncButton.vue +25 -12
- package/components/AwsComplianceBanner.vue +44 -0
- package/components/BannerGraphic.vue +11 -2
- package/components/ChartReadme.vue +10 -2
- package/components/CompoundStatusBadge.vue +50 -0
- package/components/CopyToClipboardText.vue +25 -4
- package/components/CruResource.vue +185 -16
- package/components/CruResourceFooter.vue +17 -1
- package/components/EtcdInfoBanner.vue +1 -1
- package/components/FilterLabel.vue +254 -0
- package/components/GlobalRoleBindings.vue +2 -2
- package/components/GrafanaDashboard.vue +1 -1
- package/components/GrowlManager.vue +20 -9
- package/components/HarvesterServiceAddOnConfig.vue +2 -2
- package/components/Import.vue +2 -2
- package/components/LandingPagePreference.vue +2 -2
- package/components/Markdown.vue +44 -12
- package/components/ModalWithCard.vue +2 -2
- package/components/MoveModal.vue +1 -1
- package/components/PercentageBar.vue +1 -1
- package/components/PromptChangePassword.vue +1 -1
- package/components/PromptModal.vue +13 -2
- package/components/PromptRemove.vue +64 -33
- package/components/PromptRestore.vue +3 -3
- package/components/Questions/Boolean.vue +1 -1
- package/components/Questions/Float.vue +1 -1
- package/components/Questions/Int.vue +1 -1
- package/components/Questions/Reference.vue +1 -1
- package/components/Questions/String.vue +1 -1
- package/components/RelatedResources.vue +1 -1
- package/components/RelatedWorkloadsTable.vue +3 -1
- package/components/ResourceDetail/Masthead.vue +27 -9
- package/components/ResourceDetail/index.vue +72 -7
- package/components/ResourceList/Masthead.vue +22 -0
- package/components/ResourceList/ResourceLoadingIndicator.vue +137 -0
- package/components/ResourceList/index.vue +42 -7
- package/components/ResourceTable.vue +11 -2
- package/components/ResourceYaml.vue +7 -1
- package/components/SelectIconGrid.vue +14 -1
- package/components/SortableTable/THead.vue +1 -1
- package/components/SortableTable/debug.js +117 -0
- package/components/SortableTable/index.vue +200 -43
- package/components/SortableTable/paging.js +2 -12
- package/components/SortableTable/selection.js +3 -0
- package/components/SortableTable/sorting.js +3 -1
- package/components/Tabbed/Tab.vue +25 -4
- package/components/Tabbed/index.vue +133 -119
- package/components/TypeDescription.vue +1 -1
- package/components/VMConsoleBar.vue +1 -1
- package/components/Wizard.vue +53 -14
- package/components/YamlEditor.vue +10 -0
- package/components/__tests__/CopyCode.test.ts +1 -7
- package/components/__tests__/CruResource.test.ts +1 -8
- package/components/auth/AllowedPrincipals.vue +1 -1
- package/components/auth/AuthBanner.vue +2 -1
- package/components/auth/AzureWarning.vue +69 -0
- package/components/auth/RoleDetailEdit.vue +4 -4
- package/components/auth/login/ldap.vue +1 -1
- package/components/cards/ApplicationCard.vue +140 -0
- package/components/dialog/AddClusterMemberDialog.vue +1 -1
- package/components/dialog/AddCustomBadgeDialog.vue +4 -4
- package/components/dialog/AddProjectMemberDialog.vue +2 -2
- package/components/dialog/AddonConfigConfirmationDialog.vue +1 -1
- package/components/dialog/DrainNode.vue +3 -3
- package/components/dialog/ForceMachineRemoveDialog.vue +2 -2
- package/components/dialog/GenericPrompt.vue +2 -2
- package/components/dialog/RollbackWorkloadDialog.vue +2 -2
- package/components/dialog/RotateCertificatesDialog.vue +3 -3
- package/components/dialog/RotateEncryptionKeyDialog.vue +11 -6
- package/components/dialog/SaveAsRKETemplateDialog.vue +3 -3
- package/components/dialog/harvester/AddHotplugModal.vue +3 -3
- package/components/dialog/harvester/BackupModal.vue +3 -3
- package/components/dialog/harvester/CloneTemplate.vue +3 -3
- package/components/dialog/harvester/EjectCDROMDialog.vue +3 -3
- package/components/dialog/harvester/ExportImageDialog.vue +3 -3
- package/components/dialog/harvester/MaintenanceDialog.vue +2 -2
- package/components/dialog/harvester/MigrationDialog.vue +2 -2
- package/components/dialog/harvester/RestoreDialog.vue +2 -2
- package/components/dialog/harvester/SupportBundle.vue +2 -2
- package/components/dialog/harvester/UnplugVolume.vue +2 -2
- package/components/fleet/FleetBundleResources.vue +1 -1
- package/components/fleet/FleetBundles.vue +1 -1
- package/components/fleet/FleetResources.vue +5 -3
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +17 -0
- package/components/fleet/ForceDirectedTreeChart/index.vue +553 -0
- package/components/form/ArrayList.vue +22 -3
- package/components/form/BannerSettings.vue +3 -3
- package/components/form/ChangePassword.vue +2 -2
- package/components/form/Command.vue +28 -9
- package/components/form/Error.vue +50 -0
- package/components/form/Footer.vue +2 -5
- package/components/form/HealthCheck.vue +2 -2
- package/components/form/HookOption.vue +2 -2
- package/components/form/InputWithSelect.vue +12 -2
- package/components/form/KeyValue.vue +5 -2
- package/components/form/LabeledSelect.vue +27 -14
- package/components/form/Labels.vue +12 -0
- package/components/form/MatchExpressions.vue +44 -10
- package/components/form/Members/ClusterPermissionsEditor.vue +3 -3
- package/components/form/Members/MembershipEditor.vue +10 -1
- package/components/form/Members/ProjectMembershipEditor.vue +1 -0
- package/components/form/NameNsDescription.vue +202 -79
- package/components/form/Networking.vue +1 -1
- package/components/form/NodeAffinity.vue +41 -26
- package/components/form/NodeScheduling.vue +29 -3
- package/components/form/NotificationSettings.vue +2 -2
- package/components/form/Password.vue +1 -1
- package/components/form/PodAffinity.vue +64 -6
- package/components/form/PodSecurity.vue +2 -2
- package/components/form/Ports.vue +1 -1
- package/components/form/Probe.vue +60 -17
- package/components/form/ProjectMemberEditor.vue +3 -3
- package/components/form/ResourceQuota/NamespaceRow.vue +46 -2
- package/components/form/ResourceQuota/Project.vue +4 -0
- package/components/form/ResourceTabs/index.vue +19 -7
- package/components/form/RuleSelector.vue +1 -1
- package/components/form/Security.vue +56 -14
- package/components/form/Select.vue +52 -10
- package/components/form/SelectOrCreateAuthSecret.vue +70 -31
- package/components/form/ServiceNameSelect.vue +1 -1
- package/components/form/ServicePorts.vue +10 -2
- package/components/form/ShellInput.vue +1 -1
- package/components/form/SimpleSecretSelector.vue +2 -2
- package/components/form/Tolerations.vue +1 -1
- package/components/form/UnitInput.vue +12 -3
- package/components/form/ValueFromResource.vue +1 -1
- package/components/form/WorkloadPorts.vue +1 -1
- package/components/form/__tests__/Command.test.ts +63 -0
- package/components/form/__tests__/Error.test.ts +56 -0
- package/components/form/__tests__/MatchExpressions.test.ts +79 -0
- package/components/form/__tests__/Probe.test.ts +62 -0
- package/components/form/__tests__/Security.test.ts +55 -0
- package/components/form/__tests__/UnitInput.test.ts +31 -23
- package/components/formatter/BadgeStateFormatter.vue +1 -1
- package/components/formatter/Capitalize.vue +7 -0
- package/components/formatter/ClusterLink.vue +6 -2
- package/components/formatter/ClusterProvider.vue +36 -0
- package/components/formatter/DelayedValue.vue +43 -0
- package/components/formatter/Endpoints.vue +2 -2
- package/components/formatter/HarvesterDiskState.vue +1 -1
- package/components/formatter/HarvesterIpAddress.vue +37 -18
- package/components/formatter/HarvesterMigrationState.vue +1 -1
- package/components/formatter/HarvesterVmState.vue +1 -1
- package/components/formatter/LinkDetail.vue +11 -2
- package/components/formatter/LinkName.vue +2 -2
- package/components/formatter/LiveExpiryBadgeState.vue +1 -1
- package/components/formatter/LivePodRestarts.vue +47 -0
- package/components/formatter/MachineSummaryGraph.vue +51 -5
- package/components/formatter/PodsUsage.vue +5 -3
- package/components/formatter/Weight.vue +1 -1
- package/components/formatter/WorkloadHealthScale.vue +17 -6
- package/components/nav/HarvesterUpgrade.vue +15 -5
- package/components/nav/Header.vue +15 -6
- package/components/nav/Jump.vue +1 -1
- package/components/nav/NamespaceFilter.vue +30 -10
- package/components/nav/TopLevelMenu.vue +52 -14
- package/components/nav/WindowManager/ContainerLogs.vue +14 -2
- package/components/nav/WorkspaceSwitcher.vue +1 -1
- package/components/{NovncConsole.vue → novnc/NovncConsole.vue} +0 -0
- package/components/novnc/NovncConsoleItem.vue +89 -0
- package/components/novnc/NovncConsoleWrapper.vue +243 -0
- package/config/labels-annotations.js +6 -2
- package/config/product/explorer.js +7 -3
- package/config/product/fleet.js +4 -1
- package/config/product/manager.js +5 -6
- package/config/product/settings.js +12 -1
- package/config/query-params.js +2 -0
- package/config/roles.ts +5 -0
- package/config/settings.js +60 -63
- package/config/table-headers.js +47 -18
- package/config/types.js +24 -8
- package/content/docs/en-us/whats-new.md +25 -0
- package/core/plugin.ts +12 -2
- package/creators/app/init +7 -1
- package/creators/pkg/tsconfig.json +2 -3
- package/detail/catalog.cattle.io.app.vue +1 -1
- package/detail/cis.cattle.io.clusterscan.vue +1 -1
- package/detail/fleet.cattle.io.bundle.vue +73 -21
- package/detail/fleet.cattle.io.gitrepo.vue +5 -4
- package/detail/harvesterhci.io.host/HarvesterHostBasic.vue +25 -4
- package/detail/harvesterhci.io.host/HarvesterHostDisk.vue +2 -2
- package/detail/harvesterhci.io.virtualmachinebackup/index.vue +1 -1
- package/detail/helm.cattle.io.projecthelmchart.vue +1 -1
- package/detail/networking.k8s.io.ingress.vue +10 -2
- package/detail/pod.vue +37 -1
- package/detail/provisioning.cattle.io.cluster.vue +102 -15
- package/detail/workload/index.vue +163 -15
- package/edit/auth/azuread.vue +146 -34
- package/edit/auth/github.vue +3 -3
- package/edit/auth/googleoauth.vue +3 -3
- package/edit/auth/ldap/config.vue +15 -7
- package/edit/auth/ldap/index.vue +2 -2
- package/edit/auth/oidc.vue +3 -3
- package/edit/auth/saml.vue +3 -3
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +1 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +2 -2
- package/edit/cis.cattle.io.clusterscan.vue +4 -4
- package/edit/cis.cattle.io.clusterscanbenchmark.vue +1 -1
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -1
- package/edit/fleet.cattle.io.cluster.vue +1 -0
- package/edit/fleet.cattle.io.clustergroup.vue +1 -1
- package/edit/fleet.cattle.io.gitrepo.vue +290 -157
- package/edit/harvesterhci.io.host/HarvesterDisk.vue +4 -5
- package/edit/harvesterhci.io.host/index.vue +28 -19
- package/edit/harvesterhci.io.keypair.vue +1 -1
- package/edit/harvesterhci.io.managedchart/rancher-monitoring.vue +1 -1
- package/edit/harvesterhci.io.management.cluster.vue +1 -1
- package/edit/harvesterhci.io.networkattachmentdefinition.vue +2 -2
- package/edit/harvesterhci.io.setting/additional-ca.vue +1 -1
- package/edit/harvesterhci.io.setting/backup-target.vue +1 -1
- package/edit/harvesterhci.io.setting/http-proxy.vue +1 -1
- package/edit/harvesterhci.io.setting/index.vue +3 -3
- package/edit/harvesterhci.io.setting/overcommit-config.vue +4 -1
- package/edit/harvesterhci.io.setting/ssl-parameters.vue +1 -1
- package/edit/harvesterhci.io.setting/support-bundle-image.vue +1 -1
- package/edit/harvesterhci.io.setting/vip-pools.vue +1 -1
- package/edit/harvesterhci.io.setting/vm-force-reset-policy.vue +2 -2
- package/edit/harvesterhci.io.virtualmachinebackup.vue +2 -2
- package/edit/harvesterhci.io.virtualmachineimage.vue +2 -2
- package/edit/harvesterhci.io.virtualmachinetemplateversion.vue +26 -18
- package/edit/helm.cattle.io.projecthelmchart.vue +3 -3
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +2 -2
- package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue +1 -1
- package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue +1 -1
- package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue +1 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue +2 -1
- package/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue +3 -1
- package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/__tests__/HarvesterEditNetwork.test.ts +41 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue +79 -36
- package/edit/kubevirt.io.virtualmachine/VirtualMachineReserved.vue +54 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue +1 -1
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue +2 -3
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditContainer.test.ts +40 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditExisting.test.ts +102 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVMImage.test.ts +117 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVolume.test.ts +74 -0
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue +59 -13
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue +72 -16
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue +74 -14
- package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue +35 -9
- package/edit/kubevirt.io.virtualmachine/index.vue +33 -24
- package/edit/logging-flow/index.vue +1 -1
- package/edit/logging.banzaicloud.io.output/index.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/file.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/logdna.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +1 -1
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +2 -2
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +2 -0
- package/edit/management.cattle.io.node.vue +71 -0
- package/edit/management.cattle.io.project.vue +28 -23
- package/edit/management.cattle.io.setting.vue +14 -3
- package/edit/management.cattle.io.user.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +13 -13
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +18 -10
- package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +2 -2
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +12 -7
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +12 -7
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +20 -11
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +13 -8
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +25 -7
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +2 -2
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +20 -7
- package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +1 -1
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +19 -8
- package/edit/monitoring.coreos.com.receiver/auth.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/index.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/tls.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/types/email.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +2 -2
- package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/types/webhook.vue +3 -3
- package/edit/monitoring.coreos.com.route.vue +2 -2
- package/edit/namespace.vue +0 -8
- package/edit/network.harvesterhci.io.clusternetwork/vlan.vue +1 -1
- package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +2 -2
- package/edit/networking.istio.io.destinationrule/index.vue +1 -1
- package/edit/networking.k8s.io.ingress/Certificate.vue +5 -1
- package/edit/networking.k8s.io.ingress/Certificates.vue +5 -0
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +17 -2
- package/edit/networking.k8s.io.ingress/IngressClass.vue +63 -0
- package/edit/networking.k8s.io.ingress/Rule.vue +42 -6
- package/edit/networking.k8s.io.ingress/RulePath.vue +29 -5
- package/edit/networking.k8s.io.ingress/Rules.vue +11 -0
- package/edit/networking.k8s.io.ingress/index.vue +104 -15
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +1 -1
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +2 -2
- package/edit/networking.k8s.io.networkpolicy/index.vue +2 -2
- package/edit/persistentvolume/index.vue +1 -1
- package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +2 -2
- package/edit/persistentvolume/plugins/azureDisk.vue +2 -2
- package/edit/persistentvolume/plugins/azureFile.vue +2 -2
- package/edit/persistentvolume/plugins/cephfs.vue +4 -4
- package/edit/persistentvolume/plugins/cinder.vue +2 -2
- package/edit/persistentvolume/plugins/csi.vue +2 -2
- package/edit/persistentvolume/plugins/fc.vue +4 -4
- package/edit/persistentvolume/plugins/flexVolume.vue +2 -2
- package/edit/persistentvolume/plugins/flocker.vue +1 -1
- package/edit/persistentvolume/plugins/gcePersistentDisk.vue +2 -2
- package/edit/persistentvolume/plugins/glusterfs.vue +2 -2
- package/edit/persistentvolume/plugins/hostPath.vue +1 -1
- package/edit/persistentvolume/plugins/iscsi.vue +4 -4
- package/edit/persistentvolume/plugins/local.vue +1 -1
- package/edit/persistentvolume/plugins/longhorn.vue +2 -2
- package/edit/persistentvolume/plugins/nfs.vue +2 -2
- package/edit/persistentvolume/plugins/photonPersistentDisk.vue +1 -1
- package/edit/persistentvolume/plugins/portworxVolume.vue +2 -2
- package/edit/persistentvolume/plugins/quobyte.vue +2 -2
- package/edit/persistentvolume/plugins/rbd.vue +4 -4
- package/edit/persistentvolume/plugins/scaleIO.vue +2 -2
- package/edit/persistentvolume/plugins/storageos.vue +2 -2
- package/edit/persistentvolume/plugins/vsphereVolume.vue +1 -1
- package/edit/persistentvolumeclaim.vue +24 -8
- package/edit/provisioning.cattle.io.cluster/ACE.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +8 -3
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +15 -3
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +16 -3
- package/edit/provisioning.cattle.io.cluster/S3Config.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +1 -7
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +26 -7
- package/edit/provisioning.cattle.io.cluster/rke2.vue +136 -48
- package/edit/resources.cattle.io.backup.vue +26 -8
- package/edit/resources.cattle.io.restore.vue +3 -3
- package/edit/secret/basic.vue +1 -1
- package/edit/secret/index.vue +80 -2
- package/edit/secret/registry.vue +2 -2
- package/edit/secret/ssh.vue +1 -1
- package/edit/secret/tls.vue +1 -1
- package/edit/service.vue +47 -11
- package/edit/serviceaccount.vue +1 -1
- package/edit/storage.k8s.io.storageclass/index.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +7 -3
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +2 -2
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +2 -2
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/portworx-volume.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +1 -1
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +1 -1
- package/edit/token.vue +3 -3
- package/edit/ui.cattle.io.navlink.vue +2 -2
- package/edit/workload/Job.vue +111 -23
- package/edit/workload/Upgrading.vue +77 -22
- package/edit/workload/__tests__/Job.test.ts +72 -0
- package/edit/workload/__tests__/Upgrading.test.ts +60 -0
- package/edit/workload/index.vue +13 -1085
- package/edit/workload/mixins/workload.js +900 -0
- package/edit/workload/storage/Mount.vue +2 -2
- package/edit/workload/storage/awsElasticBlockStore.vue +1 -1
- package/edit/workload/storage/azureDisk.vue +2 -2
- package/edit/workload/storage/azureFile.vue +1 -1
- package/edit/workload/storage/ephemeralVolume/index.vue +2 -2
- package/edit/workload/storage/gcePersistentDisk.vue +1 -1
- package/edit/workload/storage/hostPath.vue +1 -1
- package/edit/workload/storage/nfs.vue +2 -2
- package/edit/workload/storage/persistentVolumeClaim/index.vue +2 -2
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +3 -3
- package/edit/workload/storage/secret.vue +2 -2
- package/edit/workload/storage/vsphereVolume.vue +1 -1
- package/edit/workload/types/Deployment.vue +377 -0
- package/edit/workload/types/Generic.vue +295 -0
- package/layouts/default.vue +26 -7
- package/layouts/error.vue +3 -2
- package/layouts/home.vue +12 -2
- package/layouts/plain.vue +18 -2
- package/layouts/unauthenticated.vue +2 -1
- package/list/catalog.cattle.io.clusterrepo.vue +1 -1
- package/list/fleet.cattle.io.bundle.vue +1 -1
- package/list/fleet.cattle.io.cluster.vue +1 -1
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +1 -1
- package/list/harvesterhci.io.dashboard/HarvesterUpgrade.vue +9 -8
- package/list/harvesterhci.io.dashboard/UpgradeInfo.vue +40 -0
- package/list/harvesterhci.io.dashboard/index.vue +14 -36
- package/list/harvesterhci.io.host/index.vue +24 -12
- package/list/harvesterhci.io.networkattachmentdefinition.vue +1 -1
- package/list/harvesterhci.io.setting.vue +1 -1
- package/list/harvesterhci.io.virtualmachinebackup.vue +1 -1
- package/list/harvesterhci.io.virtualmachineimage.vue +36 -3
- package/list/harvesterhci.io.virtualmachinetemplateversion.vue +1 -5
- package/list/helm.cattle.io.projecthelmchart.vue +1 -1
- package/list/kubevirt.io.virtualmachine.vue +4 -2
- package/list/management.cattle.io.feature.vue +3 -3
- package/list/management.cattle.io.setting.vue +2 -2
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +1 -1
- package/list/namespace.vue +3 -1
- package/list/node.vue +10 -3
- package/list/persistentvolumeclaim.vue +42 -0
- package/list/provisioning.cattle.io.cluster.vue +22 -20
- package/list/workload.vue +31 -6
- package/machine-config/amazonec2.vue +37 -12
- package/machine-config/azure.vue +3 -3
- package/machine-config/digitalocean.vue +2 -2
- package/machine-config/generic.vue +1 -1
- package/machine-config/harvester.vue +124 -25
- package/machine-config/linode.vue +2 -2
- package/machine-config/vmwarevsphere.vue +5 -5
- package/middleware/authenticated.js +36 -6
- package/middleware/unauthenticated.js +22 -0
- package/mixins/brand.js +50 -3
- package/mixins/browser-tab-visibility.js +37 -0
- package/mixins/chart.js +36 -4
- package/mixins/{compact-input.js → compact-input.ts} +5 -3
- package/mixins/form-validation.js +122 -0
- package/mixins/harvester-vm/index.js +134 -90
- package/mixins/labeled-form-element.ts +193 -0
- package/mixins/resource-fetch.js +173 -0
- package/models/cluster.x-k8s.io.machine.js +6 -2
- package/models/etcdbackup.js +4 -0
- package/models/event.js +4 -0
- package/models/fleet.cattle.io.bundle.js +1 -1
- package/models/fleet.cattle.io.gitrepo.js +10 -0
- package/models/harvester/harvesterhci.io.virtualmachinebackup.js +5 -2
- package/models/harvester/harvesterhci.io.virtualmachineimage.js +11 -8
- package/models/harvester/harvesterhci.io.virtualmachinetemplateversion.js +11 -2
- package/models/harvester/kubevirt.io.virtualmachine.js +2 -2
- package/models/harvester/kubevirt.io.virtualmachineinstance.js +1 -1
- package/models/harvester/node.js +27 -32
- package/models/harvester/persistentvolumeclaim.js +1 -1
- package/models/management.cattle.io.cluster.js +17 -11
- package/models/management.cattle.io.clusterroletemplatebinding.js +2 -2
- package/models/management.cattle.io.globalrole.js +19 -0
- package/models/management.cattle.io.node.js +10 -11
- package/models/management.cattle.io.project.js +60 -26
- package/models/management.cattle.io.roletemplate.js +19 -0
- package/models/monitoring.coreos.com.alertmanagerconfig.js +3 -2
- package/models/monitoring.coreos.com.prometheusrule.js +9 -0
- package/models/namespace.js +9 -1
- package/models/networking.k8s.io.ingress.js +17 -5
- package/models/persistentvolumeclaim.js +47 -1
- package/models/projectroletemplatebinding.js +2 -2
- package/models/provisioning.cattle.io.cluster.js +92 -13
- package/models/rke.cattle.io.etcdsnapshot.js +4 -0
- package/models/service.js +11 -5
- package/models/storage.k8s.io.storageclass.js +14 -1
- package/models/workload.js +7 -2
- package/nuxt.config.js +27 -7
- package/package.json +10 -14
- package/pages/about.vue +15 -1
- package/pages/account/index.vue +1 -1
- package/pages/auth/login.vue +17 -5
- package/pages/auth/setup.vue +47 -9
- package/pages/c/_cluster/_product/_resource/create.vue +1 -1
- package/pages/c/_cluster/_product/members/index.vue +6 -1
- package/pages/c/_cluster/_product/projectsnamespaces.vue +113 -11
- package/pages/c/_cluster/apps/charts/chart.vue +1 -1
- package/pages/c/_cluster/apps/charts/index.vue +2 -2
- package/pages/c/_cluster/apps/charts/install.vue +197 -19
- package/pages/c/_cluster/auth/config/index.vue +1 -1
- package/pages/c/_cluster/explorer/EventsTable.vue +1 -15
- package/pages/c/_cluster/explorer/index.vue +64 -35
- package/pages/c/_cluster/explorer/tools/index.vue +1 -1
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +249 -0
- package/pages/c/_cluster/fleet/index.vue +47 -65
- package/pages/c/_cluster/harvester/airgapupgrade/index.vue +7 -4
- package/pages/c/_cluster/harvester/console/_uid/vnc.vue +7 -1
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +8 -14
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/monitoring/route-receiver/index.vue +1 -1
- package/pages/c/_cluster/settings/banners.vue +2 -2
- package/pages/c/_cluster/settings/brand.vue +62 -7
- package/pages/c/_cluster/settings/performance.vue +167 -0
- package/pages/diagnostic.vue +468 -0
- package/pages/fail-whale.vue +17 -5
- package/pages/home.vue +36 -22
- package/pages/plugins.vue +1 -1
- package/pages/prefs.vue +20 -7
- package/pages/support/index.vue +51 -9
- package/pkg/auto-import.js +1 -1
- package/pkg/dynamic-importer.lib.js +8 -0
- package/pkg/tsconfig.json +26 -9
- package/pkg/vue.config.js +8 -0
- package/plugins/console.js +29 -0
- package/plugins/dashboard-store/actions.js +171 -28
- package/plugins/dashboard-store/getters.js +13 -1
- package/plugins/dashboard-store/index.js +5 -1
- package/plugins/dashboard-store/mutations.js +72 -22
- package/plugins/dashboard-store/resource-class.js +259 -184
- package/plugins/i18n.js +9 -3
- package/plugins/steve/actions.js +16 -1
- package/plugins/steve/getters.js +9 -1
- package/plugins/steve/index.js +6 -2
- package/plugins/steve/mutations.js +100 -5
- package/plugins/steve/norman-class.js +8 -0
- package/plugins/steve/performanceTesting.js +5 -0
- package/plugins/steve/subscribe.js +144 -12
- package/plugins/steve/web-worker.steve-sub-worker.js +129 -0
- package/promptRemove/kubevirt.io.virtualmachine.vue +3 -17
- package/promptRemove/management.cattle.io.project.vue +128 -0
- package/promptRemove/pod.vue +131 -0
- package/rancher-components/BadgeState/BadgeState.spec.ts +12 -0
- package/{components → rancher-components/BadgeState}/BadgeState.vue +18 -10
- package/rancher-components/BadgeState/index.ts +1 -0
- package/{components/__tests__ → rancher-components/Banner}/Banner.test.ts +1 -1
- package/{components → rancher-components/Banner}/Banner.vue +22 -7
- package/rancher-components/Banner/index.ts +1 -0
- package/{components → rancher-components/Card}/Card.vue +58 -12
- package/rancher-components/Card/index.ts +1 -0
- package/{components/form → rancher-components/Form/Checkbox}/Checkbox.vue +118 -25
- package/rancher-components/Form/Checkbox/index.ts +1 -0
- package/{components/form/__tests__ → rancher-components/Form/LabeledInput}/LabeledInput.test.ts +13 -2
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +341 -0
- package/rancher-components/Form/LabeledInput/index.ts +1 -0
- package/{components/form → rancher-components/Form/Radio}/RadioButton.vue +50 -22
- package/{components/form → rancher-components/Form/Radio}/RadioGroup.vue +76 -28
- package/rancher-components/Form/Radio/index.ts +2 -0
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +169 -0
- package/rancher-components/Form/TextArea/index.ts +1 -0
- package/rancher-components/Form/index.ts +4 -0
- package/{components/form → rancher-components/LabeledTooltip}/LabeledTooltip.vue +32 -11
- package/rancher-components/LabeledTooltip/index.ts +1 -0
- package/scripts/build-pkg.sh +4 -0
- package/scripts/publish-shell.sh +37 -18
- package/scripts/test-plugins-build.sh +115 -0
- package/store/catalog.js +4 -0
- package/store/growl.js +6 -0
- package/store/i18n.js +18 -9
- package/store/index.js +190 -107
- package/store/prefs.js +8 -2
- package/store/resource-fetch.js +44 -0
- package/store/type-map.js +43 -7
- package/store/uiplugins.ts +1 -1
- package/utils/favicon.js +40 -0
- package/utils/object.js +26 -9
- package/utils/promise.js +20 -0
- package/utils/socket.js +10 -1
- package/utils/string.js +16 -0
- package/utils/validators/formRules/__tests__/index.test.ts +928 -0
- package/utils/validators/formRules/index.ts +447 -0
- package/utils/validators/prometheusrule.js +1 -1
- package/utils/validators/vm.js +12 -5
- package/utils/width.js +39 -0
- package/yarn-error.log +196 -0
- package/components/NovncConsoleWrapper.vue +0 -150
- package/components/form/Container.vue +0 -143
- package/components/form/LabeledInput.vue +0 -245
- package/components/form/Scheduling.vue +0 -115
- package/components/form/TextAreaAutoGrow.vue +0 -127
- package/mixins/labeled-form-element.js +0 -137
package/edit/workload/index.vue
CHANGED
|
@@ -1,1106 +1,34 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
CONFIG_MAP, SECRET, WORKLOAD_TYPES, NODE, SERVICE, PVC, SERVICE_ACCOUNT, CAPI
|
|
6
|
-
} from '@shell/config/types';
|
|
7
|
-
import Tab from '@shell/components/Tabbed/Tab';
|
|
8
|
-
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
9
|
-
import { allHash } from '@shell/utils/promise';
|
|
10
|
-
import NameNsDescription from '@shell/components/form/NameNsDescription';
|
|
11
|
-
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
12
|
-
import LabeledInput from '@shell/components/form/LabeledInput';
|
|
13
|
-
import ServiceNameSelect from '@shell/components/form/ServiceNameSelect';
|
|
14
|
-
import HealthCheck from '@shell/components/form/HealthCheck';
|
|
15
|
-
import Security from '@shell/components/form/Security';
|
|
16
|
-
import Upgrading from '@shell/edit/workload/Upgrading';
|
|
17
|
-
import Loading from '@shell/components/Loading';
|
|
18
|
-
import Networking from '@shell/components/form/Networking';
|
|
19
|
-
import VolumeClaimTemplate from '@shell/edit/workload/VolumeClaimTemplate';
|
|
20
|
-
import Job from '@shell/edit/workload/Job';
|
|
21
|
-
import { _EDIT, _CREATE, _VIEW } from '@shell/config/query-params';
|
|
22
|
-
import WorkloadPorts from '@shell/components/form/WorkloadPorts';
|
|
23
|
-
import ContainerResourceLimit from '@shell/components/ContainerResourceLimit';
|
|
24
|
-
import KeyValue from '@shell/components/form/KeyValue';
|
|
25
|
-
import Tabbed from '@shell/components/Tabbed';
|
|
26
|
-
import { mapGetters } from 'vuex';
|
|
27
|
-
import NodeScheduling from '@shell/components/form/NodeScheduling';
|
|
28
|
-
import PodAffinity from '@shell/components/form/PodAffinity';
|
|
29
|
-
import Tolerations from '@shell/components/form/Tolerations';
|
|
30
|
-
import CruResource from '@shell/components/CruResource';
|
|
31
|
-
import Command from '@shell/components/form/Command';
|
|
32
|
-
import LifecycleHooks from '@shell/components/form/LifecycleHooks';
|
|
33
|
-
import Storage from '@shell/edit/workload/storage';
|
|
34
|
-
import Labels from '@shell/components/form/Labels';
|
|
35
|
-
import RadioGroup from '@shell/components/form/RadioGroup';
|
|
36
|
-
import { UI_MANAGED } from '@shell/config/labels-annotations';
|
|
37
|
-
import { removeObject } from '@shell/utils/array';
|
|
38
|
-
import { BEFORE_SAVE_HOOKS } from '@shell/mixins/child-hook';
|
|
2
|
+
import WorkloadGeneric from './types/Generic';
|
|
3
|
+
import WorkloadDeployment from './types/Deployment';
|
|
39
4
|
|
|
40
|
-
|
|
41
|
-
general: 99,
|
|
42
|
-
healthCheck: 98,
|
|
43
|
-
labels: 97,
|
|
44
|
-
networking: 96,
|
|
45
|
-
nodeScheduling: 95,
|
|
46
|
-
podScheduling: 94,
|
|
47
|
-
resources: 93,
|
|
48
|
-
upgrading: 92,
|
|
49
|
-
securityContext: 91,
|
|
50
|
-
storage: 90,
|
|
51
|
-
volumeClaimTemplates: 89,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const GPU_KEY = 'nvidia.com/gpu';
|
|
5
|
+
import WorkLoadMixin from '@shell/edit/workload/mixins/workload';
|
|
55
6
|
|
|
56
7
|
export default {
|
|
57
8
|
name: 'CruWorkload',
|
|
58
9
|
components: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
LabeledSelect,
|
|
62
|
-
LabeledInput,
|
|
63
|
-
ServiceNameSelect,
|
|
64
|
-
KeyValue,
|
|
65
|
-
Tabbed,
|
|
66
|
-
Tab,
|
|
67
|
-
Upgrading,
|
|
68
|
-
Networking,
|
|
69
|
-
Job,
|
|
70
|
-
HealthCheck,
|
|
71
|
-
Security,
|
|
72
|
-
WorkloadPorts,
|
|
73
|
-
ContainerResourceLimit,
|
|
74
|
-
PodAffinity,
|
|
75
|
-
NodeScheduling,
|
|
76
|
-
Tolerations,
|
|
77
|
-
CruResource,
|
|
78
|
-
Command,
|
|
79
|
-
LifecycleHooks,
|
|
80
|
-
Storage,
|
|
81
|
-
VolumeClaimTemplate,
|
|
82
|
-
Labels,
|
|
83
|
-
RadioGroup,
|
|
10
|
+
WorkloadGeneric,
|
|
11
|
+
WorkloadDeployment
|
|
84
12
|
},
|
|
85
|
-
|
|
86
|
-
mixins: [CreateEditView],
|
|
87
|
-
|
|
88
13
|
props: {
|
|
89
14
|
value: {
|
|
90
15
|
type: Object,
|
|
91
|
-
required: true
|
|
16
|
+
required: true,
|
|
92
17
|
},
|
|
93
18
|
|
|
94
19
|
mode: {
|
|
95
20
|
type: String,
|
|
96
|
-
default: 'create'
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
async fetch() {
|
|
101
|
-
const requests = { rancherClusters: this.$store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER }) };
|
|
102
|
-
const needed = {
|
|
103
|
-
configMaps: CONFIG_MAP,
|
|
104
|
-
nodes: NODE,
|
|
105
|
-
services: SERVICE,
|
|
106
|
-
pvcs: PVC,
|
|
107
|
-
sas: SERVICE_ACCOUNT,
|
|
108
|
-
secrets: SECRET,
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// Only fetch types if the user can see them
|
|
112
|
-
Object.keys(needed).forEach((key) => {
|
|
113
|
-
const type = needed[key];
|
|
114
|
-
|
|
115
|
-
if (this.$store.getters['cluster/schemaFor'](type)) {
|
|
116
|
-
requests[key] = this.$store.dispatch('cluster/findAll', { type });
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const hash = await allHash(requests);
|
|
121
|
-
|
|
122
|
-
this.servicesOwned = hash.services ? await this.value.getServicesOwned() : [];
|
|
123
|
-
|
|
124
|
-
this.allSecrets = hash.secrets || [];
|
|
125
|
-
this.allConfigMaps = hash.configMaps || [];
|
|
126
|
-
this.allNodeObjects = hash.nodes || [];
|
|
127
|
-
this.allNodes = this.allNodeObjects.map(node => node.id);
|
|
128
|
-
this.allServices = hash.services || [];
|
|
129
|
-
this.pvcs = hash.pvcs || [];
|
|
130
|
-
this.sas = hash.sas || [];
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
data() {
|
|
134
|
-
let type = this.$route.params.resource;
|
|
135
|
-
const createSidecar = !!this.$route.query.sidecar;
|
|
136
|
-
const isInitContainer = !!this.$route.query.init;
|
|
137
|
-
|
|
138
|
-
if (type === 'workload') {
|
|
139
|
-
type = null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (!this.value.spec) {
|
|
143
|
-
this.value.spec = {};
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const spec = this.value.spec;
|
|
147
|
-
let container;
|
|
148
|
-
const podTemplateSpec = type === WORKLOAD_TYPES.CRON_JOB ? spec.jobTemplate.spec.template.spec : spec?.template?.spec;
|
|
149
|
-
let containers = podTemplateSpec.containers;
|
|
150
|
-
|
|
151
|
-
if (this.mode === _CREATE || this.mode === _VIEW || (!createSidecar && !this.value.hasSidecars)) {
|
|
152
|
-
container = containers[0];
|
|
153
|
-
} else {
|
|
154
|
-
if (!podTemplateSpec.initContainers) {
|
|
155
|
-
podTemplateSpec.initContainers = [];
|
|
156
|
-
}
|
|
157
|
-
const allContainers = [...podTemplateSpec.initContainers, ...podTemplateSpec.containers];
|
|
158
|
-
|
|
159
|
-
if (this.$route.query.init) {
|
|
160
|
-
podTemplateSpec.initContainers.push({ imagePullPolicy: 'Always', name: `container-${ allContainers.length }` });
|
|
161
|
-
containers = podTemplateSpec.initContainers;
|
|
162
|
-
}
|
|
163
|
-
if (createSidecar) {
|
|
164
|
-
container = { imagePullPolicy: 'Always', name: `container-${ allContainers.length }` };
|
|
165
|
-
containers.push(container);
|
|
166
|
-
} else {
|
|
167
|
-
container = containers[0];
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
this.selectContainer(container);
|
|
172
|
-
|
|
173
|
-
return {
|
|
174
|
-
allConfigMaps: [],
|
|
175
|
-
allNodes: null,
|
|
176
|
-
allNodeObjects: [],
|
|
177
|
-
allSecrets: [],
|
|
178
|
-
allServices: [],
|
|
179
|
-
name: this.value?.metadata?.name || null,
|
|
180
|
-
pvcs: [],
|
|
181
|
-
sas: [],
|
|
182
|
-
showTabs: false,
|
|
183
|
-
pullPolicyOptions: ['Always', 'IfNotPresent', 'Never'],
|
|
184
|
-
spec,
|
|
185
|
-
type,
|
|
186
|
-
servicesOwned: [],
|
|
187
|
-
servicesToRemove: [],
|
|
188
|
-
portsForServices: [],
|
|
189
|
-
isInitContainer,
|
|
190
|
-
container,
|
|
191
|
-
containerChange: 0,
|
|
192
|
-
podFsGroup: podTemplateSpec.securityContext?.fsGroup,
|
|
193
|
-
savePvcHookName: 'savePvcHook',
|
|
194
|
-
tabWeightMap: TAB_WEIGHT_MAP,
|
|
195
|
-
};
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
computed: {
|
|
199
|
-
|
|
200
|
-
isEdit() {
|
|
201
|
-
return this.mode === _EDIT;
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
isJob() {
|
|
205
|
-
return this.type === WORKLOAD_TYPES.JOB || this.isCronJob;
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
isCronJob() {
|
|
209
|
-
return this.type === WORKLOAD_TYPES.CRON_JOB;
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
isReplicable() {
|
|
213
|
-
return (
|
|
214
|
-
this.type === WORKLOAD_TYPES.DEPLOYMENT ||
|
|
215
|
-
this.type === WORKLOAD_TYPES.REPLICA_SET ||
|
|
216
|
-
this.type === WORKLOAD_TYPES.REPLICATION_CONTROLLER ||
|
|
217
|
-
this.type === WORKLOAD_TYPES.STATEFUL_SET
|
|
218
|
-
);
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
isStatefulSet() {
|
|
222
|
-
return this.type === WORKLOAD_TYPES.STATEFUL_SET;
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
// if this is a cronjob, grab pod spec from within job template spec
|
|
226
|
-
podTemplateSpec: {
|
|
227
|
-
get() {
|
|
228
|
-
return this.isCronJob ? this.spec.jobTemplate.spec.template.spec : this.spec?.template?.spec;
|
|
229
|
-
},
|
|
230
|
-
set(neu) {
|
|
231
|
-
if (this.isCronJob) {
|
|
232
|
-
this.$set(this.spec.jobTemplate.spec.template, 'spec', neu);
|
|
233
|
-
} else {
|
|
234
|
-
this.$set(this.spec.template, 'spec', neu);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
podLabels: {
|
|
240
|
-
get() {
|
|
241
|
-
if (this.isCronJob) {
|
|
242
|
-
if (!this.spec.jobTemplate.metadata) {
|
|
243
|
-
this.$set( this.spec.jobTemplate, 'metadata', { labels: {} });
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return this.spec.jobTemplate.metadata.labels;
|
|
247
|
-
} else {
|
|
248
|
-
if (!this.spec.template.metadata) {
|
|
249
|
-
this.$set(this.spec.template, 'metadata', { labels: {} });
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return this.spec.template.metadata.labels;
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
set(neu) {
|
|
256
|
-
if (this.isCronJob) {
|
|
257
|
-
this.$set( this.spec.jobTemplate.metadata, 'labels', neu);
|
|
258
|
-
} else {
|
|
259
|
-
this.$set(this.spec.template.metadata, 'labels', neu);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
-
podAnnotations: {
|
|
265
|
-
get() {
|
|
266
|
-
if (this.isCronJob) {
|
|
267
|
-
if (!this.spec.jobTemplate.metadata) {
|
|
268
|
-
this.$set( this.spec.jobTemplate, 'metadata', { annotations: {} });
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
return this.spec.jobTemplate.metadata.annotations;
|
|
272
|
-
} else {
|
|
273
|
-
if (!this.spec.template.metadata) {
|
|
274
|
-
this.$set(this.spec.template, 'metadata', { annotations: {} });
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return this.spec.template.metadata.annotations;
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
set(neu) {
|
|
281
|
-
if (this.isCronJob) {
|
|
282
|
-
this.$set( this.spec.jobTemplate.metadata, 'annotations', neu);
|
|
283
|
-
} else {
|
|
284
|
-
this.$set(this.spec.template.metadata, 'annotations', neu);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
allContainers() {
|
|
290
|
-
const containers = this.podTemplateSpec?.containers || [];
|
|
291
|
-
const initContainers = this.podTemplateSpec?.initContainers || [];
|
|
292
|
-
|
|
293
|
-
return [...containers, ...initContainers.map((each) => {
|
|
294
|
-
each._init = true;
|
|
295
|
-
|
|
296
|
-
return each;
|
|
297
|
-
})];
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
flatResources: {
|
|
301
|
-
get() {
|
|
302
|
-
const { limits = {}, requests = {} } = this.container.resources || {};
|
|
303
|
-
const { cpu: limitsCpu, memory: limitsMemory, [GPU_KEY]: limitsGpu } = limits;
|
|
304
|
-
const { cpu: requestsCpu, memory: requestsMemory } = requests;
|
|
305
|
-
|
|
306
|
-
return {
|
|
307
|
-
limitsCpu, limitsMemory, requestsCpu, requestsMemory, limitsGpu
|
|
308
|
-
};
|
|
309
|
-
},
|
|
310
|
-
set(neu) {
|
|
311
|
-
const {
|
|
312
|
-
limitsCpu, limitsMemory, requestsCpu, requestsMemory, limitsGpu
|
|
313
|
-
} = neu;
|
|
314
|
-
|
|
315
|
-
const out = {
|
|
316
|
-
requests: {
|
|
317
|
-
cpu: requestsCpu,
|
|
318
|
-
memory: requestsMemory
|
|
319
|
-
},
|
|
320
|
-
limits: {
|
|
321
|
-
cpu: limitsCpu,
|
|
322
|
-
memory: limitsMemory,
|
|
323
|
-
[GPU_KEY]: limitsGpu
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
this.$set(this.container, 'resources', cleanUp(out));
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
|
|
331
|
-
healthCheck: {
|
|
332
|
-
get() {
|
|
333
|
-
const { readinessProbe, livenessProbe, startupProbe } = this.container;
|
|
334
|
-
|
|
335
|
-
return {
|
|
336
|
-
readinessProbe, livenessProbe, startupProbe
|
|
337
|
-
};
|
|
338
|
-
},
|
|
339
|
-
set(neu) {
|
|
340
|
-
Object.assign(this.container, neu);
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
|
|
344
|
-
imagePullSecrets: {
|
|
345
|
-
get() {
|
|
346
|
-
if (!this.podTemplateSpec.imagePullSecrets) {
|
|
347
|
-
this.$set(this.podTemplateSpec, 'imagePullSecrets', []);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
const { imagePullSecrets } = this.podTemplateSpec;
|
|
351
|
-
|
|
352
|
-
return imagePullSecrets.map(each => each.name);
|
|
353
|
-
},
|
|
354
|
-
set(neu) {
|
|
355
|
-
this.podTemplateSpec.imagePullSecrets = neu.map((secret) => {
|
|
356
|
-
return { name: secret };
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
schema() {
|
|
363
|
-
return this.$store.getters['cluster/schemaFor'](this.type);
|
|
364
|
-
},
|
|
365
|
-
|
|
366
|
-
namespacedSecrets() {
|
|
367
|
-
const namespace = this.value?.metadata?.namespace;
|
|
368
|
-
|
|
369
|
-
if (namespace) {
|
|
370
|
-
return this.allSecrets.filter(
|
|
371
|
-
secret => secret.metadata.namespace === namespace
|
|
372
|
-
);
|
|
373
|
-
} else {
|
|
374
|
-
return this.allSecrets;
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
|
|
378
|
-
namespacedConfigMaps() {
|
|
379
|
-
const namespace = this.value?.metadata?.namespace;
|
|
380
|
-
|
|
381
|
-
if (namespace) {
|
|
382
|
-
return this.allConfigMaps.filter(
|
|
383
|
-
configMap => configMap.metadata.namespace === namespace
|
|
384
|
-
);
|
|
385
|
-
} else {
|
|
386
|
-
return this.allConfigMaps;
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
namespacedServiceNames() {
|
|
391
|
-
const { namespace } = this.value?.metadata;
|
|
392
|
-
|
|
393
|
-
if (namespace) {
|
|
394
|
-
return this.sas.filter(
|
|
395
|
-
serviceName => serviceName.metadata.namespace === namespace
|
|
396
|
-
);
|
|
397
|
-
} else {
|
|
398
|
-
return this.sas;
|
|
399
|
-
}
|
|
21
|
+
default: 'create',
|
|
400
22
|
},
|
|
401
|
-
|
|
402
|
-
headlessServices() {
|
|
403
|
-
return this.allServices.filter(service => service.spec.clusterIP === 'None' && service.metadata.namespace === this.value.metadata.namespace);
|
|
404
|
-
},
|
|
405
|
-
|
|
406
|
-
workloadTypes() {
|
|
407
|
-
return omitBy(WORKLOAD_TYPES, (type) => {
|
|
408
|
-
return type === WORKLOAD_TYPES.REPLICA_SET || type === WORKLOAD_TYPES.REPLICATION_CONTROLLER;
|
|
409
|
-
} );
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
// array of id, label, description, initials for type selection step
|
|
413
|
-
workloadSubTypes() {
|
|
414
|
-
const out = [];
|
|
415
|
-
|
|
416
|
-
for (const prop in this.workloadTypes) {
|
|
417
|
-
const type = this.workloadTypes[prop];
|
|
418
|
-
const subtype = {
|
|
419
|
-
id: type,
|
|
420
|
-
description: `workload.typeDescriptions.'${ type }'`,
|
|
421
|
-
label: this.nameDisplayFor(type),
|
|
422
|
-
bannerAbbrv: this.initialDisplayFor(type)
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
out.push(subtype);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
return out;
|
|
429
|
-
},
|
|
430
|
-
|
|
431
|
-
nameNsColumns() {
|
|
432
|
-
const out = [];
|
|
433
|
-
|
|
434
|
-
if (this.isCronJob) {
|
|
435
|
-
out.push('schedule');
|
|
436
|
-
} else if (this.isReplicable) {
|
|
437
|
-
out.push('replicas');
|
|
438
|
-
|
|
439
|
-
if (this.isStatefulSet) {
|
|
440
|
-
out.push('service');
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
return out;
|
|
445
|
-
},
|
|
446
|
-
|
|
447
|
-
containerOptions() {
|
|
448
|
-
const out = [...this.allContainers];
|
|
449
|
-
|
|
450
|
-
if (!this.isView) {
|
|
451
|
-
out.push({ name: 'Add Container', __add: true });
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
return out;
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
...mapGetters({ t: 'i18n/t' })
|
|
458
23
|
},
|
|
459
|
-
|
|
460
|
-
watch: {
|
|
461
|
-
type(neu, old) {
|
|
462
|
-
const template =
|
|
463
|
-
old === WORKLOAD_TYPES.CRON_JOB ? this.spec?.jobTemplate?.spec?.template : this.spec?.template;
|
|
464
|
-
|
|
465
|
-
if (!template.spec) {
|
|
466
|
-
template.spec = {};
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
let restartPolicy;
|
|
470
|
-
|
|
471
|
-
if (this.isJob || this.isCronJob) {
|
|
472
|
-
restartPolicy = 'Never';
|
|
473
|
-
} else {
|
|
474
|
-
restartPolicy = 'Always';
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
this.$set(template.spec, 'restartPolicy', restartPolicy);
|
|
478
|
-
|
|
479
|
-
if (!this.isReplicable) {
|
|
480
|
-
delete this.spec.replicas;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if (old === WORKLOAD_TYPES.CRON_JOB) {
|
|
484
|
-
this.$set(this.spec, 'template', { ...template });
|
|
485
|
-
delete this.spec.jobTemplate;
|
|
486
|
-
delete this.spec.schedule;
|
|
487
|
-
} else if (neu === WORKLOAD_TYPES.CRON_JOB) {
|
|
488
|
-
this.$set(this.spec, 'jobTemplate', { spec: { template } });
|
|
489
|
-
this.$set(this.spec, 'schedule', '0 * * * *');
|
|
490
|
-
delete this.spec.template;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
this.$set(this.value, 'type', neu);
|
|
494
|
-
delete this.value.apiVersion;
|
|
495
|
-
},
|
|
496
|
-
|
|
497
|
-
container(neu) {
|
|
498
|
-
const containers = this.isInitContainer ? this.podTemplateSpec.initContainers : this.podTemplateSpec.containers;
|
|
499
|
-
const existing = containers.filter(container => container.__active)[0];
|
|
500
|
-
|
|
501
|
-
Object.assign(existing, neu);
|
|
502
|
-
}
|
|
503
|
-
},
|
|
504
|
-
|
|
505
|
-
created() {
|
|
506
|
-
this.registerBeforeHook(this.saveWorkload, 'willSaveWorkload');
|
|
507
|
-
this.registerBeforeHook(this.getPorts, 'getPorts');
|
|
508
|
-
|
|
509
|
-
this.registerAfterHook(this.saveService, 'saveService');
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
methods: {
|
|
513
|
-
nameDisplayFor(type) {
|
|
514
|
-
const schema = this.$store.getters['cluster/schemaFor'](type);
|
|
515
|
-
|
|
516
|
-
return this.$store.getters['type-map/labelFor'](schema) || '';
|
|
517
|
-
},
|
|
518
|
-
|
|
519
|
-
// TODO better images for workload types?
|
|
520
|
-
// show initials of workload type in blue circles for now
|
|
521
|
-
initialDisplayFor(type) {
|
|
522
|
-
const typeDisplay = this.nameDisplayFor(type);
|
|
523
|
-
|
|
524
|
-
return typeDisplay.split('').filter(letter => letter.match(/[A-Z]/)).join('');
|
|
525
|
-
},
|
|
526
|
-
|
|
527
|
-
cancel() {
|
|
528
|
-
this.done();
|
|
529
|
-
},
|
|
530
|
-
|
|
531
|
-
async getPorts() {
|
|
532
|
-
const ports = await this.value.getPortsWithServiceType() || [];
|
|
533
|
-
|
|
534
|
-
this.portsForServices = ports;
|
|
535
|
-
},
|
|
536
|
-
|
|
537
|
-
async saveService() {
|
|
538
|
-
// If we can't access services then just return - the UI should only allow ports without service creation
|
|
539
|
-
if (!this.$store.getters['cluster/schemaFor'](SERVICE)) {
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
const { toSave = [], toRemove = [] } = await this.value.servicesFromContainerPorts(this.mode, this.portsForServices) || {};
|
|
544
|
-
|
|
545
|
-
this.servicesOwned = toSave;
|
|
546
|
-
this.servicesToRemove = toRemove;
|
|
547
|
-
|
|
548
|
-
if (!toSave.length && !toRemove.length) {
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
return Promise.all([...toSave.map(svc => svc.save()), ...toRemove.map((svc) => {
|
|
553
|
-
const ui = svc?.metadata?.annotations[UI_MANAGED];
|
|
554
|
-
|
|
555
|
-
if (ui) {
|
|
556
|
-
svc.remove();
|
|
557
|
-
}
|
|
558
|
-
})]);
|
|
559
|
-
},
|
|
560
|
-
|
|
561
|
-
saveWorkload() {
|
|
562
|
-
if (this.type !== WORKLOAD_TYPES.JOB && this.type !== WORKLOAD_TYPES.CRON_JOB && this.mode === _CREATE) {
|
|
563
|
-
this.spec.selector = { matchLabels: this.value.workloadSelector };
|
|
564
|
-
Object.assign(this.value.metadata.labels, this.value.workloadSelector);
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
let template;
|
|
568
|
-
|
|
569
|
-
if (this.type === WORKLOAD_TYPES.CRON_JOB) {
|
|
570
|
-
template = this.spec.jobTemplate;
|
|
571
|
-
} else {
|
|
572
|
-
template = this.spec.template;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
if (this.type !== WORKLOAD_TYPES.JOB && this.type !== WORKLOAD_TYPES.CRON_JOB && this.mode === _CREATE) {
|
|
576
|
-
if (!template.metadata) {
|
|
577
|
-
template.metadata = { labels: this.value.workloadSelector };
|
|
578
|
-
} else {
|
|
579
|
-
Object.assign(template.metadata.labels, this.value.workloadSelector);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
if (template.spec.containers && template.spec.containers[0]) {
|
|
584
|
-
const containerResources = template.spec.containers[0].resources;
|
|
585
|
-
const nvidiaGpuLimit = template.spec.containers[0].resources?.limits?.[GPU_KEY];
|
|
586
|
-
|
|
587
|
-
// Though not required, requests are also set to mirror the ember ui
|
|
588
|
-
if (nvidiaGpuLimit > 0) {
|
|
589
|
-
containerResources.requests = containerResources.requests || {};
|
|
590
|
-
containerResources.requests[GPU_KEY] = nvidiaGpuLimit;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
if (!this.nvidiaIsValid(nvidiaGpuLimit) ) {
|
|
594
|
-
try {
|
|
595
|
-
delete containerResources.requests[GPU_KEY];
|
|
596
|
-
delete containerResources.limits[GPU_KEY];
|
|
597
|
-
|
|
598
|
-
if (Object.keys(containerResources.limits).length === 0) {
|
|
599
|
-
delete containerResources.limits;
|
|
600
|
-
}
|
|
601
|
-
if (Object.keys(containerResources.requests).length === 0) {
|
|
602
|
-
delete containerResources.requests;
|
|
603
|
-
}
|
|
604
|
-
if (Object.keys(containerResources).length === 0) {
|
|
605
|
-
delete template.spec.containers[0].resources;
|
|
606
|
-
}
|
|
607
|
-
} catch {}
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
const nodeAffinity = template?.spec?.affinity?.nodeAffinity || {};
|
|
612
|
-
const podAffinity = template?.spec?.affinity?.podAffinity || {};
|
|
613
|
-
const podAntiAffinity = template?.spec?.affinity?.podAntiAffinity || {};
|
|
614
|
-
|
|
615
|
-
this.fixNodeAffinity(nodeAffinity);
|
|
616
|
-
this.fixPodAffinity(podAffinity);
|
|
617
|
-
this.fixPodAffinity(podAntiAffinity);
|
|
618
|
-
this.fixPodSecurityContext(this.podTemplateSpec);
|
|
619
|
-
|
|
620
|
-
// delete this.value.kind;
|
|
621
|
-
if (this.container && !this.container.name) {
|
|
622
|
-
this.$set(this.container, 'name', this.value.metadata.name);
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
const ports = this.value.containers.reduce((total, each) => {
|
|
626
|
-
const containerPorts = each.ports || [];
|
|
627
|
-
|
|
628
|
-
total.push(...containerPorts.filter(port => port._serviceType && port._serviceType !== ''));
|
|
629
|
-
|
|
630
|
-
return total;
|
|
631
|
-
}, []);
|
|
632
|
-
|
|
633
|
-
// ports contain info used to create services after saving
|
|
634
|
-
this.portsForServices = ports;
|
|
635
|
-
Object.assign(this.value, { spec: this.spec });
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
// node and pod affinity are formatted incorrectly from API; fix before saving
|
|
639
|
-
fixNodeAffinity(nodeAffinity) {
|
|
640
|
-
const preferredDuringSchedulingIgnoredDuringExecution =
|
|
641
|
-
nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution || [];
|
|
642
|
-
const requiredDuringSchedulingIgnoredDuringExecution =
|
|
643
|
-
nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution || {};
|
|
644
|
-
|
|
645
|
-
preferredDuringSchedulingIgnoredDuringExecution.forEach((term) => {
|
|
646
|
-
const matchExpressions = term?.preference?.matchExpressions || [];
|
|
647
|
-
|
|
648
|
-
matchExpressions.forEach((expression) => {
|
|
649
|
-
if (expression.values) {
|
|
650
|
-
expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
});
|
|
654
|
-
|
|
655
|
-
(
|
|
656
|
-
requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms || []
|
|
657
|
-
).forEach((term) => {
|
|
658
|
-
const matchExpressions = term.matchExpressions || [];
|
|
659
|
-
|
|
660
|
-
matchExpressions.forEach((expression) => {
|
|
661
|
-
if (expression.values) {
|
|
662
|
-
expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
});
|
|
666
|
-
},
|
|
667
|
-
|
|
668
|
-
fixPodAffinity(podAffinity) {
|
|
669
|
-
const preferredDuringSchedulingIgnoredDuringExecution =
|
|
670
|
-
podAffinity.preferredDuringSchedulingIgnoredDuringExecution || [];
|
|
671
|
-
const requiredDuringSchedulingIgnoredDuringExecution =
|
|
672
|
-
podAffinity.requiredDuringSchedulingIgnoredDuringExecution || [];
|
|
673
|
-
|
|
674
|
-
preferredDuringSchedulingIgnoredDuringExecution.forEach((term) => {
|
|
675
|
-
const matchExpressions = term?.podAffinityTerm?.labelSelector?.matchExpressions || [];
|
|
676
|
-
|
|
677
|
-
matchExpressions.forEach((expression) => {
|
|
678
|
-
if (expression.values) {
|
|
679
|
-
expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
});
|
|
683
|
-
|
|
684
|
-
requiredDuringSchedulingIgnoredDuringExecution.forEach((term) => {
|
|
685
|
-
const matchExpressions = term?.labelSelector?.matchExpressions || [];
|
|
686
|
-
|
|
687
|
-
matchExpressions.forEach((expression) => {
|
|
688
|
-
if (expression.values) {
|
|
689
|
-
expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
|
|
690
|
-
}
|
|
691
|
-
});
|
|
692
|
-
});
|
|
693
|
-
|
|
694
|
-
return podAffinity;
|
|
695
|
-
},
|
|
696
|
-
|
|
697
|
-
fixPodSecurityContext(podTempSpec) {
|
|
698
|
-
if (this.podFsGroup) {
|
|
699
|
-
podTempSpec.securityContext = podTempSpec.securityContext || {};
|
|
700
|
-
podTempSpec.securityContext.fsGroup = this.podFsGroup;
|
|
701
|
-
} else {
|
|
702
|
-
if (podTempSpec.securityContext?.fsGroup) {
|
|
703
|
-
delete podTempSpec.securityContext.fsGroup;
|
|
704
|
-
}
|
|
705
|
-
if (Object.keys(podTempSpec.securityContext || {}).length === 0) {
|
|
706
|
-
delete podTempSpec.securityContext;
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
|
|
711
|
-
selectType(type) {
|
|
712
|
-
if (!this.type && type) {
|
|
713
|
-
this.$router.replace({ params: { resource: type } });
|
|
714
|
-
} else {
|
|
715
|
-
this.type = type;
|
|
716
|
-
}
|
|
717
|
-
},
|
|
718
|
-
|
|
719
|
-
selectContainer(container) {
|
|
720
|
-
if (container.__add) {
|
|
721
|
-
this.addContainer();
|
|
722
|
-
|
|
723
|
-
return;
|
|
724
|
-
}
|
|
725
|
-
(this.allContainers || []).forEach((container) => {
|
|
726
|
-
if (container.__active) {
|
|
727
|
-
delete container.__active;
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
container.__active = true;
|
|
731
|
-
this.container = container;
|
|
732
|
-
this.isInitContainer = !!container._init;
|
|
733
|
-
this.containerChange++;
|
|
734
|
-
},
|
|
735
|
-
|
|
736
|
-
addContainer() {
|
|
737
|
-
let nameNumber = this.allContainers.length;
|
|
738
|
-
const allNames = this.allContainers.reduce((names, each) => {
|
|
739
|
-
names.push(each.name);
|
|
740
|
-
|
|
741
|
-
return names;
|
|
742
|
-
}, []);
|
|
743
|
-
|
|
744
|
-
while (allNames.includes(`container-${ nameNumber }`)) {
|
|
745
|
-
nameNumber++;
|
|
746
|
-
}
|
|
747
|
-
const container = { imagePullPolicy: 'Always', name: `container-${ nameNumber }` };
|
|
748
|
-
|
|
749
|
-
this.podTemplateSpec.containers.push(container);
|
|
750
|
-
this.selectContainer(container);
|
|
751
|
-
},
|
|
752
|
-
|
|
753
|
-
removeContainer(container) {
|
|
754
|
-
if (container._init) {
|
|
755
|
-
removeObject(this.podTemplateSpec.initContainers, container);
|
|
756
|
-
} else {
|
|
757
|
-
removeObject(this.podTemplateSpec.containers, container);
|
|
758
|
-
}
|
|
759
|
-
this.selectContainer(this.allContainers[0]);
|
|
760
|
-
},
|
|
761
|
-
|
|
762
|
-
updateInitContainer(neu) {
|
|
763
|
-
if (!this.container) {
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
const containers = this.podTemplateSpec.containers;
|
|
767
|
-
|
|
768
|
-
if (neu) {
|
|
769
|
-
if (!this.podTemplateSpec.initContainers) {
|
|
770
|
-
this.podTemplateSpec.initContainers = [];
|
|
771
|
-
}
|
|
772
|
-
this.podTemplateSpec.initContainers.push(this.container);
|
|
773
|
-
|
|
774
|
-
removeObject(containers, this.container);
|
|
775
|
-
} else {
|
|
776
|
-
delete this.container._init;
|
|
777
|
-
const initContainers = this.podTemplateSpec.initContainers;
|
|
778
|
-
|
|
779
|
-
removeObject(initContainers, this.container);
|
|
780
|
-
containers.push(this.container);
|
|
781
|
-
}
|
|
782
|
-
this.isInitContainer = neu;
|
|
783
|
-
},
|
|
784
|
-
clearPvcFormState(hookName) {
|
|
785
|
-
// On the `closePvcForm` event, remove the
|
|
786
|
-
// before save hook to prevent the PVC from
|
|
787
|
-
// being created. Use the PVC's unique ID to distinguish
|
|
788
|
-
// between hooks for different PVCs.
|
|
789
|
-
if (this[BEFORE_SAVE_HOOKS]) {
|
|
790
|
-
this.unregisterBeforeSaveHook(hookName);
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
|
|
794
|
-
updateServiceAccount(neu) {
|
|
795
|
-
if (neu) {
|
|
796
|
-
this.podTemplateSpec.serviceAccount = neu;
|
|
797
|
-
this.podTemplateSpec.serviceAccountName = neu;
|
|
798
|
-
} else {
|
|
799
|
-
// Note - both have to be removed in order for removal to work
|
|
800
|
-
delete this.podTemplateSpec.serviceAccount;
|
|
801
|
-
delete this.podTemplateSpec.serviceAccountName;
|
|
802
|
-
}
|
|
803
|
-
},
|
|
804
|
-
nvidiaIsValid(nvidiaGpuLimit) {
|
|
805
|
-
if (!Number.isInteger(nvidiaGpuLimit)) {
|
|
806
|
-
return false;
|
|
807
|
-
}
|
|
808
|
-
if (nvidiaGpuLimit === undefined) {
|
|
809
|
-
return false;
|
|
810
|
-
}
|
|
811
|
-
if (nvidiaGpuLimit < 1) {
|
|
812
|
-
return false;
|
|
813
|
-
} else {
|
|
814
|
-
return true;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
//
|
|
818
|
-
}
|
|
819
|
-
}
|
|
24
|
+
mixins: [WorkLoadMixin],
|
|
820
25
|
};
|
|
821
26
|
</script>
|
|
822
27
|
|
|
823
28
|
<template>
|
|
824
|
-
<
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
<
|
|
828
|
-
|
|
829
|
-
:selected-subtype="type"
|
|
830
|
-
:resource="value"
|
|
831
|
-
:mode="mode"
|
|
832
|
-
:errors="errors"
|
|
833
|
-
:done-route="doneRoute"
|
|
834
|
-
:subtypes="workloadSubTypes"
|
|
835
|
-
:apply-hooks="applyHooks"
|
|
836
|
-
@finish="save"
|
|
837
|
-
@select-type="selectType"
|
|
838
|
-
@error="e=>errors = e"
|
|
839
|
-
>
|
|
840
|
-
<div class="row">
|
|
841
|
-
<div class="col span-12">
|
|
842
|
-
<NameNsDescription :value="value" :extra-columns="nameNsColumns" :mode="mode" @change="name=value.metadata.name">
|
|
843
|
-
<template #schedule>
|
|
844
|
-
<LabeledInput
|
|
845
|
-
v-model="spec.schedule"
|
|
846
|
-
type="cron"
|
|
847
|
-
required
|
|
848
|
-
:mode="mode"
|
|
849
|
-
:label="t('workload.cronSchedule')"
|
|
850
|
-
placeholder="0 * * * *"
|
|
851
|
-
/>
|
|
852
|
-
</template>
|
|
853
|
-
<template #replicas>
|
|
854
|
-
<LabeledInput
|
|
855
|
-
v-model.number="spec.replicas"
|
|
856
|
-
type="number"
|
|
857
|
-
min="0"
|
|
858
|
-
required
|
|
859
|
-
:mode="mode"
|
|
860
|
-
:label="t('workload.replicas')"
|
|
861
|
-
/>
|
|
862
|
-
</template>
|
|
863
|
-
<template #service>
|
|
864
|
-
<LabeledSelect
|
|
865
|
-
v-model="spec.serviceName"
|
|
866
|
-
option-label="metadata.name"
|
|
867
|
-
:reduce="service=>service.metadata.name"
|
|
868
|
-
:mode="mode"
|
|
869
|
-
:label="t('workload.serviceName')"
|
|
870
|
-
:options="headlessServices"
|
|
871
|
-
required
|
|
872
|
-
/>
|
|
873
|
-
</template>
|
|
874
|
-
</NameNsDescription>
|
|
875
|
-
</div>
|
|
876
|
-
</div>
|
|
877
|
-
<div v-if="containerOptions.length > 1" class="container-row">
|
|
878
|
-
<div class="col span-4">
|
|
879
|
-
<LabeledSelect :value="container" option-label="name" :label="t('workload.container.titles.container')" :options="containerOptions" @input="selectContainer" />
|
|
880
|
-
</div>
|
|
881
|
-
<div v-if="allContainers.length > 1 && !isView" class="col">
|
|
882
|
-
<button type="button" class="btn-sm role-link" @click="removeContainer(container)">
|
|
883
|
-
{{ t('workload.container.removeContainer') }}
|
|
884
|
-
</button>
|
|
885
|
-
</div>
|
|
886
|
-
</div>
|
|
887
|
-
<Tabbed :key="containerChange" :side-tabs="true">
|
|
888
|
-
<Tab :label="t('workload.container.titles.general')" name="general" :weight="tabWeightMap['general']">
|
|
889
|
-
<div>
|
|
890
|
-
<div :style="{'align-items':'center'}" class="row mb-20">
|
|
891
|
-
<div class="col span-6">
|
|
892
|
-
<LabeledInput v-model="container.name" :mode="mode" :label="t('workload.container.containerName')" />
|
|
893
|
-
</div>
|
|
894
|
-
<div class="col span-6">
|
|
895
|
-
<RadioGroup
|
|
896
|
-
:mode="mode"
|
|
897
|
-
:value="isInitContainer"
|
|
898
|
-
name="initContainer"
|
|
899
|
-
:options="[true, false]"
|
|
900
|
-
:labels="[t('workload.container.init'), t('workload.container.standard')]"
|
|
901
|
-
@input="updateInitContainer"
|
|
902
|
-
/>
|
|
903
|
-
</div>
|
|
904
|
-
</div>
|
|
905
|
-
<h3>{{ t('workload.container.titles.image') }}</h3>
|
|
906
|
-
<div class="row mb-20">
|
|
907
|
-
<div class="col span-6">
|
|
908
|
-
<LabeledInput
|
|
909
|
-
v-model.trim="container.image"
|
|
910
|
-
:mode="mode"
|
|
911
|
-
:label="t('workload.container.image')"
|
|
912
|
-
:placeholder="t('generic.placeholder', {text: 'nginx:latest'}, true)"
|
|
913
|
-
required
|
|
914
|
-
/>
|
|
915
|
-
</div>
|
|
916
|
-
<div class="col span-6">
|
|
917
|
-
<LabeledSelect
|
|
918
|
-
v-model="container.imagePullPolicy"
|
|
919
|
-
:label="t('workload.container.imagePullPolicy')"
|
|
920
|
-
:options="pullPolicyOptions"
|
|
921
|
-
:mode="mode"
|
|
922
|
-
/>
|
|
923
|
-
</div>
|
|
924
|
-
</div>
|
|
925
|
-
<div class="row">
|
|
926
|
-
<div class="col span-6">
|
|
927
|
-
<LabeledSelect
|
|
928
|
-
v-model="imagePullSecrets"
|
|
929
|
-
:label="t('workload.container.imagePullSecrets')"
|
|
930
|
-
:multiple="true"
|
|
931
|
-
:taggable="true"
|
|
932
|
-
:options="namespacedSecrets"
|
|
933
|
-
:mode="mode"
|
|
934
|
-
option-label="metadata.name"
|
|
935
|
-
:reduce="service=>service.metadata.name"
|
|
936
|
-
/>
|
|
937
|
-
</div>
|
|
938
|
-
</div>
|
|
939
|
-
</div>
|
|
940
|
-
|
|
941
|
-
<div class="spacer"></div>
|
|
942
|
-
<div>
|
|
943
|
-
<h3>{{ t('workload.container.titles.ports') }}</h3>
|
|
944
|
-
<div class="row">
|
|
945
|
-
<WorkloadPorts v-model="container.ports" :name="value.metadata.name" :services="servicesOwned" :mode="mode" />
|
|
946
|
-
</div>
|
|
947
|
-
</div>
|
|
948
|
-
|
|
949
|
-
<div class="spacer"></div>
|
|
950
|
-
<div>
|
|
951
|
-
<h3>{{ t('workload.container.titles.command') }}</h3>
|
|
952
|
-
<Command v-model="container" :secrets="namespacedSecrets" :config-maps="namespacedConfigMaps" :mode="mode" />
|
|
953
|
-
</div>
|
|
954
|
-
<ServiceNameSelect
|
|
955
|
-
:value="podTemplateSpec.serviceAccountName"
|
|
956
|
-
:mode="mode"
|
|
957
|
-
:select-label="t('workload.serviceAccountName.label')"
|
|
958
|
-
:select-placeholder="t('workload.serviceAccountName.label')"
|
|
959
|
-
:options="namespacedServiceNames"
|
|
960
|
-
option-label="metadata.name"
|
|
961
|
-
@input="updateServiceAccount"
|
|
962
|
-
/>
|
|
963
|
-
|
|
964
|
-
<div class="spacer"></div>
|
|
965
|
-
<div>
|
|
966
|
-
<h3>{{ t('workload.container.titles.lifecycle') }}</h3>
|
|
967
|
-
<LifecycleHooks v-model="container.lifecycle" :mode="mode" />
|
|
968
|
-
</div>
|
|
969
|
-
</Tab>
|
|
970
|
-
<Tab :label="t('workload.storage.title')" name="storage" :weight="tabWeightMap['storage']">
|
|
971
|
-
<Storage
|
|
972
|
-
v-model="podTemplateSpec"
|
|
973
|
-
:namespace="value.metadata.namespace"
|
|
974
|
-
:register-before-hook="registerBeforeHook"
|
|
975
|
-
:mode="mode"
|
|
976
|
-
:secrets="namespacedSecrets"
|
|
977
|
-
:config-maps="namespacedConfigMaps"
|
|
978
|
-
:container="container"
|
|
979
|
-
:save-pvc-hook-name="savePvcHookName"
|
|
980
|
-
@removePvcForm="clearPvcFormState"
|
|
981
|
-
/>
|
|
982
|
-
</Tab>
|
|
983
|
-
<Tab :label="t('workload.container.titles.resources')" name="resources" :weight="tabWeightMap['resources']">
|
|
984
|
-
<h3 class="mb-10">
|
|
985
|
-
<t k="workload.scheduling.titles.limits" />
|
|
986
|
-
</h3>
|
|
987
|
-
<ContainerResourceLimit v-model="flatResources" :mode="mode" :show-tip="false" />
|
|
988
|
-
<template>
|
|
989
|
-
<div class="spacer"></div>
|
|
990
|
-
<div>
|
|
991
|
-
<h3 class="mb-10">
|
|
992
|
-
<t k="workload.scheduling.titles.tolerations" />
|
|
993
|
-
</h3>
|
|
994
|
-
<div class="row">
|
|
995
|
-
<Tolerations v-model="podTemplateSpec.tolerations" :mode="mode" />
|
|
996
|
-
</div>
|
|
997
|
-
</div>
|
|
998
|
-
|
|
999
|
-
<div>
|
|
1000
|
-
<div class="spacer"></div>
|
|
1001
|
-
<h3 class="mb-10">
|
|
1002
|
-
<t k="workload.scheduling.titles.priority" />
|
|
1003
|
-
</h3>
|
|
1004
|
-
<div class="row">
|
|
1005
|
-
<div class="col span-6">
|
|
1006
|
-
<LabeledInput v-model.number="podTemplateSpec.priority" :mode="mode" :label="t('workload.scheduling.priority.priority')" />
|
|
1007
|
-
</div>
|
|
1008
|
-
<div class="col span-6">
|
|
1009
|
-
<LabeledInput v-model="podTemplateSpec.priorityClassname" :mode="mode" :label="t('workload.scheduling.priority.className')" />
|
|
1010
|
-
</div>
|
|
1011
|
-
</div>
|
|
1012
|
-
</div>
|
|
1013
|
-
</template>
|
|
1014
|
-
</Tab>
|
|
1015
|
-
<Tab :label="t('workload.container.titles.podScheduling')" name="podScheduling" :weight="tabWeightMap['podScheduling']">
|
|
1016
|
-
<PodAffinity :mode="mode" :value="podTemplateSpec" :nodes="allNodeObjects" />
|
|
1017
|
-
</Tab>
|
|
1018
|
-
<Tab :label="t('workload.container.titles.nodeScheduling')" name="nodeScheduling" :weight="tabWeightMap['nodeScheduling']">
|
|
1019
|
-
<NodeScheduling :mode="mode" :value="podTemplateSpec" :nodes="allNodes" />
|
|
1020
|
-
</Tab>
|
|
1021
|
-
<Tab :label="t('workload.container.titles.upgrading')" name="upgrading" :weight="tabWeightMap['upgrading']">
|
|
1022
|
-
<Job v-if="isJob || isCronJob" v-model="spec" :mode="mode" :type="type" />
|
|
1023
|
-
<Upgrading v-else v-model="spec" :mode="mode" :type="type" />
|
|
1024
|
-
</Tab>
|
|
1025
|
-
<Tab v-if="!isInitContainer" :label="t('workload.container.titles.healthCheck')" name="healthCheck" :weight="tabWeightMap['healthCheck']">
|
|
1026
|
-
<HealthCheck v-model="healthCheck" :mode="mode" />
|
|
1027
|
-
</Tab>
|
|
1028
|
-
<Tab :label="t('workload.container.titles.securityContext')" name="securityContext" :weight="tabWeightMap['securityContext']">
|
|
1029
|
-
<Security v-model="container.securityContext" :mode="mode" />
|
|
1030
|
-
<div class="spacer"></div>
|
|
1031
|
-
<div>
|
|
1032
|
-
<h3>{{ t('workload.container.security.podFsGroup') }}</h3>
|
|
1033
|
-
<div class="row">
|
|
1034
|
-
<div class="col span-6">
|
|
1035
|
-
<LabeledInput v-model.number="podFsGroup" type="number" :mode="mode" :label="t('workload.container.security.fsGroup')" />
|
|
1036
|
-
</div>
|
|
1037
|
-
</div>
|
|
1038
|
-
</div>
|
|
1039
|
-
</Tab>
|
|
1040
|
-
<Tab :label="t('workload.container.titles.networking')" name="networking" :weight="tabWeightMap['networking']">
|
|
1041
|
-
<Networking v-model="podTemplateSpec" :mode="mode" />
|
|
1042
|
-
</Tab>
|
|
1043
|
-
<Tab v-if="isStatefulSet" :label="t('workload.container.titles.volumeClaimTemplates')" name="volumeClaimTemplates" :weight="tabWeightMap['volumeClaimTemplates']">
|
|
1044
|
-
<VolumeClaimTemplate v-model="spec" :mode="mode" />
|
|
1045
|
-
</Tab>
|
|
1046
|
-
<Tab name="labels" label-key="generic.labelsAndAnnotations" :weight="tabWeightMap['labels']">
|
|
1047
|
-
<Labels v-model="value" :mode="mode" />
|
|
1048
|
-
<div class="spacer"></div>
|
|
1049
|
-
|
|
1050
|
-
<div>
|
|
1051
|
-
<h3>{{ t('workload.container.titles.podLabels') }}</h3>
|
|
1052
|
-
<div class="row mb-20">
|
|
1053
|
-
<KeyValue
|
|
1054
|
-
key="labels"
|
|
1055
|
-
v-model="podLabels"
|
|
1056
|
-
:add-label="t('labels.addLabel')"
|
|
1057
|
-
:mode="mode"
|
|
1058
|
-
:read-allowed="false"
|
|
1059
|
-
:protip="false"
|
|
1060
|
-
/>
|
|
1061
|
-
</div>
|
|
1062
|
-
<div class="spacer"></div>
|
|
1063
|
-
<h3>{{ t('workload.container.titles.podAnnotations') }}</h3>
|
|
1064
|
-
<div class="row">
|
|
1065
|
-
<KeyValue
|
|
1066
|
-
key="annotations"
|
|
1067
|
-
v-model="podAnnotations"
|
|
1068
|
-
:add-label="t('labels.addAnnotation')"
|
|
1069
|
-
:mode="mode"
|
|
1070
|
-
:read-allowed="false"
|
|
1071
|
-
:protip="false"
|
|
1072
|
-
/>
|
|
1073
|
-
</div>
|
|
1074
|
-
</div>
|
|
1075
|
-
</Tab>
|
|
1076
|
-
</Tabbed>
|
|
1077
|
-
</CruResource>
|
|
1078
|
-
</form>
|
|
29
|
+
<div>
|
|
30
|
+
<Loading v-if="$fetchState.pending" />
|
|
31
|
+
<WorkloadDeployment v-else-if="isDeployment" :mode="mode" :value="value" />
|
|
32
|
+
<WorkloadGeneric v-else :mode="mode" :value="value" />
|
|
33
|
+
</div>
|
|
1079
34
|
</template>
|
|
1080
|
-
|
|
1081
|
-
<style lang='scss'>
|
|
1082
|
-
.container-row{
|
|
1083
|
-
display: flex;
|
|
1084
|
-
align-items: center;
|
|
1085
|
-
margin-bottom: 20px;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
.type-placeholder{
|
|
1089
|
-
color: white;
|
|
1090
|
-
font-size: 2.5em;
|
|
1091
|
-
height: 100%;
|
|
1092
|
-
width: 100%;
|
|
1093
|
-
background-color: var(--primary);
|
|
1094
|
-
display: flex;
|
|
1095
|
-
justify-content: center;
|
|
1096
|
-
align-items: center;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
.type-description{
|
|
1100
|
-
color: var(--input-label)
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
.next-dropdown{
|
|
1104
|
-
display: inline-block;
|
|
1105
|
-
}
|
|
1106
|
-
</style>
|