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

Vendor gardener 1.57.1 and upgrade ginkgo to v2 #450

Merged

Conversation

AleksandarSavchev
Copy link
Member

How to categorize this PR?

/area open-source
/kind enhancement

What this PR does / why we need it:
Vendor gardener v1.57.1
This PR also upgrades ginkgo to v2 and removes unnecessary replace directives from go.mod file.

Which issue(s) this PR fixes:
Fixes #447

Special notes for your reviewer:
The ginkgo upgrade was needed because newer versions of g/g are using v2 and it was causing problems in some of the env tests

Release note:

Dependency `github.com/gardener/gardener` is updated `v1.36.0` -> `v1.57.1`
Dependency `github.com/onsi/ginkgo` is upgraded to `github.com/onsi/ginkgo/v2`

@AleksandarSavchev AleksandarSavchev requested a review from a team as a code owner October 18, 2022 12:27
@gardener-robot gardener-robot added area/open-source Open Source (community, enablement, contributions, conferences, CNCF, etc.) related kind/enhancement Enhancement, improvement, extension needs/review Needs review labels Oct 18, 2022
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 18, 2022
@gardener-robot gardener-robot added the size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) label Oct 18, 2022
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 18, 2022
@gardener-robot gardener-robot added the needs/second-opinion Needs second review by someone else label Oct 18, 2022
@AleksandarSavchev AleksandarSavchev changed the title Vendor gardener 1.57.0 and upgrade ginkgo to v2 Vendor gardener 1.57.1 and upgrade ginkgo to v2 Oct 18, 2022
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 19, 2022
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 20, 2022
Copy link
Contributor

@aaronfern aaronfern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @AleksandarSavchev!

A few questions/comments

resources:
- pods
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These permissions are required when deploying druid through kustomize

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These permissions were also removed by running make manifests. I am not sure which change caused it. Will have to look into it.

Comment on lines -192 to -197
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the status field?

Copy link
Member Author

@AleksandarSavchev AleksandarSavchev Oct 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field was removed by make manifests due to this PR in controller-tools v0.9.0

@@ -34,7 +35,7 @@ type statefulSetToEtcdMapper struct {
cl client.Client
}

