-
Notifications
You must be signed in to change notification settings - Fork 3
chore: when a cluster event occurs, create config map instead of secret #280
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
Changes from 34 commits
1196aa2
17673c3
405943c
d504346
18ca4a3
0edc8f8
28fd5f0
dce8d68
e1121de
9a252fc
1b6fc97
c0371be
df280dc
1041940
96556fe
68ba8f2
996f82c
60bd924
c5591ad
48b990c
93c5820
5ed7eaa
17f2964
1205ee2
01ed8fb
222f1e0
556a5a9
d40f917
5f0ce09
f3a156d
ddb036d
323af49
b13ea5f
626bf7f
2439202
483d6a2
8a47b97
b913d2d
aa57ae9
2650af5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package configMap | ||
|
|
||
| import ( | ||
| v1 "k8s.io/api/core/v1" | ||
| ) | ||
|
|
||
| type Option func(*v1.ConfigMap) | ||
prakash100198 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
prakash100198 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| // WithLabels adds labels to a ConfigMap | ||
| func WithLabels(labels map[string]string) Option { | ||
| return func(cm *v1.ConfigMap) { | ||
| if labels != nil && len(labels) > 0 { | ||
| cm.ObjectMeta.Labels = labels | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // WithAnnotations adds annotations to a ConfigMap | ||
| func WithAnnotations(annotations map[string]string) Option { | ||
| return func(cm *v1.ConfigMap) { | ||
| if annotations != nil && len(annotations) > 0 { | ||
| cm.ObjectMeta.Annotations = annotations | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // WithData adds string data to a ConfigMap | ||
| func WithData(data map[string]string) Option { | ||
| return func(cm *v1.ConfigMap) { | ||
| if data != nil && len(data) > 0 { | ||
| cm.Data = data | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // WithBinaryData adds binary data to a ConfigMap | ||
| func WithBinaryData(binaryData map[string][]byte) Option { | ||
| return func(cm *v1.ConfigMap) { | ||
| if binaryData != nil && len(binaryData) > 0 { | ||
| cm.BinaryData = binaryData | ||
| } | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.