-
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.
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>
- Loading branch information
1 parent
c3cf90b
commit 8e2052f
Showing
37 changed files
with
15,733 additions
and
5 deletions.
There are no files selected for viewing
8,491 changes: 8,491 additions & 0 deletions
8,491
charts/yurt-manager/crds/device.openyurt.io_iot.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
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/iot/config" | ||
) | ||
|
||
type IoTControllerOptions struct { | ||
*config.IoTControllerConfiguration | ||
} | ||
|
||
func NewIoTControllerOptions() *IoTControllerOptions { | ||
return &IoTControllerOptions{ | ||
config.NewIoTControllerConfiguration(), | ||
} | ||
} | ||
|
||
// AddFlags adds flags related to nodepool for yurt-manager to the specified FlagSet. | ||
func (n *IoTControllerOptions) AddFlags(fs *pflag.FlagSet) { | ||
if n == nil { | ||
return | ||
} | ||
} | ||
|
||
// ApplyTo fills up nodepool config with options. | ||
func (o *IoTControllerOptions) ApplyTo(cfg *config.IoTControllerConfiguration) error { | ||
if o == nil { | ||
return nil | ||
} | ||
*cfg = *o.IoTControllerConfiguration | ||
return nil | ||
} | ||
|
||
// Validate checks validation of IoTControllerOptions. | ||
func (o *IoTControllerOptions) Validate() []error { | ||
if o == nil { | ||
return nil | ||
} | ||
errs := []error{} | ||
if o.IoTControllerConfiguration == 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
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/device/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/device/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 EdgeX configmap. | ||
ConfigmapAvailableCondition IoTConditionType = "ConfigmapAvailable" | ||
|
||
ConfigmapProvisioningReason = "ConfigmapProvisioning" | ||
|
||
ConfigmapProvisioningFailedReason = "ConfigmapProvisioningFailed" | ||
// ServiceAvailableCondition documents the status of the EdgeX service. | ||
ServiceAvailableCondition IoTConditionType = "ServiceAvailable" | ||
|
||
ServiceProvisioningReason = "ServiceProvisioning" | ||
|
||
ServiceProvisioningFailedReason = "ServiceProvisioningFailed" | ||
// DeploymentAvailableCondition documents the status of the EdgeX deployment. | ||
DeploymentAvailableCondition IoTConditionType = "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 | ||
|
||
// SetDefaultsIoT set default values for IoT. | ||
func SetDefaultsIoT(obj *IoT) { | ||
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=device.openyurt.io | ||
package v1alpha1 |
Oops, something went wrong.