Skip to content

Commit 1595bc5

Browse files
Merge branch 'kubernetes-sigs:main' into feature/custom-reconcile-error-metrics-labeled-by-ACS-error-code
2 parents 106e7dd + 13ed8d7 commit 1595bc5

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Image URL to use all building/pushing image targets
2-
IMG ?= public.ecr.aws/a4z9h2b1/cluster-api-provider-capc:latest
3-
IMG_LOCAL ?= localhost:5000/cluster-api-provider-cloudstack:latest
2+
STAGING_REGISTRY := gcr.io/k8s-staging-capi-cloudstack
3+
REGISTRY ?= $(STAGING_REGISTRY)
4+
IMAGE_NAME ?= capi-cloudstack-controller
5+
TAG ?= dev
6+
IMG ?= $(REGISTRY)/$(IMAGE_NAME):$(TAG)
7+
IMG_LOCAL ?= localhost:5000/$(IMAGE_NAME):$(TAG)
48

59
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
610
ifeq (,$(shell go env GOBIN))
@@ -45,7 +49,7 @@ help: ## Display this help.
4549
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
4650

4751
MANIFEST_GEN_INPUTS=$(shell find ./api ./controllers -type f -name "*test*" -prune -o -name "*zz_generated*" -prune -o -print)
48-
52+
4953
# Using a flag file here as config output is too complicated to be a target.
5054
# The following triggers manifest building if $(IMG) differs from that found in config/default/manager_image_patch.yaml.
5155
$(shell grep -qs "$(IMG)" config/default/manager_image_patch_edited.yaml || rm -f config/.flag.mk)
@@ -58,7 +62,7 @@ config/.flag.mk: bin/controller-gen $(MANIFEST_GEN_INPUTS)
5862

5963
.PHONY: release-manifests
6064
RELEASE_MANIFEST_TARGETS=$(RELEASE_DIR)/infrastructure-components.yaml $(RELEASE_DIR)/metadata.yaml
61-
RELEASE_MANIFEST_INPUTS=bin/kustomize config/.flag.mk $(shell find config)
65+
RELEASE_MANIFEST_INPUTS=bin/kustomize config/.flag.mk $(shell find config)
6266
release-manifests: $(RELEASE_MANIFEST_TARGETS) ## Create kustomized release manifest in $RELEASE_DIR (defaults to out).
6367
$(RELEASE_DIR)/%: $(RELEASE_MANIFEST_INPUTS)
6468
@mkdir -p $(RELEASE_DIR)
@@ -146,7 +150,7 @@ bin/golangci-lint: ## Install golangci-lint to bin.
146150
bin/staticcheck: ## Install staticcheck to bin.
147151
GOBIN=$(PROJECT_DIR)/bin go install honnef.co/go/tools/cmd/[email protected]
148152
bin/ginkgo: bin/ginkgo_v1 bin/ginkgo_v2 ## Install ginkgo to bin.
149-
bin/ginkgo_v2:
153+
bin/ginkgo_v2:
150154
GOBIN=$(PROJECT_DIR)/bin go install github.com/onsi/ginkgo/v2/[email protected]
151155
mv $(PROJECT_DIR)/bin/ginkgo $(PROJECT_DIR)/bin/ginkgo_v2
152156
bin/ginkgo_v1:
@@ -180,15 +184,15 @@ test: generate-mocks lint bin/ginkgo bin/kubectl bin/kube-apiserver bin/etcd ##
180184
@# The following is a slightly funky way to make sure the ginkgo statements are removed regardless the test results.
181185
@ginkgo_v2 --label-filter="!integ" --cover -coverprofile cover.out --covermode=atomic -v ./api/... ./controllers/... ./pkg/...; EXIT_STATUS=$$?;\
182186
./hack/testing_ginkgo_recover_statements.sh --remove; exit $$EXIT_STATUS
183-
187+
184188
.PHONY: generate-mocks
185189
generate-mocks: bin/mockgen generate-deepcopy pkg/mocks/mock_client.go $(shell find ./pkg/mocks -type f -name "mock*.go") ## Generate mocks needed for testing. Primarily mocks of the cloud package.
186190
pkg/mocks/mock%.go: $(shell find ./pkg/cloud -type f -name "*test*" -prune -o -print)
187191
go generate ./...
188192

189193
##@ Tilt
190194

191-
.PHONY: tilt-up
195+
.PHONY: tilt-up
192196
tilt-up: cluster-api kind-cluster cluster-api/tilt-settings.json manifests cloud-config ## Setup and run tilt for development.
193197
export CLOUDSTACK_B64ENCODED_SECRET=$$(base64 -w0 -i cloud-config 2>/dev/null || base64 -b 0 -i cloud-config) && cd cluster-api && tilt up
194198

OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ approvers:
33
- davidjumani
44
- maxdrib
55
- rejoshed
6+
- jweite-amazon

test/e2e/common.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"os"
2525
"path/filepath"
2626
"strings"
27+
"time"
2728

2829
apierrors "k8s.io/apimachinery/pkg/api/errors"
2930

@@ -187,9 +188,22 @@ func DeployAppToWorkloadClusterAndWaitForDeploymentReady(ctx context.Context, wo
187188

188189
func DownloadFromAppInWorkloadCluster(ctx context.Context, workloadKubeconfigPath string, appName string, port int, path string) (string, error) {
189190
runArgs := []string{
190-
"-i", "--restart=Never", "dummy", "--image=dockerqa/curl:ubuntu-trusty", "--command", "--", "curl", "--silent", fmt.Sprintf("%s:%d%s", appName, port, path),
191+
// Required by below: container name is runArg zero.
192+
"dummy", "-i", "--restart=Never", "--image=dockerqa/curl:ubuntu-trusty", "--command", "--", "curl", "--silent", "--show-error", fmt.Sprintf("%s:%d%s", appName, port, path),
191193
}
192-
return KubectlExec(ctx, "run", workloadKubeconfigPath, runArgs...)
194+
var result, err = KubectlExec(ctx, "run", workloadKubeconfigPath, runArgs...)
195+
if err != nil {
196+
return result, err
197+
}
198+
if result == "" {
199+
// A single retry to accommodate occasional cases where an empty string is returned, ostensibly
200+
// because the service isn't fully ready. Subsequent requests have always worked.
201+
fmt.Println("Retrying html download")
202+
time.Sleep(5 * time.Second)
203+
runArgs[0] = "dummy2" // Assumed: container name is runArg zero.
204+
result, err = KubectlExec(ctx, "run", workloadKubeconfigPath, runArgs...)
205+
}
206+
return result, err
193207
}
194208

195209
func DownloadMetricsFromCAPCManager(ctx context.Context, bootstrapKubeconfigPath string) (string, error) {
@@ -245,12 +259,6 @@ func DestroyOneMachine(clusterName string, machineType string) {
245259
}
246260

247261
Byf("Destroying machine %s", vmToDestroy.Name)
248-
stopParams := client.VirtualMachine.NewStopVirtualMachineParams(vmToDestroy.Id)
249-
stopParams.SetForced(true)
250-
_, err = client.VirtualMachine.StopVirtualMachine(stopParams)
251-
if err != nil {
252-
Fail("Failed to stop machine: " + err.Error())
253-
}
254262
destroyParams := client.VirtualMachine.NewDestroyVirtualMachineParams(vmToDestroy.Id)
255263
destroyParams.SetExpunge(true)
256264
_, err = client.VirtualMachine.DestroyVirtualMachine(destroyParams)

0 commit comments

Comments
 (0)