Skip to content

Commit

Permalink
modify poolservice api.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyjhtangtang committed Apr 8, 2024
1 parent e80164a commit dfd8a16
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: poolservices.net.openyurt.io
name: poolservices.network.openyurt.io
spec:
group: net.openyurt.io
group: network.openyurt.io
names:
categories:
- all
Expand Down Expand Up @@ -48,11 +48,6 @@ spec:
properties:
loadBalancerClass:
type: string
poolName:
type: string
renewTime:
format: date-time
type: string
type: object
status:
description: PoolServiceStatus defines the observed state of PoolService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package apis

import (
version "github.com/openyurtio/openyurt/pkg/apis/net/v1alpha1"
version "github.com/openyurtio/openyurt/pkg/apis/network/v1alpha1"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "net.openyurt.io", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "network.openyurt.io", Version: "v1alpha1"}

SchemeGroupVersion = GroupVersion

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand All @@ -26,14 +26,8 @@ import (

// PoolServiceSpec defines the desired state of PoolService
type PoolServiceSpec struct {
// Specify the name of the nodepool to identifies the nodepool to which the PoolService belongs.
PoolName string `json:"poolName,omitempty"`

// When the service corresponding to poolService is updated, the RenewTime will be refreshed.
RenewTime *metav1.MicroTime `json:"renewTime,omitempty"`

// Inherited from service annotations service.beta.kubernetes.io/class.
LoadBalancerClass string `json:"loadBalancerClass,omitempty"`
// Inherited from service spec.LoadBalancerClass
LoadBalancerClass *string `json:"loadBalancerClass,omitempty"`
}

// PoolServiceStatus defines the observed state of PoolService
Expand Down

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

24 changes: 24 additions & 0 deletions pkg/apis/network/well_known_labels_annotations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package network

const (
LabelServiceName = "openyurt.io/service-name"
LabelNodePoolName = "openyurt.io/pool-name"
AnnotationNodePoolSelector = "service.openyurt.io/nodepool-labelselector"
AggregateAnnotationsKeyPrefix = "service.openyurt.io"
)
2 changes: 1 addition & 1 deletion pkg/yurtmanager/controller/poolservice/config/types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,7 +34,7 @@ import (

appconfig "github.com/openyurtio/openyurt/cmd/yurt-manager/app/config"
"github.com/openyurtio/openyurt/cmd/yurt-manager/names"
netv1alpha1 "github.com/openyurtio/openyurt/pkg/apis/net/v1alpha1"
netv1alpha1 "github.com/openyurtio/openyurt/pkg/apis/network/v1alpha1"
"github.com/openyurtio/openyurt/pkg/yurtmanager/controller/poolservice/config"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"

"github.com/openyurtio/openyurt/pkg/apis/net/v1alpha1"
"github.com/openyurtio/openyurt/pkg/apis/network/v1alpha1"
)

// Default satisfies the defaulting webhook interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/openyurtio/openyurt/pkg/apis/net/v1alpha1"
"github.com/openyurtio/openyurt/pkg/apis/network/v1alpha1"
"github.com/openyurtio/openyurt/pkg/yurtmanager/webhook/util"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 The OpenYurt Authors.
Copyright 2024 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"

"github.com/openyurtio/openyurt/pkg/apis/net/v1alpha1"
"github.com/openyurtio/openyurt/pkg/apis/network/v1alpha1"
)

// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
Expand Down

0 comments on commit dfd8a16

Please sign in to comment.