Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
operator: mark time stamps as nullable
Browse files Browse the repository at this point in the history
This seems to fix the problem that garbage collecting a CR during E2E
testing fails with this error in kube-controller-manager:

E1217 09:15:55.314521       1 garbagecollector.go:309] error syncing item &garbagecollector.node{identity:garbagecollector.objectReference{OwnerReference:v1.OwnerReference{APIVersion:"pmem-csi.intel.com/v1beta1", Kind:"Deployment", Name:"alpha-default-values", UID:"35cbcde1-bf31-40f0-8a2d-abf8bfd69474", Controller:(*bool)(nil), BlockOwnerDeletion:(*bool)(nil)}, Namespace:""}, dependentsLock:sync.RWMutex{w:sync.Mutex{state:0, sema:0x0}, writerSem:0x0, readerSem:0x0, readerCount:1, readerWait:0}, dependents:map[*garbagecollector.node]struct {}{}, deletingDependents:true, deletingDependentsLock:sync.RWMutex{w:sync.Mutex{state:0, sema:0x0}, writerSem:0x0, readerSem:0x0, readerCount:0, readerWait:0}, beingDeleted:true, beingDeletedLock:sync.RWMutex{w:sync.Mutex{state:0, sema:0x0}, writerSem:0x0, readerSem:0x0, readerCount:0, readerWait:0}, virtual:false, virtualLock:sync.RWMutex{w:sync.Mutex{state:0, sema:0x0}, writerSem:0x0, readerSem:0x0, readerCount:0, readerWait:0}, owners:[]v1.OwnerReference(nil)}: Deployment.pmem-csi.intel.com "alpha-default-values" is invalid: status.lastUpdated: Invalid value: "null": status.lastUpdated in body must be of type string: "null"

The e2e.test error was:

/mnt/workspace/pmem-csi_PR-825/test/e2e/operator/deployment_api.go:913
Dec 16 18:44:57.138: Timed out after 180.000s.
delete deployment "alpha-default-values"
Expected
<bool>: false
to be true
/mnt/workspace/pmem-csi_PR-825/test/e2e/deploy/operator.go:162
  • Loading branch information
pohly committed Dec 17, 2020
1 parent 2a9c10f commit 95e00fc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions deploy/crd/pmem-csi.intel.com_deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ spec:
lastUpdateTime:
description: Last time the condition was probed.
format: date-time
nullable: true
type: string
reason:
description: Message human readable text that explain why this
Expand All @@ -217,6 +218,7 @@ spec:
lastUpdated:
description: LastUpdated time of the driver status
format: date-time
nullable: true
type: string
reason:
description: Reason represents the human readable text that
Expand All @@ -237,6 +239,7 @@ spec:
lastUpdated:
description: LastUpdated time of the deployment status
format: date-time
nullable: true
type: string
phase:
description: Phase indicates the state of the deployment
Expand Down Expand Up @@ -478,6 +481,7 @@ spec:
lastUpdateTime:
description: Last time the condition was probed.
format: date-time
nullable: true
type: string
reason:
description: Message human readable text that explain why this
Expand All @@ -504,6 +508,7 @@ spec:
lastUpdated:
description: LastUpdated time of the driver status
format: date-time
nullable: true
type: string
reason:
description: Reason represents the human readable text that
Expand All @@ -524,6 +529,7 @@ spec:
lastUpdated:
description: LastUpdated time of the deployment status
format: date-time
nullable: true
type: string
phase:
description: Phase indicates the state of the deployment
Expand Down
6 changes: 6 additions & 0 deletions deploy/crd/pmem-csi.intel.com_deployments_webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ spec:
lastUpdateTime:
description: Last time the condition was probed.
format: date-time
nullable: true
type: string
reason:
description: Message human readable text that explain why this condition is in this state
Expand All @@ -198,6 +199,7 @@ spec:
lastUpdated:
description: LastUpdated time of the driver status
format: date-time
nullable: true
type: string
reason:
description: Reason represents the human readable text that explains why the driver is in this state.
Expand All @@ -214,6 +216,7 @@ spec:
lastUpdated:
description: LastUpdated time of the deployment status
format: date-time
nullable: true
type: string
phase:
description: Phase indicates the state of the deployment
Expand Down Expand Up @@ -416,6 +419,7 @@ spec:
lastUpdateTime:
description: Last time the condition was probed.
format: date-time
nullable: true
type: string
reason:
description: Message human readable text that explain why this condition is in this state
Expand All @@ -440,6 +444,7 @@ spec:
lastUpdated:
description: LastUpdated time of the driver status
format: date-time
nullable: true
type: string
reason:
description: Reason represents the human readable text that explains why the driver is in this state.
Expand All @@ -456,6 +461,7 @@ spec:
lastUpdated:
description: LastUpdated time of the deployment status
format: date-time
nullable: true
type: string
phase:
description: Phase indicates the state of the deployment
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/pmemcsi/v1alpha1/deployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ type DeploymentCondition struct {
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// Message human readable text that explain why this condition is in this state
// +optional
Reason string `json:"reason,omitempty"`
// Last time the condition was probed.
// +optional
// +nullable
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
}

Expand Down Expand Up @@ -158,6 +157,7 @@ type DriverStatus struct {
// driver is in this state.
Reason string `json:"reason"`
// LastUpdated time of the driver status
// +nullable
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
}

Expand All @@ -175,6 +175,7 @@ type DeploymentStatus struct {
Conditions []DeploymentCondition `json:"conditions,omitempty"`
Components []DriverStatus `json:"driverComponents,omitempty"`
// LastUpdated time of the deployment status
// +nullable
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/pmemcsi/v1beta1/deployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ type DeploymentCondition struct {
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// Message human readable text that explain why this condition is in this state
// +optional
Reason string `json:"reason,omitempty"`
// Last time the condition was probed.
// +optional
// +nullable
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
}

Expand Down Expand Up @@ -162,6 +161,7 @@ type DriverStatus struct {
// driver is in this state.
Reason string `json:"reason"`
// LastUpdated time of the driver status
// +nullable
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
}

Expand All @@ -179,6 +179,7 @@ type DeploymentStatus struct {
Conditions []DeploymentCondition `json:"conditions,omitempty"`
Components []DriverStatus `json:"driverComponents,omitempty"`
// LastUpdated time of the deployment status
// +nullable
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
}

Expand Down

0 comments on commit 95e00fc

Please sign in to comment.