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

feat(operator): Copy annotations from parent resource if not defined on pod #305

Merged
merged 41 commits into from
Nov 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3013925
first implementation steps
mowies Nov 3, 2022
c72f5d2
fix typo in readme
mowies Nov 3, 2022
82867fa
add label copying for dp, sts and ds
mowies Nov 3, 2022
55b580a
go fmt
mowies Nov 3, 2022
2f0862c
remove duplicate methods in favor of generalized ones
mowies Nov 7, 2022
058fca4
remove unneeded length checks
mowies Nov 7, 2022
5c59ec8
move code to separate function to reduce complexity
mowies Nov 7, 2022
7c8352b
rename to kltv1alpha1
mowies Nov 7, 2022
35273a0
small refactoring, adjust return values
mowies Nov 7, 2022
fe41484
remove unneeded initialization
mowies Nov 7, 2022
3debb0c
initialize map correctly
mowies Nov 7, 2022
6022a74
add label copy for all pre/post deployment/evaluation labels
mowies Nov 7, 2022
0d07b5c
add namespace to single service example
mowies Nov 8, 2022
d32f6c9
add permission to list apps.v1 resources to operator
mowies Nov 8, 2022
27f8c8a
add unit test file for webhook
mowies Nov 8, 2022
25669e2
first unit tests for webhook
mowies Nov 8, 2022
daed320
more tests
mowies Nov 8, 2022
6c5bcdb
even more tests
mowies Nov 8, 2022
7442912
moooooooooooore
mowies Nov 8, 2022
872d7cb
check if pod reference got updated correctly
mowies Nov 8, 2022
cb0166f
add error when parent rs of pod cannot be found
mowies Nov 9, 2022
75bc13d
typo
mowies Nov 9, 2022
eea85a7
more tests and added error if rs of pod doesnt have an owner
mowies Nov 9, 2022
8a95ee3
fix behaviour when no owner is found
mowies Nov 9, 2022
37c3e48
more tests, also copy over app name
mowies Nov 9, 2022
4a1b565
fix rebase artifact
mowies Nov 9, 2022
4ab3b21
more tests
mowies Nov 9, 2022
b4de62d
optimise finding of owner a little bit
mowies Nov 9, 2022
6b19285
fix some refactoring things
mowies Nov 9, 2022
9925ebb
go fmt
mowies Nov 9, 2022
2378248
update the whole process with switch case and change behaviour
mowies Nov 9, 2022
ccf00c3
simplify the whole thing by using get instead of list and search
mowies Nov 9, 2022
8881c94
update CRDs accordingly
mowies Nov 9, 2022
4504446
fix unit tests
mowies Nov 10, 2022
33552ea
refactoring
mowies Nov 10, 2022
c8372e6
move error check as per review request
mowies Nov 10, 2022
6c78d1b
remove unneeded permissions
mowies Nov 10, 2022
22f9c98
fix typo
mowies Nov 10, 2022
65736b8
fix unit tests
mowies Nov 10, 2022
13e8e20
minor cleanups
bacherfl Nov 14, 2022
64bccea
pr review
bacherfl Nov 14, 2022
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
Prev Previous commit
Next Next commit
update CRDs accordingly
Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
mowies authored and bacherfl committed Nov 14, 2022
commit 8881c943d4a0bbb99fd3dad9640557b450e975f8
3 changes: 2 additions & 1 deletion operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -10,9 +10,10 @@ rules:
resources:
- daemonsets
- deployments
- replicasets
- statefulsets
verbs:
- list
- get
- apiGroups:
- apps
resources:
2 changes: 1 addition & 1 deletion operator/webhooks/pod_mutating_webhook.go
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ import (

// +kubebuilder:webhook:path=/mutate-v1-pod,mutating=true,failurePolicy=fail,groups="",resources=pods,verbs=create;update,versions=v1,name=mpod.keptn.sh,admissionReviewVersions=v1,sideEffects=None
//+kubebuilder:rbac:groups=core,resources=namespaces,verbs=get;list;watch
//+kubebuilder:rbac:groups=apps,resources=deployments;statefulsets;daemonsets,verbs=list;get
//+kubebuilder:rbac:groups=apps,resources=deployments;statefulsets;daemonsets;replicasets,verbs=get

// PodMutatingWebhook annotates Pods
type PodMutatingWebhook struct {