Skip to content

Conversation

@AmitSahastra
Copy link
Contributor

@AmitSahastra AmitSahastra commented Sep 18, 2025

This PR fixes the CI/CD image build path for the lxd-initializer image and modifies initialization container parameters to improve deployment consistency and reliability.

  • Consolidates image build variables and updates image tags from dev version to production version
  • Replaces Ubuntu base image with custom lxd-initializer image in init container
  • Updates deployment configuration to use consistent image pull policies and adds node affinity rules

- Modify inti container image and parameters
@AmitSahastra AmitSahastra marked this pull request as ready for review September 18, 2025 11:19
Copy link

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

This PR fixes the CI/CD image build path for the lxd-initializer image and modifies initialization container parameters to improve deployment consistency and reliability.

  • Consolidates image build variables and updates image tags from dev version to production version
  • Replaces Ubuntu base image with custom lxd-initializer image in init container
  • Updates deployment configuration to use consistent image pull policies and adds node affinity rules

Reviewed Changes

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

File Description
lxd-initializer/lxd-initializer-daemonset.yaml Complete removal of standalone DaemonSet configuration
lxd-initializer/integration.md Updates documentation to reference new template file location
controllers/templates/lxd_initializer_ds.yaml Major refactoring of init container logic and image configuration
Makefile Consolidates LXD image build variables and updates version tags

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

initContainers:
- name: ensure-lxd
image: ubuntu:22.04
image: us-east1-docker.pkg.dev/spectro-images/cluster-api/lxd-initializer:v0.6.1-spectro-4.7.13
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

The image tag is hardcoded with a specific version. Consider using a variable or template substitution to make this configurable and consistent with the build system.

Suggested change
image: us-east1-docker.pkg.dev/spectro-images/cluster-api/lxd-initializer:v0.6.1-spectro-4.7.13
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +45
nsenter -t 1 -m -p -- sh -c 'command -v apt-get >/dev/null 2>&1 && apt-get update || true'
nsenter -t 1 -m -p -- sh -c 'command -v apt-get >/dev/null 2>&1 && apt-get install -y snapd systemd || true'
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

The repeated nsenter -t 1 -m -p -- sh -c 'command -v apt-get >/dev/null 2>&1 && pattern creates code duplication. Consider extracting this into a shell function or combining the commands into a single nsenter call.

Suggested change
nsenter -t 1 -m -p -- sh -c 'command -v apt-get >/dev/null 2>&1 && apt-get update || true'
nsenter -t 1 -m -p -- sh -c 'command -v apt-get >/dev/null 2>&1 && apt-get install -y snapd systemd || true'
nsenter -t 1 -m -p -- sh -c 'if command -v apt-get >/dev/null 2>&1; then apt-get update && apt-get install -y snapd systemd; fi || true'

Copilot uses AI. Check for mistakes.
CONTROLLER_IMG ?= ${REGISTRY}/${IMAGE_NAME}


LXD_IMAGE_NAME ?= "lxd-initializer"
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

The variable name should not have quotes around the string value. In Makefiles, quotes are literal and will be included in the variable value, which could cause issues when the variable is used in commands.

Suggested change
LXD_IMAGE_NAME ?= "lxd-initializer"
LXD_IMAGE_NAME ?= lxd-initializer

Copilot uses AI. Check for mistakes.
@AmitSahastra AmitSahastra changed the title - Fix cicd image build path for lxd-initializer image [WIP] Fix cicd image build path for lxd-initializer image Sep 23, 2025
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