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

Support Namespaced Cloud Profiles #462

Merged
merged 3 commits into from
Oct 21, 2024
Merged

Conversation

petersutter
Copy link
Member

@petersutter petersutter commented Oct 11, 2024

What this PR does / why we need it:
Due to the deprecation of Shoot.spec.CloudProfileName, we now use Shoot.spec.CloudProfile, which can reference either a CloudProfile or a NamespacedCloudProfile. The GetCloudProfile method has been updated to handle both types, with their specs accessible via GetCloudProfileSpec.

type CloudProfileUnion struct {
	CloudProfile *gardencorev1beta1.CloudProfile
	NamespacedCloudProfile *gardencorev1beta1.NamespacedCloudProfile
}

// CloudProfileUnion returns the CloudProfileSpec of the CloudProfile or NamespacedCloudProfile.
func (u *CloudProfileUnion) GetCloudProfileSpec() *gardencorev1beta1.CloudProfileSpec {
    if u.NamespacedCloudProfile != nil {
        return &u.NamespacedCloudProfile.Status.CloudProfileSpec
    }

    return &u.CloudProfile.Spec
}

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Support Namespaced Cloud Profiles

@petersutter petersutter requested a review from a team as a code owner October 11, 2024 12:20
@gardener-robot gardener-robot added needs/review Needs review size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Oct 11, 2024
@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) 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 11, 2024
Due to the deprecation of `Shoot.spec.CloudProfileName`, we now use `Shoot.spec.CloudProfile`, which can reference either a `CloudProfile` or a `NamespacedCloudProfile`. The `GetCloudProfile` method has been updated to handle both types, with their specs accessible via `GetCloudProfileSpec`.

```go
// CloudProfile encapsulates a CloudProfile or NamespacedCloudProfile.
type CloudProfile struct {
    CloudProfile *gardencorev1beta1.CloudProfile
    NamespacedCloudProfile *gardencorev1beta1.NamespacedCloudProfile
}

// GetCloudProfileSpec returns the CloudProfileSpec of the CloudProfile or NamespacedCloudProfile.
func (w *CloudProfile) GetCloudProfileSpec() *gardencorev1beta1.CloudProfileSpec {
    if w.NamespacedCloudProfile != nil {
        return &w.NamespacedCloudProfile.Status.CloudProfileSpec
    }

    return &w.CloudProfile.Spec
}
```
@grolu grolu added the area/ipcei IPCEI (Important Project of Common European Interest) label Oct 14, 2024
@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 14, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 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 14, 2024
@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 14, 2024
Copy link
Member

@holgerkoser holgerkoser left a comment

Choose a reason for hiding this comment

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

/lgtm
Beside from the renaming to CloudProfileUnion it is a straight forward change

internal/client/garden/client.go Outdated Show resolved Hide resolved
@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review needs/second-opinion Needs second review by someone else labels Oct 18, 2024
@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, 2024
@gardener-robot gardener-robot added the needs/second-opinion Needs second review by someone else label Oct 18, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 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 18, 2024
@gardener-robot gardener-robot removed the reviewed/lgtm Has approval for merging label Oct 18, 2024
Copy link
Contributor

@grolu grolu left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/second-opinion Needs second review by someone else labels Oct 18, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 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, 2024
@petersutter petersutter merged commit f781a77 into master Oct 21, 2024
8 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipcei IPCEI (Important Project of Common European Interest) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) 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.

7 participants