Skip to content

Commit 3c9074e

Browse files
authored
CLOUDP-293822: Fix targets affected by new project layout (#2028)
* Fix targets affected by new project layout * Fix scripts by new project layout * custom roles manifest updates
1 parent 298ca47 commit 3c9074e

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

.github/actions/gen-install-scripts/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mkdir -p "${crds_dir}"
1414
mkdir -p "${openshift}"
1515

1616
# Generate configuration and save it to `all-in-one`
17-
controller-gen crd:crdVersions=v1,ignoreUnexportedFields=true rbac:roleName=manager-role webhook paths="./internal/..." output:crd:artifacts:config=config/crd/bases
17+
controller-gen crd:crdVersions=v1,ignoreUnexportedFields=true rbac:roleName=manager-role webhook paths="./api/..." paths="./internal/controller/..." output:crd:artifacts:config=config/crd/bases
1818
cd config/manager && kustomize edit set image controller="${INPUT_IMAGE_URL}"
1919
cd -
2020
./scripts/split_roles_yaml.sh

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ KUBEBUILDER_ASSETS ?= $(ENVTEST_ASSETS_DIR)/k8s/$(ENVTEST_K8S_VERSION)-$(TARGET_
9797
# Ginkgo configuration
9898
GINKGO_NODES ?= 12
9999
GINKGO_EDITOR_INTEGRATION ?= true
100-
GINKGO_OPTS = -vv --randomize-all --output-interceptor-mode=none --trace --timeout 90m --flake-attempts=1 --race --nodes=$(GINKGO_NODES) --cover --coverpkg=github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/...
100+
GINKGO_OPTS = -vv --randomize-all --output-interceptor-mode=none --trace --timeout 90m --flake-attempts=1 --race --nodes=$(GINKGO_NODES) --cover --coverpkg=github.com/mongodb/mongodb-atlas-kubernetes/v2/...
101101
GINKGO_FILTER_LABEL ?=
102102
ifneq ($(GINKGO_FILTER_LABEL),)
103103
GINKGO_FILTER_LABEL_OPT := --label-filter="$(GINKGO_FILTER_LABEL)"
@@ -209,7 +209,7 @@ bin/$(TARGET_OS)/$(TARGET_ARCH):
209209

210210
bin/$(TARGET_OS)/$(TARGET_ARCH)/manager: $(GO_SOURCES) bin/$(TARGET_OS)/$(TARGET_ARCH)
211211
@echo "Building operator with version $(VERSION); $(TARGET_OS) - $(TARGET_ARCH)"
212-
CGO_ENABLED=0 GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) go build -o $@ -ldflags="-X github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/version.Version=$(VERSION)" cmd/main.go
212+
CGO_ENABLED=0 GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) go build -o $@ -ldflags="-X github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/version.Version=$(VERSION)" cmd/main.go
213213
@touch $@
214214

215215
bin/manager: bin/$(TARGET_OS)/$(TARGET_ARCH)/manager
@@ -234,7 +234,7 @@ deploy: generate manifests run-kind ## Deploy controller in the configured Kuber
234234
# Produce CRDs that work back to Kubernetes 1.16 (so 'apiVersion: apiextensions.k8s.io/v1')
235235
manifests: CRD_OPTIONS ?= "crd:crdVersions=v1,ignoreUnexportedFields=true"
236236
manifests: fmt ## Generate manifests e.g. CRD, RBAC etc.
237-
controller-gen $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./internal/..." output:crd:artifacts:config=config/crd/bases
237+
controller-gen $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./api/..." paths="./internal/controller/..." output:crd:artifacts:config=config/crd/bases
238238
@./scripts/split_roles_yaml.sh
239239

240240

@@ -252,7 +252,7 @@ fmt: $(TIMESTAMPS_DIR)/fmt ## Run go fmt against code
252252

253253
fix-lint:
254254
find . -name "*.go" -not -path "./vendor/*" -exec gofmt -w "{}" \;
255-
goimports -local github.com/mongodb/mongodb-atlas-kubernetes/v2 -w ./internal ./pkg ./test
255+
goimports -local github.com/mongodb/mongodb-atlas-kubernetes/v2 -w ./internal ./api ./test
256256
golangci-lint run --fix
257257

258258
$(TIMESTAMPS_DIR)/vet: $(GO_SOURCES)
@@ -264,7 +264,7 @@ vet: $(TIMESTAMPS_DIR)/vet ## Run go vet against code
264264

265265
.PHONY: generate
266266
generate: ${GO_SOURCES} ## Generate code
267-
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./internal/..."
267+
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./api/..." paths="./internal/controller/..."
268268
$(MAKE) fmt
269269

270270
.PHONY: check-missing-files
@@ -288,7 +288,7 @@ validate-manifests: generate manifests
288288
.PHONY: bundle
289289
bundle: manifests ## Generate bundle manifests and metadata, then validate generated files.
290290
@echo "Building bundle $(VERSION)"
291-
operator-sdk generate $(KUSTOMIZE) manifests -q --apis-dir=pkg/api
291+
operator-sdk generate $(KUSTOMIZE) manifests -q --apis-dir=api
292292
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
293293
$(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
294294
operator-sdk bundle validate ./bundle

config/crd/bases/atlas.mongodb.com_atlascustomroles.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ spec:
2525
- jsonPath: .spec.role.name
2626
name: Name
2727
type: string
28-
- jsonPath: .spec.projectIDRef.id
29-
name: Project ID
30-
type: string
3128
name: v1
3229
schema:
3330
openAPIV3Schema:

scripts/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ docker build -f fast.Dockerfile --rm -t "${image}" .
1313
docker push "${image}"
1414

1515
#Prepare CRDs
16-
controller-gen crd:crdVersions=v1,ignoreUnexportedFields=true rbac:roleName=manager-role webhook paths="./internal/..." output:crd:artifacts:config=config/crd/bases
16+
controller-gen crd:crdVersions=v1,ignoreUnexportedFields=true rbac:roleName=manager-role webhook paths="./api/..." paths="./internal/controller/..." output:crd:artifacts:config=config/crd/bases
1717

1818
#Installing the CRD,Operator,Role
1919
ns=mongodb-atlas-system

0 commit comments

Comments
 (0)