fix: thread secret annotations and labels through new helm charts
The new config and pull secret helm releases need to honor user-set annotations and labels for `--resource-type secret` so existing scheduler-k3s annotation tests keep passing. The dedicated charts now render `.Values.global.annotations` and `.Values.global.labels` onto their Secret manifest, and the deploy trigger plumbs `SecretAnnotations` and `SecretLabels` from the global annotation/label config. The rollback regression bats test now uses `dokku ps:rebuild` for its second deploy because git push of an unchanged ref is rejected by the dokku remote.
This commit is contained in:
6 files changed
+69
-16
No files matched your search
@@ -17,9 +17,11 @@ type ImagePullSecretValues struct {
|
||||
|
||||
// ImagePullSecretGlobalValues contains the global values for the image pull secret chart
|
||||
type ImagePullSecretGlobalValues struct {
|
||||
AppName string `yaml:"app_name"`
|
||||
Namespace string `yaml:"namespace"`
|
||||
PullSecretBase64 string `yaml:"pull_secret_base64"`
|
||||
Annotations map[string]string `yaml:"annotations,omitempty"`
|
||||
AppName string `yaml:"app_name"`
|
||||
Labels map[string]string `yaml:"labels,omitempty"`
|
||||
Namespace string `yaml:"namespace"`
|
||||
PullSecretBase64 string `yaml:"pull_secret_base64"`
|
||||
}
|
||||
|
||||
// GetImagePullSecretReleaseName returns the helm release name for the image pull secret
|
||||
@@ -32,8 +34,17 @@ func GetImagePullSecretName(appName string) string {
|
||||
return fmt.Sprintf("pull-secret-%s", appName)
|
||||
}
|
||||
|
||||
// CreateOrUpdateImagePullSecretInput contains the inputs to CreateOrUpdateImagePullSecret
|
||||
type CreateOrUpdateImagePullSecretInput struct {
|
||||
AppName string
|
||||
DockerConfigJSON []byte
|
||||
Annotations map[string]string
|
||||
Labels map[string]string
|
||||
}
|
||||
|
||||
// CreateOrUpdateImagePullSecret creates or updates the image pull secret helm chart for an app
|
||||
func CreateOrUpdateImagePullSecret(ctx context.Context, appName string, dockerConfigJSON []byte) error {
|
||||
func CreateOrUpdateImagePullSecret(ctx context.Context, input CreateOrUpdateImagePullSecretInput) error {
|
||||
appName := input.AppName
|
||||
if err := isKubernetesAvailable(); err != nil {
|
||||
common.LogDebug("kubernetes not available, skipping image pull secret creation")
|
||||
return nil
|
||||
@@ -95,9 +106,11 @@ func CreateOrUpdateImagePullSecret(ctx context.Context, appName string, dockerCo
|
||||
|
||||
values := &ImagePullSecretValues{
|
||||
Global: ImagePullSecretGlobalValues{
|
||||
Annotations: input.Annotations,
|
||||
AppName: appName,
|
||||
Labels: input.Labels,
|
||||
Namespace: namespace,
|
||||
PullSecretBase64: base64.StdEncoding.EncodeToString(dockerConfigJSON),
|
||||
PullSecretBase64: base64.StdEncoding.EncodeToString(input.DockerConfigJSON),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user