jerryshao commented on code in PR #15001:
URL: https://github.com/apache/gravitino/pull/15001#discussion_r4639835212
##########
dev/charts/gravitino/templates/schema-migrate-job.yaml:
##########
@@ -0,0 +1,182 @@
+{{- /*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */}}
+
+{{- if eq (include "gravitino.schemaMigrateEnabled" . | trim) "true" }}
+{{- $_ := include "gravitino.schemaMigrateSslValidate" . }}
+{{- $engine := include "gravitino.schemaMigrateEngine" . | trim }}
+{{- $dbHost := include "gravitino.schemaMigrateHost" . | trim }}
+{{- $dbPort := include "gravitino.schemaMigratePort" . | trim }}
+{{- $dbName := include "gravitino.schemaMigrateDatabase" . | trim }}
+{{- $pgSchema := include "gravitino.schemaMigrateCurrentSchema" . | trim }}
+{{- $pgSslMode := include "gravitino.schemaMigrateSslMode" . | trim }}
+{{- $sslCaSecret := include "gravitino.schemaMigrateSslCaSecretName" . | trim
}}
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: {{ printf "%s-schema-migrate-r%d" .Release.Name .Release.Revision |
trunc 63 | trimSuffix "-" }}
Review Comment:
[P2] For a 48-character release name, truncating the complete string removes
the revision suffix, so revisions 1 and 2 get the same Job name. Upgrading the
image before the previous Job's 600-second TTL expires then attempts to update
its immutable pod template instead of creating a migration Job. Please truncate
the release-name portion while reserving space for the complete revision
suffix, and add a test asserting distinct names across revisions for long
release names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]