Skip to content

Commit

Permalink
Bump CRDs version to v1beta1 (#1782)
Browse files Browse the repository at this point in the history
This commit introduces the support for the two versions v1alpha1 (0.9) and v1beta1 (the next released version: 1.0.0-beta1). 
The CRDs are generated using `trivialVersions` to be compatible with older k8s versions (<1.13).
A go script is called after the CRDs generation to remove the podTemplate schema which is problematic.

List of changes:
- Copy pkg/apis/*/v1alpha1 in pkg/apis/*/v1beta1. Only differences exist for the ElasticsearchStatus (some fields have been removed since the 0.9)
- Replace v1alpha1 by v1betav1 in pkg/, config/, test/ and docs/*.asciidoc
- Add JSON struct tag fields to make the controller-gen happy
- Add kubebuilder annotations
- Restore the controller-gen target to generate the CRDs (with trivialVersions=true for now, #1823)
- Add a patch-crd go script to remove the podTemplate schema (#1822)
- Add the apm shortname for the APM Server
  • Loading branch information
thbkrkr authored Oct 1, 2019
1 parent de261a0 commit 25caaf1
Show file tree
Hide file tree
Showing 213 changed files with 4,211 additions and 1,585 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ else
CONTROLLER_GEN=$(shell which controller-gen)
endif

# Produce CRDs that work back to Kubernetes <1.13 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"

## -- Docker image

# on GKE, use GCR and GCLOUD_PROJECT
Expand Down Expand Up @@ -98,6 +101,9 @@ generate: controller-gen
# we use this in pkg/controller/common/license
go generate -tags='$(GO_TAGS)' ./pkg/... ./cmd/...
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
# Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./pkg/apis/..." output:crd:artifacts:config=config/crds
cd hack/patch-crd && go run main.go
$(MAKE) --no-print-directory generate-all-in-one
# TODO (sabo): reenable when new tag is cut and can work with the new repo path
# $(MAKE) --no-print-directory generate-api-docs
Expand Down
386 changes: 386 additions & 0 deletions config/crds/apm.k8s.elastic.co_apmservers.yaml

Large diffs are not rendered by default.

193 changes: 0 additions & 193 deletions config/crds/apm_v1alpha1_apmserver.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions config/crds/elasticsearch.k8s.elastic.co_elasticsearches.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: elasticsearches.elasticsearch.k8s.elastic.co
spec:
additionalPrinterColumns:
- JSONPath: .status.health
name: health
type: string
- JSONPath: .status.availableNodes
description: Available nodes
name: nodes
type: integer
- JSONPath: .spec.version
description: Elasticsearch version
name: version
type: string
- JSONPath: .status.phase
name: phase
type: string
- JSONPath: .metadata.creationTimestamp
name: age
type: date
group: elasticsearch.k8s.elastic.co
names:
categories:
- elastic
kind: Elasticsearch
listKind: ElasticsearchList
plural: elasticsearches
shortNames:
- es
singular: elasticsearch
scope: Namespaced
subresources:
status: {}
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: false
- name: v1beta1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit 25caaf1

Please sign in to comment.