Skip to content

Commit

Permalink
Merge branch 'main' into shoot-comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
m00g3n authored May 20, 2024
2 parents 44ee2d0 + 4cbacaa commit e0c276d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 33 deletions.
27 changes: 13 additions & 14 deletions api/v1/runtime_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package v1
import (
gardener "github.com/gardener/gardener/pkg/apis/core/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

//+kubebuilder:object:root=true
Expand Down Expand Up @@ -64,15 +63,17 @@ type RuntimeStatus struct {
}

type RuntimeShoot struct {
Name string `json:"name"`
Purpose gardener.ShootPurpose `json:"purpose"`
Region string `json:"region"`
LicenceType *string `json:"licenceType,omitempty"`
SecretBindingName string `json:"secretBindingName"`
Kubernetes Kubernetes `json:"kubernetes"`
Provider Provider `json:"provider"`
Networking Networking `json:"networking"`
ControlPlane gardener.ControlPlane `json:"controlPlane"`
Name string `json:"name"`
Purpose gardener.ShootPurpose `json:"purpose"`
PlatformRegion string `json:"platformRegion"`
Region string `json:"region"`
LicenceType *string `json:"licenceType,omitempty"`
SecretBindingName string `json:"secretBindingName"`
EnforceSeedLocation *bool `json:"enforceSeedLocation,omitempty"`
Kubernetes Kubernetes `json:"kubernetes"`
Provider Provider `json:"provider"`
Networking Networking `json:"networking"`
ControlPlane gardener.ControlPlane `json:"controlPlane"`
}

type Kubernetes struct {
Expand All @@ -86,10 +87,8 @@ type APIServer struct {
}

type Provider struct {
Type string `json:"type"`
ControlPlaneConfig runtime.RawExtension `json:"controlPlaneConfig"`
InfrastructureConfig runtime.RawExtension `json:"infrastructureConfig"`
Workers []gardener.Worker `json:"workers"`
Type string `json:"type"`
Workers []gardener.Worker `json:"workers"`
}

type Networking struct {
Expand Down
9 changes: 6 additions & 3 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ spec:
- failureTolerance
type: object
type: object
enforceSeedLocation:
type: boolean
kubernetes:
properties:
kubeAPIServer:
Expand Down Expand Up @@ -295,14 +297,10 @@ spec:
- pods
- services
type: object
platformRegion:
type: string
provider:
properties:
controlPlaneConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
infrastructureConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
type:
type: string
workers:
Expand Down Expand Up @@ -1001,8 +999,6 @@ spec:
type: object
type: array
required:
- controlPlaneConfig
- infrastructureConfig
- type
- workers
type: object
Expand All @@ -1018,6 +1014,7 @@ spec:
- kubernetes
- name
- networking
- platformRegion
- provider
- purpose
- region
Expand Down
5 changes: 1 addition & 4 deletions internal/controller/runtime_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
. "github.com/onsi/gomega" //nolint:revive
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apimachneryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)
Expand Down Expand Up @@ -55,9 +54,7 @@ var _ = Describe("Runtime Controller", func() {
Shoot: imv1.RuntimeShoot{
Networking: imv1.Networking{},
Provider: imv1.Provider{
ControlPlaneConfig: apimachneryruntime.RawExtension{Raw: []byte("{}")},
InfrastructureConfig: apimachneryruntime.RawExtension{Raw: []byte("{}")},
Workers: []gardener.Worker{},
Workers: []gardener.Worker{},
},
},
Security: imv1.Security{
Expand Down
6 changes: 2 additions & 4 deletions internal/gardener/shoot/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ func getOIDCConfig(oidcConfig gardenerv1beta.OIDCConfig) *gardenerv1beta.OIDCCon

func getProvider(runtimeProvider imv1.Provider) gardenerv1beta.Provider {
return gardenerv1beta.Provider{
Type: runtimeProvider.Type,
ControlPlaneConfig: &runtimeProvider.ControlPlaneConfig,
InfrastructureConfig: &runtimeProvider.InfrastructureConfig,
Workers: runtimeProvider.Workers,
Type: runtimeProvider.Type,
Workers: runtimeProvider.Workers,
}
}

Expand Down

0 comments on commit e0c276d

Please sign in to comment.