-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move iot controller to yurt-manager (#1488)
* add a new crd device/v1alpha1&v1alpha2/iot and controller, webhook Signed-off-by: Rui-Gan <1171530954@qq.com> add a new crd device/v1alpha1&v1alpha2/iot and controller, webhook Signed-off-by: Rui-Gan <1171530954@qq.com> * refactor: rename IoT crd and device group to PlatformAdmin crd and iot group Signed-off-by: LavenderQAQ <1254297317@qq.com> --------- Signed-off-by: Rui-Gan <1171530954@qq.com> Signed-off-by: LavenderQAQ <1254297317@qq.com> Co-authored-by: LavenderQAQ <1254297317@qq.com>
- Loading branch information
1 parent
669e004
commit b2d7d49
Showing
37 changed files
with
15,768 additions
and
1 deletion.
There are no files selected for viewing
8,493 changes: 8,493 additions & 0 deletions
8,493
charts/yurt-manager/crds/iot.openyurt.io_platformadmins.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
Copyright 2023 The OpenYurt Authors. | ||
Licensed under the Apache License, Version 2.0 (the License); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an AS IS BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package options | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/pflag" | ||
|
||
"github.com/openyurtio/openyurt/pkg/controller/platformadmin/config" | ||
) | ||
|
||
type PlatformAdminControllerOptions struct { | ||
*config.PlatformAdminControllerConfiguration | ||
} | ||
|
||
func NewPlatformAdminControllerOptions() *PlatformAdminControllerOptions { | ||
return &PlatformAdminControllerOptions{ | ||
config.NewPlatformAdminControllerConfiguration(), | ||
} | ||
} | ||
|
||
// AddFlags adds flags related to nodepool for yurt-manager to the specified FlagSet. | ||
func (n *PlatformAdminControllerOptions) AddFlags(fs *pflag.FlagSet) { | ||
if n == nil { | ||
return | ||
} | ||
} | ||
|
||
// ApplyTo fills up nodepool config with options. | ||
func (o *PlatformAdminControllerOptions) ApplyTo(cfg *config.PlatformAdminControllerConfiguration) error { | ||
if o == nil { | ||
return nil | ||
} | ||
*cfg = *o.PlatformAdminControllerConfiguration | ||
return nil | ||
} | ||
|
||
// Validate checks validation of IoTControllerOptions. | ||
func (o *PlatformAdminControllerOptions) Validate() []error { | ||
if o == nil { | ||
return nil | ||
} | ||
errs := []error{} | ||
if o.PlatformAdminControllerConfiguration == nil { | ||
errs = append(errs, errors.New("IoTControllerConfiguration can not be empty!")) | ||
} | ||
return errs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright 2023 The OpenYurt Authors. | ||
Licensed under the Apache License, Version 2.0 (the License); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an AS IS BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package apis | ||
|
||
import ( | ||
version "github.com/openyurtio/openyurt/pkg/apis/iot/v1alpha1" | ||
) | ||
|
||
func init() { | ||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back | ||
AddToSchemes = append(AddToSchemes, version.SchemeBuilder.AddToScheme) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright 2023 The OpenYurt Authors. | ||
Licensed under the Apache License, Version 2.0 (the License); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an AS IS BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package apis | ||
|
||
import ( | ||
version "github.com/openyurtio/openyurt/pkg/apis/iot/v1alpha2" | ||
) | ||
|
||
func init() { | ||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back | ||
AddToSchemes = append(AddToSchemes, version.SchemeBuilder.AddToScheme) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Copyright 2023 The OpenYurt Authors. | ||
Licensed under the Apache License, Version 2.0 (the License); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an AS IS BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
const ( | ||
// ConfigmapAvailableCondition documents the status of the PlatformAdmin configmap. | ||
ConfigmapAvailableCondition PlatformAdminConditionType = "ConfigmapAvailable" | ||
|
||
ConfigmapProvisioningReason = "ConfigmapProvisioning" | ||
|
||
ConfigmapProvisioningFailedReason = "ConfigmapProvisioningFailed" | ||
// ServiceAvailableCondition documents the status of the PlatformAdmin service. | ||
ServiceAvailableCondition PlatformAdminConditionType = "ServiceAvailable" | ||
|
||
ServiceProvisioningReason = "ServiceProvisioning" | ||
|
||
ServiceProvisioningFailedReason = "ServiceProvisioningFailed" | ||
// DeploymentAvailableCondition documents the status of the PlatformAdmin deployment. | ||
DeploymentAvailableCondition PlatformAdminConditionType = "DeploymentAvailable" | ||
|
||
DeploymentProvisioningReason = "DeploymentProvisioning" | ||
|
||
DeploymentProvisioningFailedReason = "DeploymentProvisioningFailed" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Copyright 2023 The OpenYurt Authors. | ||
Licensed under the Apache License, Version 2.0 (the License); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an AS IS BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
// SetDefaultsPlatformAdmin set default values for PlatformAdmin. | ||
func SetDefaultsPlatformAdmin(obj *PlatformAdmin) { | ||
if obj.Annotations == nil { | ||
obj.Annotations = make(map[string]string) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
Copyright 2023 The OpenYurt Authors. | ||
Licensed under the Apache License, Version 2.0 (the License); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an AS IS BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
// +groupName=iot.openyurt.io | ||
package v1alpha1 |
Oops, something went wrong.