Remove ControlPlane.k8s_api_endpoint
This commit is contained in:
parent
03989d24d4
commit
e85f1fc5f4
4 changed files with 32 additions and 5 deletions
|
@ -50,7 +50,6 @@ erDiagram
|
||||||
ControlPlane {
|
ControlPlane {
|
||||||
string name
|
string name
|
||||||
string description
|
string description
|
||||||
string k8s_api_endpoint
|
|
||||||
json api_credentials
|
json api_credentials
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,16 +112,16 @@ class CloudProviderAdmin(admin.ModelAdmin):
|
||||||
@admin.register(ControlPlane)
|
@admin.register(ControlPlane)
|
||||||
class ControlPlaneAdmin(admin.ModelAdmin):
|
class ControlPlaneAdmin(admin.ModelAdmin):
|
||||||
form = ControlPlaneAdminForm
|
form = ControlPlaneAdminForm
|
||||||
list_display = ("name", "cloud_provider", "k8s_api_endpoint")
|
list_display = ("name", "cloud_provider")
|
||||||
list_filter = ("cloud_provider",)
|
list_filter = ("cloud_provider",)
|
||||||
search_fields = ("name", "description", "k8s_api_endpoint")
|
search_fields = ("name", "description")
|
||||||
autocomplete_fields = ("cloud_provider",)
|
autocomplete_fields = ("cloud_provider",)
|
||||||
actions = ["test_kubernetes_connection"]
|
actions = ["test_kubernetes_connection"]
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(
|
(
|
||||||
None,
|
None,
|
||||||
{"fields": ("name", "description", "k8s_api_endpoint", "cloud_provider")},
|
{"fields": ("name", "description", "cloud_provider")},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
_("API Credentials"),
|
_("API Credentials"),
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Generated by Django 5.2b1 on 2025-03-24 10:27
|
||||||
|
|
||||||
|
import encrypted_fields.fields
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
import servala.core.models.service
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("core", "0004_encrypt_api_credentials"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name="controlplane",
|
||||||
|
name="k8s_api_endpoint",
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="controlplane",
|
||||||
|
name="api_credentials",
|
||||||
|
field=encrypted_fields.fields.EncryptedJSONField(
|
||||||
|
help_text="Required fields: certificate-authority-data, server (URL), token",
|
||||||
|
validators=[servala.core.models.service.validate_api_credentials],
|
||||||
|
verbose_name="API credentials",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -89,7 +89,6 @@ def validate_api_credentials(value):
|
||||||
class ControlPlane(models.Model):
|
class ControlPlane(models.Model):
|
||||||
name = models.CharField(max_length=100, verbose_name=_("Name"))
|
name = models.CharField(max_length=100, verbose_name=_("Name"))
|
||||||
description = models.TextField(blank=True, verbose_name=_("Description"))
|
description = models.TextField(blank=True, verbose_name=_("Description"))
|
||||||
k8s_api_endpoint = models.URLField(verbose_name=_("Kubernetes API endpoint"))
|
|
||||||
# Either contains the fields "certificate_authority_data", "server" and "token", or is empty
|
# Either contains the fields "certificate_authority_data", "server" and "token", or is empty
|
||||||
api_credentials = EncryptedJSONField(
|
api_credentials = EncryptedJSONField(
|
||||||
verbose_name=_("API credentials"),
|
verbose_name=_("API credentials"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue