Skip to content

Commit 6557f72

Browse files
committed
Update code logic
1 parent 97eccd4 commit 6557f72

File tree

14 files changed

+20
-88
lines changed

14 files changed

+20
-88
lines changed

.asf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ github:
3434
# only disable force push
3535
# foo: bar
3636
labels:
37+
- grpc
3738
- dubbo
3839
- consul
3940
- dubbo-go-pixiu

dubbod/planet/pkg/bootstrap/server.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ type Server struct {
100100
httpMux *http.ServeMux
101101
httpsMux *http.ServeMux // webhooks
102102

103-
ConfigStores []model.ConfigStoreController
104-
configController model.ConfigStoreController
103+
ConfigStores []model.ConfigStoreController
104+
configController model.ConfigStoreController
105+
105106
multiclusterController *multicluster.Controller
106107

107108
fileWatcher filewatcher.FileWatcher

dubbod/security/pkg/credentialfetcher/fetcher.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323
"github.com/apache/dubbo-kubernetes/pkg/security"
2424
)
2525

26+
// If the credential generator does not have a JWT or is not configured with any secure credentials,
27+
// it will obtain them from the Kubernetes token plugin.
2628
func NewCredFetcher(credtype string) (security.CredFetcher, error) {
2729
switch credtype {
2830
case security.JWT, "":

dubbod/security/pkg/credentialfetcher/plugin/token.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type KubernetesTokenPlugin struct {
3131

3232
func CreateTokenPlugin() *KubernetesTokenPlugin {
3333
return &KubernetesTokenPlugin{
34+
// e.g: /var/run/secrets/kubernetes.io/serviceaccount/token
3435
path: "",
3536
}
3637
}

dubbod/security/pkg/k8s/configutil.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func InsertDataToConfigMap(client kclient.Client[*v1.ConfigMap], meta metav1.Obj
6161
return nil
6262
}
6363

64+
// Plugin new data into the ConfigMap.
65+
// Returns true if the content has changed.
66+
// Returns false if the content is exactly the same.
67+
// Avoids meaningless updates.
6468
func insertData(cm *v1.ConfigMap, data map[string]string) bool {
6569
if cm.Data == nil {
6670
cm.Data = data

dubbod/security/pkg/k8s/controller/casecret.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ type CaSecretController struct {
2222
client corev1.CoreV1Interface
2323
}
2424

25+
// Create a CA certificate secret
26+
// Rotate CAs
27+
// Synchronize CAs to various namespaces
2528
func NewCaSecretController(core corev1.CoreV1Interface) *CaSecretController {
2629
cs := &CaSecretController{
2730
client: core,

dubbod/security/pkg/util/certutil.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,10 @@ func (cu CertUtilImpl) GetWaitTime(certBytes []byte, now time.Time) (time.Durati
4646
return time.Duration(0), fmt.Errorf("certificate already expired at %s, but now is %s",
4747
cert.NotAfter, now)
4848
}
49-
// Note: multiply time.Duration(int64) by an int (gracePeriodPercentage) will cause overflow (e.g.,
50-
// when duration is time.Hour * 90000). So float64 is used instead.
5149
gracePeriod := time.Duration(float64(cert.NotAfter.Sub(cert.NotBefore)) * (float64(cu.gracePeriodPercentage) / 100))
52-
// waitTime is the duration between now and the grace period starts.
53-
// It is the time until cert expiration minus the length of grace period.
50+
5451
waitTime := timeToExpire - gracePeriod
5552
if waitTime < 0 {
56-
// We are within the grace period.
5753
return time.Duration(0), fmt.Errorf("got a certificate that should be renewed now")
5854
}
5955
return waitTime, nil

dubbod/security/pkg/util/jwtutil.go

Lines changed: 0 additions & 30 deletions
This file was deleted.

manifests/charts/dubbo-control/dubbo-discovery/files/gateway.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
serviceAccountName: {{ .ServiceAccount }}
4747
containers:
4848
- name: dubbo-proxy
49-
image: mfordjody/proxyadapter:0.3.1-debug
49+
image: mfordjody/proxyadapter:0.3.2-debug
5050
imagePullPolicy: Always
5151
ports:
5252
- containerPort: 15020

manifests/charts/dubbo-control/dubbo-discovery/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
serviceAccountName: dubbod
2020
containers:
2121
- name: discovery
22-
image: "mfordjody/planet:0.3.1-debug"
22+
image: "mfordjody/planet:0.3.2-debug"
2323
imagePullPolicy: Always
2424
args:
2525
- "discovery"

0 commit comments

Comments
 (0)