-
Notifications
You must be signed in to change notification settings - Fork 49
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
Refactor Role
Helm charts into component
#538
Refactor Role
Helm charts into component
#538
Conversation
pkg/utils/names.go
Outdated
@@ -64,3 +71,17 @@ func GetDeltaSnapshotLeaseName(etcd *druidv1alpha1.Etcd) string { | |||
func GetFullSnapshotLeaseName(etcd *druidv1alpha1.Etcd) string { | |||
return fmt.Sprintf("%s-full-snap", etcd.Name) | |||
} | |||
|
|||
// GenerateEtcdOwnerReference generates an OwnerReference for an etcd object that can be used to set it as the owner of other objects. | |||
func GenerateEtcdOwnerReference(etcd *druidv1alpha1.Etcd) []metav1.OwnerReference { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not belong here. Can you move it to miscellaneous.go for now?
Role
Helm charts into component
e94fcd3
to
b618c53
Compare
b618c53
to
823bf18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seshachalam-yv thanks for addressing my comments. Please address the changes mentioned for introducing a BeforeEach()
section in pkg/component/etcd/serviceaccount/values_helper_test.go
in a separate PR as mentioned.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, i have added some minor comments
- Remove Role from template yaml from chart - Add utils function `GetRoleName` - Removed old `reconcileRole` - Add unit tests for Role component
- `GetPeerServiceName` - `GetClientServiceName` - `GetServiceAccountName` - `GetConfigmapName` - `GetCompactionJobName` - `GetOrdinalPodName` - `GetDeltaSnapshotLeaseName` - `GetFullSnapshotLeaseName` - `GetDefaultLabels` - `GetAsOwnerReference` - `GetRoleName`
511e6d7
to
16a6533
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
… the service account test in response to gardener#538 (review)
… the service account test in response to gardener#538 (review)
…etcd` (#559) * Refactor: Update `configmap` component to use default labels and owner references from `etcd`. This commit refactors the `configmap` component to use the default labels and owner references provided by etcd. Specifically, we removed the functions `getOwnerReferences` and `getObjectMeta`, and instead used the `GetEtcdAsOwnerReference` and `GetDefaultLabels` functions. In addition, we improved the formulation of the configmap by adding a new function called `getEtcdConfigYaml`. * Refactor: Update `lease` component to use default labels and owner references from `etcd`. This commit refactors the `lease` component to use the default labels and owner references provided by etcd. Specifically, we removed the functions `getOwnerReferences`, and instead used the `GetEtcdAsOwnerReference` and `GetDefaultLabels` functions. * Refactor: Update `poddisruptionbudget` component to use default labels and owner references from `etcd`. This commit refactors the `poddisruptionbudget` component to use the default labels and owner references provided by etcd. Specifically, we removed the functions `getOwnerReferences`, and instead used the `GetEtcdAsOwnerReference` and `GetDefaultLabels` functions. * Refactor: Update `service` component to use default labels and owner references from `etcd`. This commit refactors the `service` component to use the default labels and owner references provided by etcd. Specifically, removed the functions `getOwnerReferences`, `getSelectors`, `getLabels` and instead used the `GetEtcdAsOwnerReference` and `GetDefaultLabels` functions. * Refactor: Update `statefulset` component to use default labels and owner references from `etcd`. This commit refactors the `statefulset` component to use the default labels and owner references provided by etcd. Specifically, removed the functions `getCommonLabels` and instead used the `GetAsOwnerReference` and `GetDefaultLabels` functions. Fix intergration test rebase with master * Updated the E2E test suite to use the appropriate component names. * Addressed review comment from Madhav about OwnerReferences. This commit addresses the review comment #539 (comment) * This commit addresses the review comment from Shreyas about improving the service account test in response to #538 (review) * Refactor API version to use 'druidv1alpha1.GroupVersion.String()' instead of the static string 'druid.gardener.cloud/v1alpha1 * Addressed review comment - Updated function `GetAsOwnerReference to return metav1.OwnerReference instead of *metav1.OwnerReference * Renamed function name checkConfigmap to checkConfigMap * Renamed ServerPort to PeerPort * Removed arguments of emptyPodDisruptionBudget and reused name, namespace from component's value * Constructing a etcdconfig YAML using strut instead of string string concatenation * Used default labels for lease component * Update log message with OwnerReference <name>:<uid> * make revendor * fix failing test * Removed checkPDBMetadata function * minor refactoring to configmap component * Removed JSON tags * Rebase with master * Fix integration test * Fix failing test * Apply suggestions from code review Co-authored-by: Aaron Francis Fernandes <79958509+aaronfern@users.noreply.github.com> * Addressed review feedback * Apply suggestions from code review Co-authored-by: Shreyas Rao <42259948+shreyas-s-rao@users.noreply.github.com> * Addressed review comment - Renamed field `PodAdditionalLabels` to `AdditionalPodLabels`. * Update pkg/component/etcd/configmap/values.go Co-authored-by: Shreyas Rao <42259948+shreyas-s-rao@users.noreply.github.com> * Fixed typo --------- Co-authored-by: Madhav Bhargava <madhav.bhargava@sap.com> Co-authored-by: Aaron Francis Fernandes <79958509+aaronfern@users.noreply.github.com> Co-authored-by: Shreyas Rao <42259948+shreyas-s-rao@users.noreply.github.com>
How to categorize this PR?
/area robustness
/kind enhancement
What this PR does / why we need it:
This PR refactors the
Etcd-druid
Role
helm charts in Golang component and adds unit tests.Which issue(s) this PR fixes:
Fixes part of #278
Special notes for your reviewer:
Release note: