Skip to content

Commit 7aeda4b

Browse files
committed
Generate Applyconfigurations to enable SSA
Server-side-apply needs its own structs to keep track of which fields are actually touched. This change only enables the generation of the configuration without making use of it yet.
1 parent 4b56d4d commit 7aeda4b

15 files changed

Lines changed: 1345 additions & 4 deletions

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ help: ## Display this help.
4848

4949
.PHONY: manifests
5050
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
51-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
51+
$(CONTROLLER_GEN) \
52+
paths="./internal/..." \
53+
rbac:roleName=manager-role crd webhook \
54+
output:crd:artifacts:config=config/crd/bases
5255

5356
.PHONY: generate
54-
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
55-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
57+
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations and applyconfigurations
58+
$(CONTROLLER_GEN) \
59+
paths="./api/..." \
60+
object:headerFile="hack/boilerplate.go.txt" \
61+
applyconfiguration:headerFile="hack/boilerplate.go.txt"
5662

5763
.PHONY: fmt
5864
fmt: ## Run go fmt against code.

api/v1/groupversion_info.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ limitations under the License.
1616
*/
1717

1818
// Package v1 contains API Schema definitions for the kvm v1 API group
19+
// +kubebuilder:ac:generate=true
20+
// +kubebuilder:ac:output:package=../../applyconfigurations
1921
// +kubebuilder:object:generate=true
2022
// +groupName=kvm.cloud.sap
2123
package v1
@@ -34,4 +36,7 @@ var (
3436

3537
// AddToScheme adds the types in this group-version to the given scheme.
3638
AddToScheme = SchemeBuilder.AddToScheme
39+
40+
// Workaround: https://github.com/kubernetes-sigs/controller-tools/issues/1193
41+
SchemeGroupVersion = GroupVersion
3742
)

applyconfigurations/api/v1/capabilitiesstatus.go

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfigurations/api/v1/eviction.go

Lines changed: 242 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfigurations/api/v1/evictionspec.go

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)