Skip to content

Commit 7b78a17

Browse files
authored
Add base plugin code for k8s multicluster plugin (#5592)
Signed-off-by: Yoshiki Fujikane <[email protected]>
1 parent 7d9c00c commit 7b78a17

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2025 The PipeCD Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package main
16+
17+
import (
18+
"log"
19+
20+
"github.com/pipe-cd/pipecd/pkg/plugin/sdk"
21+
)
22+
23+
func main() {
24+
sdk.RegisterPipelineSyncPlugin(&plugin{})
25+
26+
if err := sdk.Run(); err != nil {
27+
log.Fatalln(err)
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2025 The PipeCD Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package main
16+
17+
import (
18+
"context"
19+
20+
"github.com/pipe-cd/pipecd/pkg/plugin/sdk"
21+
)
22+
23+
type plugin struct{}
24+
25+
type config struct{}
26+
27+
// Name implements sdk.Plugin.
28+
func (p *plugin) Name() string {
29+
return "kubernetes_multicluster"
30+
}
31+
32+
// Version implements sdk.Plugin.
33+
func (p *plugin) Version() string {
34+
return "0.0.1"
35+
}
36+
37+
// BuildPipelineSyncStages implements sdk.PipelineSyncPlugin.
38+
func (p *plugin) BuildPipelineSyncStages(context.Context, *config, *sdk.BuildPipelineSyncStagesInput) (*sdk.BuildPipelineSyncStagesResponse, error) {
39+
return &sdk.BuildPipelineSyncStagesResponse{}, nil
40+
}
41+
42+
// ExecuteStage implements sdk.PipelineSyncPlugin.
43+
func (p *plugin) ExecuteStage(context.Context, *config, sdk.DeployTargetsNone, *sdk.ExecuteStageInput) (*sdk.ExecuteStageResponse, error) {
44+
return &sdk.ExecuteStageResponse{}, nil
45+
}
46+
47+
// FetchDefinedStages implements sdk.PipelineSyncPlugin.
48+
func (p *plugin) FetchDefinedStages() []string {
49+
return []string{"K8S_SYNC"}
50+
}

0 commit comments

Comments
 (0)