Skip to content

Commit

Permalink
Moving dataplane CRs
Browse files Browse the repository at this point in the history
Bringing APIs and controllers from https://github.com/openstack-k8s-operators/dataplane-operator

Dataplane commit:
openstack-k8s-operators/dataplane-operator@66a037a

Signed-off-by: Fabricio Aguiar <[email protected]>
  • Loading branch information
fao89 committed Jun 3, 2024
1 parent fb5ce90 commit e366f41
Show file tree
Hide file tree
Showing 206 changed files with 38,945 additions and 83 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build Docs
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- .github/workflows/docs*
- apis/client/v1beta1/**
- apis/core/v1beta1/**
- apis/dataplane/v1beta1/**
- docs/**
- Gemfile
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
fetch-depth: 0
- uses: ruby/[email protected]
with:
ruby-version: '3.2'

- name: Install Asciidoc
run: make docs-dependencies
- name: Build docs
run: |
make docs
- name: Prepare gh-pages branch
run: |
git restore docs/assemblies/custom_resources.adoc
git config user.name github-actions
git config user.email [email protected]
git branch -D gh-pages &>/dev/null || true
git checkout -b gh-pages 4cd0193fc6c5bc7e76f3a0148d0447fb0d7fbe6a
- name: Commit asciidoc docs
run: |
mkdir user dev
mv docs_build/ctlplane/index-upstream.html index.html
git add index.html
git commit -m "Rendered docs"
- name: Push rendered docs to gh-pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git push --force origin gh-pages
36 changes: 36 additions & 0 deletions .github/workflows/kustom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Kustomize Build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- config/samples/**
jobs:
kustomize:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
fetch-depth: 0
- name: download kustomize
run: |
mkdir bin
LINK=https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh
curl -Ss $LINK | bash -s -- 5.0.1 ./bin
- name: kustomize build
run: |
cd config/samples/dataplane
for d in */ ; do
echo "=============== $d ==============="
../../../bin/kustomize build --load-restrictor LoadRestrictionsNone "$d"
done
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ CI_TOOLS_REPO
# generated workspace file
go.work
go.work.sum

# docs
.bundle/
docs_build/
Gemfile.lock
local/
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ RUN if [ ! -f $CACHITO_ENV_FILE ]; then go mod download ; fi
# Build manager
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; env ${GO_BUILD_EXTRA_ENV_ARGS} go build ${GO_BUILD_EXTRA_ARGS} -a -o ${DEST_ROOT}/manager main.go

RUN cp -r config/services ${DEST_ROOT}/services

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM $OPERATOR_BASE_IMAGE
Expand Down Expand Up @@ -56,13 +58,17 @@ LABEL com.redhat.component="${IMAGE_COMPONENT}" \
io.openshift.tags="${IMAGE_TAGS}"
### DO NOT EDIT LINES ABOVE

ENV USER_UID=$USER_ID
ENV USER_UID=$USER_ID \
OPERATOR_SERVICES=/usr/share/openstack-operator/services/

WORKDIR /

# Install operator binary to WORKDIR
COPY --from=builder ${DEST_ROOT}/manager .

# Install services
COPY --from=builder ${DEST_ROOT}/services ${OPERATOR_SERVICES}

USER $USER_ID

ENV PATH="/:${PATH}"
Expand Down
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'

gem 'asciidoctor', '~> 2.0', '>= 2.0.20'

# Uncomment for ability to render pdf:
# gem 'asciidoctor-pdf', '~> 2.0', '>= 2.0.20'

# Uncomment for ability to convert Markdown to AsciiDoc
gem 'kramdown-asciidoc'
39 changes: 38 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,36 @@ DOCKER_BUILD_ARGS ?=
.PHONY: all
all: build

##@ Docs

.PHONY: docs-dependencies
docs-dependencies: .bundle

.PHONY: .bundle
.bundle:
if ! type bundle; then \
echo "Bundler not found. On Linux run 'sudo dnf install /usr/bin/bundle' to install it."; \
exit 1; \
fi

bundle config set --local path 'local/bundle'; bundle install

.PHONY: docs
docs: manifests docs-dependencies crd-to-markdown ## Build docs
CRD_MARKDOWN=$(CRD_MARKDOWN) MAKE=$(MAKE) ./docs/build_docs.sh

.PHONY: docs-preview
docs-preview: docs
cd docs; $(MAKE) open-html

.PHONY: docs-watch
docs-watch: docs-preview
cd docs; $(MAKE) watch-html

.PHONY: docs-clean
docs-clean:
rm -r docs_build

##@ General

# The help target prints out all targets with their descriptions organized
Expand Down Expand Up @@ -137,7 +167,7 @@ test: manifests generate gowork fmt vet envtest ginkgo ## Run tests.
source hack/export_related_images.sh && \
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) -v debug --bin-dir $(LOCALBIN) use $(ENVTEST_K8S_VERSION) -p path)" \
OPERATOR_TEMPLATES="$(PWD)/templates" \
$(GINKGO) --trace --cover --coverpkg=../../pkg/openstack,../../pkg/openstackclient,../../pkg/util,../../controllers,../../apis/client/v1beta1,../../apis/core/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/... ./apis/client/...
$(GINKGO) --trace --cover --coverpkg=../../pkg/openstack,../../pkg/openstackclient,../../pkg/util,../../controllers,../../apis/client/v1beta1,../../apis/core/v1beta1,../../apis/dataplane/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/... ./apis/client/...

##@ Build

Expand Down Expand Up @@ -214,11 +244,13 @@ $(LOCALBIN):
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
CRD_MARKDOWN ?= $(LOCALBIN)/crd-to-markdown
GINKGO ?= $(LOCALBIN)/ginkgo

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.11.1
CRD_MARKDOWN_VERSION ?= v0.0.3

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -236,6 +268,11 @@ $(CONTROLLER_GEN): $(LOCALBIN)
test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

.PHONY: crd-to-markdown
crd-to-markdown: $(CRD_MARKDOWN) ## Download crd-to-markdown locally if necessary.
$(CRD_MARKDOWN): $(LOCALBIN)
test -s $(LOCALBIN)/crd-to-markdown || GOBIN=$(LOCALBIN) go install github.com/clamoriniere/crd-to-markdown@$(CRD_MARKDOWN_VERSION)

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
Expand Down
2 changes: 2 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
approvers:
- ci-approvers
- openstack-approvers
- dataplane-approvers

reviewers:
- ci-approvers
- openstack-approvers
- dataplane-approvers
10 changes: 10 additions & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ aliases:
- lewisdenny
- frenzyfriday
- viroel
docs-approvers:
- igallagh-redhat
openstack-approvers:
- abays
- dprince
- olliewalsh
- stuggi
dataplane-approvers:
- fao89
- fultonj
- rebtoor
- slagle
- bshephar
- rabi
- jpodivin
31 changes: 31 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,35 @@ resources:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openstack.org
group: dataplane
kind: OpenStackDataPlaneNodeSet
path: github.com/openstack-k8s-operators/openstack-operator/apis/dataplane/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openstack.org
group: dataplane
kind: OpenStackDataPlaneService
path: github.com/openstack-k8s-operators/openstack-operator/apis/dataplane/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openstack.org
group: dataplane
kind: OpenStackDataPlaneDeployment
path: github.com/openstack-k8s-operators/openstack-operator/apis/dataplane/v1beta1
version: v1beta1
version: "3"
Loading

0 comments on commit e366f41

Please sign in to comment.