add the pod delete feature to the kubernetes react plugin (#24534)
* add the pod delete feature to the kubernetes react plugin Signed-off-by: sebalaini <sebastianolaini@gmail.com> * move podDelete into PodDrawer Signed-off-by: sebalaini <sebastianolaini@gmail.com> * remove dialog and use only a button Signed-off-by: sebalaini <sebastianolaini@gmail.com> * move config inside frontend object Signed-off-by: sebalaini <sebastianolaini@gmail.com> * update the k8 configration.md documentation Signed-off-by: sebalaini <sebastianolaini@gmail.com> * add error ui if error Signed-off-by: sebalaini <sebastianolaini@gmail.com> * refactor restart text logic Signed-off-by: sebalaini <sebastianolaini@gmail.com> * fix test var name Signed-off-by: sebalaini <sebastianolaini@gmail.com> * fix doc key Signed-off-by: sebalaini <sebastianolaini@gmail.com> * revert last commit Signed-off-by: sebalaini <sebastianolaini@gmail.com> * add i18n Signed-off-by: sebalaini <sebastianolaini@gmail.com> * Update plugins/kubernetes-react/src/translation.ts Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com> Signed-off-by: Seba <17096352+sebalaini@users.noreply.github.com> * remove buttonText config Signed-off-by: sebalaini <sebastianolaini@gmail.com> * add alpha and doc Signed-off-by: sebalaini <sebastianolaini@gmail.com> * add alpha api report Signed-off-by: sebalaini <sebastianolaini@gmail.com> --------- Signed-off-by: sebalaini <sebastianolaini@gmail.com> Signed-off-by: Seba <17096352+sebalaini@users.noreply.github.com> Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -17,6 +17,9 @@ The following is a full example entry in `app-config.yaml`:
|
||||
|
||||
```yaml
|
||||
kubernetes:
|
||||
frontend:
|
||||
podDelete:
|
||||
enabled: true
|
||||
serviceLocatorMethod:
|
||||
type: 'multiTenant'
|
||||
clusterLocatorMethods:
|
||||
@@ -48,6 +51,55 @@ kubernetes:
|
||||
exposeDashboard: true
|
||||
```
|
||||
|
||||
### `frontend` (optional)
|
||||
|
||||
This is an array used to configure some frontend features.
|
||||
|
||||
Valid values are:
|
||||
|
||||
- `podDelete`
|
||||
|
||||
#### `podDelete` (optional)
|
||||
|
||||
This configures the behavior of the delete pod button in the container panel.
|
||||
|
||||
Valid configurations are:
|
||||
|
||||
- `enabled`
|
||||
|
||||
##### `enabled`
|
||||
|
||||
This configuration controls the visibility of this feature.
|
||||
|
||||
Valid values are:
|
||||
|
||||
- `true`
|
||||
- `false`
|
||||
|
||||
The default value is `false`.
|
||||
|
||||
#### Internationalization
|
||||
|
||||
To customize or translate the **Delete Pod** text, use the following approach:
|
||||
|
||||
```js
|
||||
import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
|
||||
import { kubernetesReactTranslationRef } from '@backstage/plugin-kubernetes-react/alpha';
|
||||
|
||||
const app = createApp({
|
||||
__experimentalTranslations: {
|
||||
resources: [
|
||||
createTranslationMessages({
|
||||
ref: kubernetesReactTranslationRef,
|
||||
messages: {
|
||||
"podDrawer.buttons.delete": 'Restart Pod'
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
...
|
||||
```
|
||||
|
||||
### `serviceLocatorMethod`
|
||||
|
||||
This configures how to determine which clusters a component is running in.
|
||||
|
||||
Reference in New Issue
Block a user