Skip to content

Commit 5317675

Browse files
committed
Prohibit any operation for Secret resource
1 parent 2957faa commit 5317675

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/kubernetes/resources.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ func (k *Kubernetes) resourcesCreateOrUpdate(ctx context.Context, resources []*u
156156
}
157157

158158
func (k *Kubernetes) resourceFor(gvk *schema.GroupVersionKind) (*schema.GroupVersionResource, error) {
159+
secret := schema.GroupVersionKind{Version: "v1", Kind: "Secret"}
160+
if gvk.String() == secret.String() {
161+
return nil, fmt.Errorf("any operations in Secret resource is not allowed")
162+
}
159163
m, err := k.manager.deferredDiscoveryRESTMapper.RESTMapping(schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version)
160164
if err != nil {
161165
return nil, err

0 commit comments

Comments
 (0)