Skip to content

Commit

Permalink
Remove the sync finalizer
Browse files Browse the repository at this point in the history
Fixes #352. Removes the sync finalizer on objects that have been cached,
and the various bits of logic around keeping track of what objects have
finalizers and removing them on shutdown etc.

Signed-off-by: Jack Kleeman <jackkleeman@gmail.com>
  • Loading branch information
jackkleeman committed Dec 23, 2019
1 parent 2c0610b commit 945e2df
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 459 deletions.
20 changes: 0 additions & 20 deletions api/v1alpha1/config_types.go
Expand Up @@ -17,7 +17,6 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)

// ConfigSpec defines the desired state of Config
Expand Down Expand Up @@ -55,28 +54,9 @@ type SyncOnlyEntry struct {
Version string `json:"version,omitempty"`
Kind string `json:"kind,omitempty"`
}

type ByPod struct {
// a unique identifier for the pod that wrote the status
ID string `json:"id,omitempty"`
// List of Group/Version/Kinds with finalizers
AllFinalizers []GVK `json:"allFinalizers,omitempty"`
}

// ConfigStatus defines the observed state of Config
type ConfigStatus struct {
// Important: Run "make" to regenerate code after modifying this file

// List of statuses as seen by individual pods
ByPod []*ByPod `json:"byPod,omitempty"`
}

func ToAPIGVK(gvk schema.GroupVersionKind) GVK {
return GVK{Group: gvk.Group, Version: gvk.Version, Kind: gvk.Kind}
}

func ToGVK(gvk GVK) schema.GroupVersionKind {
return schema.GroupVersionKind{Group: gvk.Group, Version: gvk.Version, Kind: gvk.Kind}
}

type GVK struct {
Expand Down
33 changes: 1 addition & 32 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 1 addition & 23 deletions config/crd/bases/config.gatekeeper.sh_configs.yaml
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.2
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: configs.config.gatekeeper.sh
spec:
Expand Down Expand Up @@ -82,28 +82,6 @@ spec:
type: object
status:
description: ConfigStatus defines the observed state of Config
properties:
byPod:
description: List of statuses as seen by individual pods
items:
properties:
allFinalizers:
description: List of Group/Version/Kinds with finalizers
items:
properties:
group:
type: string
kind:
type: string
version:
type: string
type: object
type: array
id:
description: a unique identifier for the pod that wrote the status
type: string
type: object
type: array
type: object
type: object
version: v1alpha1
Expand Down
24 changes: 1 addition & 23 deletions deploy/gatekeeper.yaml
Expand Up @@ -9,7 +9,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.2
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: configs.config.gatekeeper.sh
spec:
Expand Down Expand Up @@ -87,28 +87,6 @@ spec:
type: object
status:
description: ConfigStatus defines the observed state of Config
properties:
byPod:
description: List of statuses as seen by individual pods
items:
properties:
allFinalizers:
description: List of Group/Version/Kinds with finalizers
items:
properties:
group:
type: string
kind:
type: string
version:
type: string
type: object
type: array
id:
description: a unique identifier for the pod that wrote the status
type: string
type: object
type: array
type: object
type: object
version: v1alpha1
Expand Down

0 comments on commit 945e2df

Please sign in to comment.