Skip to content

🌱 Remove unused updateClusterStatus #12295

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions bootstrap/kubeadm/types/upstreamv1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ func (dst *ClusterConfiguration) ConvertFrom(srcRaw conversion.Hub) error {
return Convert_v1beta2_ClusterConfiguration_To_upstreamv1beta1_ClusterConfiguration(src, dst, nil)
}

func (src *ClusterStatus) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*bootstrapv1.ClusterStatus)
return Convert_upstreamv1beta1_ClusterStatus_To_v1beta2_ClusterStatus(src, dst, nil)
}

func (dst *ClusterStatus) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*bootstrapv1.ClusterStatus)
return Convert_v1beta2_ClusterStatus_To_upstreamv1beta1_ClusterStatus(src, dst, nil)
}

func (src *InitConfiguration) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*bootstrapv1.InitConfiguration)
return Convert_upstreamv1beta1_InitConfiguration_To_v1beta2_InitConfiguration(src, dst, nil)
Expand Down
7 changes: 0 additions & 7 deletions bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ func TestFuzzyConversion(t *testing.T) {
SkipSpokeAnnotationCleanup: true,
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
}))
t.Run("for ClusterStatus", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
Hub: &bootstrapv1.ClusterStatus{},
Spoke: &ClusterStatus{},
// NOTE: Kubeadm types does not have ObjectMeta, so we are required to skip data annotation cleanup in the spoke-hub-spoke round trip test.
SkipSpokeAnnotationCleanup: true,
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
}))
t.Run("for InitConfiguration", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
Hub: &bootstrapv1.InitConfiguration{},
Spoke: &InitConfiguration{},
Expand Down
12 changes: 0 additions & 12 deletions bootstrap/kubeadm/types/upstreamv1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,6 @@ type ImageMeta struct {
//TODO: evaluate if we need also a ImageName based on user feedbacks
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterStatus contains the cluster status. The ClusterStatus will be stored in the kubeadm-config
// ConfigMap in the cluster, and then updated by kubeadm when additional control plane instance joins or leaves the cluster.
type ClusterStatus struct {
metav1.TypeMeta `json:",inline"`

// APIEndpoints currently available in the cluster, one for each control plane/api server instance.
// The key of the map is the IP of the host's default interface
APIEndpoints map[string]APIEndpoint `json:"apiEndpoints"`
}

// APIEndpoint struct contains elements of API server instance deployed on a node.
type APIEndpoint struct {
// AdvertiseAddress sets the IP address for the API server to advertise.
Expand Down
30 changes: 0 additions & 30 deletions bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go

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

31 changes: 0 additions & 31 deletions bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.deepcopy.go

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

10 changes: 0 additions & 10 deletions bootstrap/kubeadm/types/upstreamv1beta2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ func (dst *ClusterConfiguration) ConvertFrom(srcRaw conversion.Hub) error {
return Convert_v1beta2_ClusterConfiguration_To_upstreamv1beta2_ClusterConfiguration(src, dst, nil)
}

func (src *ClusterStatus) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*bootstrapv1.ClusterStatus)
return Convert_upstreamv1beta2_ClusterStatus_To_v1beta2_ClusterStatus(src, dst, nil)
}

func (dst *ClusterStatus) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*bootstrapv1.ClusterStatus)
return Convert_v1beta2_ClusterStatus_To_upstreamv1beta2_ClusterStatus(src, dst, nil)
}

func (src *InitConfiguration) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*bootstrapv1.InitConfiguration)
return Convert_upstreamv1beta2_InitConfiguration_To_v1beta2_InitConfiguration(src, dst, nil)
Expand Down
7 changes: 0 additions & 7 deletions bootstrap/kubeadm/types/upstreamv1beta2/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ func TestFuzzyConversion(t *testing.T) {
SkipSpokeAnnotationCleanup: true,
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
}))
t.Run("for ClusterStatus", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
Hub: &bootstrapv1.ClusterStatus{},
Spoke: &ClusterStatus{},
// NOTE: Kubeadm types does not have ObjectMeta, so we are required to skip data annotation cleanup in the spoke-hub-spoke round trip test.
SkipSpokeAnnotationCleanup: true,
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
}))
t.Run("for InitConfiguration", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
Hub: &bootstrapv1.InitConfiguration{},
Spoke: &InitConfiguration{},
Expand Down
12 changes: 0 additions & 12 deletions bootstrap/kubeadm/types/upstreamv1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,6 @@ type ImageMeta struct {
//TODO: evaluate if we need also a ImageName based on user feedbacks
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterStatus contains the cluster status. The ClusterStatus will be stored in the kubeadm-config
// ConfigMap in the cluster, and then updated by kubeadm when additional control plane instance joins or leaves the cluster.
type ClusterStatus struct {
metav1.TypeMeta `json:",inline"`

// APIEndpoints currently available in the cluster, one for each control plane/api server instance.
// The key of the map is the IP of the host's default interface
APIEndpoints map[string]APIEndpoint `json:"apiEndpoints"`
}

// APIEndpoint struct contains elements of API server instance deployed on a node.
type APIEndpoint struct {
// AdvertiseAddress sets the IP address for the API server to advertise.
Expand Down
30 changes: 0 additions & 30 deletions bootstrap/kubeadm/types/upstreamv1beta2/zz_generated.conversion.go

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

31 changes: 0 additions & 31 deletions bootstrap/kubeadm/types/upstreamv1beta2/zz_generated.deepcopy.go

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

22 changes: 0 additions & 22 deletions bootstrap/kubeadm/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ var (
upstreamv1beta2.GroupVersion: &upstreamv1beta2.ClusterConfiguration{},
}

clusterStatusVersionTypeMap = map[schema.GroupVersion]conversion.Convertible{
// ClusterStatus has been removed in v1beta3, so we don't need an entry for v1beta3 & v1beta4
upstreamv1beta2.GroupVersion: &upstreamv1beta2.ClusterStatus{},
}

initConfigurationVersionTypeMap = map[schema.GroupVersion]conversion.Convertible{
upstreamv1beta4.GroupVersion: &upstreamv1beta4.InitConfiguration{},
upstreamv1beta3.GroupVersion: &upstreamv1beta3.InitConfiguration{},
Expand Down Expand Up @@ -100,13 +95,6 @@ func MarshalClusterConfigurationForVersion(initConfiguration *bootstrapv1.InitCo
return marshalForVersion(initConfiguration, clusterConfiguration, version, clusterConfigurationVersionTypeMap)
}

// MarshalClusterStatusForVersion converts a Cluster API ClusterStatus type to the kubeadm API type
// for the given Kubernetes Version.
// NOTE: This assumes Kubernetes Version equals to kubeadm version.
func MarshalClusterStatusForVersion(clusterStatus *bootstrapv1.ClusterStatus, version semver.Version) (string, error) {
return marshalForVersion(nil, clusterStatus, version, clusterStatusVersionTypeMap)
}

// MarshalInitConfigurationForVersion converts a Cluster API InitConfiguration type to the kubeadm API type
// for the given Kubernetes Version.
// NOTE: This assumes Kubernetes Version equals to kubeadm version.
Expand Down Expand Up @@ -185,16 +173,6 @@ func UnmarshalClusterConfiguration(yaml string, initConfiguration *bootstrapv1.I
return obj, nil
}

// UnmarshalClusterStatus tries to translate a Kubeadm API yaml back to the Cluster API ClusterStatus type.
// NOTE: The yaml could be any of the known formats for the kubeadm ClusterStatus type.
func UnmarshalClusterStatus(yaml string) (*bootstrapv1.ClusterStatus, error) {
obj := &bootstrapv1.ClusterStatus{}
if err := unmarshalFromVersions(yaml, clusterStatusVersionTypeMap, nil, obj); err != nil {
return nil, err
}
return obj, nil
}

// UnmarshalInitConfiguration tries to translate a Kubeadm API yaml back to the InitConfiguration type.
// NOTE: The yaml could be any of the known formats for the kubeadm InitConfiguration type.
func UnmarshalInitConfiguration(yaml string) (*bootstrapv1.InitConfiguration, error) {
Expand Down
Loading
Loading