Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Jun 11, 2024
1 parent b658d2d commit ca3a7a4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 80 deletions.
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ VM_OPERATOR_ALL_ARCH = amd64 arm64
NET_OPERATOR_IMAGE_NAME ?= cluster-api-net-operator
NET_OPERATOR_IMG ?= $(STAGING_REGISTRY)/$(NET_OPERATOR_IMAGE_NAME)

# boskosctl
BOSKOSCTL_IMG ?= gcr.io/k8s-staging-capi-vsphere/extra/boskosctl
BOSKOSCTL_IMG_TAG ?= $(shell git describe --always --dirty)

# openvpn
OPENVPN_IMG ?= gcr.io/k8s-staging-capi-vsphere/extra/openvpn
OPENVPN_IMG_TAG ?= $(shell git describe --always --dirty)

# It is set by Prow GIT_TAG, a git-based tag of the form vYYYYMMDD-hash, e.g., v20210120-v0.3.10-308-gc61521971

TAG ?= dev
Expand Down Expand Up @@ -571,6 +579,28 @@ docker-build-net-operator: docker-pull-prerequisites ## Build the docker image f
$(MAKE) set-manifest-pull-policy TARGET_RESOURCE="./$(NETOP_DIR)/config/default/manager_pull_policy.yaml"; \
fi

.PHONY: docker-build-boskosctl
docker-build-boskosctl:
cat hack/tools/boskosctl/Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) . -t $(BOSKOSCTL_IMG):$(BOSKOSCTL_IMG_TAG) --file -
docker tag $(BOSKOSCTL_IMG):$(BOSKOSCTL_IMG_TAG) $(BOSKOSCTL_IMG):latest
.PHONY: build

.PHONY: docker-push-boskosctl
docker-push-boskosctl:
docker push $(BOSKOSCTL_IMG):$(BOSKOSCTL_IMG_TAG)
docker push $(BOSKOSCTL_IMG):latest

.PHONY: docker-build-openvpn
docker-build-openvpn:
cat hack/tools/openvpn/Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) . -t $(OPENVPN_IMG):$(OPENVPN_IMG_TAG) --file -
docker tag $(OPENVPN_IMG):$(OPENVPN_IMG_TAG) $(OPENVPN_IMG):latest
.PHONY: build

.PHONY: docker-push-openvpn
docker-push-openvpn:
docker push $(OPENVPN_IMG):$(OPENVPN_IMG_TAG)
docker push $(OPENVPN_IMG):latest

## --------------------------------------
## Testing
## --------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if [[ ! "${GINKGO_FOCUS:-}" =~ $RE_VCSIM ]]; then
function wait_for_vpn_up() {
local n=0
until [ $n -ge 30 ]; do
curl "https://${VSPHERE_SERVER}" --connect-timeout 2 -k -v && RET=$? || RET=$?
curl "https://${VSPHERE_SERVER}" --connect-timeout 2 -k && RET=$? || RET=$?
if [[ "$RET" -eq 0 ]]; then
break
fi
Expand Down
45 changes: 0 additions & 45 deletions hack/tools/boskosctl/Makefile

This file was deleted.

16 changes: 11 additions & 5 deletions hack/tools/boskosctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func setupCommands(ctx context.Context) *cobra.Command {
Short: "boskosctl can be used to consume Boskos vSphere resources",
}
// Note: http://boskos.test-pods.svc.cluster.local is the URL of the service usually used in k8s.io clusters.
rootCmd.PersistentFlags().StringVar(&boskosHost, "boskos-host", getOrDefault(os.Getenv("BOSKOS_HOST"), "http://boskos.test-pods.svc.cluster.local"), "Boskos server URL.")
rootCmd.PersistentFlags().StringVar(&boskosHost, "boskos-host", getOrDefault(os.Getenv("BOSKOS_HOST"), "http://boskos.test-pods.svc.cluster.local"), "Boskos server URL. (can also be set via BOSKOS_HOST env var)")
rootCmd.PersistentFlags().StringVar(&resourceOwner, "resource-owner", "", "Owner for the resource.")

// acquire command
Expand Down Expand Up @@ -101,8 +101,8 @@ func setupCommands(ctx context.Context) *cobra.Command {
RunE: runCmd(ctx),
}
releaseCmd.PersistentFlags().StringVar(&resourceName, "resource-name", "", "Name of the resource.")
releaseCmd.PersistentFlags().StringVar(&vSphereUsername, "vsphere-username", os.Getenv("VSPHERE_USERNAME"), "vSphere username of the resource, required for cleanup before release")
releaseCmd.PersistentFlags().StringVar(&vSpherePassword, "vsphere-password", os.Getenv("VSPHERE_PASSWORD"), "vSphere password of the resource, required for cleanup before release")
releaseCmd.PersistentFlags().StringVar(&vSphereUsername, "vsphere-username", "", "vSphere username of the resource, required for cleanup before release (can also be set via VSPHERE_USERNAME env var)")
releaseCmd.PersistentFlags().StringVar(&vSpherePassword, "vsphere-password", "", "vSphere password of the resource, required for cleanup before release (can also be set via VSPHERE_PASSWORD env var)")
releaseCmd.PersistentFlags().StringVar(&vSphereServer, "vsphere-server", "", "vSphere server of the resource, required for cleanup before release")
releaseCmd.PersistentFlags().StringVar(&vSphereTLSThumbprint, "vsphere-tls-thumbprint", "", "vSphere TLS thumbprint of the resource, required for cleanup before release")
releaseCmd.PersistentFlags().StringVar(&vSphereFolder, "vsphere-folder", "", "vSphere folder of the resource, required for cleanup before release")
Expand Down Expand Up @@ -160,10 +160,16 @@ func runCmd(ctx context.Context) func(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("--resource-name must be set")
}
if vSphereUsername == "" {
return fmt.Errorf("--vsphere-username must be set")
vSphereUsername = os.Getenv("VSPHERE_USERNAME")
}
if vSphereUsername == "" {
return fmt.Errorf("--vsphere-username or VSPHERE_USERNAME env var must be set")
}
if vSpherePassword == "" {
vSpherePassword = os.Getenv("VSPHERE_PASSWORD")
}
if vSpherePassword == "" {
return fmt.Errorf("--vsphere-password must be set")
return fmt.Errorf("--vsphere-password or VSPHERE_PASSWORD env var must be set")
}
if vSphereServer == "" {
return fmt.Errorf("--vsphere-server must be set")
Expand Down
29 changes: 0 additions & 29 deletions hack/tools/openvpn/Makefile

This file was deleted.

0 comments on commit ca3a7a4

Please sign in to comment.