Skip to content

Commit

Permalink
Update crd version (#20)
Browse files Browse the repository at this point in the history
* fix:update crd version in helm chart

* fix:update crd version in folder

* refactor: remove the import aliases as they are not needed thereby reducing maintenance with every upgrade

* refactor: upgrading the version on samples and comments that were missed in the last commit

* fix: moving the crd to crd folder and checking to see if we can deploy through helm controller

* upgrade helm chart version

* refactor: update v1aplpha2 reference

Co-authored-by: Sangeetha Madamanchi <[email protected]>
Co-authored-by: Flux <>
  • Loading branch information
sangdammad and Sangeetha Madamanchi authored Sep 28, 2022
1 parent f8aeafd commit e16cda4
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ helmManifests: manifests kustomize kubernetes-split-yaml ## Create Helm Template

.PHONY: helmInstall
helmInstall:
helm upgrade -i overwhelm ./charts/overwhelm
helm upgrade -i overwhelm -n overwhelm-system ./charts/overwhelm

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha2/application_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ type ApplicationSpec struct {
// +optional
Data map[string]string `json:"data,omitempty"`

// PreRenderer holds custom templating delimiters and a flag to
// By default standard delimiters {{ and }} will be used to render values within. If specified then the custom delimiters will be used.
// PreRenderer holds custom templating delimiters and a flag.
// By default, standard delimiters {{ and }} will be used to render values within. If specified then the custom delimiters will be used.
// +optional
PreRenderer PreRenderer `json:"preRenderer,omitempty"`

Expand All @@ -74,11 +74,11 @@ type ApplicationStatus struct {
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`

// HelmReleaseGeneration is the helm release generation
// HelmReleaseGeneration is the helm release generation number
// +optional
HelmReleaseGeneration int64 `json:"helmReleaseGeneration,omitempty"`

// ValuesCheckSum is the checksum of the values for helm
// ValuesCheckSum is the checksum of the values file associated with the helm chart
// +optional
ValuesCheckSum string `json:"valuesCheckSum,omitempty"`

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha2/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package v1alpha2contains API Schema definitions for the core v1alpha2 API group
// Package v1alpha2 contains API Schema definitions for the core v1alpha2 API group
//+kubebuilder:object:generate=true
//+groupName=core.expediagroup.com
//+versionName:=v1alpha2
Expand Down
4 changes: 1 addition & 3 deletions api/v1alpha2/reference_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

package v1alpha2

// SourceReference is the reference of the source where the chart is available.
// For e.g., the HelmRepository resource specifying where the helm chart is located

type PreRenderer struct {
// Custom non white-spaced and non alpha-numeric open delimiter used for go templating action to pre-render. For e.g., <%. Default is {{
Expand All @@ -30,7 +28,7 @@ type PreRenderer struct {
// +optional
RightDelimiter string `json:"closeDelimiter,omitempty"`

// Enable to allow Helm Templating to interpolate values within the default delimiters {{ }}.
// Enable to allow Helm Templating to interpolate values within the delimiters {{ }}.
// Defaults to false allowing the pre-renderer to do interpolation within the default delimiters. If both helm templating
// and pre-rendering are desired, then enable EnableHelmTemplating and specify custom delimiters as LeftDelimiter and RightDelimiter
// +optional
Expand Down
2 changes: 1 addition & 1 deletion charts/overwhelm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: overwhelm
version: 1.1.1
version: 1.1.2
maintainers:
- name: "Expedia Group"
url: "https://github.com/ExpediaGroup/overwhelm"
15 changes: 11 additions & 4 deletions charts/overwhelm/crds/applications.core.expediagroup.com-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ spec:
singular: application
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Application is the Schema for the applications API
type: object
served: false
storage: false
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
Expand Down Expand Up @@ -48,15 +55,15 @@ spec:
description: Data to be consolidated for the Helm Chart's values.yaml file
type: object
preRenderer:
description: PreRenderer holds custom templating delimiters and a flag to By default standard delimiters \{\{ and }} will be used to render values within. If specified then the custom delimiters will be used.
description: PreRenderer holds custom templating delimiters and a flag. By default, standard delimiters \{\{ and }} will be used to render values within. If specified then the custom delimiters will be used.
properties:
closeDelimiter:
description: Custom non white-spaced and non alpha-numeric close delimiter used for go templating action to pre-render. For e.g., %>. Default is }}
maxLength: 2
minLength: 2
type: string
enableHelmTemplating:
description: Enable to allow Helm Templating to interpolate values within the default delimiters \{\{ }}. Defaults to false allowing the pre-renderer to do interpolation within the default delimiters. If both helm templating and pre-rendering are desired, then enable EnableHelmTemplating and specify custom delimiters as LeftDelimiter and RightDelimiter
description: Enable to allow Helm Templating to interpolate values within the delimiters \{\{ }}. Defaults to false allowing the pre-renderer to do interpolation within the default delimiters. If both helm templating and pre-rendering are desired, then enable EnableHelmTemplating and specify custom delimiters as LeftDelimiter and RightDelimiter
type: boolean
openDelimiter:
description: Custom non white-spaced and non alpha-numeric open delimiter used for go templating action to pre-render. For e.g., <%. Default is \{\{
Expand Down Expand Up @@ -590,15 +597,15 @@ spec:
format: int64
type: integer
helmReleaseGeneration:
description: HelmReleaseGeneration is the helm release generation
description: HelmReleaseGeneration is the helm release generation number
format: int64
type: integer
observedGeneration:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
valuesCheckSum:
description: ValuesCheckSum is the checksum of the values for helm
description: ValuesCheckSum is the checksum of the values file associated with the helm chart
type: string
type: object
type: object
Expand Down
10 changes: 6 additions & 4 deletions config/crd/bases/core.expediagroup.com_applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
type: object
preRenderer:
description: PreRenderer holds custom templating delimiters and a
flag to By default standard delimiters {{ and }} will be used to
flag. By default, standard delimiters {{ and }} will be used to
render values within. If specified then the custom delimiters will
be used.
properties:
Expand All @@ -68,8 +68,8 @@ spec:
type: string
enableHelmTemplating:
description: Enable to allow Helm Templating to interpolate values
within the default delimiters {{ }}. Defaults to false allowing
the pre-renderer to do interpolation within the default delimiters.
within the delimiters {{ }}. Defaults to false allowing the
pre-renderer to do interpolation within the default delimiters.
If both helm templating and pre-rendering are desired, then
enable EnableHelmTemplating and specify custom delimiters as
LeftDelimiter and RightDelimiter
Expand Down Expand Up @@ -883,14 +883,16 @@ spec:
type: integer
helmReleaseGeneration:
description: HelmReleaseGeneration is the helm release generation
number
format: int64
type: integer
observedGeneration:
description: ObservedGeneration is the last observed generation.
format: int64
type: integer
valuesCheckSum:
description: ValuesCheckSum is the checksum of the values for helm
description: ValuesCheckSum is the checksum of the values file associated
with the helm chart
type: string
type: object
type: object
Expand Down
11 changes: 11 additions & 0 deletions config/helm-manifest/application_crd_older_version_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# add older versions here if there is a version upgrade of the application CRD
- op: add
path: /spec/versions/0
value:
name: v1alpha1
served: false
storage: false
schema:
openAPIV3Schema:
description: Application is the Schema for the applications API
type: object
11 changes: 9 additions & 2 deletions config/helm-manifest/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ patchesStrategicMerge:
name: overwhelm-system
$patch: delete
patchesJson6902: # We use Json6902 patches for inline replacement patches which are not possible with Strategic Merge patches
- target:
patchesJson6902:
- target: # We use Json6902 patches for inline replacement patches which are not possible with Strategic Merge patches
group: apps
version: v1
kind: Deployment
Expand All @@ -20,3 +20,10 @@ patchesJson6902: # We use Json6902 patches for inline replacement patches which
- op: replace
path: /spec/template/spec/containers/0/resources
value: <GOTEMPLATE> toYaml .Values.deployment.resources | indent 10 </GOTEMPLATE>
- target:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
name: applications.core.expediagroup.com
path: application_crd_older_version_patch.yaml

0 comments on commit e16cda4

Please sign in to comment.