Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9 update crds breaking change #10

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
uses: azure/setup-helm@v4.1.0

- name: Helm lint
run: helm lint ./chart
run: helm lint ./chart
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
charts_url: https://charts.krateo.io
owner: krateoplatformops
repository: helm-charts
branch: gh-pages
branch: gh-pages
20 changes: 1 addition & 19 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
samples/
55 changes: 31 additions & 24 deletions chart/crds/krateo.io_patches.yaml
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.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.15.0
name: patches.krateo.io
spec:
group: krateo.io
Expand All @@ -30,14 +29,19 @@ spec:
description: Patch is the Schema for the patches API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand All @@ -46,16 +50,18 @@ spec:
properties:
deletionPolicy:
default: Delete
description: DeletionPolicy specifies what will happen to the underlying
external when this managed resource is deleted - either "Delete"
or "Orphan" the external resource.
description: |-
DeletionPolicy specifies what will happen to the underlying external
when this managed resource is deleted - either "Delete" or "Orphan" the
external resource.
enum:
- Orphan
- Delete
type: string
from:
description: From is the path of the field on the resource whose value
is to be used as input.
description: |-
From is the path of the field on the resource whose value is
to be used as input.
properties:
fieldPath:
type: string
Expand Down Expand Up @@ -106,10 +112,8 @@ spec:
- kind
- name
type: object
transforms:
items:
type: string
type: array
transform:
type: string
type: object
type: object
status:
Expand All @@ -121,13 +125,15 @@ spec:
description: A Condition that may apply to a resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this condition
transitioned from one status to another.
description: |-
LastTransitionTime is the last time this condition transitioned from one
status to another.
format: date-time
type: string
message:
description: A Message containing details about this condition's
last transition from one status to another, if any.
description: |-
A Message containing details about this condition's last transition from
one status to another, if any.
type: string
reason:
description: A Reason for this condition's last transition from
Expand All @@ -138,8 +144,9 @@ spec:
False, or Unknown?
type: string
type:
description: Type of this condition. At most one of each condition
type may apply to a resource at any point in time.
description: |-
Type of this condition. At most one of each condition type may apply to
a resource at any point in time.
type: string
required:
- lastTransitionTime
Expand All @@ -153,4 +160,4 @@ spec:
served: true
storage: true
subresources:
status: {}
status: {}
19 changes: 19 additions & 0 deletions chart/samples/data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: foo
namespace: default
data:
replicas: "3"
value1: Foo1
value2: Foo2
value3: Foo3
---
apiVersion: v1
kind: ConfigMap
metadata:
name: bar
namespace: default
data:
value1: Bar1
value2: Bar2
21 changes: 21 additions & 0 deletions chart/samples/sample-jq-int.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: krateo.io/v1alpha1
kind: Patch
metadata:
name: sample-jq
spec:
from:
objectReference:
apiVersion: v1
kind: ConfigMap
name: foo
# namespace: default
fieldPath: data
to:
objectReference:
apiVersion: apps/v1
kind: Deployment
name: nginx-deployment
# namespace: default
fieldPath: spec.replicas
transform: ${ .replicas | tonumber }

20 changes: 20 additions & 0 deletions chart/samples/sample-jq-notransform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: krateo.io/v1alpha1
kind: Patch
metadata:
name: sample-notransform
spec:
from:
objectReference:
apiVersion: v1
kind: ConfigMap
name: foo
# namespace: default
fieldPath: data
to:
objectReference:
apiVersion: v1
kind: ConfigMap
name: bar
# namespace: default
fieldPath: data

21 changes: 21 additions & 0 deletions chart/samples/sample1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: krateo.io/v1alpha1
kind: Patch
metadata:
name: sample1
spec:
from:
objectReference:
apiVersion: v1
kind: ConfigMap
name: foo
# namespace: default
fieldPath: data
to:
objectReference:
apiVersion: v1
kind: ConfigMap
name: bar
# namespace: default
fieldPath: data.value1
transform: ${ .value2 | @base64 }

Loading