Fix 'AntreaInstall is not registered to scheme' issue. OperatorClusterClient is used to perform CRUD operations after upgrading, and OperatorClusterClient uses global scheme(aka scheme.Scheme) to register CRD. But antrea-operator creates a new scheme by scheme := runtime.NewScheme(), which finally causes that CRD is not registered to the scheme used by OperatorClusterClient. To fix this, antrea-operator uses the same scheme as OperatorClusterClient.
Function 'apply.ApplyObject' updates its interface to receive type 'Object', so there is no need to convert 'Object' to 'Unstructured'.
scheme.Scheme
) to register CRD. But antrea-operator creates a new scheme byscheme := runtime.NewScheme()
, which finally causes that CRD is not registered to the scheme used by OperatorClusterClient. To fix this, antrea-operator uses the same scheme as OperatorClusterClient.