func (m *statefulSetToEtcdMapper) Map(obj client.Object) []reconcile.Request {
func (m *statefulSetToEtcdMapper) Map(ctx context.Context, log logr.Logger, reader client.Reader, obj client.Object) []reconcile.Request {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These newly added parameters are unused in this function

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added these parameters since they are needed for the new Mapper interface in order not to change the StatefulSetToEtcd() function. The Mapper interface was changed in this PR.

Copy link
Contributor

@aaronfern aaronfern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, however a second opinion would be great before I merge this PR
/second-opinion @ishan16696 @abdasgupta

Copy link
Contributor

@plkokanov plkokanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I just have a few minor comments.

Makefile Outdated
@@ -66,11 +63,12 @@ deploy: manifests
kustomize build config/default | kubectl apply -f -

# Generate manifests e.g. CRD, RBAC etc.
# TODO(AleksandarSavchev): config/rbac/role.yaml has had manual changes that were ruiden by the last command of make manifests. make manifests need a fix.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# TODO(AleksandarSavchev): config/rbac/role.yaml has had manual changes that were ruiden by the last command of make manifests. make manifests need a fix.
# TODO(AleksandarSavchev): config/rbac/role.yaml gets incorrectly overwritten by this make target. Thus the generation of the role is skipped for now until a proper generation and generation check is implemented.

Also could you move this comment right above line 71.

Makefile Outdated
.PHONY: manifests
manifests: $(CONTROLLER_GEN)
@go generate ./config/crd/bases
@find "$(REPO_ROOT)/config/crd/bases" -name "*.yaml" -exec cp '{}' "$(REPO_ROOT)/charts/druid/charts/crds/templates/" \;
@controller-gen rbac:roleName=manager-role paths="./controllers/..."
# @controller-gen rbac:roleName=manager-role paths="./controllers/..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to skip the entire generation here? @aaronfern

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be okay
This role.yaml file generated is used only when deploying druid using kustomize and not in any other case. So should be okay from my pov

@@ -454,7 +453,8 @@ func (r *EtcdReconciler) getPodDisruptionBudgetFromEtcd(etcd *druidv1alpha1.Etcd
decoded := &policyv1beta1.PodDisruptionBudget{}
pdbPath := getChartPathForPodDisruptionBudget()
chartPath := getChartPath()
renderedChart, err := r.chartApplier.Render(chartPath, etcd.Name, etcd.Namespace, values)
// TODO(AleksandarSavchev): .Render is deprecated. Refactor or adapt code to use RenderEmbeddedFS https://github.com/gardener/gardener/pull/6165
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also open an issue for this on gardener/etcd-druid so that we don't forget it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etcd.Status.Ready = nil
etcd.Status.ReadyReplicas = 0

err := r.Client.Status().Update(ctx, etcd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
err := r.Client.Status().Update(ctx, etcd)
return etcd, r.Client.Status().Update(ctx, etcd)


return c.Watch(
&source.Kind{Type: &appsv1.StatefulSet{}},
mapper.EnqueueRequestsFrom(druidmapper.StatefulSetToEtcd(ctx, mgr.GetClient()), mapper.UpdateWithNew, mgr.GetLogger()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mapper.EnqueueRequestsFrom(druidmapper.StatefulSetToEtcd(ctx, mgr.GetClient()), mapper.UpdateWithNew, mgr.GetLogger()),
mapper.EnqueueRequestsFrom(druidmapper.StatefulSetToEtcd(ctx, mgr.GetClient()), mapper.UpdateWithNew, c.GetLogger()),

@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Oct 27, 2022
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 27, 2022
@aaronfern
Copy link
Contributor

Hi @AleksandarSavchev
Can you please rebase this PR?

@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 4, 2022
@AleksandarSavchev AleksandarSavchev requested review from plkokanov and aaronfern and removed request for plkokanov and aaronfern November 4, 2022 08:03
@gardener-robot gardener-robot removed the needs/second-opinion Needs second review by someone else label Dec 5, 2022
@unmarshall
Copy link
Contributor

Hi @AleksandarSavchev,
Thanks for the PR. We would like to hold off on this PR for some time till we remove our dependency on /hack/scripts that we source from gardener/gardener into etcd-druid. A lot of dependencies are pulled into the vendor directory when we source /hack/scripts and we hardly use any of those dependencies. Once we remove the dependency on g/g we will also upgrade the g/g version to the latest version.

I hope that is ok with you. Apologies for the delay. I was supposed to leave a comment in this issue earlier but was unable to do it. If you have any concerns then please respond here and we can discuss further.

Best Regards,
Madhav

@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 6, 2023
@gardener-robot gardener-robot added needs/second-opinion Needs second review by someone else and removed reviewed/lgtm Has approval for merging labels Jan 6, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 6, 2023
@aaronfern aaronfern added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 12, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 12, 2023
@aaronfern aaronfern merged commit fa55c9b into gardener:master Jan 12, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Jan 12, 2023
aaronfern pushed a commit to aaronfern/etcd-druid that referenced this pull request Jan 13, 2023
* Vendor gardener 1.57.1

* Upgrade ginkgo to v2

* linter fixes and added/removed TODOs

* Added github username to TODOs

* Added review suggestions

* Made fixes to PR

* Rebase master

* squash

* remove changes to make manifests
aaronfern pushed a commit to aaronfern/etcd-druid that referenced this pull request Jan 16, 2023
* Vendor gardener 1.57.1

* Upgrade ginkgo to v2

* linter fixes and added/removed TODOs

* Added github username to TODOs

* Added review suggestions

* Made fixes to PR

* Rebase master

* squash

* remove changes to make manifests
aaronfern added a commit that referenced this pull request Jan 16, 2023
* Vendor gardener 1.57.1

* Upgrade ginkgo to v2

* linter fixes and added/removed TODOs

* Added github username to TODOs

* Added review suggestions

* Made fixes to PR

* Rebase master

* squash

* remove changes to make manifests

Co-authored-by: Aleksandar Savchev <57963548+AleksandarSavchev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/open-source Open Source (community, enablement, contributions, conferences, CNCF, etc.) related kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/second-opinion Needs second review by someone else size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Upgrade g/g to version >= v1.44.0
8 participants