Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controller): agent image name parsing #42

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

starbops
Copy link
Member

@starbops starbops commented Feb 10, 2025

IMPORTANT: Please do not create a Pull Request without creating an issue first.

Problem:

Previously, enabling the Managed DHCP add-on with images containing port numbers in their name caused the controller pod to crash.

Solution:

Handle the image name properly with support for the following cases:

  • Names containing port numbers
  • Names without tags (default to latest)

Related Issue:

harvester/harvester#7549

Test plan:

  1. Prepare a v1.4.1 Harvester cluster
  2. Create the Managed DHCP Addon CR with the following content
    apiVersion: harvesterhci.io/v1beta1
    kind: Addon
    metadata:
      name: harvester-vm-dhcp-controller
      namespace: harvester-system
      labels:
        addon.harvesterhci.io/experimental: "true"
    spec:
      enabled: false
      repo: https://charts.harvesterhci.io
      version: 0.3.3
      chart: harvester-vm-dhcp-controller
      valuesContent: |
        image:
          repo: starbops/harvester-vm-dhcp-controller
          tag: fix-7549-head
        agent:
          image:
            repo: myregistry.local:5000/rancher/harvester-vm-dhcp-agent
    
  3. Enable the add-on
  4. The controller manager pod should be running fine without crashing

Support image name with registry prefix containing port number or
without tag (default to latest)
Copy link

@ihcsim ihcsim left a comment

Choose a reason for hiding this comment

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

+1000 to the unit test! thanks!

@starbops starbops requested a review from mingshuoqiu February 13, 2025 11:05
@starbops
Copy link
Member Author

@mergify backport v1.5

Copy link

mergify bot commented Feb 24, 2025

backport v1.5

✅ Backports have been created

@starbops starbops merged commit 36c78a5 into harvester:main Feb 25, 2025
6 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.

3 participants