Skip to content

Commit 2c5cf63

Browse files
committed
Enhance HTTPRoute controller with exponential backoff retry logic for ConfigMap updates to handle conflicts. Update Makefile to enable Gateway API when running the controller. Modify Docker publish workflow to improve image signing process with retries for transient issues.
1 parent bc29a32 commit 2c5cf63

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

.github/workflows/docker-publish.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,25 @@ jobs:
9696
if: github.event_name != 'pull_request'
9797
env:
9898
DIGEST: ${{ steps.build.outputs.digest }}
99+
TAGS: ${{ steps.meta.outputs.tags }}
99100
run: |
100101
# 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
102+
echo "$TAGS" | while IFS= read -r tag; do
103+
if [[ -n "$tag" ]]; then
104+
echo "Signing: $tag@${DIGEST}"
106105
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
106+
echo "First attempt failed, retrying in 10 seconds..."
107+
sleep 10
108+
if ! cosign sign --yes "$tag@${DIGEST}"; then
109+
echo "❌ Failed to sign $tag after retry"
110+
echo "::warning::Failed to sign image $tag - continuing with unsigned image"
111+
# Continue with other images rather than failing entire workflow
112+
else
113+
echo "✅ Successfully signed $tag on retry"
114+
fi
110115
else
111-
echo "✅ Successfully signed $tag on retry"
116+
echo "✅ Successfully signed $tag"
112117
fi
113-
else
114-
echo "✅ Successfully signed $tag"
115118
fi
116119
done
117120

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ build: manifests generate fmt vet ## Build manager binary.
115115

116116
.PHONY: run
117117
run: manifests generate fmt vet ## Run a controller from your host.
118-
go run ./cmd/main.go
118+
ENABLE_GATEWAY_API=true go run ./cmd/main.go
119119

120120
# If you wish to build the manager image targeting other platforms you can use the --platform flag.
121121
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.

internal/controller/httproute_controller.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ func (r *HTTPRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
5151
return ctrl.Result{}, client.IgnoreNotFound(err)
5252
}
5353

54-
// Check if the HTTPRoute has homer annotations
55-
if len(httproute.Annotations) == 0 {
56-
log.Info("HTTPRoute has no annotations, skipping", "httproute", req.NamespacedName)
57-
return ctrl.Result{}, nil
58-
}
59-
6054
// List all Dashboard CRs
6155
dashboardList := &homerv1alpha1.DashboardList{}
6256
if err := r.List(ctx, dashboardList); err != nil {

pkg/homer/config.go

Lines changed: 3 additions & 3 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 && chmod -R 755 /www/assets",
292+
"cp /config/config.yml /www/assets/config.yml",
293293
},
294294
SecurityContext: &corev1.SecurityContext{
295295
AllowPrivilegeEscalation: &[]bool{false}[0],
@@ -591,8 +591,8 @@ func CreateDeploymentWithAssets(name string, namespace string, replicas *int32,
591591
initCommand += " && cat > /www/assets/manifest.json << 'EOF'\n" + pwaManifest + "\nEOF"
592592
}
593593

594-
// Complete init command with permissions
595-
initCommand += " && chmod -R 755 /www/assets"
594+
// Complete init command (FSGroup handles permissions)
595+
// No chmod needed - FSGroup=1000 ensures proper volume permissions
596596

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

0 commit comments

Comments
 (0)