• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubernetes-sigs / kubebuilder / 20694092930

04 Jan 2026 02:06PM UTC coverage: 67.164% (-4.2%) from 71.354%
20694092930

Pull #5352

github

camilamacedo86
Add delete api and delete webhook commands

Add delete functionality to remove APIs and webhooks from projects.
Users can now clean up scaffolded resources with proper validation.
Pull Request #5352: WIP ✨ Add delete api and delete webhook commands

341 of 1049 new or added lines in 18 files covered. (32.51%)

1 existing line in 1 file now uncovered.

6521 of 9709 relevant lines covered (67.16%)

27.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/pkg/plugins/external/plugin.go
1
/*
2
Copyright 2021 The Kubernetes Authors.
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
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
*/
16

17
package external
18

19
import (
20
        "sigs.k8s.io/kubebuilder/v4/pkg/config"
21
        "sigs.k8s.io/kubebuilder/v4/pkg/plugin"
22
)
23

24
var (
25
        _ plugin.Full          = Plugin{}
26
        _ plugin.DeleteAPI     = Plugin{}
27
        _ plugin.DeleteWebhook = Plugin{}
28
)
29

30
// Plugin implements the plugin.Full interface
31
type Plugin struct {
32
        PName                     string
33
        PVersion                  plugin.Version
34
        PSupportedProjectVersions []config.Version
35

36
        Path string
37
        Args []string
38
}
39

40
// Name returns the name of the plugin
41
func (p Plugin) Name() string { return p.PName }
7✔
42

43
// Version returns the version of the plugin
44
func (p Plugin) Version() plugin.Version { return p.PVersion }
2✔
45

46
// SupportedProjectVersions returns an array with all project versions supported by the plugin
47
func (p Plugin) SupportedProjectVersions() []config.Version { return p.PSupportedProjectVersions }
1✔
48

49
// GetInitSubcommand will return the subcommand which is responsible for initializing and common scaffolding
50
func (p Plugin) GetInitSubcommand() plugin.InitSubcommand {
1✔
51
        return &initSubcommand{
1✔
52
                Path: p.Path,
1✔
53
                Args: p.Args,
1✔
54
        }
1✔
55
}
1✔
56

57
// GetCreateAPISubcommand will return the subcommand which is responsible for scaffolding apis
58
func (p Plugin) GetCreateAPISubcommand() plugin.CreateAPISubcommand {
1✔
59
        return &createAPISubcommand{
1✔
60
                Path: p.Path,
1✔
61
                Args: p.Args,
1✔
62
        }
1✔
63
}
1✔
64

65
// GetCreateWebhookSubcommand will return the subcommand which is responsible for scaffolding webhooks
66
func (p Plugin) GetCreateWebhookSubcommand() plugin.CreateWebhookSubcommand {
1✔
67
        return &createWebhookSubcommand{
1✔
68
                Path: p.Path,
1✔
69
                Args: p.Args,
1✔
70
        }
1✔
71
}
1✔
72

73
// GetEditSubcommand will return the subcommand which is responsible for editing the scaffold of the project
74
func (p Plugin) GetEditSubcommand() plugin.EditSubcommand {
1✔
75
        return &editSubcommand{
1✔
76
                Path: p.Path,
1✔
77
                Args: p.Args,
1✔
78
        }
1✔
79
}
1✔
80

81
// GetDeleteAPISubcommand will return the subcommand which is responsible for deleting apis
NEW
82
func (p Plugin) GetDeleteAPISubcommand() plugin.DeleteAPISubcommand {
×
NEW
83
        return &deleteAPISubcommand{
×
NEW
84
                Path: p.Path,
×
NEW
85
                Args: p.Args,
×
NEW
86
        }
×
NEW
87
}
×
88

89
// GetDeleteWebhookSubcommand will return the subcommand which is responsible for deleting webhooks
NEW
90
func (p Plugin) GetDeleteWebhookSubcommand() plugin.DeleteWebhookSubcommand {
×
NEW
91
        return &deleteWebhookSubcommand{
×
NEW
92
                Path: p.Path,
×
NEW
93
                Args: p.Args,
×
NEW
94
        }
×
NEW
95
}
×
96

97
// DeprecationWarning define the deprecation message or return empty when plugin is not deprecated
98
func (p Plugin) DeprecationWarning() string {
1✔
99
        return ""
1✔
100
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc