Skip to content

Commit 778298f

Browse files
authored
[dubboctl] update charts and operator v2 (#675)
1 parent ac86a9c commit 778298f

36 files changed

Lines changed: 547 additions & 78 deletions

dubboctl/cmd/create.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ import (
3333
type createArgs struct {
3434
// dirname specifies the name of the custom-created directory.
3535
dirname string
36-
// language specifies different SDK languages.
36+
// language specifies different sdk languages.
3737
language string
38+
// template specifies repository or default common.
3839
template string
3940
}
4041

@@ -102,12 +103,16 @@ func sdkGenerateCmd(cmd *cobra.Command, clientFactory ClientFactory) *cobra.Comm
102103

103104
type createConfig struct {
104105
// Path Absolute to function source
105-
Path string
106-
Runtime string
106+
Path string
107+
// Runtime
108+
Runtime string
109+
// Template
107110
Template string
108-
// Repo URI (overrides builtin and installed)
109-
Repo string
110-
DirName string
111+
// Repo Uri (overrides builtin and installed)
112+
Repo string
113+
// DirName Defines a custom creation directory name。
114+
DirName string
115+
// Initialized
111116
Initialized bool
112117
}
113118

dubboctl/cmd/image.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ import (
3535
)
3636

3737
type imageArgs struct {
38+
// dockerfile Defines the required Dockerfile files.
3839
dockerfile bool
39-
builder bool
40-
output string
41-
destroy bool
40+
// builder Defines the path used by the builder.
41+
builder bool
42+
// output Defines the generated dubbo deploy yaml file.
43+
output string
44+
// destroy Defines the deletion of deploy yaml file.
45+
destroy bool
4246
}
4347

4448
func addHubFlags(cmd *cobra.Command, iArgs *imageArgs) {
@@ -48,7 +52,7 @@ func addHubFlags(cmd *cobra.Command, iArgs *imageArgs) {
4852

4953
func addDeployFlags(cmd *cobra.Command, iArgs *imageArgs) {
5054
cmd.PersistentFlags().StringVarP(&iArgs.output, "output", "o", "dubbo-deploy.yaml", "The output generates k8s yaml file")
51-
cmd.PersistentFlags().BoolVarP(&iArgs.destroy, "delete", "d", false, "delete k8s yaml file")
55+
cmd.PersistentFlags().BoolVarP(&iArgs.destroy, "delete", "d", false, "deletion k8s yaml file")
5256
}
5357

5458
func ImageCmd(ctx cli.Context, cmd *cobra.Command, clientFactory ClientFactory) *cobra.Command {
@@ -64,9 +68,12 @@ func ImageCmd(ctx cli.Context, cmd *cobra.Command, clientFactory ClientFactory)
6468
}
6569

6670
type hubConfig struct {
71+
// Dockerfile Defines the required files.
6772
Dockerfile bool
68-
Builder bool
69-
Image string
73+
// Builder Defines the path used by the builder.
74+
Builder bool
75+
// Image information required by image.
76+
Image string
7077
// BuilderImage is the image (name or mapping) to use for building. Usually
7178
// set automatically.
7279
BuilderImage string

dubboctl/cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewClientFactory(options ...sdk.Option) (*sdk.Client, func()) {
4848
var (
4949
t = newTransport(false)
5050
c = newCredentialsProvider(util.Dir(), t)
51-
d = newDubboDeployer()
51+
d = newDeployer()
5252
o = []sdk.Option{
5353
sdk.WithRepositoriesPath(util.RepositoriesPath()),
5454
sdk.WithBuilder(pack.NewBuilder()),
@@ -77,7 +77,7 @@ func newCredentialsProvider(configPath string, t http.RoundTripper) pusher.Crede
7777
return credentials.NewCredentialsProvider(configPath, options...)
7878
}
7979

80-
func newDubboDeployer() sdk.Deployer {
80+
func newDeployer() sdk.Deployer {
8181
var options []deployer.DeployerOption
8282

8383
return deployer.NewDeployer(options...)

dubboctl/pkg/hub/builder/pack/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var (
5252

5353
type Builder struct {
5454
name string
55-
outBuff bytes.Buffer
55+
outBuffer bytes.Buffer
5656
logger logging.Logger
5757
impl Impl
5858
withTimestamp bool
@@ -136,7 +136,7 @@ func (b *Builder) Build(ctx context.Context, dc *dubbo.DubboConfig) (err error)
136136
} else {
137137
err = fmt.Errorf("failed to build the application: %w", err)
138138
fmt.Fprintln(color.Stderr(), "")
139-
_, _ = io.Copy(color.Stderr(), &b.outBuff)
139+
_, _ = io.Copy(color.Stderr(), &b.outBuffer)
140140
fmt.Fprintln(color.Stderr(), "")
141141
}
142142
}

dubboctl/pkg/hub/deployer/deploy.tpl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ spec:
2121
ports:
2222
- containerPort: {{.Port}}
2323
name: dubbo
24-
readinessProbe:
25-
tcpSocket:
26-
port: {{.Port}}
27-
initialDelaySeconds: 5
28-
periodSeconds: 10
29-
livenessProbe:
30-
tcpSocket:
31-
port: {{.Port}}
32-
initialDelaySeconds: 15
33-
periodSeconds: 20
3424
resources:
3525
requests:
3626
cpu: 100m

dubboctl/pkg/hub/pusher/pusher.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,24 @@ type Credentials struct {
5151

5252
type CredentialsProvider func(ctx context.Context, image string) (Credentials, error)
5353

54-
type PusherDockerClientFactory func() (PusherDockerClient, error)
54+
type DockerClientFactory func() (DockerClient, error)
5555

5656
type Pusher struct {
5757
credentialsProvider CredentialsProvider
5858
transport http.RoundTripper
59-
dockerClientFactory PusherDockerClientFactory
59+
dockerClientFactory DockerClientFactory
6060
}
6161

6262
type authConfig struct {
63-
Username string `json:"username,omitempty"`
64-
Password string `json:"password,omitempty"`
65-
Auth string `json:"auth,omitempty"`
66-
Email string `json:"email,omitempty"`
67-
ServerAddress string `json:"serveraddress,omitempty"`
68-
IdentityToken string `json:"identitytoken,omitempty"`
69-
RegistryToken string `json:"registrytoken,omitempty"`
63+
Username string `json:"username,omitempty"`
64+
Password string `json:"password,omitempty"`
7065
}
7166

7267
func NewPusher(opts ...Opt) *Pusher {
7368
result := &Pusher{
7469
credentialsProvider: EmptyCredentialsProvider,
7570
transport: http.DefaultTransport,
76-
dockerClientFactory: func() (PusherDockerClient, error) {
71+
dockerClientFactory: func() (DockerClient, error) {
7772
c, _, err := hub.NewClient(client.DefaultDockerHost)
7873
return c, err
7974
},
@@ -236,7 +231,7 @@ func (n *Pusher) push(ctx context.Context, dc *dubbo.DubboConfig, credentials Cr
236231
return hash.String(), nil
237232
}
238233

239-
type PusherDockerClient interface {
234+
type DockerClient interface {
240235
daemon.Client
241236
ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)
242237
Close() error

manifests/charts/admin/charts/kube-prometheus/Chart.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
annotations:
217
artifacthub.io/license: Apache-2.0
318
artifacthub.io/links: |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
apiVersion: v2
217
name: crds
318
version: 0.0.0

manifests/charts/admin/charts/kube-prometheus/charts/crds/crds/crd-alertmanagerconfigs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
217
---
318
apiVersion: apiextensions.k8s.io/v1

manifests/charts/admin/charts/kube-prometheus/charts/crds/crds/crd-alertmanagers.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.81.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
217
---
318
apiVersion: apiextensions.k8s.io/v1

0 commit comments

Comments
 (0)