Skip to content

Conversation

pengzhouml
Copy link
Collaborator

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Ports the Helm-based liveness probe to the operator, adds retry logic for configure_group in the postStart hook, removes the legacy script, and updates the default HAProxy image.

  • Replace Exec-based liveness probe with a TCP socket check on port 8001
  • Introduce a retry helper and wrap configure_group calls in postStart hook
  • Delete obsolete liveness-probe.sh script and bump HAProxy default image to v3.2.1

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
pkg/k8sutil/statefulset.go Switch liveness probe from ExecAction script to TCPSocketAction
pkg/k8sutil/scripts/poststart-hook.sh Add retry function and wrap configure_group calls
pkg/k8sutil/scripts/liveness-probe.sh Remove obsolete liveness probe script
api/v1/common_types.go Update HAProxy default image from 3.2 to 3.2.1
Comments suppressed due to low confidence (2)

pkg/k8sutil/scripts/poststart-hook.sh:59

  • New retry logic is introduced; consider adding unit or integration tests to verify that configure_group is retried as expected on failure.
retry() {

api/v1/common_types.go:85

  • After updating the default HAProxy image tag, regenerate CRDs or update API documentation to reflect this new default version.
	// +kubebuilder:default:="haproxytech/haproxy-alpine:3.2.1"

Comment on lines +67 to +70
echo "Command failed after $retries attempts."
return $exit_code
fi
echo "Attempt $count failed. Retrying..."
Copy link
Preview

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Use the existing log function instead of echo so retries are recorded in the pod log and /tmp/script.log.

Suggested change
echo "Command failed after $retries attempts."
return $exit_code
fi
echo "Attempt $count failed. Retrying..."
log "Error" "Command failed after $retries attempts."
return $exit_code
fi
log "Info" "Attempt $count failed. Retrying..."

Copilot uses AI. Check for mistakes.

echo "Command failed after $retries attempts."
return $exit_code
fi
echo "Attempt $count failed. Retrying..."
Copy link
Preview

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Replace this echo with the log helper to ensure consistent logging with timestamps and PID handling.

Suggested change
echo "Attempt $count failed. Retrying..."
info "Attempt $count failed. Retrying..."

Copilot uses AI. Check for mistakes.

Makefile Outdated
ifeq ($(VERIFY_HUGE_PAGES), true)
@echo "=====Setting hugepages value to 1280 for hugepages-e2e test"
sudo sysctl -w vm.nr_hugepages=1280
# @echo "=====Setting hugepages value to 1280 for hugepages-e2e test"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting huge pages is required to verify the huge pages.
please comment if I am missing anything here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@barkhachoithani , I accidentally commit these comments for my local test. I've revert chose changes back

@pengzhouml pengzhouml merged commit 643f3ee into develop Jul 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants