Skip to content

Commit

Permalink
upgrade k8s version to v1.30 (vesoft-inc#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaByte875 authored Aug 12, 2024
1 parent a9c0c57 commit d6430f2
Show file tree
Hide file tree
Showing 18 changed files with 2,680 additions and 876 deletions.
8 changes: 4 additions & 4 deletions apis/apps/v1alpha1/nebulacluster_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,15 @@ func storageDataVolume(componentType string, index int) string {
return dataVolume(componentType)
}

func parseStorageRequest(res corev1.ResourceList) (corev1.ResourceRequirements, error) {
func parseStorageRequest(res corev1.ResourceList) (corev1.VolumeResourceRequirements, error) {
if res == nil {
return corev1.ResourceRequirements{}, nil
return corev1.VolumeResourceRequirements{}, nil
}
storage, ok := res[corev1.ResourceStorage]
if !ok {
return corev1.ResourceRequirements{}, fmt.Errorf("storage request is not set")
return corev1.VolumeResourceRequirements{}, fmt.Errorf("storage request is not set")
}
return corev1.ResourceRequirements{
return corev1.VolumeResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: storage,
},
Expand Down
4 changes: 2 additions & 2 deletions apis/apps/v1alpha1/nebulacluster_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func (a *componentAccessor) DNSPolicy() corev1.DNSPolicy {
type NebulaClusterComponent interface {
BaseComponent

GetLogStorageResources() *corev1.ResourceRequirements
GetDataStorageResources() (*corev1.ResourceRequirements, error)
GetLogStorageResources() *corev1.VolumeResourceRequirements
GetDataStorageResources() (*corev1.VolumeResourceRequirements, error)
GetConfig() map[string]string
GetConfigMapKey() string

Expand Down
4 changes: 2 additions & 2 deletions apis/apps/v1alpha1/nebulacluster_graphd.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ func (c *graphdComponent) GetLogStorageClass() *string {
return scName
}

func (c *graphdComponent) GetLogStorageResources() *corev1.ResourceRequirements {
func (c *graphdComponent) GetLogStorageResources() *corev1.VolumeResourceRequirements {
if c.nc.Spec.Graphd.LogVolumeClaim == nil {
return nil
}
return c.nc.Spec.Graphd.LogVolumeClaim.Resources.DeepCopy()
}

func (c *graphdComponent) GetDataStorageResources() (*corev1.ResourceRequirements, error) {
func (c *graphdComponent) GetDataStorageResources() (*corev1.VolumeResourceRequirements, error) {
return nil, nil
}

Expand Down
4 changes: 2 additions & 2 deletions apis/apps/v1alpha1/nebulacluster_metad.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ func (c *metadComponent) GetDataStorageClass() *string {
return scName
}

func (c *metadComponent) GetLogStorageResources() *corev1.ResourceRequirements {
func (c *metadComponent) GetLogStorageResources() *corev1.VolumeResourceRequirements {
if c.nc.Spec.Metad.LogVolumeClaim == nil {
return nil
}
return c.nc.Spec.Metad.LogVolumeClaim.Resources.DeepCopy()
}

func (c *metadComponent) GetDataStorageResources() (*corev1.ResourceRequirements, error) {
func (c *metadComponent) GetDataStorageResources() (*corev1.VolumeResourceRequirements, error) {
if c.nc.Spec.Metad.DataVolumeClaim == nil {
return nil, nil
}
Expand Down
6 changes: 3 additions & 3 deletions apis/apps/v1alpha1/nebulacluster_storaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ func (c *storagedComponent) GetDataStorageClass() *string {
return nil
}

func (c *storagedComponent) GetLogStorageResources() *corev1.ResourceRequirements {
func (c *storagedComponent) GetLogStorageResources() *corev1.VolumeResourceRequirements {
if c.nc.Spec.Storaged.LogVolumeClaim == nil {
return nil
}
return c.nc.Spec.Storaged.LogVolumeClaim.Resources.DeepCopy()
}

func (c *storagedComponent) GetDataStorageResources() (*corev1.ResourceRequirements, error) {
resources := corev1.ResourceRequirements{}
func (c *storagedComponent) GetDataStorageResources() (*corev1.VolumeResourceRequirements, error) {
resources := corev1.VolumeResourceRequirements{}
for i := range c.nc.Spec.Storaged.DataVolumeClaims {
claim := c.nc.Spec.Storaged.DataVolumeClaims[i]
storageRequest, err := parseStorageRequest(claim.Resources.Requests)
Expand Down
2 changes: 1 addition & 1 deletion apis/apps/v1alpha1/nebulacluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ type ComponentSpec struct {
type StorageClaim struct {
// Resources represents the minimum resources the volume should have.
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
Resources corev1.VolumeResourceRequirements `json:"resources,omitempty"`

// Name of the StorageClass required by the claim.
// +optional
Expand Down
30 changes: 16 additions & 14 deletions apis/go.mod
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
module github.com/vesoft-inc/nebula-operator/apis

go 1.20
go 1.22.0

toolchain go1.22.5

require (
github.com/openkruise/kruise-api v1.3.0
github.com/vesoft-inc/nebula-go/v3 v3.6.0
k8s.io/api v0.27.10
k8s.io/apimachinery v0.27.10
k8s.io/client-go v0.27.10
k8s.io/utils v0.0.0-20230209194617-a36077c30491
sigs.k8s.io/controller-runtime v0.15.2
github.com/openkruise/kruise-api v1.6.0
github.com/vesoft-inc/nebula-go/v3 v3.8.0
k8s.io/api v0.30.0
k8s.io/apimachinery v0.30.0
k8s.io/client-go v0.30.0
k8s.io/utils v0.0.0-20240310230437-4693a0247e57
sigs.k8s.io/controller-runtime v0.18.0
)

require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/vesoft-inc/fbthrift v0.0.0-20230214024353-fa2f34755b28 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit d6430f2

Please sign in to comment.