Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
53d673b
Merge upstream kubernetes-sigs/cluster-api-provider-openstack
pierreprinetti Mar 29, 2022
2f2caac
Downstream owners
pierreprinetti Apr 4, 2022
d7d1be2
Merge pull request #229 from shiftstack/owners
mandre Apr 4, 2022
d6bf6d3
Merge pull request #227 from shiftstack/main-merge
openshift-merge-robot Apr 4, 2022
efbb760
Merge remote-tracking branch 'upstream/main'
dulek Apr 6, 2022
f8a255d
Merge pull request #230 from dulek/main
openshift-merge-robot Apr 7, 2022
53cc87d
Merge upstream/main
pierreprinetti Apr 25, 2022
268e159
Merge pull request #235 from shiftstack/merge_upstream
openshift-merge-robot Apr 27, 2022
c0d7fd9
Add release 0.6.x to metadata.yaml
mdbooth Apr 27, 2022
c4e7b24
Merge pull request #1227 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Apr 27, 2022
221494e
Merge upstream/release-0.6
pierreprinetti Apr 28, 2022
523f6d7
Merge pull request #236 from shiftstack/merge_upstream
openshift-merge-robot Apr 28, 2022
b55a9e7
Fix nil pointer reference
Apr 29, 2022
dc3103f
Merge pull request #1232 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot May 3, 2022
89693ce
move chrischdi to emeritus_approvers
chrischdi May 4, 2022
92e022b
Merge pull request #1234 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot May 5, 2022
94c9af8
remove v1alpha4 webhooks
bavarianbidi May 10, 2022
1adc0ff
Merge pull request #1241 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot May 10, 2022
614f2cf
Merge tag 'v0.6.3'
pierreprinetti Sep 8, 2022
ef44b7e
Merge pull request #241 from shiftstack/merge_upstream
openshift-merge-robot Sep 8, 2022
50607dd
doc/development: add devstack notes
tormath1 May 31, 2023
8d37e1e
fixup! doc/development: add devstack notes
tormath1 Jun 2, 2023
d6deef7
feat: Allow the change on OpenstackCluster's spec.allowAllInClusterTr…
okozachenko1203 Sep 8, 2023
30cd0da
Fix typo
okozachenko1203 Sep 8, 2023
66f6e0d
Bump CAPI to v1.5.1
mdbooth Sep 11, 2023
4b7389e
Merge pull request #1666 from shiftstack/capi-1.5.1
k8s-ci-robot Sep 12, 2023
60d78f8
avoid duplicate error event
jichenjc Sep 7, 2023
01b5263
Merge pull request #1655 from jichenjc/fix_event
k8s-ci-robot Sep 13, 2023
78dd034
Update uses of some deprecated kustomize features
mdbooth Sep 13, 2023
24c64a4
Bump controller-tools to v0.13.0
mdbooth Sep 13, 2023
d717654
Update `make generate` with controller-tools v0.13.0
mdbooth Sep 13, 2023
8bae874
Bump kustomize to v5.1.1
mdbooth Sep 13, 2023
74e96b0
Remove unused kind from tools
mdbooth Sep 13, 2023
08bfcfc
Merge pull request #1663 from vexxhost/feature/allow-update-openstack…
k8s-ci-robot Sep 13, 2023
1347c00
Set failure only on instance error when no nodeRef
lentzi90 Aug 28, 2023
0d76248
Merge pull request #1669 from shiftstack/kustomize
k8s-ci-robot Sep 14, 2023
1aeacb7
Merge pull request #1637 from Nordix/mquhuy/not-set-failure-when-open…
k8s-ci-robot Sep 14, 2023
3d75b7f
Add test for getOrCreate
lentzi90 Sep 14, 2023
9d43fd6
Merge pull request #1673 from Nordix/lentzi90/test-get-or-create
k8s-ci-robot Sep 15, 2023
686923c
Merge pull request #1569 from tormath1/tormath1/devstack
k8s-ci-robot Sep 18, 2023
35a742b
Remove defaulter-gen
mdbooth Sep 22, 2023
739fbe3
Merge pull request #1677 from shiftstack/defaulter-gen
k8s-ci-robot Sep 22, 2023
2d23974
Clarify release notes content for releases and pre-releases
wwentland Sep 24, 2023
00db21a
Merge pull request #1678 from wwentland/release-note-content
k8s-ci-robot Sep 25, 2023
7c9b173
Only delete all ports when deleting cluster network
mdbooth Sep 25, 2023
c8bc750
Update Gophercloud to 1.7.0
EmilienM Sep 25, 2023
3a621fb
Merge pull request #1680 from shiftstack/cluster-port-deletion
k8s-ci-robot Sep 26, 2023
47b3e15
Merge pull request #1682 from shiftstack/gophercloud
k8s-ci-robot Sep 26, 2023
298f12a
Move webhook CA injection into webhook resource
mdbooth Sep 26, 2023
671d185
Merge pull request #1686 from shiftstack/webhook-cainject
k8s-ci-robot Sep 27, 2023
913e267
gitignore: ignore vendor/ directory
EmilienM Sep 27, 2023
c73d55d
Merge pull request #1690 from shiftstack/gitvendoring
k8s-ci-robot Sep 28, 2023
e127019
kustomize for cluster-capi-operator
mdbooth Jul 7, 2023
b38d487
openshift bits - wip
mdbooth Aug 15, 2023
bb04c6d
Move manifests to top level
mdbooth Sep 14, 2023
c361bc4
Rollup
mdbooth Sep 19, 2023
b654241
Set common labels
mdbooth Sep 26, 2023
76f921b
Use Matt's CAPO image
mdbooth Sep 26, 2023
1e5149d
Rename manifest CM to openstack
mdbooth Sep 29, 2023
e9891fd
Rollup
mdbooth Sep 29, 2023
b623a6b
Don't ignore vendor directory
mdbooth Sep 29, 2023
93ccb5e
go mod vendor
mdbooth Sep 29, 2023
d91cf6c
Merge remote-tracking branch 'shiftstack/main' into cluster-capi-oper…
mdbooth Sep 29, 2023
e13e164
Add Dockerfile.rhel
mdbooth Sep 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
51 changes: 51 additions & 0 deletions Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# syntax=docker/dockerfile:1.1-experimental

# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Build the manager binary
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.14 as builder
WORKDIR /workspace

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum

# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download

# Copy the sources
COPY ./ ./

# Build
ARG package=.
ARG ARCH
ARG ldflags

# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -ldflags "${ldflags} -extldflags '-static'" \
-o manager ${package}

# Production image
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies
USER 65532
ENTRYPOINT ["/manager"]
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ GO_INSTALL := ./scripts/go_install.sh
# Binaries.
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
CONVERSION_GEN := $(TOOLS_BIN_DIR)/conversion-gen
DEFAULTER_GEN := $(TOOLS_BIN_DIR)/defaulter-gen
ENVSUBST := $(TOOLS_BIN_DIR)/envsubst
GINKGO := $(TOOLS_BIN_DIR)/ginkgo
GOJQ := $(TOOLS_BIN_DIR)/gojq
Expand Down Expand Up @@ -262,7 +261,7 @@ generate: ## Generate code

.PHONY: generate-go
generate-go: $(MOCKGEN)
$(MAKE) -B $(CONTROLLER_GEN) $(CONVERSION_GEN) $(DEFAULTER_GEN)
$(MAKE) -B $(CONTROLLER_GEN) $(CONVERSION_GEN)
$(CONTROLLER_GEN) \
paths=./api/... \
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
Expand Down
23 changes: 4 additions & 19 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md

approvers:
- sig-cluster-lifecycle-leads
- cluster-api-openstack-maintainers

- shiftstack-team
reviewers:
- cluster-api-openstack-maintainers
- cluster-api-openstack-reviewers

