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

Delete provSpec redundant check in MC providers #1791

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mohamed-rafraf
Copy link
Member

What this PR does / why we need it:

No need for this check in the getConfig() function

if provSpec.Value == nil {
	return nil, nil, fmt.Errorf("machine.spec.providerconfig.value is nil")
}

because it already exists in providerconfigtypes.GetConfig() function

Which issue(s) this PR fixes:

Fixes #

What type of PR is this?

Special notes for your reviewer:

Does this PR introduce a user-facing change? Then add your Release Note here:

NONE

Documentation:

NONE

No need for this check in the `getConfig()` function
```	
if provSpec.Value == nil {
		return nil, nil, fmt.Errorf("machine.spec.providerconfig.value is nil")
	}
```
because it already exists in `providerconfigtypes.GetConfig()` function



Signed-off-by: Mohamed Rafraf <81432497+mohamed-rafraf@users.noreply.github.com>
@kubermatic-bot kubermatic-bot added docs/none Denotes a PR that doesn't need documentation (changes). release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. labels May 4, 2024
@mohamed-rafraf
Copy link
Member Author

/assign

@kubermatic-bot kubermatic-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 4, 2024
@mohamed-rafraf
Copy link
Member Author

/cc @ahmedwaleedmalik

@ahmedwaleedmalik
Copy link
Member

Looks good. Would it be possible for you to do the same for other instances where we also have this redundant check? It should only be required here https://github.com/kubermatic/machine-controller/blob/main/pkg/providerconfig/types/types.go#L386-L388

@kubermatic-bot kubermatic-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 6, 2024
@mohamed-rafraf mohamed-rafraf changed the title Delete provSpec check in baremetal provider Delete provSpec redundant check in MC providers May 6, 2024
Copy link
Member

@ahmedwaleedmalik ahmedwaleedmalik left a comment

Choose a reason for hiding this comment

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

/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2024
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: dbcfdddf3a55bfaa5a239bc275ce77b4d62d906e

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmedwaleedmalik

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

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2024
@kubermatic-triage-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs

Review the full test history

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@ahmedwaleedmalik
Copy link
Member

/hold to avoid retries

@kubermatic-bot kubermatic-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 6, 2024
@ahmedwaleedmalik
Copy link
Member

@mohamed-rafraf you'll need overrides for the failing tests. @xrstf is the person to reach for that.

@kubermatic-bot
Copy link
Contributor

kubermatic-bot commented May 6, 2024

@mohamed-rafraf: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-machine-controller-e2e-vmware-cloud-director 894e2bc link true /test pull-machine-controller-e2e-vmware-cloud-director
pull-machine-controller-e2e-vsphere 894e2bc link true /test pull-machine-controller-e2e-vsphere

Full PR test history

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/test-infra repository. I understand the commands that are listed here.

@ahmedwaleedmalik
Copy link
Member

/retest pull-machine-controller-e2e-azure pull-machine-controller-e2e-azure-custom-image-reference

@kubermatic-bot
Copy link
Contributor

@ahmedwaleedmalik: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test pre-machine-controller-verify-shfmt
  • /test pull-kubermatic-machine-controller-validate-prow-yaml
  • /test pull-machine-controller-build
  • /test pull-machine-controller-dependencies
  • /test pull-machine-controller-e2e-aws
  • /test pull-machine-controller-e2e-aws-arm
  • /test pull-machine-controller-e2e-aws-assume-role
  • /test pull-machine-controller-e2e-aws-centos8
  • /test pull-machine-controller-e2e-aws-ebs-encryption-enabled
  • /test pull-machine-controller-e2e-aws-flatcar-coreos-cloud-init
  • /test pull-machine-controller-e2e-aws-spot-instance
  • /test pull-machine-controller-e2e-azure
  • /test pull-machine-controller-e2e-azure-custom-image-reference
  • /test pull-machine-controller-e2e-custom-ca
  • /test pull-machine-controller-e2e-deployment-upgrade
  • /test pull-machine-controller-e2e-digitalocean
  • /test pull-machine-controller-e2e-gce
  • /test pull-machine-controller-e2e-hetzner
  • /test pull-machine-controller-e2e-invalid-objects-get-rejected
  • /test pull-machine-controller-e2e-kubevirt
  • /test pull-machine-controller-e2e-nutanix
  • /test pull-machine-controller-e2e-openstack
  • /test pull-machine-controller-e2e-openstack-project-auth
  • /test pull-machine-controller-e2e-scaleway
  • /test pull-machine-controller-e2e-ubuntu-upgrade
  • /test pull-machine-controller-e2e-vmware-cloud-director
  • /test pull-machine-controller-e2e-vsphere
  • /test pull-machine-controller-e2e-vsphere-anti-affinity
  • /test pull-machine-controller-e2e-vsphere-datastore-cluster
  • /test pull-machine-controller-e2e-vsphere-multiple-networks
  • /test pull-machine-controller-e2e-vsphere-resource-pool
  • /test pull-machine-controller-license-validation
  • /test pull-machine-controller-lint
  • /test pull-machine-controller-test
  • /test pull-machine-controller-verify-boilerplate
  • /test pull-machine-controller-yamllint

The following commands are available to trigger optional jobs:

  • /test pull-machine-controller-e2e-alibaba
  • /test pull-machine-controller-e2e-anexia
  • /test pull-machine-controller-e2e-azure-redhat-satellite
  • /test pull-machine-controller-e2e-equinix-metal
  • /test pull-machine-controller-e2e-linode

Use /test all to run the following jobs that were automatically triggered:

  • pull-kubermatic-machine-controller-validate-prow-yaml
  • pull-machine-controller-build
  • pull-machine-controller-dependencies
  • pull-machine-controller-e2e-azure
  • pull-machine-controller-e2e-azure-custom-image-reference
  • pull-machine-controller-e2e-custom-ca
  • pull-machine-controller-e2e-digitalocean
  • pull-machine-controller-e2e-equinix-metal
  • pull-machine-controller-e2e-gce
  • pull-machine-controller-e2e-hetzner
  • pull-machine-controller-e2e-invalid-objects-get-rejected
  • pull-machine-controller-e2e-kubevirt
  • pull-machine-controller-e2e-nutanix
  • pull-machine-controller-e2e-vmware-cloud-director
  • pull-machine-controller-e2e-vsphere
  • pull-machine-controller-lint
  • pull-machine-controller-test
  • pull-machine-controller-verify-boilerplate
  • pull-machine-controller-yamllint

In response to this:

/retest pull-machine-controller-e2e-azure pull-machine-controller-e2e-azure-custom-image-reference

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/test-infra repository.

@ahmedwaleedmalik
Copy link
Member

/test pull-machine-controller-e2e-azure pull-machine-controller-e2e-azure-custom-image-reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. docs/none Denotes a PR that doesn't need documentation (changes). lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants