Skip to content

Commit 088ccc2

Browse files
authored
No Resource List in Multiclusterapplicationsetreports of pull model if a standalone ArgoCD app is created on the managed cluster (#127)
Signed-off-by: Xiangjing Li <[email protected]>
1 parent 7b6cb0c commit 088ccc2

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ build-images: build
6565
@docker build -t ${IMAGE_NAME_AND_VERSION} -f build/Dockerfile .
6666

6767
# build local linux/amd64 images on non-amd64 hosts such as Apple M3
68+
# need to create the buildx builder as a fixed name and clean it up after usage
69+
# Or a new builder is created everytime and it will fail docker buildx image build eventually.
6870
build-images-non-amd64-docker:
69-
docker buildx create --use
70-
docker buildx inspect --bootstrap
71-
@docker buildx build --platform linux/amd64 -t ${IMAGE_NAME_AND_VERSION} -f build/Dockerfile --load .
71+
docker buildx create --name local-builder --use
72+
docker buildx inspect local-builder --bootstrap
73+
docker buildx build --platform linux/amd64 -t ${IMAGE_NAME_AND_VERSION} -f build/Dockerfile --load .
74+
docker buildx rm local-builder
75+
7276

7377
build-images-non-amd64-podman:
7478
podman build --platform linux/amd64 -t ${IMAGE_NAME_AND_VERSION} -f build/Dockerfile .

common/scripts/gobuild.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ shift
2929
set -e
3030

3131
BUILD_GOOS=${GOOS:-linux}
32-
BUILD_GOARCH=${GOARCH:-$(go env GOARCH)}
32+
BUILD_GOARCH=${GOARCH:-amd64}
3333
GOBINARY=${GOBINARY:-go}
3434
BUILDINFO=${BUILDINFO:-""}
3535
STATIC=${STATIC:-1}

pkg/controller/gitopssyncresc/gitopssyncresc_controller.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ func (r *GitOpsSyncResource) syncResources() error {
177177

178178
apps, related, err := r.getArgoAppsFromSearch(queryManagedClustersStr, "", "")
179179
if err != nil {
180-
return err
180+
klog.Info(err.Error())
181+
continue
181182
}
182183

183184
for _, app := range apps {
@@ -190,16 +191,16 @@ func (r *GitOpsSyncResource) syncResources() error {
190191

191192
// Skip application that don't belong to an appset
192193
if hostingAppsetName == nil {
193-
klog.V(1).Infof("skip application %v/%v on cluster %v, it does not belong to an appset", itemmap["namespace"], itemmap["name"], managedClusterName)
194-
return nil
194+
klog.Infof("skip application %v/%v on cluster %v, it does not belong to an appset", itemmap["namespace"], itemmap["name"], managedClusterName)
195+
continue
195196
}
196197

197198
appsetNsn := strings.Split(hostingAppsetName.(string), "/")
198199
if len(appsetNsn) != 3 {
199200
err := fmt.Errorf("_hostingResource is not in the correct format: %v", hostingAppsetName)
200201
klog.Info(err.Error())
201202

202-
return err
203+
continue
203204
}
204205

205206
reportKey := appsetNsn[1] + "_" + appsetNsn[2]
@@ -230,7 +231,7 @@ func (r *GitOpsSyncResource) syncResources() error {
230231
report.Statuses.Resources = append(relatedResources, unhealthyResources...)
231232
}
232233

233-
klog.V(1).Infof("resources for app (%v/%v): %v", itemmap["namespace"], itemmap["name"], report.Statuses.Resources)
234+
klog.Infof("resources for app (%v/%v): %v", itemmap["namespace"], itemmap["name"], report.Statuses.Resources)
234235
}
235236
}
236237
}

0 commit comments

Comments
 (0)