cluster-api-provider-openstack icon indicating copy to clipboard operation
cluster-api-provider-openstack copied to clipboard

๐Ÿ› Fix ServerMetadata Not Applied to Bastion in OpenStackCluster

Open namgon-kim opened this issue 1 year ago โ€ข 14 comments

  • Fixed issue where spec.bastion.spec.serverMetadata was not set in bastion.
  • Updated bastionToInstanceSpec to apply serverMetadata in InstanceSpec.

What this PR does / why we need it: Fixes an issue where spec.bastion.spec.serverMetadata in OpenStackCluster was not applied as metadata to OpenStack instances. This change ensures that server metadata is set during bastion creation.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #2177

Special notes for your reviewer:

  1. Please check if any other parts of the repository require updates to serverMetadata outside of this change.

TODOs:

  • [ ] squashed commits

/hold

namgon-kim avatar Sep 26 '24 04:09 namgon-kim

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: namgon-kim (3b57409590e8abed56a18be0e79e370d7800f298)

Welcome @namgon-kim!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-openstack ๐ŸŽ‰. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-openstack has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Sep 26 '24 04:09 k8s-ci-robot

Hi @namgon-kim. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Sep 26 '24 04:09 k8s-ci-robot

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
Latest commit 3b57409590e8abed56a18be0e79e370d7800f298
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/6720e1c055f4e50008b34378
Deploy Preview https://deploy-preview-2179--kubernetes-sigs-cluster-api-openstack.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Sep 26 '24 04:09 netlify[bot]

@mdbooth how did we deal with PRs only for stable releases?

The least minimum is to retitle it to mention that. I'm not against the idea but this has a cost, for maintenance and future cherry-pick conflicts when doing backports on other things.

EmilienM avatar Sep 26 '24 13:09 EmilienM

/ok-to-test

mdbooth avatar Sep 26 '24 14:09 mdbooth

The issue is fixed in main and is unreleased now:

https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/1e39a380a979c6b3ac9a182e25749eab83740ac5/controllers/openstackcluster_controller.go#L566C25-L566C66 https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/1e39a380a979c6b3ac9a182e25749eab83740ac5/controllers/openstackmachine_controller.go#L481

So I'm fine fixing it only stable branches.

EmilienM avatar Sep 26 '24 15:09 EmilienM

/test pull-cluster-api-provider-openstack-test

EmilienM avatar Sep 26 '24 15:09 EmilienM

Looks like the linter broke in the stable branch :( How did that happen without making the tests fail?

mdbooth avatar Sep 27 '24 08:09 mdbooth

/test pull-cluster-api-provider-openstack-test

namgon-kim avatar Oct 04 '24 00:10 namgon-kim

/retest-required

namgon-kim avatar Oct 10 '24 01:10 namgon-kim

Iโ€™ve noticed that the tests are failing due to linter errors across the project. Is there any specific action I need to take to resolve this?

I ran the linter locally and got the following results:

$ make -C hack/tools bin/kustomize
$ make -C hack/tools bin/controller-gen
$ make -C hack/tools bin/conversion-gen
$ make -C hack/tools bin/mockgen
$ make -C hack/tools bin/gen-crd-api-reference-docs
$ make -C hack/tools bin/golangci-lint
$ hack/tools/bin/golangci-lint run -v --fast=false
INFO [config_reader] Config search paths: [./ /home/dev/workspaces/cluster-api-provider-openstack /home/dev/workspaces /home/dev /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 47 linters: [asasalint asciicheck bidichk bodyclose cyclop dogsled dupword durationcheck errcheck exportloopref forbidigo gci goconst gocritic gocyclo godot gofmt gofumpt goheader goimports gomodguard goprintffuncname gosec gosimple govet importas ineffassign makezero misspell nakedret nestif nilerr noctx nolintlint prealloc predeclared revive rowserrcheck sqlclosecheck staticcheck stylecheck thelper unconvert unparam unused wastedassign whitespace] 
INFO [loader] Using build tags: [e2e]             
INFO [loader] Go packages loading at mode 575 (deps|files|imports|types_sizes|compiled_files|exports_file|name) took 4.045486744s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 27.733474ms 
INFO [linters_context/goanalysis] analyzers took 0s with no stages 
INFO [runner] Issues before processing: 1047, after processing: 0 
INFO [runner] Processors filtering stat (out/in): cgo: 1047/1047, autogenerated_exclude: 816/816, nolint: 0/18, filename_unadjuster: 1047/1047, path_prettifier: 1047/1047, skip_files: 816/1047, exclude: 816/816, exclude-rules: 18/816, skip_dirs: 816/816, identifier_marker: 816/816 
INFO [runner] processing took 70.727961ms with stages: exclude-rules: 35.551671ms, identifier_marker: 19.235856ms, nolint: 5.942609ms, path_prettifier: 4.489669ms, autogenerated_exclude: 4.091699ms, skip_dirs: 785.717ยตs, skip_files: 391.232ยตs, cgo: 151.051ยตs, filename_unadjuster: 84.952ยตs, max_same_issues: 1.006ยตs, fixer: 342ns, exclude: 319ns, sort_results: 282ns, uniq_by_line: 277ns, diff: 264ns, severity-rules: 217ns, max_from_linter: 199ns, path_prefixer: 172ns, source_code: 166ns, path_shortener: 139ns, max_per_file_from_linter: 122ns 
INFO [runner] linters took 2.92052316s with stages: goanalysis_metalinter: 2.849671785s 
INFO File cache stats: 80 entries of total size 675.0KiB 
INFO Memory: 71 samples, avg is 50.0MB, max is 105.6MB 
INFO Execution took 7.00053684s

@EmilienM @mdbooth could you please advise on how to proceed?

namgon-kim avatar Oct 10 '24 01:10 namgon-kim

@namgon-kim I fixed the linter issue in https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/2211. Do you want to try rebasing this on top of current release-0.10 if you still need this?

mdbooth avatar Oct 29 '24 09:10 mdbooth

I took care of the rebasing, so we can produce a release on v0.10

EmilienM avatar Oct 29 '24 13:10 EmilienM

/lgtm /approve

I'll hold cancel when CI is passing

EmilienM avatar Oct 29 '24 14:10 EmilienM

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: EmilienM

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Oct 29 '24 14:10 k8s-ci-robot

/hold cancel

EmilienM avatar Oct 29 '24 14:10 EmilienM