emeritus_approvers:
- ncdc
- chaosaffe
- chrigl
- dims
- gyliu513
- Lion-Wei
- m1093782566
- sbueringer
- hidekazuna
- chrischdi
- shiftstack-team
component: "Cloud Compute"
subcomponent: "OpenStack Provider"
34 changes: 8 additions & 26 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md
#
# When making changes to this file, also consider if you need to update:
# - https://github.com/kubernetes/org/blob/main/config/kubernetes-sigs/sig-cluster-lifecycle/teams.yaml
# - https://github.com/kubernetes/test-infra/blob/master/OWNERS_ALIASES
# - https://github.com/kubernetes/k8s.io/blob/main/groups/sig-architecture/groups.yaml
# - https://github.com/kubernetes/k8s.io/blob/main/groups/sig-cluster-lifecycle/groups.yaml

aliases:
# sig-cluster-lifecycle-leads are included as approvers in case it's ever
# operationally expedient:
# Source:
# https://github.com/kubernetes/org/blob/main/config/kubernetes/sig-cluster-lifecycle/teams.yaml
# correct as of 2023/05/10
sig-cluster-lifecycle-leads:
- CecileRobertMichon
- fabriziopandini
- justinsb
- neolit123
- vincepri
cluster-api-openstack-maintainers:
- jichenjc
- lentzi90
- mdbooth
- seanschneeweiss
- tobiasgiese
cluster-api-openstack-reviewers:
shiftstack-team:
- EmilienM
- MaysaMacedo
- dulek
- gryf
- mandre
- mdbooth
- pierreprinetti
- stephenfin
19 changes: 15 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ to version 1.2.3 would be called `v1.2.3-rc.0`.

It is recommended to create at least one release candidate when bumping `X` or `Y`.

## Release notes

Release notes are user visible information providing details of all relevant changes between releases.

The content of the release notes differs depending on the type of release, specifically:

- Stable releases contain a *full* changelog from the last stable release.
- Pre-releases contain a changelog from the previous pre-release, or the last stable release if there isn't one.

## Process

