@@ -12,6 +12,7 @@ import (
12
12
apierrors "k8s.io/apimachinery/pkg/api/errors"
13
13
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14
14
"k8s.io/apimachinery/pkg/util/intstr"
15
+ "k8s.io/apimachinery/pkg/util/sets"
15
16
corev1ac "k8s.io/client-go/applyconfigurations/core/v1"
16
17
rbacv1ac "k8s.io/client-go/applyconfigurations/rbac/v1"
17
18
@@ -161,6 +162,7 @@ func HostnamesForService(serviceName, namespace string) []string {
161
162
return []string {
162
163
fmt .Sprintf ("%s.%s" , serviceName , namespace ),
163
164
fmt .Sprintf ("%s.%s.svc" , serviceName , namespace ),
165
+ fmt .Sprintf ("%s.%s.svc.cluster.local" , serviceName , namespace ),
164
166
}
165
167
}
166
168
@@ -274,15 +276,15 @@ func shouldRotateCerts(certSecret *corev1.Secret, hosts []string) bool {
274
276
func (i * StrategyDeploymentInstaller ) ShouldRotateCerts (s Strategy ) (bool , error ) {
275
277
strategy , ok := s .(* v1alpha1.StrategyDetailsDeployment )
276
278
if ! ok {
277
- return false , fmt .Errorf ("attempted to install %s strategy with deployment installer" , strategy .GetStrategyName ())
279
+ return false , fmt .Errorf ("failed to install %s strategy with deployment installer: unsupported deployment install strategy " , strategy .GetStrategyName ())
278
280
}
279
281
280
- hasCerts := map [string ]struct {}{}
282
+ hasCerts := sets . New [string ]()
281
283
for _ , c := range i .getCertResources () {
282
- hasCerts [ c .getDeploymentName ()] = struct {}{}
284
+ hasCerts . Insert ( c .getDeploymentName ())
283
285
}
284
286
for _ , sddSpec := range strategy .DeploymentSpecs {
285
- if _ , ok := hasCerts [ sddSpec .Name ]; ok {
287
+ if hasCerts . Has ( sddSpec .Name ) {
286
288
certSecret , err := i .strategyClient .GetOpLister ().CoreV1 ().SecretLister ().Secrets (i .owner .GetNamespace ()).Get (SecretName (ServiceName (sddSpec .Name )))
287
289
if err == nil {
288
290
if shouldRotateCerts (certSecret , HostnamesForService (ServiceName (sddSpec .Name ), i .owner .GetNamespace ())) {
0 commit comments