Skip to content

Commit f93464b

Browse files
authored
Merge pull request #208 from gianlucam76/release-0.9
Release 0.9
2 parents 78b7d30 + b8adfed commit f93464b

12 files changed

+21
-21
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'main'
77
- 'dev'
88
pull_request:
9-
types: opened
9+
types: [opened, edited, reopened]
1010

1111

1212
jobs:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARCH ?= amd64
2525
OS ?= $(shell uname -s | tr A-Z a-z)
2626
K8S_LATEST_VER ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
2727
export CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
28-
TAG ?= v0.9.0
28+
TAG ?= v0.9.1
2929

3030
# Get cluster-api version and build ldflags
3131
clusterapi := $(shell go list -m sigs.k8s.io/cluster-api)

config/default/manager_image_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ spec:
88
spec:
99
containers:
1010
# Change the value of image field below to your controller image URL
11-
- image: projectsveltos/addon-manager-amd64:v0.9.0
11+
- image: projectsveltos/addon-manager-amd64:v0.9.1
1212
name: manager

controllers/clustersummary_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (r *ClusterSummaryReconciler) reconcileDelete(
211211

212212
err = r.removeResourceSummary(ctx, clusterSummaryScope, logger)
213213
if err != nil {
214-
logger.V(logs.LogInfo).Info("failed to remove ResourceSummary.")
214+
logger.V(logs.LogInfo).Error(err, "failed to remove ResourceSummary.")
215215
return reconcile.Result{Requeue: true, RequeueAfter: deleteRequeueAfter}, nil
216216
}
217217

controllers/handlers_resources.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,17 @@ func deployResources(ctx context.Context, c client.Client,
7272
var remoteResourceReports []configv1alpha1.ResourceReport
7373
localResourceReports, remoteResourceReports, err = deployReferencedObjects(ctx, c, remoteRestConfig,
7474
clusterSummary, featureHandler, logger)
75-
if err != nil {
76-
return err
77-
}
7875

79-
clusterProfileOwnerRef, err := configv1alpha1.GetClusterProfileOwnerReference(clusterSummary)
76+
// Irrespective of error, update deployed gvks. Otherwise cleanup won't happen in case
77+
gvkErr := updateDeployedGroupVersionKind(ctx, clusterSummary, localResourceReports, remoteResourceReports, logger)
8078
if err != nil {
8179
return err
8280
}
81+
if gvkErr != nil {
82+
return gvkErr
83+
}
8384

84-
err = updateDeployedGroupVersionKind(ctx, clusterSummary, localResourceReports, remoteResourceReports, logger)
85+
clusterProfileOwnerRef, err := configv1alpha1.GetClusterProfileOwnerReference(clusterSummary)
8586
if err != nil {
8687
return err
8788
}

controllers/handlers_utils.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,22 +478,21 @@ func deployReferencedObjects(ctx context.Context, c client.Client, remoteConfig
478478
localConfig.Impersonate = rest.ImpersonationConfig{
479479
UserName: fmt.Sprintf("system:serviceaccount:%s:%s", adminNamespace, adminName),
480480
}
481-
logger.Info("MGIANLUC")
482481
}
483482
tmpResourceReports, err = deployObjects(ctx, c, localConfig, objectsToDeployLocally, clusterSummary,
484483
mgtmResources, logger)
484+
localReports = append(localReports, tmpResourceReports...)
485485
if err != nil {
486-
return nil, nil, err
486+
return localReports, nil, err
487487
}
488-
localReports = append(localReports, tmpResourceReports...)
489488

490489
// Deploy all resources that need to be deployed in the managed cluster
491490
tmpResourceReports, err = deployObjects(ctx, remoteClient, remoteConfig, objectsToDeployRemotely, clusterSummary,
492491
mgtmResources, logger)
492+
remoteReports = append(remoteReports, tmpResourceReports...)
493493
if err != nil {
494-
return nil, nil, err
494+
return localReports, remoteReports, err
495495
}
496-
remoteReports = append(remoteReports, tmpResourceReports...)
497496

498497
return localReports, remoteReports, nil
499498
}

controllers/template_instantiation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func instantiateTemplateValues(ctx context.Context, config *rest.Config, c clien
173173
}
174174

175175
templateName := getTemplateName(clusterNamespace, clusterName, requestorName)
176-
tmpl, err := template.New(templateName).Funcs(sprig.FuncMap()).Parse(values)
176+
tmpl, err := template.New(templateName).Option("missingkey=error").Funcs(sprig.FuncMap()).Parse(values)
177177
if err != nil {
178178
return "", err
179179
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/onsi/ginkgo/v2 v2.9.2
1313
github.com/onsi/gomega v1.27.5
1414
github.com/pkg/errors v0.9.1
15-
github.com/projectsveltos/libsveltos v0.9.0
15+
github.com/projectsveltos/libsveltos v0.9.1
1616
github.com/prometheus/client_golang v1.14.0
1717
github.com/spf13/pflag v1.0.5
1818
golang.org/x/text v0.8.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg
529529
github.com/poy/onpar v0.0.0-20200406201722-06f95a1c68e8/go.mod h1:nSbFQvMj97ZyhFRSJYtut+msi4sOY6zJDGCdSc+/rZU=
530530
github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY=
531531
github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg=
532-
github.com/projectsveltos/libsveltos v0.9.0 h1:JYOlEtnFTDqmozNTz7hmuRAW1+VrFlu++ZPZwPv39Rk=
533-
github.com/projectsveltos/libsveltos v0.9.0/go.mod h1:10UR0S+rA8NdP/X8IPWKv1tb0CL4gOOguT2JCXyL/18=
532+
github.com/projectsveltos/libsveltos v0.9.1 h1:6y6oq2FGlDlQ9/6vyA7tzWC6lq0B3X74kDbpSsV8Y5E=
533+
github.com/projectsveltos/libsveltos v0.9.1/go.mod h1:10UR0S+rA8NdP/X8IPWKv1tb0CL4gOOguT2JCXyL/18=
534534
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
535535
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
536536
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=

manifest/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ spec:
15611561
- --v=5
15621562
command:
15631563
- /manager
1564-
image: projectsveltos/addon-manager-amd64:v0.9.0
1564+
image: projectsveltos/addon-manager-amd64:v0.9.1
15651565
livenessProbe:
15661566
httpGet:
15671567
path: /healthz

pkg/drift-detection/drift-detection-manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ spec:
260260
- --run-mode=do-not-send-updates
261261
command:
262262
- /manager
263-
image: projectsveltos/drift-detection-manager-amd64:v0.9.0
263+
image: projectsveltos/drift-detection-manager-amd64:v0.9.1
264264
livenessProbe:
265265
httpGet:
266266
path: /healthz

pkg/drift-detection/drift-detection-manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ spec:
242242
- --run-mode=do-not-send-updates
243243
command:
244244
- /manager
245-
image: projectsveltos/drift-detection-manager-amd64:v0.9.0
245+
image: projectsveltos/drift-detection-manager-amd64:v0.9.1
246246
livenessProbe:
247247
httpGet:
248248
path: /healthz

0 commit comments

Comments
 (0)