Skip to content

Commit

Permalink
Merge pull request #6 from grzegorzgniadek/configmap-feat
Browse files Browse the repository at this point in the history
feat: added outputKind
  • Loading branch information
grzegorzgniadek authored Aug 18, 2024
2 parents 7076cf2 + c40ae44 commit 8d5fc19
Show file tree
Hide file tree
Showing 11 changed files with 242 additions and 137 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.5
0.5.0-rc
15 changes: 9 additions & 6 deletions api/v1/interpolator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ import (

// InterpolatorSpec defines the desired state of Interpolator
type InterpolatorSpec struct {
// Output secret Name
OutputSecretName string `json:"outputSecretName"`
// Name of output resource
OutputName string `json:"outputName"`
// Type of Output resource, Can be ConfigMap or Secret
// +kubebuilder:validation:Enum=ConfigMap;Secret
OutputKind string `json:"outputKind"`
//Output secret array of structs
OutputSecret []InterpolatorOutputSecret `json:"outputSecret,omitempty"`
OutputSecrets []InterpolatorOutputSecrets `json:"outputSecrets,omitempty"`
//Input secret array of structs
InputSecret []InterpolatorInputSecret `json:"inputSecret"`
InputSecrets []InterpolatorInputSecrets `json:"inputSecrets"`
}

type InterpolatorInputSecret struct {
type InterpolatorInputSecrets struct {
// Name of input resource
Name string `json:"name,omitempty"`
// Type of input resource, Can be ConfigMap or Secret
Expand All @@ -44,7 +47,7 @@ type InterpolatorInputSecret struct {
Value string `json:"value,omitempty"`
}

type InterpolatorOutputSecret struct {
type InterpolatorOutputSecrets struct {
// Source key for value
SourceKey string `json:"sourcekey,omitempty"`
// Output key for value, if empty the SourceKey is master
Expand Down
28 changes: 14 additions & 14 deletions api/v1/zz_generated.deepcopy.go

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

4 changes: 2 additions & 2 deletions charts/interpolator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.5
version: 0.5.0-rc
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.4.5"
appVersion: "0.5.0-rc"
4 changes: 2 additions & 2 deletions charts/interpolator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



![Version: 0.4.5](https://img.shields.io/badge/Version-0.4.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.5](https://img.shields.io/badge/AppVersion-0.4.5-informational?style=flat-square)
![Version: 0.5.0-rc](https://img.shields.io/badge/Version-0.5.0--rc-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.0-rc](https://img.shields.io/badge/AppVersion-0.5.0--rc-informational?style=flat-square)

Interpolator Helm Chart

Expand All @@ -23,7 +23,7 @@ Interpolator Helm Chart
| controllerManager.manager.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | |
| controllerManager.manager.containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | |
| controllerManager.manager.image.repository | string | `"ghcr.io/grzegorzgniadek/interpolator-operator"` | |
| controllerManager.manager.image.tag | string | `"0.4.5"` | |
| controllerManager.manager.image.tag | string | `"0.5.0"` | |
| controllerManager.manager.imagePullPolicy | string | `"Always"` | |
| controllerManager.manager.resources.limits.cpu | string | `"200m"` | |
| controllerManager.manager.resources.limits.memory | string | `"128Mi"` | |
Expand Down
21 changes: 14 additions & 7 deletions charts/interpolator/templates/interpolator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
spec:
description: InterpolatorSpec defines the desired state of Interpolator
properties:
inputSecret:
inputSecrets:
description: Input secret array of structs
items:
properties:
Expand All @@ -73,7 +73,16 @@ spec:
type: string
type: object
type: array
outputSecret:
outputKind:
description: Type of Output resource, Can be ConfigMap or Secret
enum:
- ConfigMap
- Secret
type: string
outputName:
description: Name of output resource
type: string
outputSecrets:
description: Output secret array of structs
items:
properties:
Expand All @@ -89,12 +98,10 @@ spec:
type: string
type: object
type: array
outputSecretName:
description: Output secret Name
type: string
required:
- inputSecret
- outputSecretName
- inputSecrets
- outputKind
- outputName
type: object
status:
description: InterpolatorStatus defines the observed state of Interpolator
Expand Down
2 changes: 1 addition & 1 deletion charts/interpolator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ controllerManager:
- ALL
image:
repository: ghcr.io/grzegorzgniadek/interpolator-operator
tag: 0.4.5
tag: 0.5.0
imagePullPolicy: Always
resources:
limits:
Expand Down
21 changes: 14 additions & 7 deletions config/crd/bases/interpolator.io_interpolators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
spec:
description: InterpolatorSpec defines the desired state of Interpolator
properties:
inputSecret:
inputSecrets:
description: Input secret array of structs
items:
properties:
Expand All @@ -72,7 +72,16 @@ spec:
type: string
type: object
type: array
outputSecret:
outputKind:
description: Type of Output resource, Can be ConfigMap or Secret
enum:
- ConfigMap
- Secret
type: string
outputName:
description: Name of output resource
type: string
outputSecrets:
description: Output secret array of structs
items:
properties:
Expand All @@ -88,12 +97,10 @@ spec:
type: string
type: object
type: array
outputSecretName:
description: Output secret Name
type: string
required:
- inputSecret
- outputSecretName
- inputSecrets
- outputKind
- outputName
type: object
status:
description: InterpolatorStatus defines the observed state of Interpolator
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/grzegorzgniadek/interpolator-operator
newTag: 0.4.3
newTag: 0.5.0-rc
60 changes: 43 additions & 17 deletions config/samples/inter_v1_interpolator.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
---
apiVersion: v1
kind: Secret
metadata:
name: testing-secret
namespace: default
data:
password: cGFzc3dvcmQ=
type: Opaque
---
apiVersion: v1
data:
username: admin
kind: ConfigMap
metadata:
name: testing-cm
namespace: default
---
apiVersion: interpolator.io/v1
kind: Interpolator
metadata:
name: interpolator-sample
namespace: default
spec:
inputSecret:
inputSecrets:
- name: testing-cm
kind: ConfigMap
namespace: default
Expand All @@ -14,28 +31,37 @@ spec:
kind: Secret
namespace: default
key: password
outputSecret:
outputSecrets:
- sourcekey: username
outputkey: username-rooted
value: "{{ username }}-with-permissions"
- sourcekey: password
outputkey: password-changed
value: "{{ password }}-with-something-added"
outputSecretName: testing-output
outputName: testing-output
outputKind: ConfigMap
---
apiVersion: v1
kind: Secret
apiVersion: interpolator.io/v1
kind: Interpolator
metadata:
name: testing-secret
name: interpolator-sample2
namespace: default
data:
password: cGFzc3dvcmQ=
type: Opaque
---
apiVersion: v1
data:
username: admin
kind: ConfigMap
metadata:
name: testing-cm
namespace: default
spec:
inputSecrets:
- name: testing-cm
kind: ConfigMap
namespace: default
key: username
- name: testing-secret
kind: Secret
namespace: default
key: password
outputSecrets:
- sourcekey: username
outputkey: username-rooted
value: "{{ username }}-with-permissions"
- sourcekey: password
outputkey: password-changed
value: "{{ password }}-with-something-added"
outputName: testing-output
outputKind: Secret
Loading

0 comments on commit 8d5fc19

Please sign in to comment.