From 6579fe41c4791726732b87d14d54be65fefe5a2b Mon Sep 17 00:00:00 2001 From: jiuker Date: Mon, 21 Oct 2024 17:09:56 +0800 Subject: [PATCH 1/2] feat:add portName to container feat:add portName to container --- pkg/apis/minio.min.io/v2/constants.go | 3 +++ pkg/resources/statefulsets/minio-statefulset.go | 1 + 2 files changed, 4 insertions(+) diff --git a/pkg/apis/minio.min.io/v2/constants.go b/pkg/apis/minio.min.io/v2/constants.go index 61463b31b01..8e2c793f243 100644 --- a/pkg/apis/minio.min.io/v2/constants.go +++ b/pkg/apis/minio.min.io/v2/constants.go @@ -69,6 +69,9 @@ const Revision = "min.io/revision" // MinIOPort specifies the default Tenant port number. const MinIOPort = 9000 +// MinIOPortName specifies the default Container port name +const MinIOPortName = "minio-port" + // MinIOSFTPPort specifies the default Tenant SFTP port number. const MinIOSFTPPort = 8022 diff --git a/pkg/resources/statefulsets/minio-statefulset.go b/pkg/resources/statefulsets/minio-statefulset.go index c9e416fe193..e31ab5dc12c 100644 --- a/pkg/resources/statefulsets/minio-statefulset.go +++ b/pkg/resources/statefulsets/minio-statefulset.go @@ -149,6 +149,7 @@ func poolMinioServerContainer(t *miniov2.Tenant, skipEnvVars map[string][]byte, containerPorts := []corev1.ContainerPort{ { + Name: miniov2.MinIOPortName, ContainerPort: miniov2.MinIOPort, }, { From 6addc9cc823dc23afa8c10923d90df46ce7ee999 Mon Sep 17 00:00:00 2001 From: jiuker Date: Mon, 21 Oct 2024 17:48:45 +0800 Subject: [PATCH 2/2] adds more adds more --- pkg/apis/minio.min.io/v2/constants.go | 6 ++++++ pkg/resources/statefulsets/minio-statefulset.go | 2 ++ 2 files changed, 8 insertions(+) diff --git a/pkg/apis/minio.min.io/v2/constants.go b/pkg/apis/minio.min.io/v2/constants.go index 8e2c793f243..b4b9c6ae5ca 100644 --- a/pkg/apis/minio.min.io/v2/constants.go +++ b/pkg/apis/minio.min.io/v2/constants.go @@ -72,6 +72,12 @@ const MinIOPort = 9000 // MinIOPortName specifies the default Container port name const MinIOPortName = "minio-port" +// ConsolePortName specifies the default Container port name +const ConsolePortName = "console-port" + +// MinIOSFTPPortName specifies the default Container port name +const MinIOSFTPPortName = "sftp-port" + // MinIOSFTPPort specifies the default Tenant SFTP port number. const MinIOSFTPPort = 8022 diff --git a/pkg/resources/statefulsets/minio-statefulset.go b/pkg/resources/statefulsets/minio-statefulset.go index e31ab5dc12c..debe4deecd2 100644 --- a/pkg/resources/statefulsets/minio-statefulset.go +++ b/pkg/resources/statefulsets/minio-statefulset.go @@ -153,6 +153,7 @@ func poolMinioServerContainer(t *miniov2.Tenant, skipEnvVars map[string][]byte, ContainerPort: miniov2.MinIOPort, }, { + Name: miniov2.ConsolePortName, ContainerPort: int32(consolePort), }, } @@ -164,6 +165,7 @@ func poolMinioServerContainer(t *miniov2.Tenant, skipEnvVars map[string][]byte, "--sftp", "ssh-private-key=" + pkFile, }...) containerPorts = append(containerPorts, corev1.ContainerPort{ + Name: miniov2.MinIOSFTPPortName, ContainerPort: miniov2.MinIOSFTPPort, }) }