1. Make sure your repo is clean by git's standards. It is recommended to use a fresh checkout.
Expand Down Expand Up @@ -60,10 +69,12 @@ It is recommended to create at least one release candidate when bumping `X` or `
It is good practise to get somebody else to review this PR. It is safe to perform the following steps while waiting
for review and the promotion of the image.
1. Run `make release` to build artifacts to be attached to the GitHub release.
1. Generate and finalize the release notes and save them for the next step:
- Run `make release-notes` to gather changes since the last revision. If you need to specify a specific tag to look for changes
since, use `make release-notes RELEASE_NOTES_ARGS="--from <tag>"`.
- Pay close attention to the `## :question: Sort these by hand` section, as it contains items that need to be manually sorted.
1. Generate and finalize the release notes and save them for the next step.
- Run `make release-notes RELEASE_NOTES_ARGS="--from <tag>"`.
- Depending on the type of release, substitute `<tag>` with the following:
- Stable releases: tag of the last stable release
- Pre-releases*: tag of the latest pre-release (or last stable release if there isn't one)
- Pay close attention to the `## :question: Sort these by hand` section, as it contains items that need to be manually sorted.
1. Create a draft release in GitHub based on the tag created above
- Name the release `Release [VERSION]` where VERSION is the full version string.
- For a pre-release, ensure you check `This is a pre-release` in GitHub when creating the release.
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha5/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/v1alpha6/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/v1alpha7/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const (
InstanceNotReadyReason = "InstanceNotReady"
// InstanceDeleteFailedReason used when deleting the instance failed.
InstanceDeleteFailedReason = "InstanceDeleteFailed"
// OpenstackErrorReason used when there is an error communicating with OpenStack.
OpenStackErrorReason = "OpenStackError"
)

const (
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha7/openstackcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ func (r *OpenStackCluster) ValidateUpdate(oldRaw runtime.Object) (admission.Warn
old.Spec.ControlPlaneAvailabilityZones = []string{}
r.Spec.ControlPlaneAvailabilityZones = []string{}

// Allow change to the allowAllInClusterTraffic.
old.Spec.AllowAllInClusterTraffic = false
r.Spec.AllowAllInClusterTraffic = false

if !reflect.DeepEqual(old.Spec, r.Spec) {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "cannot be modified"))
}
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha7/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: openstackclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: openstackclustertemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: openstackmachines.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: openstackmachinetemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down
18 changes: 9 additions & 9 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ resources:
- bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
- patches/webhook_in_openstackclusters.yaml
- patches/webhook_in_openstackmachines.yaml
- patches/webhook_in_openstackmachinetemplates.yaml
- patches/webhook_in_openstackclustertemplates.yaml
- path: patches/webhook_in_openstackclusters.yaml
- path: patches/webhook_in_openstackmachines.yaml
- path: patches/webhook_in_openstackmachinetemplates.yaml
- path: patches/webhook_in_openstackclustertemplates.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
- patches/cainjection_in_openstackclusters.yaml
- patches/cainjection_in_openstackmachines.yaml
- patches/cainjection_in_openstackmachinetemplates.yaml
- patches/cainjection_in_openstackclustertemplates.yaml
- path: patches/cainjection_in_openstackclusters.yaml
- path: patches/cainjection_in_openstackmachines.yaml
- path: patches/cainjection_in_openstackmachinetemplates.yaml
- path: patches/cainjection_in_openstackclustertemplates.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
Expand Down
12 changes: 4 additions & 8 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ commonLabels:

resources:
- namespace.yaml

bases:
- ../crd
- ../rbac
- ../manager
- ../webhook
- ../certmanager

patchesStrategicMerge:
patches:
# Provide customizable hook for make targets.
- manager_image_patch.yaml
- manager_pull_policy.yaml
- path: manager_image_patch.yaml
- path: manager_pull_policy.yaml
# Enable webhook.
- manager_webhook_patch.yaml
# Inject certificate in the webhook definition.
- webhookcainjection_patch.yaml
- path: manager_webhook_patch.yaml

vars:
- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
Expand Down
13 changes: 0 additions & 13 deletions config/default/webhookcainjection_patch.yaml

This file was deleted.

1 change: 0 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
Expand Down
3 changes: 3 additions & 0 deletions config/webhook/cainjection_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: add
path: "/metadata/annotations/cert-manager.io~1inject-ca-from"
value: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
8 changes: 8 additions & 0 deletions config/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ resources:

configurations:
- kustomizeconfig.yaml

patches:
# Inject certificate in the webhook definition.
- target:
group: admissionregistration.k8s.io
version: v1
name: mutating-webhook-configuration|validating-webhook-configuration
path: cainjection_patch.yaml
2 changes: 0 additions & 2 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
creationTimestamp: null
name: mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
Expand Down Expand Up @@ -72,7 +71,6 @@ webhooks:
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
creationTimestamp: null
name: validating-webhook-configuration
webhooks:
- admissionReviewVersions:
Expand Down
10 changes: 5 additions & 5 deletions controllers/openstackcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ func (r *OpenStackClusterReconciler) reconcileDelete(ctx context.Context, scope

clusterName := fmt.Sprintf("%s-%s", cluster.Namespace, cluster.Name)

if err = networkingService.DeletePorts(openStackCluster); err != nil {
handleUpdateOSCError(openStackCluster, fmt.Errorf("failed to delete ports: %w", err))
return reconcile.Result{}, fmt.Errorf("failed to delete ports: %w", err)
}

if openStackCluster.Spec.APIServerLoadBalancer.Enabled {
loadBalancerService, err := loadbalancer.NewService(scope)
if err != nil {
Expand All @@ -184,6 +179,11 @@ func (r *OpenStackClusterReconciler) reconcileDelete(ctx context.Context, scope
return ctrl.Result{}, fmt.Errorf("failed to delete router: %w", err)
}

if err = networkingService.DeletePorts(openStackCluster); err != nil {
handleUpdateOSCError(openStackCluster, fmt.Errorf("failed to delete ports: %w", err))
return reconcile.Result{}, fmt.Errorf("failed to delete ports: %w", err)
}

if err = networkingService.DeleteNetwork(openStackCluster, clusterName); err != nil {
handleUpdateOSCError(openStackCluster, fmt.Errorf("failed to delete network: %w", err))
return ctrl.Result{}, fmt.Errorf("failed to delete network: %w", err)
Expand Down
Loading