Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 3297a87

Browse files
committed
cleanup
1 parent 7d49091 commit 3297a87

File tree

8 files changed

+189
-173
lines changed

8 files changed

+189
-173
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ CAPI_KIND_CLUSTER_NAME ?= capi-test
231231
# It is set by Prow GIT_TAG, a git-based tag of the form vYYYYMMDD-hash, e.g., v20210120-v0.3.10-308-gc61521971
232232

233233
# Next release is: v0.3.2
234-
TAG ?= v0.3.2-preview.26
234+
TAG ?= v0.3.2-preview.28
235235
ARCH ?= $(shell go env GOARCH)
236236
ALL_ARCH = amd64 arm arm64
237237

api/v1alpha1/condition_consts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2222
const (
2323
// DeploymentProgressingCondition indicates that the cdk8s application deployment is progressing.
2424
DeploymentProgressingCondition clusterv1.ConditionType = "DeploymentProgressing"
25-
2625
// GitCloneFailedReason indicates that git clone operation failed.
2726
GitCloneFailedReason = "GitCloneFailed"
2827
// GitCheckoutFailedReason indicates that git checkout operation failed.
2928
GitCheckoutFailedReason = "GitCheckoutFailed"
3029
// SourceNotSpecifiedReason indicates that no source (GitRepository) was specified.
3130
SourceNotSpecifiedReason = "SourceNotSpecified"
31+
GitOperationFailedReason = "GitOperationFailed"
3232
// Cdk8sSynthFailedReason indicates that cdk8s synth operation failed.
3333
Cdk8sSynthFailedReason = "Cdk8sSynthFailed"
3434
// WalkDistFailedReason indicates that walking the dist directory failed.

config/default/manager_image_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
template:
88
spec:
99
containers:
10-
- image: ghcr.io/patricklaabs/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller:v0.3.2-preview.26
10+
- image: ghcr.io/patricklaabs/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller:v0.3.2-preview.28
1111
name: manager

config/default/manager_image_patch.yaml-e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
template:
88
spec:
99
containers:
10-
- image: ghcr.io/patricklaabs/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller:v0.3.2-preview.26
10+
- image: ghcr.io/patricklaabs/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller:v0.3.2-preview.28
1111
name: manager

controllers/cdk8sappproxy/cdk8sappproxy_consts.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ const (
77

88
// Operation represents the type of operation being performed by the cdk8sappproxy controller.
99
const (
10-
OperationDeletion = "deletion"
11-
OperationNormal = "normal"
12-
OperationPolling = "polling"
13-
OperationFindFiles = "findFiles"
14-
OperationSynthesize = "synthesize"
15-
OperationApply = "apply"
16-
OperationNpmInstall = "npmInstall"
10+
OperationDeletion = "deletion"
11+
OperationNormal = "normal"
1712
)

controllers/cdk8sappproxy/cdk8sappproxy_controller.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,20 @@ func (r *Reconciler) checkIfResourceExists(ctx context.Context, dynClient dynami
8787
}
8888

8989
func (r *Reconciler) synthesizeAndParseResources(appSourcePath string, logger logr.Logger) ([]*unstructured.Unstructured, error) {
90+
reason := addonsv1alpha1.Cdk8sSynthFailedReason
9091
// Synthesize cdk8s application
91-
if err := r.synthesizeCdk8sApp(appSourcePath, logger, OperationSynthesize); err != nil {
92+
if err := r.synthesizeCdk8sApp(appSourcePath, logger, reason); err != nil {
9293
return nil, err
9394
}
9495

9596
// Find manifest files
96-
manifestFiles, err := r.findManifestFiles(appSourcePath, logger, OperationFindFiles)
97+
manifestFiles, err := r.findManifestFiles(appSourcePath, logger, reason)
9798
if err != nil {
9899
return nil, err
99100
}
100101

101102
// Parse resources from manifest files using the consolidated function
102-
return r.parseManifestFiles(manifestFiles, logger, OperationSynthesize)
103+
return r.parseManifestFiles(manifestFiles, logger, reason)
103104
}
104105

105106
func (r *Reconciler) synthesizeCdk8sApp(appSourcePath string, logger logr.Logger, operation string) error {
@@ -212,7 +213,7 @@ func (r *Reconciler) deleteResourcesFromClusters(ctx context.Context, cdk8sAppPr
212213
dynamicClient, err := r.getDynamicClientForCluster(ctx, cdk8sAppProxy.Namespace, cluster.Name)
213214
if err != nil {
214215
clusterLogger.Error(err, "Failed to get dynamic client for cluster during deletion, skipping this cluster")
215-
// Log error but continue with other clusters
216+
216217
continue
217218
}
218219

0 commit comments

Comments
 (0)