Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions api/v1alpha1/controller_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ limitations under the License.

package v1alpha1

import (
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +kubebuilder:validation:Enum:=managed;unmanaged
type ManagementPolicy string

Expand Down Expand Up @@ -53,6 +59,14 @@ type ManagedOptions struct {
// +kubebuilder:default:=delete
// +optional
OnDelete OnDelete `json:"onDelete,omitempty"`

// resyncPeriod specifies the interval after which a successfully
// reconciled resource will be reconciled again to detect drift from the
// desired state. Set to 0 to disable periodic resync. If not specified,
// the default is 10 hours.
// +kubebuilder:default:="10h"
// +optional
ResyncPeriod *metav1.Duration `json:"resyncPeriod,omitempty"` //nolint:kubeapilinter
}

// GetOnDelete returns the delete behaviour from ManagedOptions. If called on a
Expand All @@ -63,3 +77,15 @@ func (o *ManagedOptions) GetOnDelete() OnDelete {
}
return o.OnDelete
}

// DefaultResyncPeriod is the default interval for periodic resync to detect drift (10 hours).
const DefaultResyncPeriod = 10 * time.Hour

// GetResyncPeriod returns the resync period from ManagedOptions. If called on a
// nil receiver or if ResyncPeriod is not set, it returns the default of 10 hours.
func (o *ManagedOptions) GetResyncPeriod() time.Duration {
if o == nil || o.ResyncPeriod == nil {
return DefaultResyncPeriod
}
return o.ResyncPeriod.Duration
}
41 changes: 23 additions & 18 deletions api/v1alpha1/zz_generated.deepcopy.go

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

8 changes: 8 additions & 0 deletions cmd/models-schema/zz_generated.openapi.go

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

8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_domains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_flavors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_floatingips.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_keypairs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_ports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/openstack.k-orc.cloud_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ spec:
- delete
- detach
type: string
resyncPeriod:
default: 10h
description: |-
resyncPeriod specifies the interval after which a successfully
reconciled resource will be reconciled again to detect drift from the
desired state. Set to 0 to disable periodic resync. If not specified,
the default is 10 hours.
type: string
type: object
managementPolicy:
default: managed
Expand Down
Loading