Skip to content

Commit bc29a32

Browse files
committed
Implement retry logic for image signing in GitHub Actions workflow to handle transient Sigstore issues. Update deployment commands in config.go to remove unnecessary ownership changes while maintaining permissions for asset directories.
1 parent c8a5b4b commit bc29a32

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/docker-publish.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,23 @@ jobs:
9797
env:
9898
DIGEST: ${{ steps.build.outputs.digest }}
9999
run: |
100-
echo "${{ steps.meta.outputs.tags }}" | xargs -I {} -P 4 cosign sign --yes {}@${DIGEST}
100+
# Simple retry for transient Sigstore issues
101+
for tag in ${{ steps.meta.outputs.tags }}; do
102+
echo "Signing: $tag@${DIGEST}"
103+
if ! cosign sign --yes "$tag@${DIGEST}"; then
104+
echo "First attempt failed, retrying in 10 seconds..."
105+
sleep 10
106+
if ! cosign sign --yes "$tag@${DIGEST}"; then
107+
echo "❌ Failed to sign $tag after retry"
108+
echo "::warning::Failed to sign image $tag - continuing with unsigned image"
109+
# Continue with other images rather than failing entire workflow
110+
else
111+
echo "✅ Successfully signed $tag on retry"
112+
fi
113+
else
114+
echo "✅ Successfully signed $tag"
115+
fi
116+
done
101117
102118
# Separate job for PR validation
103119
validate:

pkg/homer/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func CreateDeployment(name string, namespace string, replicas *int32, owner clie
289289
Command: []string{
290290
"sh",
291291
"-c",
292-
"cp /config/config.yml /www/assets/config.yml && chown -R 1000:1000 /www/assets && chmod -R 755 /www/assets",
292+
"cp /config/config.yml /www/assets/config.yml && chmod -R 755 /www/assets",
293293
},
294294
SecurityContext: &corev1.SecurityContext{
295295
AllowPrivilegeEscalation: &[]bool{false}[0],
@@ -592,7 +592,7 @@ func CreateDeploymentWithAssets(name string, namespace string, replicas *int32,
592592
}
593593

594594
// Complete init command with permissions
595-
initCommand += " && chown -R 1000:1000 /www/assets && chmod -R 755 /www/assets"
595+
initCommand += " && chmod -R 755 /www/assets"
596596

597597
d := &appsv1.Deployment{
598598
ObjectMeta: metav1.ObjectMeta{

0 commit comments

Comments
 (0)