From 1c59b1304da6617b14f758ce9518fd8cda0bc82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Ma=C5=88=C3=A1k?= Date: Tue, 8 Mar 2022 13:04:13 +0100 Subject: [PATCH 1/2] Refactor to use common metav1.Condition --- .../azure/actuators/machine/conditions.go | 15 +++---- .../actuators/machine/conditions_test.go | 39 +++++++++---------- .../azure/actuators/machine/reconciler.go | 13 ++++--- 3 files changed, 32 insertions(+), 35 deletions(-) diff --git a/pkg/cloud/azure/actuators/machine/conditions.go b/pkg/cloud/azure/actuators/machine/conditions.go index 1b089670a..c554ee856 100644 --- a/pkg/cloud/azure/actuators/machine/conditions.go +++ b/pkg/cloud/azure/actuators/machine/conditions.go @@ -1,7 +1,6 @@ package machine import ( - machinev1 "github.com/openshift/api/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" ) @@ -13,8 +12,8 @@ const ( ) func shouldUpdateCondition( - oldCondition machinev1.AzureMachineProviderCondition, - newCondition machinev1.AzureMachineProviderCondition, + oldCondition metav1.Condition, + newCondition metav1.Condition, ) bool { if oldCondition.Status != newCondition.Status || oldCondition.Reason != newCondition.Reason || @@ -24,7 +23,7 @@ func shouldUpdateCondition( return false } -// setMachineProviderCondition sets the condition for the machine and +// setCondition sets the condition for the machine and // returns the new slice of conditions. // If the machine does not already have a condition with the specified type, // a condition will be added to the slice. @@ -33,20 +32,19 @@ func shouldUpdateCondition( // 1) Requested Status is different than existing status. // 2) requested Reason is different that existing one. // 3) requested Message is different that existing one. -func setMachineProviderCondition(conditions []machinev1.AzureMachineProviderCondition, newCondition machinev1.AzureMachineProviderCondition) []machinev1.AzureMachineProviderCondition { +func setCondition(conditions []metav1.Condition, newCondition metav1.Condition) []metav1.Condition { now := metav1.Now() currentCondition := findCondition(conditions, newCondition.Type) if currentCondition == nil { klog.V(4).Infof("Adding new provider condition %v", newCondition) conditions = append( conditions, - machinev1.AzureMachineProviderCondition{ + metav1.Condition{ Type: newCondition.Type, Status: newCondition.Status, Reason: newCondition.Reason, Message: newCondition.Message, LastTransitionTime: now, - LastProbeTime: now, }, ) } else { @@ -61,7 +59,6 @@ func setMachineProviderCondition(conditions []machinev1.AzureMachineProviderCond currentCondition.Status = newCondition.Status currentCondition.Reason = newCondition.Reason currentCondition.Message = newCondition.Message - currentCondition.LastProbeTime = now } } return conditions @@ -69,7 +66,7 @@ func setMachineProviderCondition(conditions []machinev1.AzureMachineProviderCond // findCondition finds in the machine the condition that has the // specified condition type. If none exists, then returns nil. -func findCondition(conditions []machinev1.AzureMachineProviderCondition, conditionType machinev1.ConditionType) *machinev1.AzureMachineProviderCondition { +func findCondition(conditions []metav1.Condition, conditionType string) *metav1.Condition { for i, condition := range conditions { if condition.Type == conditionType { return &conditions[i] diff --git a/pkg/cloud/azure/actuators/machine/conditions_test.go b/pkg/cloud/azure/actuators/machine/conditions_test.go index d932ec972..5f4edc9f4 100644 --- a/pkg/cloud/azure/actuators/machine/conditions_test.go +++ b/pkg/cloud/azure/actuators/machine/conditions_test.go @@ -3,65 +3,64 @@ package machine import ( "testing" - machinev1 "github.com/openshift/api/machine/v1beta1" - corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestShouldUpdateCondition(t *testing.T) { testCases := []struct { - oldCondition machinev1.AzureMachineProviderCondition - newCondition machinev1.AzureMachineProviderCondition + oldCondition metav1.Condition + newCondition metav1.Condition expected bool }{ { - oldCondition: machinev1.AzureMachineProviderCondition{ + oldCondition: metav1.Condition{ Reason: "foo", Message: "bar", - Status: corev1.ConditionTrue, + Status: metav1.ConditionTrue, }, - newCondition: machinev1.AzureMachineProviderCondition{ + newCondition: metav1.Condition{ Reason: "foo", Message: "bar", - Status: corev1.ConditionTrue, + Status: metav1.ConditionTrue, }, expected: false, }, { - oldCondition: machinev1.AzureMachineProviderCondition{ + oldCondition: metav1.Condition{ Reason: "foo", Message: "bar", - Status: corev1.ConditionTrue, + Status: metav1.ConditionTrue, }, - newCondition: machinev1.AzureMachineProviderCondition{ + newCondition: metav1.Condition{ Reason: "different reason", Message: "bar", - Status: corev1.ConditionTrue, + Status: metav1.ConditionTrue, }, expected: true, }, { - oldCondition: machinev1.AzureMachineProviderCondition{ + oldCondition: metav1.Condition{ Reason: "foo", Message: "different message", - Status: corev1.ConditionTrue, + Status: metav1.ConditionTrue, }, - newCondition: machinev1.AzureMachineProviderCondition{ + newCondition: metav1.Condition{ Reason: "foo", Message: "bar", - Status: corev1.ConditionTrue, + Status: metav1.ConditionTrue, }, expected: true, }, { - oldCondition: machinev1.AzureMachineProviderCondition{ + oldCondition: metav1.Condition{ Reason: "foo", Message: "bar", - Status: corev1.ConditionTrue, + Status: metav1.ConditionTrue, }, - newCondition: machinev1.AzureMachineProviderCondition{ + newCondition: metav1.Condition{ Reason: "foo", Message: "bar", - Status: corev1.ConditionFalse, + Status: metav1.ConditionFalse, }, expected: true, }, diff --git a/pkg/cloud/azure/actuators/machine/reconciler.go b/pkg/cloud/azure/actuators/machine/reconciler.go index 12cea319e..a0f8741dd 100644 --- a/pkg/cloud/azure/actuators/machine/reconciler.go +++ b/pkg/cloud/azure/actuators/machine/reconciler.go @@ -42,6 +42,7 @@ import ( "github.com/openshift/machine-api-provider-azure/pkg/cloud/azure/services/virtualmachineextensions" "github.com/openshift/machine-api-provider-azure/pkg/cloud/azure/services/virtualmachines" apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client" @@ -95,9 +96,9 @@ func NewReconciler(scope *actuators.MachineScope) *Reconciler { // Create creates machine if and only if machine exists, handled by cluster-api func (s *Reconciler) Create(ctx context.Context) error { if err := s.CreateMachine(ctx); err != nil { - s.scope.MachineStatus.Conditions = setMachineProviderCondition(s.scope.MachineStatus.Conditions, machinev1.AzureMachineProviderCondition{ - Type: machinev1.MachineCreated, - Status: apicorev1.ConditionTrue, + s.scope.MachineStatus.Conditions = setCondition(s.scope.MachineStatus.Conditions, metav1.Condition{ + Type: string(machinev1.MachineCreated), + Status: metav1.ConditionTrue, Reason: machineCreationFailedReason, Message: err.Error(), }) @@ -265,9 +266,9 @@ func (s *Reconciler) Update(ctx context.Context) error { } // Set instance conditions - s.scope.MachineStatus.Conditions = setMachineProviderCondition(s.scope.MachineStatus.Conditions, machinev1.AzureMachineProviderCondition{ - Type: machinev1.MachineCreated, - Status: apicorev1.ConditionTrue, + s.scope.MachineStatus.Conditions = setCondition(s.scope.MachineStatus.Conditions, metav1.Condition{ + Type: string(machinev1.MachineCreated), + Status: metav1.ConditionTrue, Reason: machineCreationSucceedReason, Message: machineCreationSucceedMessage, }) From 4d1d7109aea23fc9459b4edece42e67a353d12ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Ma=C5=88=C3=A1k?= Date: Tue, 29 Mar 2022 10:31:26 +0200 Subject: [PATCH 2/2] Update vendor to include Condition changes --- go.mod | 2 +- go.sum | 4 +- ...ersion-operator_01_clusterversion.crd.yaml | 3 + ...03_config-operator_01_operatorhub.crd.yaml | 1 + ...000_10_config-operator_01_ingress.crd.yaml | 8 +- .../api/config/v1/types_cluster_version.go | 9 ++- .../openshift/api/config/v1/types_ingress.go | 15 +++- .../api/machine/v1beta1/types_awsprovider.go | 22 +---- .../machine/v1beta1/types_azureprovider.go | 22 +---- .../api/machine/v1beta1/types_gcpprovider.go | 22 +---- .../machine/v1beta1/types_vsphereprovider.go | 22 +---- .../machine/v1beta1/zz_generated.deepcopy.go | 80 +------------------ .../zz_generated.swagger_doc_generated.go | 56 ------------- vendor/modules.txt | 2 +- 14 files changed, 42 insertions(+), 226 deletions(-) diff --git a/go.mod b/go.mod index 06b909170..1037afcbf 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/mitchellh/mapstructure v1.4.2 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.17.0 - github.com/openshift/api v0.0.0-20220324135351-3d6a78ae0721 + github.com/openshift/api v0.0.0-20220325173635-8107b7a38e53 github.com/openshift/machine-api-operator v0.2.1-0.20220327131531-58ba8507d869 github.com/spf13/cobra v1.2.1 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 diff --git a/go.sum b/go.sum index 2f7b82115..335e7d888 100644 --- a/go.sum +++ b/go.sum @@ -570,8 +570,8 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/openshift/api v0.0.0-20211209135129-c58d9f695577/go.mod h1:DoslCwtqUpr3d/gsbq4ZlkaMEdYqKxuypsDjorcHhME= github.com/openshift/api v0.0.0-20220322000322-9c4998a4d646/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= -github.com/openshift/api v0.0.0-20220324135351-3d6a78ae0721 h1:2kDNqCgKxnv/KuvUoDlc9sC0TODOtSOxPvuxvKKkVaM= -github.com/openshift/api v0.0.0-20220324135351-3d6a78ae0721/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= +github.com/openshift/api v0.0.0-20220325173635-8107b7a38e53 h1:WpOfczPbuY5llRH94DJRsGTsgm7d8iAA2b7m0+YXAqI= +github.com/openshift/api v0.0.0-20220325173635-8107b7a38e53/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= github.com/openshift/build-machinery-go v0.0.0-20210712174854-1bb7fd1518d3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/client-go v0.0.0-20211209144617-7385dd6338e3 h1:SG1aqwleU6bGD0X4mhkTNupjVnByMYYuW4XbnCPavQU= diff --git a/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml index ceb8b7e6d..24f379c13 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml @@ -65,6 +65,7 @@ spec: enum: - openshift-samples - baremetal + - marketplace x-kubernetes-list-type: atomic baselineCapabilitySet: description: baselineCapabilitySet selects an initial set of optional capabilities to enable, which can be extended via additionalEnabledCapabilities. If unset, the cluster will choose a default, and the default may change over time. The current default is vCurrent. @@ -167,6 +168,7 @@ spec: enum: - openshift-samples - baremetal + - marketplace x-kubernetes-list-type: atomic knownCapabilities: description: knownCapabilities lists all the capabilities known to the current cluster. @@ -177,6 +179,7 @@ spec: enum: - openshift-samples - baremetal + - marketplace x-kubernetes-list-type: atomic conditionalUpdates: description: conditionalUpdates contains the list of updates that may be recommended for this cluster if it meets specific required conditions. Consumers interested in the set of updates that are actually recommended for this cluster should use availableUpdates. This list may be empty if no updates are recommended, if the update service is unavailable, or if an empty or invalid channel has been specified. diff --git a/vendor/github.com/openshift/api/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml index 4ba6c01cf..e9895002f 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml @@ -6,6 +6,7 @@ metadata: include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" include.release.openshift.io/single-node-developer: "true" + capability.openshift.io/name: "marketplace" name: operatorhubs.config.openshift.io spec: group: config.openshift.io diff --git a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml index 95fe8dfd9..e1ecba1cb 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml @@ -53,7 +53,7 @@ spec: hostname: description: hostname is the hostname that should be used by the route. type: string - format: hostname + pattern: ^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$|^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$ name: description: "name is the logical name of the route to customize. \n The namespace and name of this componentRoute must match a corresponding entry in the list of status.componentRoutes if the route is to be customized." type: string @@ -226,13 +226,13 @@ spec: type: array minItems: 1 items: - description: Hostname is an alias for hostname string validation. + description: "Hostname is an alias for hostname string validation. \n The left operand of the | is the original kubebuilder hostname validation format, which is incorrect because it allows upper case letters, disallows hyphen or number in the TLD, and allows labels to start/end in non-alphanumeric characters. See https://bugzilla.redhat.com/show_bug.cgi?id=2039256. ^([a-zA-Z0-9\\p{S}\\p{L}]((-?[a-zA-Z0-9\\p{S}\\p{L}]{0,62})?)|([a-zA-Z0-9\\p{S}\\p{L}](([a-zA-Z0-9-\\p{S}\\p{L}]{0,61}[a-zA-Z0-9\\p{S}\\p{L}])?)(\\.)){1,}([a-zA-Z\\p{L}]){2,63})$ \n The right operand of the | is a new pattern that mimics the current API route admission validation on hostname, except that it allows hostnames longer than the maximum length: ^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$ \n Both operand patterns are made available so that modifications on ingress spec can still happen after an invalid hostname was saved via validation by the incorrect left operand of the | operator." type: string - format: hostname + pattern: ^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$|^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$ defaultHostname: description: defaultHostname is the hostname of this route prior to customization. type: string - format: hostname + pattern: ^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$|^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$ name: description: "name is the logical name of the route to customize. It does not have to be the actual name of a route resource but it cannot be renamed. \n The namespace and name of this componentRoute must match a corresponding entry in the list of spec.componentRoutes if the route is to be customized." type: string diff --git a/vendor/github.com/openshift/api/config/v1/types_cluster_version.go b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go index cd907699f..52248a68e 100644 --- a/vendor/github.com/openshift/api/config/v1/types_cluster_version.go +++ b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go @@ -225,7 +225,7 @@ type UpdateHistory struct { type ClusterID string // ClusterVersionCapability enumerates optional, core cluster components. -// +kubebuilder:validation:Enum=openshift-samples;baremetal +// +kubebuilder:validation:Enum=openshift-samples;baremetal;marketplace type ClusterVersionCapability string const ( @@ -240,6 +240,11 @@ const ( // baremetal operator which is responsible for running the metal3 // deployment. ClusterVersionCapabilityBaremetal ClusterVersionCapability = "baremetal" + + // ClusterVersionCapabilityMarketplace manages the Marketplace operator which + // supplies Operator Lifecycle Manager (OLM) users with default catalogs of + // "optional" operators. + ClusterVersionCapabilityMarketplace ClusterVersionCapability = "marketplace" ) // ClusterVersionCapabilitySet defines sets of cluster version capabilities. @@ -269,10 +274,12 @@ var ClusterVersionCapabilitySets = map[ClusterVersionCapabilitySet][]ClusterVers ClusterVersionCapabilitySet4_11: { ClusterVersionCapabilityOpenShiftSamples, ClusterVersionCapabilityBaremetal, + ClusterVersionCapabilityMarketplace, }, ClusterVersionCapabilitySetCurrent: { ClusterVersionCapabilityOpenShiftSamples, ClusterVersionCapabilityBaremetal, + ClusterVersionCapabilityMarketplace, }, } diff --git a/vendor/github.com/openshift/api/config/v1/types_ingress.go b/vendor/github.com/openshift/api/config/v1/types_ingress.go index 2c6bed3cb..9ca88efd7 100644 --- a/vendor/github.com/openshift/api/config/v1/types_ingress.go +++ b/vendor/github.com/openshift/api/config/v1/types_ingress.go @@ -91,7 +91,20 @@ type IngressSpec struct { type ConsumingUser string // Hostname is an alias for hostname string validation. -// +kubebuilder:validation:Format=hostname +// +// The left operand of the | is the original kubebuilder hostname validation format, which is incorrect because it +// allows upper case letters, disallows hyphen or number in the TLD, and allows labels to start/end in non-alphanumeric +// characters. See https://bugzilla.redhat.com/show_bug.cgi?id=2039256. +// ^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$ +// +// The right operand of the | is a new pattern that mimics the current API route admission validation on hostname, +// except that it allows hostnames longer than the maximum length: +// ^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$ +// +// Both operand patterns are made available so that modifications on ingress spec can still happen after an invalid hostname +// was saved via validation by the incorrect left operand of the | operator. +// +// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$|^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$` type Hostname string type IngressStatus struct { diff --git a/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go b/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go index 7d789f698..75c81f37f 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go +++ b/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go @@ -296,25 +296,5 @@ type AWSMachineProviderStatus struct { // Conditions is a set of conditions associated with the Machine to indicate // errors or other status // +optional - Conditions []AWSMachineProviderCondition `json:"conditions,omitempty"` -} - -// AWSMachineProviderCondition is a condition in a AWSMachineProviderStatus. -type AWSMachineProviderCondition struct { - // Type is the type of the condition. - Type ConditionType `json:"type"` - // Status is the status of the condition. - Status corev1.ConditionStatus `json:"status"` - // LastProbeTime is the last time we probed the condition. - // +optional - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - // LastTransitionTime is the last time the condition transitioned from one status to another. - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - // Reason is a unique, one-word, CamelCase reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty"` - // Message is a human-readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` } diff --git a/vendor/github.com/openshift/api/machine/v1beta1/types_azureprovider.go b/vendor/github.com/openshift/api/machine/v1beta1/types_azureprovider.go index 1cb013564..914e73478 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/types_azureprovider.go +++ b/vendor/github.com/openshift/api/machine/v1beta1/types_azureprovider.go @@ -143,7 +143,7 @@ type AzureMachineProviderStatus struct { // Conditions is a set of conditions associated with the Machine to indicate // errors or other status. // +optional - Conditions []AzureMachineProviderCondition `json:"conditions,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` } // VMState describes the state of an Azure virtual machine. @@ -382,26 +382,6 @@ type SecurityProfile struct { EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` } -// AzureMachineProviderCondition is a condition in a AzureMachineProviderStatus -type AzureMachineProviderCondition struct { - // Type is the type of the condition. - Type ConditionType `json:"type"` - // Status is the status of the condition. - Status corev1.ConditionStatus `json:"status"` - // LastProbeTime is the last time we probed the condition. - // +optional - LastProbeTime metav1.Time `json:"lastProbeTime"` - // LastTransitionTime is the last time the condition transitioned from one status to another. - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime"` - // Reason is a unique, one-word, CamelCase reason for the condition's last transition. - // +optional - Reason string `json:"reason"` - // Message is a human-readable message indicating details about last transition. - // +optional - Message string `json:"message"` -} - // AzureUltraSSDCapabilityState defines the different states of an UltraSSDCapability type AzureUltraSSDCapabilityState string diff --git a/vendor/github.com/openshift/api/machine/v1beta1/types_gcpprovider.go b/vendor/github.com/openshift/api/machine/v1beta1/types_gcpprovider.go index 4970bd7e2..6daac65eb 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/types_gcpprovider.go +++ b/vendor/github.com/openshift/api/machine/v1beta1/types_gcpprovider.go @@ -199,25 +199,5 @@ type GCPMachineProviderStatus struct { // Conditions is a set of conditions associated with the Machine to indicate // errors or other status // +optional - Conditions []GCPMachineProviderCondition `json:"conditions,omitempty"` -} - -// GCPMachineProviderCondition is a condition in a GCPMachineProviderStatus -type GCPMachineProviderCondition struct { - // Type is the type of the condition. - Type ConditionType `json:"type"` - // Status is the status of the condition. - Status corev1.ConditionStatus `json:"status"` - // LastProbeTime is the last time we probed the condition. - // +optional - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - // LastTransitionTime is the last time the condition transitioned from one status to another. - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - // Reason is a unique, one-word, CamelCase reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty"` - // Message is a human-readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` } diff --git a/vendor/github.com/openshift/api/machine/v1beta1/types_vsphereprovider.go b/vendor/github.com/openshift/api/machine/v1beta1/types_vsphereprovider.go index 9d28632f8..2cf75675d 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/types_vsphereprovider.go +++ b/vendor/github.com/openshift/api/machine/v1beta1/types_vsphereprovider.go @@ -114,26 +114,6 @@ type Workspace struct { ResourcePool string `gcfg:"resourcepool-path,omitempty" json:"resourcePool,omitempty"` } -// VSphereMachineProviderCondition is a condition in a VSphereMachineProviderStatus. -type VSphereMachineProviderCondition struct { - // Type is the type of the condition. - Type ConditionType `json:"type"` - // Status is the status of the condition. - Status corev1.ConditionStatus `json:"status"` - // LastProbeTime is the last time we probed the condition. - // +optional - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - // LastTransitionTime is the last time the condition transitioned from one status to another. - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - // Reason is a unique, one-word, CamelCase reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty"` - // Message is a human-readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty"` -} - // VSphereMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field. // It contains VSphere-specific status information. // Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer). @@ -149,7 +129,7 @@ type VSphereMachineProviderStatus struct { InstanceState *string `json:"instanceState,omitempty"` // Conditions is a set of conditions associated with the Machine to indicate // errors or other status - Conditions []VSphereMachineProviderCondition `json:"conditions,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` // TaskRef is a managed object reference to a Task related to the machine. // This value is set automatically at runtime and should not be set or // modified by users. diff --git a/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go index fdabf1112..f9f13cebb 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go @@ -12,24 +12,6 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachineProviderCondition) DeepCopyInto(out *AWSMachineProviderCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineProviderCondition. -func (in *AWSMachineProviderCondition) DeepCopy() *AWSMachineProviderCondition { - if in == nil { - return nil - } - out := new(AWSMachineProviderCondition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSMachineProviderConfig) DeepCopyInto(out *AWSMachineProviderConfig) { *out = *in @@ -154,7 +136,7 @@ func (in *AWSMachineProviderStatus) DeepCopyInto(out *AWSMachineProviderStatus) } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]AWSMachineProviderCondition, len(*in)) + *out = make([]metav1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -205,24 +187,6 @@ func (in *AWSResourceReference) DeepCopy() *AWSResourceReference { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineProviderCondition) DeepCopyInto(out *AzureMachineProviderCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineProviderCondition. -func (in *AzureMachineProviderCondition) DeepCopy() *AzureMachineProviderCondition { - if in == nil { - return nil - } - out := new(AzureMachineProviderCondition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureMachineProviderSpec) DeepCopyInto(out *AzureMachineProviderSpec) { *out = *in @@ -317,7 +281,7 @@ func (in *AzureMachineProviderStatus) DeepCopyInto(out *AzureMachineProviderStat } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]AzureMachineProviderCondition, len(*in)) + *out = make([]metav1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -624,24 +588,6 @@ func (in *GCPKMSKeyReference) DeepCopy() *GCPKMSKeyReference { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPMachineProviderCondition) DeepCopyInto(out *GCPMachineProviderCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineProviderCondition. -func (in *GCPMachineProviderCondition) DeepCopy() *GCPMachineProviderCondition { - if in == nil { - return nil - } - out := new(GCPMachineProviderCondition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GCPMachineProviderSpec) DeepCopyInto(out *GCPMachineProviderSpec) { *out = *in @@ -757,7 +703,7 @@ func (in *GCPMachineProviderStatus) DeepCopyInto(out *GCPMachineProviderStatus) } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]GCPMachineProviderCondition, len(*in)) + *out = make([]metav1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -1618,24 +1564,6 @@ func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VSphereMachineProviderCondition) DeepCopyInto(out *VSphereMachineProviderCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VSphereMachineProviderCondition. -func (in *VSphereMachineProviderCondition) DeepCopy() *VSphereMachineProviderCondition { - if in == nil { - return nil - } - out := new(VSphereMachineProviderCondition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VSphereMachineProviderSpec) DeepCopyInto(out *VSphereMachineProviderSpec) { *out = *in @@ -1694,7 +1622,7 @@ func (in *VSphereMachineProviderStatus) DeepCopyInto(out *VSphereMachineProvider } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]VSphereMachineProviderCondition, len(*in)) + *out = make([]metav1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go index 81695cb5f..5016a6999 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go @@ -11,20 +11,6 @@ package v1beta1 // Those methods can be generated by using hack/update-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE -var map_AWSMachineProviderCondition = map[string]string{ - "": "AWSMachineProviderCondition is a condition in a AWSMachineProviderStatus.", - "type": "Type is the type of the condition.", - "status": "Status is the status of the condition.", - "lastProbeTime": "LastProbeTime is the last time we probed the condition.", - "lastTransitionTime": "LastTransitionTime is the last time the condition transitioned from one status to another.", - "reason": "Reason is a unique, one-word, CamelCase reason for the condition's last transition.", - "message": "Message is a human-readable message indicating details about last transition.", -} - -func (AWSMachineProviderCondition) SwaggerDoc() map[string]string { - return map_AWSMachineProviderCondition -} - var map_AWSMachineProviderConfig = map[string]string{ "": "AWSMachineProviderConfig is the Schema for the awsmachineproviderconfigs API Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).", "ami": "AMI is the reference to the AMI from which to create the machine instance.", @@ -164,20 +150,6 @@ func (TagSpecification) SwaggerDoc() map[string]string { return map_TagSpecification } -var map_AzureMachineProviderCondition = map[string]string{ - "": "AzureMachineProviderCondition is a condition in a AzureMachineProviderStatus", - "type": "Type is the type of the condition.", - "status": "Status is the status of the condition.", - "lastProbeTime": "LastProbeTime is the last time we probed the condition.", - "lastTransitionTime": "LastTransitionTime is the last time the condition transitioned from one status to another.", - "reason": "Reason is a unique, one-word, CamelCase reason for the condition's last transition.", - "message": "Message is a human-readable message indicating details about last transition.", -} - -func (AzureMachineProviderCondition) SwaggerDoc() map[string]string { - return map_AzureMachineProviderCondition -} - var map_AzureMachineProviderSpec = map[string]string{ "": "AzureMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field for an Azure virtual machine. It is used by the Azure machine actuator to create a single Machine. Required parameters such as location that are not specified by this configuration, will be defaulted by the actuator. Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).", "userDataSecret": "UserDataSecret contains a local reference to a secret that contains the UserData to apply to the instance", @@ -366,20 +338,6 @@ func (GCPKMSKeyReference) SwaggerDoc() map[string]string { return map_GCPKMSKeyReference } -var map_GCPMachineProviderCondition = map[string]string{ - "": "GCPMachineProviderCondition is a condition in a GCPMachineProviderStatus", - "type": "Type is the type of the condition.", - "status": "Status is the status of the condition.", - "lastProbeTime": "LastProbeTime is the last time we probed the condition.", - "lastTransitionTime": "LastTransitionTime is the last time the condition transitioned from one status to another.", - "reason": "Reason is a unique, one-word, CamelCase reason for the condition's last transition.", - "message": "Message is a human-readable message indicating details about last transition.", -} - -func (GCPMachineProviderCondition) SwaggerDoc() map[string]string { - return map_GCPMachineProviderCondition -} - var map_GCPMachineProviderSpec = map[string]string{ "": "GCPMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field for an GCP virtual machine. It is used by the GCP machine actuator to create a single Machine. Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).", "userDataSecret": "UserDataSecret contains a local reference to a secret that contains the UserData to apply to the instance", @@ -688,20 +646,6 @@ func (NetworkSpec) SwaggerDoc() map[string]string { return map_NetworkSpec } -var map_VSphereMachineProviderCondition = map[string]string{ - "": "VSphereMachineProviderCondition is a condition in a VSphereMachineProviderStatus.", - "type": "Type is the type of the condition.", - "status": "Status is the status of the condition.", - "lastProbeTime": "LastProbeTime is the last time we probed the condition.", - "lastTransitionTime": "LastTransitionTime is the last time the condition transitioned from one status to another.", - "reason": "Reason is a unique, one-word, CamelCase reason for the condition's last transition.", - "message": "Message is a human-readable message indicating details about last transition.", -} - -func (VSphereMachineProviderCondition) SwaggerDoc() map[string]string { - return map_VSphereMachineProviderCondition -} - var map_VSphereMachineProviderSpec = map[string]string{ "": "VSphereMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field for an VSphere virtual machine. It is used by the vSphere machine actuator to create a single Machine. Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).", "userDataSecret": "UserDataSecret contains a local reference to a secret that contains the UserData to apply to the instance", diff --git a/vendor/modules.txt b/vendor/modules.txt index 43ba147fb..6911e8407 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -239,7 +239,7 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/openshift/api v0.0.0-20220324135351-3d6a78ae0721 +# github.com/openshift/api v0.0.0-20220325173635-8107b7a38e53 ## explicit; go 1.16 github.com/openshift/api/config/v1 github.com/openshift/api/machine/v1beta1