Skip to content

Commit

Permalink
feat: Resolve image name dynamically based on extension configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
marc1404 committed Jan 20, 2025
1 parent f8ff50e commit 3546561
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions pkg/apis/service/utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package service

import "github.com/gardener/gardener-extension-shoot-dns-service/pkg/service"

// ResolveImageName returns the image name based on the cleanup metadata records flag.
// TODO(marc1404): Remove once metadata records have been cleaned up.
func (dnsconfig *DNSConfig) ResolveImageName() string {
if dnsconfig.CleanupMetadataRecords != nil && *dnsconfig.CleanupMetadataRecords {
return service.ImageName
}

return service.ImageNameWithMetadataRecords
}
5 changes: 3 additions & 2 deletions pkg/controller/lifecycle/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,10 @@ func (a *actuator) createOrUpdateSeedResources(ctx context.Context, dnsconfig *a
}
chartValues["targetClusterSecret"] = gutil.SecretNamePrefixShootAccess + service.ShootAccessSecretName

chartValues, err = chart.InjectImages(chartValues, imagevector.ImageVector(), []string{service.ImageName})
imageName := dnsconfig.ResolveImageName()
chartValues, err = chart.InjectImages(chartValues, imagevector.ImageVector(), []string{imageName})
if err != nil {
return fmt.Errorf("failed to find image version for %s: %v", service.ImageName, err)
return fmt.Errorf("failed to find image version for %s: %v", imageName, err)
}

a.Info("Component is being applied", "component", service.ExtensionServiceName, "namespace", namespace)
Expand Down

0 comments on commit 3546561

Please sign in to comment.