diff --git a/clients/applyconfiguration/internal/internal.go b/clients/applyconfiguration/internal/internal.go new file mode 100644 index 00000000..b171e759 --- /dev/null +++ b/clients/applyconfiguration/internal/internal.go @@ -0,0 +1,61 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + fmt "fmt" + sync "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/baseresult.go b/clients/applyconfiguration/kubeeye/v1alpha2/baseresult.go new file mode 100644 index 00000000..aad7437f --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/baseresult.go @@ -0,0 +1,60 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// BaseResultApplyConfiguration represents a declarative configuration of the BaseResult type for use +// with apply. +type BaseResultApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Assert *bool `json:"assert,omitempty"` + Level *kubeeyev1alpha2.Level `json:"level,omitempty"` +} + +// BaseResultApplyConfiguration constructs a declarative configuration of the BaseResult type for use with +// apply. +func BaseResult() *BaseResultApplyConfiguration { + return &BaseResultApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BaseResultApplyConfiguration) WithName(value string) *BaseResultApplyConfiguration { + b.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *BaseResultApplyConfiguration) WithAssert(value bool) *BaseResultApplyConfiguration { + b.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *BaseResultApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *BaseResultApplyConfiguration { + b.Level = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/cluster.go b/clients/applyconfiguration/kubeeye/v1alpha2/cluster.go new file mode 100644 index 00000000..19f21307 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/cluster.go @@ -0,0 +1,47 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// ClusterApplyConfiguration represents a declarative configuration of the Cluster type for use +// with apply. +type ClusterApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Provider *string `json:"provider,omitempty"` +} + +// ClusterApplyConfiguration constructs a declarative configuration of the Cluster type for use with +// apply. +func Cluster() *ClusterApplyConfiguration { + return &ClusterApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithName(value string) *ClusterApplyConfiguration { + b.Name = &value + return b +} + +// WithProvider sets the Provider field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Provider field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithProvider(value string) *ClusterApplyConfiguration { + b.Provider = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/clusterinfo.go b/clients/applyconfiguration/kubeeye/v1alpha2/clusterinfo.go new file mode 100644 index 00000000..5e93368b --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/clusterinfo.go @@ -0,0 +1,56 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// ClusterInfoApplyConfiguration represents a declarative configuration of the ClusterInfo type for use +// with apply. +type ClusterInfoApplyConfiguration struct { + ClusterVersion *string `json:"version,omitempty"` + NodesCount *int `json:"nodesCount,omitempty"` + NamespacesCount *int `json:"namespacesCount,omitempty"` +} + +// ClusterInfoApplyConfiguration constructs a declarative configuration of the ClusterInfo type for use with +// apply. +func ClusterInfo() *ClusterInfoApplyConfiguration { + return &ClusterInfoApplyConfiguration{} +} + +// WithClusterVersion sets the ClusterVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterVersion field is set to the value of the last call. +func (b *ClusterInfoApplyConfiguration) WithClusterVersion(value string) *ClusterInfoApplyConfiguration { + b.ClusterVersion = &value + return b +} + +// WithNodesCount sets the NodesCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodesCount field is set to the value of the last call. +func (b *ClusterInfoApplyConfiguration) WithNodesCount(value int) *ClusterInfoApplyConfiguration { + b.NodesCount = &value + return b +} + +// WithNamespacesCount sets the NamespacesCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespacesCount field is set to the value of the last call. +func (b *ClusterInfoApplyConfiguration) WithNamespacesCount(value int) *ClusterInfoApplyConfiguration { + b.NamespacesCount = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/commandresultitem.go b/clients/applyconfiguration/kubeeye/v1alpha2/commandresultitem.go new file mode 100644 index 00000000..349a051a --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/commandresultitem.go @@ -0,0 +1,85 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// CommandResultItemApplyConfiguration represents a declarative configuration of the CommandResultItem type for use +// with apply. +type CommandResultItemApplyConfiguration struct { + BaseResultApplyConfiguration `json:",inline"` + Command *string `json:"command,omitempty"` + Value *string `json:"value,omitempty"` + NodeName *string `json:"nodeName,omitempty"` +} + +// CommandResultItemApplyConfiguration constructs a declarative configuration of the CommandResultItem type for use with +// apply. +func CommandResultItem() *CommandResultItemApplyConfiguration { + return &CommandResultItemApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CommandResultItemApplyConfiguration) WithName(value string) *CommandResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *CommandResultItemApplyConfiguration) WithAssert(value bool) *CommandResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *CommandResultItemApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *CommandResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Level = &value + return b +} + +// WithCommand sets the Command field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Command field is set to the value of the last call. +func (b *CommandResultItemApplyConfiguration) WithCommand(value string) *CommandResultItemApplyConfiguration { + b.Command = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *CommandResultItemApplyConfiguration) WithValue(value string) *CommandResultItemApplyConfiguration { + b.Value = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *CommandResultItemApplyConfiguration) WithNodeName(value string) *CommandResultItemApplyConfiguration { + b.NodeName = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/componentresultitem.go b/clients/applyconfiguration/kubeeye/v1alpha2/componentresultitem.go new file mode 100644 index 00000000..1050c943 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/componentresultitem.go @@ -0,0 +1,58 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// ComponentResultItemApplyConfiguration represents a declarative configuration of the ComponentResultItem type for use +// with apply. +type ComponentResultItemApplyConfiguration struct { + BaseResultApplyConfiguration `json:",inline"` +} + +// ComponentResultItemApplyConfiguration constructs a declarative configuration of the ComponentResultItem type for use with +// apply. +func ComponentResultItem() *ComponentResultItemApplyConfiguration { + return &ComponentResultItemApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ComponentResultItemApplyConfiguration) WithName(value string) *ComponentResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *ComponentResultItemApplyConfiguration) WithAssert(value bool) *ComponentResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *ComponentResultItemApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *ComponentResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Level = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/customcommandrule.go b/clients/applyconfiguration/kubeeye/v1alpha2/customcommandrule.go new file mode 100644 index 00000000..27734a14 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/customcommandrule.go @@ -0,0 +1,98 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// CustomCommandRuleApplyConfiguration represents a declarative configuration of the CustomCommandRule type for use +// with apply. +type CustomCommandRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + Command *string `json:"command,omitempty"` + NodeApplyConfiguration `json:",inline"` +} + +// CustomCommandRuleApplyConfiguration constructs a declarative configuration of the CustomCommandRule type for use with +// apply. +func CustomCommandRule() *CustomCommandRuleApplyConfiguration { + return &CustomCommandRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CustomCommandRuleApplyConfiguration) WithName(value string) *CustomCommandRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *CustomCommandRuleApplyConfiguration) WithRule(value string) *CustomCommandRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *CustomCommandRuleApplyConfiguration) WithDesc(value string) *CustomCommandRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *CustomCommandRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *CustomCommandRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithCommand sets the Command field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Command field is set to the value of the last call. +func (b *CustomCommandRuleApplyConfiguration) WithCommand(value string) *CustomCommandRuleApplyConfiguration { + b.Command = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *CustomCommandRuleApplyConfiguration) WithNodeName(value string) *CustomCommandRuleApplyConfiguration { + b.NodeApplyConfiguration.NodeName = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *CustomCommandRuleApplyConfiguration) WithNodeSelector(entries map[string]string) *CustomCommandRuleApplyConfiguration { + if b.NodeApplyConfiguration.NodeSelector == nil && len(entries) > 0 { + b.NodeApplyConfiguration.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeApplyConfiguration.NodeSelector[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/extrainfo.go b/clients/applyconfiguration/kubeeye/v1alpha2/extrainfo.go new file mode 100644 index 00000000..6cb53773 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/extrainfo.go @@ -0,0 +1,49 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// ExtraInfoApplyConfiguration represents a declarative configuration of the ExtraInfo type for use +// with apply. +type ExtraInfoApplyConfiguration struct { + WorkloadsCount *int `json:"workloadsCount,omitempty"` + NamespacesList []string `json:"namespacesList,omitempty"` +} + +// ExtraInfoApplyConfiguration constructs a declarative configuration of the ExtraInfo type for use with +// apply. +func ExtraInfo() *ExtraInfoApplyConfiguration { + return &ExtraInfoApplyConfiguration{} +} + +// WithWorkloadsCount sets the WorkloadsCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkloadsCount field is set to the value of the last call. +func (b *ExtraInfoApplyConfiguration) WithWorkloadsCount(value int) *ExtraInfoApplyConfiguration { + b.WorkloadsCount = &value + return b +} + +// WithNamespacesList adds the given value to the NamespacesList field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NamespacesList field. +func (b *ExtraInfoApplyConfiguration) WithNamespacesList(values ...string) *ExtraInfoApplyConfiguration { + for i := range values { + b.NamespacesList = append(b.NamespacesList, values[i]) + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/filechangeresultitem.go b/clients/applyconfiguration/kubeeye/v1alpha2/filechangeresultitem.go new file mode 100644 index 00000000..77d77e85 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/filechangeresultitem.go @@ -0,0 +1,87 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// FileChangeResultItemApplyConfiguration represents a declarative configuration of the FileChangeResultItem type for use +// with apply. +type FileChangeResultItemApplyConfiguration struct { + BaseResultApplyConfiguration `json:",inline"` + Issues []string `json:"issues,omitempty"` + Path *string `json:"path,omitempty"` + NodeName *string `json:"nodeName,omitempty"` +} + +// FileChangeResultItemApplyConfiguration constructs a declarative configuration of the FileChangeResultItem type for use with +// apply. +func FileChangeResultItem() *FileChangeResultItemApplyConfiguration { + return &FileChangeResultItemApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *FileChangeResultItemApplyConfiguration) WithName(value string) *FileChangeResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *FileChangeResultItemApplyConfiguration) WithAssert(value bool) *FileChangeResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *FileChangeResultItemApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *FileChangeResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Level = &value + return b +} + +// WithIssues adds the given value to the Issues field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Issues field. +func (b *FileChangeResultItemApplyConfiguration) WithIssues(values ...string) *FileChangeResultItemApplyConfiguration { + for i := range values { + b.Issues = append(b.Issues, values[i]) + } + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *FileChangeResultItemApplyConfiguration) WithPath(value string) *FileChangeResultItemApplyConfiguration { + b.Path = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *FileChangeResultItemApplyConfiguration) WithNodeName(value string) *FileChangeResultItemApplyConfiguration { + b.NodeName = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/filechangerule.go b/clients/applyconfiguration/kubeeye/v1alpha2/filechangerule.go new file mode 100644 index 00000000..e6c5330c --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/filechangerule.go @@ -0,0 +1,98 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// FileChangeRuleApplyConfiguration represents a declarative configuration of the FileChangeRule type for use +// with apply. +type FileChangeRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + Path *string `json:"path,omitempty"` + NodeApplyConfiguration `json:",inline"` +} + +// FileChangeRuleApplyConfiguration constructs a declarative configuration of the FileChangeRule type for use with +// apply. +func FileChangeRule() *FileChangeRuleApplyConfiguration { + return &FileChangeRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *FileChangeRuleApplyConfiguration) WithName(value string) *FileChangeRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *FileChangeRuleApplyConfiguration) WithRule(value string) *FileChangeRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *FileChangeRuleApplyConfiguration) WithDesc(value string) *FileChangeRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *FileChangeRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *FileChangeRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *FileChangeRuleApplyConfiguration) WithPath(value string) *FileChangeRuleApplyConfiguration { + b.Path = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *FileChangeRuleApplyConfiguration) WithNodeName(value string) *FileChangeRuleApplyConfiguration { + b.NodeApplyConfiguration.NodeName = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *FileChangeRuleApplyConfiguration) WithNodeSelector(entries map[string]string) *FileChangeRuleApplyConfiguration { + if b.NodeApplyConfiguration.NodeSelector == nil && len(entries) > 0 { + b.NodeApplyConfiguration.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeApplyConfiguration.NodeSelector[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/filefilterrule.go b/clients/applyconfiguration/kubeeye/v1alpha2/filefilterrule.go new file mode 100644 index 00000000..dcc8bff4 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/filefilterrule.go @@ -0,0 +1,98 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// FileFilterRuleApplyConfiguration represents a declarative configuration of the FileFilterRule type for use +// with apply. +type FileFilterRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + Path *string `json:"path,omitempty"` + NodeApplyConfiguration `json:",inline"` +} + +// FileFilterRuleApplyConfiguration constructs a declarative configuration of the FileFilterRule type for use with +// apply. +func FileFilterRule() *FileFilterRuleApplyConfiguration { + return &FileFilterRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *FileFilterRuleApplyConfiguration) WithName(value string) *FileFilterRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *FileFilterRuleApplyConfiguration) WithRule(value string) *FileFilterRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *FileFilterRuleApplyConfiguration) WithDesc(value string) *FileFilterRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *FileFilterRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *FileFilterRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *FileFilterRuleApplyConfiguration) WithPath(value string) *FileFilterRuleApplyConfiguration { + b.Path = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *FileFilterRuleApplyConfiguration) WithNodeName(value string) *FileFilterRuleApplyConfiguration { + b.NodeApplyConfiguration.NodeName = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *FileFilterRuleApplyConfiguration) WithNodeSelector(entries map[string]string) *FileFilterRuleApplyConfiguration { + if b.NodeApplyConfiguration.NodeSelector == nil && len(entries) > 0 { + b.NodeApplyConfiguration.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeApplyConfiguration.NodeSelector[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectplan.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectplan.go new file mode 100644 index 00000000..336d10ff --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectplan.go @@ -0,0 +1,223 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InspectPlanApplyConfiguration represents a declarative configuration of the InspectPlan type for use +// with apply. +type InspectPlanApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *InspectPlanSpecApplyConfiguration `json:"spec,omitempty"` + Status *InspectPlanStatusApplyConfiguration `json:"status,omitempty"` +} + +// InspectPlan constructs a declarative configuration of the InspectPlan type for use with +// apply. +func InspectPlan(name string) *InspectPlanApplyConfiguration { + b := &InspectPlanApplyConfiguration{} + b.WithName(name) + b.WithKind("InspectPlan") + b.WithAPIVersion("kubeeye/v1alpha2") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithKind(value string) *InspectPlanApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithAPIVersion(value string) *InspectPlanApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithName(value string) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithGenerateName(value string) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithNamespace(value string) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithUID(value types.UID) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithResourceVersion(value string) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithGeneration(value int64) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithCreationTimestamp(value metav1.Time) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *InspectPlanApplyConfiguration) WithLabels(entries map[string]string) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *InspectPlanApplyConfiguration) WithAnnotations(entries map[string]string) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *InspectPlanApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *InspectPlanApplyConfiguration) WithFinalizers(values ...string) *InspectPlanApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *InspectPlanApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithSpec(value *InspectPlanSpecApplyConfiguration) *InspectPlanApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *InspectPlanApplyConfiguration) WithStatus(value *InspectPlanStatusApplyConfiguration) *InspectPlanApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InspectPlanApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectplanspec.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectplanspec.go new file mode 100644 index 00000000..df61bb86 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectplanspec.go @@ -0,0 +1,115 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// InspectPlanSpecApplyConfiguration represents a declarative configuration of the InspectPlanSpec type for use +// with apply. +type InspectPlanSpecApplyConfiguration struct { + Schedule *string `json:"schedule,omitempty"` + Suspend *bool `json:"suspend,omitempty"` + Timeout *string `json:"timeout,omitempty"` + RuleNames []InspectRuleNamesApplyConfiguration `json:"ruleNames,omitempty"` + MaxTasks *int `json:"maxTasks,omitempty"` + ClusterName []ClusterApplyConfiguration `json:"clusterName,omitempty"` + KubeConfig *string `json:"kubeConfig,omitempty"` + Once *v1.Time `json:"one,omitempty"` +} + +// InspectPlanSpecApplyConfiguration constructs a declarative configuration of the InspectPlanSpec type for use with +// apply. +func InspectPlanSpec() *InspectPlanSpecApplyConfiguration { + return &InspectPlanSpecApplyConfiguration{} +} + +// WithSchedule sets the Schedule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Schedule field is set to the value of the last call. +func (b *InspectPlanSpecApplyConfiguration) WithSchedule(value string) *InspectPlanSpecApplyConfiguration { + b.Schedule = &value + return b +} + +// WithSuspend sets the Suspend field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Suspend field is set to the value of the last call. +func (b *InspectPlanSpecApplyConfiguration) WithSuspend(value bool) *InspectPlanSpecApplyConfiguration { + b.Suspend = &value + return b +} + +// WithTimeout sets the Timeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Timeout field is set to the value of the last call. +func (b *InspectPlanSpecApplyConfiguration) WithTimeout(value string) *InspectPlanSpecApplyConfiguration { + b.Timeout = &value + return b +} + +// WithRuleNames adds the given value to the RuleNames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RuleNames field. +func (b *InspectPlanSpecApplyConfiguration) WithRuleNames(values ...*InspectRuleNamesApplyConfiguration) *InspectPlanSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRuleNames") + } + b.RuleNames = append(b.RuleNames, *values[i]) + } + return b +} + +// WithMaxTasks sets the MaxTasks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxTasks field is set to the value of the last call. +func (b *InspectPlanSpecApplyConfiguration) WithMaxTasks(value int) *InspectPlanSpecApplyConfiguration { + b.MaxTasks = &value + return b +} + +// WithClusterName adds the given value to the ClusterName field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ClusterName field. +func (b *InspectPlanSpecApplyConfiguration) WithClusterName(values ...*ClusterApplyConfiguration) *InspectPlanSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithClusterName") + } + b.ClusterName = append(b.ClusterName, *values[i]) + } + return b +} + +// WithKubeConfig sets the KubeConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KubeConfig field is set to the value of the last call. +func (b *InspectPlanSpecApplyConfiguration) WithKubeConfig(value string) *InspectPlanSpecApplyConfiguration { + b.KubeConfig = &value + return b +} + +// WithOnce sets the Once field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Once field is set to the value of the last call. +func (b *InspectPlanSpecApplyConfiguration) WithOnce(value v1.Time) *InspectPlanSpecApplyConfiguration { + b.Once = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectplanstatus.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectplanstatus.go new file mode 100644 index 00000000..7f4e90cd --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectplanstatus.go @@ -0,0 +1,102 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// InspectPlanStatusApplyConfiguration represents a declarative configuration of the InspectPlanStatus type for use +// with apply. +type InspectPlanStatusApplyConfiguration struct { + LastScheduleTime *v1.Time `json:"lastScheduleTime,omitempty"` + LastTaskStartTime *v1.Time `json:"lastTaskStartTime,omitempty"` + LastTaskEndTime *v1.Time `json:"lastTaskEndTime,omitempty"` + LastTaskName *string `json:"lastTaskName,omitempty"` + TaskNames []TaskNamesApplyConfiguration `json:"TaskNames,omitempty"` + LastTaskStatus *kubeeyev1alpha2.Phase `json:"lastTaskStatus,omitempty"` + NextScheduleTime *v1.Time `json:"nextScheduleTime,omitempty"` +} + +// InspectPlanStatusApplyConfiguration constructs a declarative configuration of the InspectPlanStatus type for use with +// apply. +func InspectPlanStatus() *InspectPlanStatusApplyConfiguration { + return &InspectPlanStatusApplyConfiguration{} +} + +// WithLastScheduleTime sets the LastScheduleTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastScheduleTime field is set to the value of the last call. +func (b *InspectPlanStatusApplyConfiguration) WithLastScheduleTime(value v1.Time) *InspectPlanStatusApplyConfiguration { + b.LastScheduleTime = &value + return b +} + +// WithLastTaskStartTime sets the LastTaskStartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTaskStartTime field is set to the value of the last call. +func (b *InspectPlanStatusApplyConfiguration) WithLastTaskStartTime(value v1.Time) *InspectPlanStatusApplyConfiguration { + b.LastTaskStartTime = &value + return b +} + +// WithLastTaskEndTime sets the LastTaskEndTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTaskEndTime field is set to the value of the last call. +func (b *InspectPlanStatusApplyConfiguration) WithLastTaskEndTime(value v1.Time) *InspectPlanStatusApplyConfiguration { + b.LastTaskEndTime = &value + return b +} + +// WithLastTaskName sets the LastTaskName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTaskName field is set to the value of the last call. +func (b *InspectPlanStatusApplyConfiguration) WithLastTaskName(value string) *InspectPlanStatusApplyConfiguration { + b.LastTaskName = &value + return b +} + +// WithTaskNames adds the given value to the TaskNames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TaskNames field. +func (b *InspectPlanStatusApplyConfiguration) WithTaskNames(values ...*TaskNamesApplyConfiguration) *InspectPlanStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTaskNames") + } + b.TaskNames = append(b.TaskNames, *values[i]) + } + return b +} + +// WithLastTaskStatus sets the LastTaskStatus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTaskStatus field is set to the value of the last call. +func (b *InspectPlanStatusApplyConfiguration) WithLastTaskStatus(value kubeeyev1alpha2.Phase) *InspectPlanStatusApplyConfiguration { + b.LastTaskStatus = &value + return b +} + +// WithNextScheduleTime sets the NextScheduleTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NextScheduleTime field is set to the value of the last call. +func (b *InspectPlanStatusApplyConfiguration) WithNextScheduleTime(value v1.Time) *InspectPlanStatusApplyConfiguration { + b.NextScheduleTime = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectresult.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectresult.go new file mode 100644 index 00000000..b4fa23b2 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectresult.go @@ -0,0 +1,223 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InspectResultApplyConfiguration represents a declarative configuration of the InspectResult type for use +// with apply. +type InspectResultApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *InspectResultSpecApplyConfiguration `json:"spec,omitempty"` + Status *InspectResultStatusApplyConfiguration `json:"status,omitempty"` +} + +// InspectResult constructs a declarative configuration of the InspectResult type for use with +// apply. +func InspectResult(name string) *InspectResultApplyConfiguration { + b := &InspectResultApplyConfiguration{} + b.WithName(name) + b.WithKind("InspectResult") + b.WithAPIVersion("kubeeye/v1alpha2") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithKind(value string) *InspectResultApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithAPIVersion(value string) *InspectResultApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithName(value string) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithGenerateName(value string) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithNamespace(value string) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithUID(value types.UID) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithResourceVersion(value string) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithGeneration(value int64) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithCreationTimestamp(value metav1.Time) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *InspectResultApplyConfiguration) WithLabels(entries map[string]string) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *InspectResultApplyConfiguration) WithAnnotations(entries map[string]string) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *InspectResultApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *InspectResultApplyConfiguration) WithFinalizers(values ...string) *InspectResultApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *InspectResultApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithSpec(value *InspectResultSpecApplyConfiguration) *InspectResultApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *InspectResultApplyConfiguration) WithStatus(value *InspectResultStatusApplyConfiguration) *InspectResultApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InspectResultApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectresultspec.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectresultspec.go new file mode 100644 index 00000000..c55233a7 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectresultspec.go @@ -0,0 +1,188 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// InspectResultSpecApplyConfiguration represents a declarative configuration of the InspectResultSpec type for use +// with apply. +type InspectResultSpecApplyConfiguration struct { + InspectCluster *ClusterApplyConfiguration `json:"inspectCluster,omitempty"` + InspectRuleTotal map[string]int `json:"inspectRuleTotal,omitempty"` + PrometheusResult []PrometheusResultApplyConfiguration `json:"prometheusResult,omitempty"` + OpaResult *KubeeyeOpaResultApplyConfiguration `json:"opaResult,omitempty"` + NodeInfo []NodeInfoResultItemApplyConfiguration `json:"nodeInfo,omitempty"` + FileChangeResult []FileChangeResultItemApplyConfiguration `json:"fileChangeResult,omitempty"` + FileFilterResult []FileChangeResultItemApplyConfiguration `json:"fileFilterResult,omitempty"` + SysctlResult []NodeMetricsResultItemApplyConfiguration `json:"sysctlResult,omitempty"` + SystemdResult []NodeMetricsResultItemApplyConfiguration `json:"systemdResult,omitempty"` + CommandResult []CommandResultItemApplyConfiguration `json:"commandResult,omitempty"` + ComponentResult []ComponentResultItemApplyConfiguration `json:"componentResult,omitempty"` + ServiceConnectResult []ServiceConnectResultItemApplyConfiguration `json:"serviceConnectResult,omitempty"` +} + +// InspectResultSpecApplyConfiguration constructs a declarative configuration of the InspectResultSpec type for use with +// apply. +func InspectResultSpec() *InspectResultSpecApplyConfiguration { + return &InspectResultSpecApplyConfiguration{} +} + +// WithInspectCluster sets the InspectCluster field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InspectCluster field is set to the value of the last call. +func (b *InspectResultSpecApplyConfiguration) WithInspectCluster(value *ClusterApplyConfiguration) *InspectResultSpecApplyConfiguration { + b.InspectCluster = value + return b +} + +// WithInspectRuleTotal puts the entries into the InspectRuleTotal field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the InspectRuleTotal field, +// overwriting an existing map entries in InspectRuleTotal field with the same key. +func (b *InspectResultSpecApplyConfiguration) WithInspectRuleTotal(entries map[string]int) *InspectResultSpecApplyConfiguration { + if b.InspectRuleTotal == nil && len(entries) > 0 { + b.InspectRuleTotal = make(map[string]int, len(entries)) + } + for k, v := range entries { + b.InspectRuleTotal[k] = v + } + return b +} + +// WithPrometheusResult adds the given value to the PrometheusResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PrometheusResult field. +func (b *InspectResultSpecApplyConfiguration) WithPrometheusResult(values ...*PrometheusResultApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPrometheusResult") + } + b.PrometheusResult = append(b.PrometheusResult, *values[i]) + } + return b +} + +// WithOpaResult sets the OpaResult field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OpaResult field is set to the value of the last call. +func (b *InspectResultSpecApplyConfiguration) WithOpaResult(value *KubeeyeOpaResultApplyConfiguration) *InspectResultSpecApplyConfiguration { + b.OpaResult = value + return b +} + +// WithNodeInfo adds the given value to the NodeInfo field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NodeInfo field. +func (b *InspectResultSpecApplyConfiguration) WithNodeInfo(values ...*NodeInfoResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithNodeInfo") + } + b.NodeInfo = append(b.NodeInfo, *values[i]) + } + return b +} + +// WithFileChangeResult adds the given value to the FileChangeResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FileChangeResult field. +func (b *InspectResultSpecApplyConfiguration) WithFileChangeResult(values ...*FileChangeResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFileChangeResult") + } + b.FileChangeResult = append(b.FileChangeResult, *values[i]) + } + return b +} + +// WithFileFilterResult adds the given value to the FileFilterResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FileFilterResult field. +func (b *InspectResultSpecApplyConfiguration) WithFileFilterResult(values ...*FileChangeResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFileFilterResult") + } + b.FileFilterResult = append(b.FileFilterResult, *values[i]) + } + return b +} + +// WithSysctlResult adds the given value to the SysctlResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SysctlResult field. +func (b *InspectResultSpecApplyConfiguration) WithSysctlResult(values ...*NodeMetricsResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSysctlResult") + } + b.SysctlResult = append(b.SysctlResult, *values[i]) + } + return b +} + +// WithSystemdResult adds the given value to the SystemdResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SystemdResult field. +func (b *InspectResultSpecApplyConfiguration) WithSystemdResult(values ...*NodeMetricsResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSystemdResult") + } + b.SystemdResult = append(b.SystemdResult, *values[i]) + } + return b +} + +// WithCommandResult adds the given value to the CommandResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CommandResult field. +func (b *InspectResultSpecApplyConfiguration) WithCommandResult(values ...*CommandResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCommandResult") + } + b.CommandResult = append(b.CommandResult, *values[i]) + } + return b +} + +// WithComponentResult adds the given value to the ComponentResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ComponentResult field. +func (b *InspectResultSpecApplyConfiguration) WithComponentResult(values ...*ComponentResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithComponentResult") + } + b.ComponentResult = append(b.ComponentResult, *values[i]) + } + return b +} + +// WithServiceConnectResult adds the given value to the ServiceConnectResult field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ServiceConnectResult field. +func (b *InspectResultSpecApplyConfiguration) WithServiceConnectResult(values ...*ServiceConnectResultItemApplyConfiguration) *InspectResultSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithServiceConnectResult") + } + b.ServiceConnectResult = append(b.ServiceConnectResult, *values[i]) + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectresultstatus.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectresultstatus.go new file mode 100644 index 00000000..0a6c918c --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectresultstatus.go @@ -0,0 +1,93 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// InspectResultStatusApplyConfiguration represents a declarative configuration of the InspectResultStatus type for use +// with apply. +type InspectResultStatusApplyConfiguration struct { + Complete *bool `json:"complete,omitempty"` + Policy *kubeeyev1alpha2.Policy `json:"policy,omitempty"` + Duration *string `json:"duration,omitempty"` + TaskStartTime *string `json:"taskStartTime,omitempty"` + TaskEndTime *string `json:"taskEndTime,omitempty"` + Level map[kubeeyev1alpha2.Level]*int `json:"level,omitempty"` +} + +// InspectResultStatusApplyConfiguration constructs a declarative configuration of the InspectResultStatus type for use with +// apply. +func InspectResultStatus() *InspectResultStatusApplyConfiguration { + return &InspectResultStatusApplyConfiguration{} +} + +// WithComplete sets the Complete field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Complete field is set to the value of the last call. +func (b *InspectResultStatusApplyConfiguration) WithComplete(value bool) *InspectResultStatusApplyConfiguration { + b.Complete = &value + return b +} + +// WithPolicy sets the Policy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Policy field is set to the value of the last call. +func (b *InspectResultStatusApplyConfiguration) WithPolicy(value kubeeyev1alpha2.Policy) *InspectResultStatusApplyConfiguration { + b.Policy = &value + return b +} + +// WithDuration sets the Duration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Duration field is set to the value of the last call. +func (b *InspectResultStatusApplyConfiguration) WithDuration(value string) *InspectResultStatusApplyConfiguration { + b.Duration = &value + return b +} + +// WithTaskStartTime sets the TaskStartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TaskStartTime field is set to the value of the last call. +func (b *InspectResultStatusApplyConfiguration) WithTaskStartTime(value string) *InspectResultStatusApplyConfiguration { + b.TaskStartTime = &value + return b +} + +// WithTaskEndTime sets the TaskEndTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TaskEndTime field is set to the value of the last call. +func (b *InspectResultStatusApplyConfiguration) WithTaskEndTime(value string) *InspectResultStatusApplyConfiguration { + b.TaskEndTime = &value + return b +} + +// WithLevel puts the entries into the Level field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Level field, +// overwriting an existing map entries in Level field with the same key. +func (b *InspectResultStatusApplyConfiguration) WithLevel(entries map[kubeeyev1alpha2.Level]*int) *InspectResultStatusApplyConfiguration { + if b.Level == nil && len(entries) > 0 { + b.Level = make(map[kubeeyev1alpha2.Level]*int, len(entries)) + } + for k, v := range entries { + b.Level[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectrule.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrule.go new file mode 100644 index 00000000..4620c2b2 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrule.go @@ -0,0 +1,223 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InspectRuleApplyConfiguration represents a declarative configuration of the InspectRule type for use +// with apply. +type InspectRuleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *InspectRuleSpecApplyConfiguration `json:"spec,omitempty"` + Status *InspectRuleStatusApplyConfiguration `json:"status,omitempty"` +} + +// InspectRule constructs a declarative configuration of the InspectRule type for use with +// apply. +func InspectRule(name string) *InspectRuleApplyConfiguration { + b := &InspectRuleApplyConfiguration{} + b.WithName(name) + b.WithKind("InspectRule") + b.WithAPIVersion("kubeeye/v1alpha2") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithKind(value string) *InspectRuleApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithAPIVersion(value string) *InspectRuleApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithName(value string) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithGenerateName(value string) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithNamespace(value string) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithUID(value types.UID) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithResourceVersion(value string) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithGeneration(value int64) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *InspectRuleApplyConfiguration) WithLabels(entries map[string]string) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *InspectRuleApplyConfiguration) WithAnnotations(entries map[string]string) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *InspectRuleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *InspectRuleApplyConfiguration) WithFinalizers(values ...string) *InspectRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *InspectRuleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithSpec(value *InspectRuleSpecApplyConfiguration) *InspectRuleApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *InspectRuleApplyConfiguration) WithStatus(value *InspectRuleStatusApplyConfiguration) *InspectRuleApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InspectRuleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulenames.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulenames.go new file mode 100644 index 00000000..01f81744 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulenames.go @@ -0,0 +1,62 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// InspectRuleNamesApplyConfiguration represents a declarative configuration of the InspectRuleNames type for use +// with apply. +type InspectRuleNamesApplyConfiguration struct { + Name *string `json:"name,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty"` +} + +// InspectRuleNamesApplyConfiguration constructs a declarative configuration of the InspectRuleNames type for use with +// apply. +func InspectRuleNames() *InspectRuleNamesApplyConfiguration { + return &InspectRuleNamesApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InspectRuleNamesApplyConfiguration) WithName(value string) *InspectRuleNamesApplyConfiguration { + b.Name = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *InspectRuleNamesApplyConfiguration) WithNodeName(value string) *InspectRuleNamesApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *InspectRuleNamesApplyConfiguration) WithNodeSelector(entries map[string]string) *InspectRuleNamesApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulespec.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulespec.go new file mode 100644 index 00000000..eaaef678 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulespec.go @@ -0,0 +1,184 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// InspectRuleSpecApplyConfiguration represents a declarative configuration of the InspectRuleSpec type for use +// with apply. +type InspectRuleSpecApplyConfiguration struct { + ComponentExclude []string `json:"componentExclude,omitempty"` + PrometheusEndpoint *string `json:"prometheusEndpoint,omitempty"` + Opas []OpaRuleApplyConfiguration `json:"opas,omitempty"` + Prometheus *PrometheusConfigApplyConfiguration `json:"prometheus,omitempty"` + PromQL []PrometheusRuleApplyConfiguration `json:"promQL,omitempty"` + FileChange []FileChangeRuleApplyConfiguration `json:"fileChange,omitempty"` + Sysctl []SysRuleApplyConfiguration `json:"sysctl,omitempty"` + Systemd []SysRuleApplyConfiguration `json:"systemd,omitempty"` + FileFilter []FileFilterRuleApplyConfiguration `json:"fileFilter,omitempty"` + CustomCommand []CustomCommandRuleApplyConfiguration `json:"customCommand,omitempty"` + NodeInfo []NodeInfoRuleApplyConfiguration `json:"nodeInfo,omitempty"` + ServiceConnect []ServiceConnectRuleApplyConfiguration `json:"serviceConnect,omitempty"` +} + +// InspectRuleSpecApplyConfiguration constructs a declarative configuration of the InspectRuleSpec type for use with +// apply. +func InspectRuleSpec() *InspectRuleSpecApplyConfiguration { + return &InspectRuleSpecApplyConfiguration{} +} + +// WithComponentExclude adds the given value to the ComponentExclude field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ComponentExclude field. +func (b *InspectRuleSpecApplyConfiguration) WithComponentExclude(values ...string) *InspectRuleSpecApplyConfiguration { + for i := range values { + b.ComponentExclude = append(b.ComponentExclude, values[i]) + } + return b +} + +// WithPrometheusEndpoint sets the PrometheusEndpoint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PrometheusEndpoint field is set to the value of the last call. +func (b *InspectRuleSpecApplyConfiguration) WithPrometheusEndpoint(value string) *InspectRuleSpecApplyConfiguration { + b.PrometheusEndpoint = &value + return b +} + +// WithOpas adds the given value to the Opas field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Opas field. +func (b *InspectRuleSpecApplyConfiguration) WithOpas(values ...*OpaRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOpas") + } + b.Opas = append(b.Opas, *values[i]) + } + return b +} + +// WithPrometheus sets the Prometheus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Prometheus field is set to the value of the last call. +func (b *InspectRuleSpecApplyConfiguration) WithPrometheus(value *PrometheusConfigApplyConfiguration) *InspectRuleSpecApplyConfiguration { + b.Prometheus = value + return b +} + +// WithPromQL adds the given value to the PromQL field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PromQL field. +func (b *InspectRuleSpecApplyConfiguration) WithPromQL(values ...*PrometheusRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPromQL") + } + b.PromQL = append(b.PromQL, *values[i]) + } + return b +} + +// WithFileChange adds the given value to the FileChange field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FileChange field. +func (b *InspectRuleSpecApplyConfiguration) WithFileChange(values ...*FileChangeRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFileChange") + } + b.FileChange = append(b.FileChange, *values[i]) + } + return b +} + +// WithSysctl adds the given value to the Sysctl field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Sysctl field. +func (b *InspectRuleSpecApplyConfiguration) WithSysctl(values ...*SysRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSysctl") + } + b.Sysctl = append(b.Sysctl, *values[i]) + } + return b +} + +// WithSystemd adds the given value to the Systemd field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Systemd field. +func (b *InspectRuleSpecApplyConfiguration) WithSystemd(values ...*SysRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSystemd") + } + b.Systemd = append(b.Systemd, *values[i]) + } + return b +} + +// WithFileFilter adds the given value to the FileFilter field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FileFilter field. +func (b *InspectRuleSpecApplyConfiguration) WithFileFilter(values ...*FileFilterRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFileFilter") + } + b.FileFilter = append(b.FileFilter, *values[i]) + } + return b +} + +// WithCustomCommand adds the given value to the CustomCommand field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CustomCommand field. +func (b *InspectRuleSpecApplyConfiguration) WithCustomCommand(values ...*CustomCommandRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCustomCommand") + } + b.CustomCommand = append(b.CustomCommand, *values[i]) + } + return b +} + +// WithNodeInfo adds the given value to the NodeInfo field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NodeInfo field. +func (b *InspectRuleSpecApplyConfiguration) WithNodeInfo(values ...*NodeInfoRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithNodeInfo") + } + b.NodeInfo = append(b.NodeInfo, *values[i]) + } + return b +} + +// WithServiceConnect adds the given value to the ServiceConnect field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ServiceConnect field. +func (b *InspectRuleSpecApplyConfiguration) WithServiceConnect(values ...*ServiceConnectRuleApplyConfiguration) *InspectRuleSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithServiceConnect") + } + b.ServiceConnect = append(b.ServiceConnect, *values[i]) + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulestatus.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulestatus.go new file mode 100644 index 00000000..96d98b29 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspectrulestatus.go @@ -0,0 +1,76 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// InspectRuleStatusApplyConfiguration represents a declarative configuration of the InspectRuleStatus type for use +// with apply. +type InspectRuleStatusApplyConfiguration struct { + StartImportTime *v1.Time `json:"startImportTime,omitempty"` + EndImportTime *v1.Time `json:"endImportTime,omitempty"` + State *kubeeyev1alpha2.State `json:"state,omitempty"` + LevelCount map[kubeeyev1alpha2.Level]*int `json:"levelCount,omitempty"` +} + +// InspectRuleStatusApplyConfiguration constructs a declarative configuration of the InspectRuleStatus type for use with +// apply. +func InspectRuleStatus() *InspectRuleStatusApplyConfiguration { + return &InspectRuleStatusApplyConfiguration{} +} + +// WithStartImportTime sets the StartImportTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartImportTime field is set to the value of the last call. +func (b *InspectRuleStatusApplyConfiguration) WithStartImportTime(value v1.Time) *InspectRuleStatusApplyConfiguration { + b.StartImportTime = &value + return b +} + +// WithEndImportTime sets the EndImportTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EndImportTime field is set to the value of the last call. +func (b *InspectRuleStatusApplyConfiguration) WithEndImportTime(value v1.Time) *InspectRuleStatusApplyConfiguration { + b.EndImportTime = &value + return b +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *InspectRuleStatusApplyConfiguration) WithState(value kubeeyev1alpha2.State) *InspectRuleStatusApplyConfiguration { + b.State = &value + return b +} + +// WithLevelCount puts the entries into the LevelCount field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the LevelCount field, +// overwriting an existing map entries in LevelCount field with the same key. +func (b *InspectRuleStatusApplyConfiguration) WithLevelCount(entries map[kubeeyev1alpha2.Level]*int) *InspectRuleStatusApplyConfiguration { + if b.LevelCount == nil && len(entries) > 0 { + b.LevelCount = make(map[kubeeyev1alpha2.Level]*int, len(entries)) + } + for k, v := range entries { + b.LevelCount[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspecttask.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspecttask.go new file mode 100644 index 00000000..7927b480 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspecttask.go @@ -0,0 +1,223 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// InspectTaskApplyConfiguration represents a declarative configuration of the InspectTask type for use +// with apply. +type InspectTaskApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *InspectTaskSpecApplyConfiguration `json:"spec,omitempty"` + Status *InspectTaskStatusApplyConfiguration `json:"status,omitempty"` +} + +// InspectTask constructs a declarative configuration of the InspectTask type for use with +// apply. +func InspectTask(name string) *InspectTaskApplyConfiguration { + b := &InspectTaskApplyConfiguration{} + b.WithName(name) + b.WithKind("InspectTask") + b.WithAPIVersion("kubeeye/v1alpha2") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithKind(value string) *InspectTaskApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithAPIVersion(value string) *InspectTaskApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithName(value string) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithGenerateName(value string) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithNamespace(value string) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithUID(value types.UID) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithResourceVersion(value string) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithGeneration(value int64) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithCreationTimestamp(value metav1.Time) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *InspectTaskApplyConfiguration) WithLabels(entries map[string]string) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *InspectTaskApplyConfiguration) WithAnnotations(entries map[string]string) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *InspectTaskApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *InspectTaskApplyConfiguration) WithFinalizers(values ...string) *InspectTaskApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *InspectTaskApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithSpec(value *InspectTaskSpecApplyConfiguration) *InspectTaskApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *InspectTaskApplyConfiguration) WithStatus(value *InspectTaskStatusApplyConfiguration) *InspectTaskApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InspectTaskApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspecttaskspec.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspecttaskspec.go new file mode 100644 index 00000000..e6d8ffaf --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspecttaskspec.go @@ -0,0 +1,79 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// InspectTaskSpecApplyConfiguration represents a declarative configuration of the InspectTaskSpec type for use +// with apply. +type InspectTaskSpecApplyConfiguration struct { + ClusterName []ClusterApplyConfiguration `json:"clusterName,omitempty"` + RuleNames []InspectRuleNamesApplyConfiguration `json:"ruleNames,omitempty"` + Timeout *string `json:"timeout,omitempty"` + InspectPolicy *kubeeyev1alpha2.Policy `json:"inspectPolicy,omitempty"` +} + +// InspectTaskSpecApplyConfiguration constructs a declarative configuration of the InspectTaskSpec type for use with +// apply. +func InspectTaskSpec() *InspectTaskSpecApplyConfiguration { + return &InspectTaskSpecApplyConfiguration{} +} + +// WithClusterName adds the given value to the ClusterName field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ClusterName field. +func (b *InspectTaskSpecApplyConfiguration) WithClusterName(values ...*ClusterApplyConfiguration) *InspectTaskSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithClusterName") + } + b.ClusterName = append(b.ClusterName, *values[i]) + } + return b +} + +// WithRuleNames adds the given value to the RuleNames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RuleNames field. +func (b *InspectTaskSpecApplyConfiguration) WithRuleNames(values ...*InspectRuleNamesApplyConfiguration) *InspectTaskSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRuleNames") + } + b.RuleNames = append(b.RuleNames, *values[i]) + } + return b +} + +// WithTimeout sets the Timeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Timeout field is set to the value of the last call. +func (b *InspectTaskSpecApplyConfiguration) WithTimeout(value string) *InspectTaskSpecApplyConfiguration { + b.Timeout = &value + return b +} + +// WithInspectPolicy sets the InspectPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InspectPolicy field is set to the value of the last call. +func (b *InspectTaskSpecApplyConfiguration) WithInspectPolicy(value kubeeyev1alpha2.Policy) *InspectTaskSpecApplyConfiguration { + b.InspectPolicy = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/inspecttaskstatus.go b/clients/applyconfiguration/kubeeye/v1alpha2/inspecttaskstatus.go new file mode 100644 index 00000000..ff3ae9ce --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/inspecttaskstatus.go @@ -0,0 +1,129 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// InspectTaskStatusApplyConfiguration represents a declarative configuration of the InspectTaskStatus type for use +// with apply. +type InspectTaskStatusApplyConfiguration struct { + *ClusterInfoApplyConfiguration `json:"clusterInfo,omitempty"` + JobPhase []JobPhaseApplyConfiguration `json:"jobPhase,omitempty"` + StartTimestamp *v1.Time `json:"startTimestamp,omitempty"` + EndTimestamp *v1.Time `json:"endTimestamp,omitempty"` + Duration *string `json:"duration,omitempty"` + Status *kubeeyev1alpha2.Phase `json:"status,omitempty"` + InspectRuleType []string `json:"inspectRuleType,omitempty"` +} + +// InspectTaskStatusApplyConfiguration constructs a declarative configuration of the InspectTaskStatus type for use with +// apply. +func InspectTaskStatus() *InspectTaskStatusApplyConfiguration { + return &InspectTaskStatusApplyConfiguration{} +} + +// WithClusterVersion sets the ClusterVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterVersion field is set to the value of the last call. +func (b *InspectTaskStatusApplyConfiguration) WithClusterVersion(value string) *InspectTaskStatusApplyConfiguration { + b.ensureClusterInfoApplyConfigurationExists() + b.ClusterInfoApplyConfiguration.ClusterVersion = &value + return b +} + +// WithNodesCount sets the NodesCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodesCount field is set to the value of the last call. +func (b *InspectTaskStatusApplyConfiguration) WithNodesCount(value int) *InspectTaskStatusApplyConfiguration { + b.ensureClusterInfoApplyConfigurationExists() + b.ClusterInfoApplyConfiguration.NodesCount = &value + return b +} + +// WithNamespacesCount sets the NamespacesCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespacesCount field is set to the value of the last call. +func (b *InspectTaskStatusApplyConfiguration) WithNamespacesCount(value int) *InspectTaskStatusApplyConfiguration { + b.ensureClusterInfoApplyConfigurationExists() + b.ClusterInfoApplyConfiguration.NamespacesCount = &value + return b +} + +func (b *InspectTaskStatusApplyConfiguration) ensureClusterInfoApplyConfigurationExists() { + if b.ClusterInfoApplyConfiguration == nil { + b.ClusterInfoApplyConfiguration = &ClusterInfoApplyConfiguration{} + } +} + +// WithJobPhase adds the given value to the JobPhase field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the JobPhase field. +func (b *InspectTaskStatusApplyConfiguration) WithJobPhase(values ...*JobPhaseApplyConfiguration) *InspectTaskStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithJobPhase") + } + b.JobPhase = append(b.JobPhase, *values[i]) + } + return b +} + +// WithStartTimestamp sets the StartTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartTimestamp field is set to the value of the last call. +func (b *InspectTaskStatusApplyConfiguration) WithStartTimestamp(value v1.Time) *InspectTaskStatusApplyConfiguration { + b.StartTimestamp = &value + return b +} + +// WithEndTimestamp sets the EndTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EndTimestamp field is set to the value of the last call. +func (b *InspectTaskStatusApplyConfiguration) WithEndTimestamp(value v1.Time) *InspectTaskStatusApplyConfiguration { + b.EndTimestamp = &value + return b +} + +// WithDuration sets the Duration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Duration field is set to the value of the last call. +func (b *InspectTaskStatusApplyConfiguration) WithDuration(value string) *InspectTaskStatusApplyConfiguration { + b.Duration = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *InspectTaskStatusApplyConfiguration) WithStatus(value kubeeyev1alpha2.Phase) *InspectTaskStatusApplyConfiguration { + b.Status = &value + return b +} + +// WithInspectRuleType adds the given value to the InspectRuleType field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InspectRuleType field. +func (b *InspectTaskStatusApplyConfiguration) WithInspectRuleType(values ...string) *InspectTaskStatusApplyConfiguration { + for i := range values { + b.InspectRuleType = append(b.InspectRuleType, values[i]) + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/jobphase.go b/clients/applyconfiguration/kubeeye/v1alpha2/jobphase.go new file mode 100644 index 00000000..749737e0 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/jobphase.go @@ -0,0 +1,51 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// JobPhaseApplyConfiguration represents a declarative configuration of the JobPhase type for use +// with apply. +type JobPhaseApplyConfiguration struct { + JobName *string `json:"jobName,omitempty"` + Phase *kubeeyev1alpha2.Phase `json:"phase,omitempty"` +} + +// JobPhaseApplyConfiguration constructs a declarative configuration of the JobPhase type for use with +// apply. +func JobPhase() *JobPhaseApplyConfiguration { + return &JobPhaseApplyConfiguration{} +} + +// WithJobName sets the JobName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the JobName field is set to the value of the last call. +func (b *JobPhaseApplyConfiguration) WithJobName(value string) *JobPhaseApplyConfiguration { + b.JobName = &value + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *JobPhaseApplyConfiguration) WithPhase(value kubeeyev1alpha2.Phase) *JobPhaseApplyConfiguration { + b.Phase = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/kubeeyeoparesult.go b/clients/applyconfiguration/kubeeye/v1alpha2/kubeeyeoparesult.go new file mode 100644 index 00000000..1e9f66f1 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/kubeeyeoparesult.go @@ -0,0 +1,140 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// KubeeyeOpaResultApplyConfiguration represents a declarative configuration of the KubeeyeOpaResult type for use +// with apply. +type KubeeyeOpaResultApplyConfiguration struct { + *ScoreInfoApplyConfiguration `json:"scoreInfo,omitempty"` + ResourceResults []ResourceResultApplyConfiguration `json:"resourceResults,omitempty"` + Percent *int `json:"percent,omitempty"` + *ExtraInfoApplyConfiguration `json:"extraInfo,omitempty"` +} + +// KubeeyeOpaResultApplyConfiguration constructs a declarative configuration of the KubeeyeOpaResult type for use with +// apply. +func KubeeyeOpaResult() *KubeeyeOpaResultApplyConfiguration { + return &KubeeyeOpaResultApplyConfiguration{} +} + +// WithScore sets the Score field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Score field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithScore(value int) *KubeeyeOpaResultApplyConfiguration { + b.ensureScoreInfoApplyConfigurationExists() + b.ScoreInfoApplyConfiguration.Score = &value + return b +} + +// WithTotal sets the Total field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Total field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithTotal(value int) *KubeeyeOpaResultApplyConfiguration { + b.ensureScoreInfoApplyConfigurationExists() + b.ScoreInfoApplyConfiguration.Total = &value + return b +} + +// WithDangerous sets the Dangerous field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Dangerous field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithDangerous(value int) *KubeeyeOpaResultApplyConfiguration { + b.ensureScoreInfoApplyConfigurationExists() + b.ScoreInfoApplyConfiguration.Dangerous = &value + return b +} + +// WithWarning sets the Warning field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Warning field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithWarning(value int) *KubeeyeOpaResultApplyConfiguration { + b.ensureScoreInfoApplyConfigurationExists() + b.ScoreInfoApplyConfiguration.Warning = &value + return b +} + +// WithIgnore sets the Ignore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ignore field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithIgnore(value int) *KubeeyeOpaResultApplyConfiguration { + b.ensureScoreInfoApplyConfigurationExists() + b.ScoreInfoApplyConfiguration.Ignore = &value + return b +} + +// WithPassing sets the Passing field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Passing field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithPassing(value int) *KubeeyeOpaResultApplyConfiguration { + b.ensureScoreInfoApplyConfigurationExists() + b.ScoreInfoApplyConfiguration.Passing = &value + return b +} + +func (b *KubeeyeOpaResultApplyConfiguration) ensureScoreInfoApplyConfigurationExists() { + if b.ScoreInfoApplyConfiguration == nil { + b.ScoreInfoApplyConfiguration = &ScoreInfoApplyConfiguration{} + } +} + +// WithResourceResults adds the given value to the ResourceResults field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceResults field. +func (b *KubeeyeOpaResultApplyConfiguration) WithResourceResults(values ...*ResourceResultApplyConfiguration) *KubeeyeOpaResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceResults") + } + b.ResourceResults = append(b.ResourceResults, *values[i]) + } + return b +} + +// WithPercent sets the Percent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Percent field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithPercent(value int) *KubeeyeOpaResultApplyConfiguration { + b.Percent = &value + return b +} + +// WithWorkloadsCount sets the WorkloadsCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkloadsCount field is set to the value of the last call. +func (b *KubeeyeOpaResultApplyConfiguration) WithWorkloadsCount(value int) *KubeeyeOpaResultApplyConfiguration { + b.ensureExtraInfoApplyConfigurationExists() + b.ExtraInfoApplyConfiguration.WorkloadsCount = &value + return b +} + +// WithNamespacesList adds the given value to the NamespacesList field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NamespacesList field. +func (b *KubeeyeOpaResultApplyConfiguration) WithNamespacesList(values ...string) *KubeeyeOpaResultApplyConfiguration { + b.ensureExtraInfoApplyConfigurationExists() + for i := range values { + b.ExtraInfoApplyConfiguration.NamespacesList = append(b.ExtraInfoApplyConfiguration.NamespacesList, values[i]) + } + return b +} + +func (b *KubeeyeOpaResultApplyConfiguration) ensureExtraInfoApplyConfigurationExists() { + if b.ExtraInfoApplyConfiguration == nil { + b.ExtraInfoApplyConfiguration = &ExtraInfoApplyConfiguration{} + } +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/node.go b/clients/applyconfiguration/kubeeye/v1alpha2/node.go new file mode 100644 index 00000000..d19fabca --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/node.go @@ -0,0 +1,53 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// NodeApplyConfiguration represents a declarative configuration of the Node type for use +// with apply. +type NodeApplyConfiguration struct { + NodeName *string `json:"nodeName,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty"` +} + +// NodeApplyConfiguration constructs a declarative configuration of the Node type for use with +// apply. +func Node() *NodeApplyConfiguration { + return &NodeApplyConfiguration{} +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithNodeName(value string) *NodeApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *NodeApplyConfiguration) WithNodeSelector(entries map[string]string) *NodeApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/nodeinforesultitem.go b/clients/applyconfiguration/kubeeye/v1alpha2/nodeinforesultitem.go new file mode 100644 index 00000000..faa749b7 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/nodeinforesultitem.go @@ -0,0 +1,85 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// NodeInfoResultItemApplyConfiguration represents a declarative configuration of the NodeInfoResultItem type for use +// with apply. +type NodeInfoResultItemApplyConfiguration struct { + BaseResultApplyConfiguration `json:",inline"` + ResourcesType *ResourcesTypeApplyConfiguration `json:",inline"` + Value *string `json:"value,omitempty"` + NodeName *string `json:"nodeName,omitempty"` +} + +// NodeInfoResultItemApplyConfiguration constructs a declarative configuration of the NodeInfoResultItem type for use with +// apply. +func NodeInfoResultItem() *NodeInfoResultItemApplyConfiguration { + return &NodeInfoResultItemApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NodeInfoResultItemApplyConfiguration) WithName(value string) *NodeInfoResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *NodeInfoResultItemApplyConfiguration) WithAssert(value bool) *NodeInfoResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *NodeInfoResultItemApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *NodeInfoResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Level = &value + return b +} + +// WithResourcesType sets the ResourcesType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourcesType field is set to the value of the last call. +func (b *NodeInfoResultItemApplyConfiguration) WithResourcesType(value *ResourcesTypeApplyConfiguration) *NodeInfoResultItemApplyConfiguration { + b.ResourcesType = value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *NodeInfoResultItemApplyConfiguration) WithValue(value string) *NodeInfoResultItemApplyConfiguration { + b.Value = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *NodeInfoResultItemApplyConfiguration) WithNodeName(value string) *NodeInfoResultItemApplyConfiguration { + b.NodeName = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/nodeinforule.go b/clients/applyconfiguration/kubeeye/v1alpha2/nodeinforule.go new file mode 100644 index 00000000..68d43cf5 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/nodeinforule.go @@ -0,0 +1,107 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// NodeInfoRuleApplyConfiguration represents a declarative configuration of the NodeInfoRule type for use +// with apply. +type NodeInfoRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + NodeApplyConfiguration `json:",inline"` + ResourcesType *string `json:"resourcesType,omitempty"` + Mount *string `json:"mount,omitempty"` +} + +// NodeInfoRuleApplyConfiguration constructs a declarative configuration of the NodeInfoRule type for use with +// apply. +func NodeInfoRule() *NodeInfoRuleApplyConfiguration { + return &NodeInfoRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NodeInfoRuleApplyConfiguration) WithName(value string) *NodeInfoRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *NodeInfoRuleApplyConfiguration) WithRule(value string) *NodeInfoRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *NodeInfoRuleApplyConfiguration) WithDesc(value string) *NodeInfoRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *NodeInfoRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *NodeInfoRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *NodeInfoRuleApplyConfiguration) WithNodeName(value string) *NodeInfoRuleApplyConfiguration { + b.NodeApplyConfiguration.NodeName = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *NodeInfoRuleApplyConfiguration) WithNodeSelector(entries map[string]string) *NodeInfoRuleApplyConfiguration { + if b.NodeApplyConfiguration.NodeSelector == nil && len(entries) > 0 { + b.NodeApplyConfiguration.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeApplyConfiguration.NodeSelector[k] = v + } + return b +} + +// WithResourcesType sets the ResourcesType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourcesType field is set to the value of the last call. +func (b *NodeInfoRuleApplyConfiguration) WithResourcesType(value string) *NodeInfoRuleApplyConfiguration { + b.ResourcesType = &value + return b +} + +// WithMount sets the Mount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mount field is set to the value of the last call. +func (b *NodeInfoRuleApplyConfiguration) WithMount(value string) *NodeInfoRuleApplyConfiguration { + b.Mount = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/nodemetricsresultitem.go b/clients/applyconfiguration/kubeeye/v1alpha2/nodemetricsresultitem.go new file mode 100644 index 00000000..23b5b3c4 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/nodemetricsresultitem.go @@ -0,0 +1,76 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// NodeMetricsResultItemApplyConfiguration represents a declarative configuration of the NodeMetricsResultItem type for use +// with apply. +type NodeMetricsResultItemApplyConfiguration struct { + BaseResultApplyConfiguration `json:",inline"` + Value *string `json:"value,omitempty"` + NodeName *string `json:"nodeName,omitempty"` +} + +// NodeMetricsResultItemApplyConfiguration constructs a declarative configuration of the NodeMetricsResultItem type for use with +// apply. +func NodeMetricsResultItem() *NodeMetricsResultItemApplyConfiguration { + return &NodeMetricsResultItemApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NodeMetricsResultItemApplyConfiguration) WithName(value string) *NodeMetricsResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *NodeMetricsResultItemApplyConfiguration) WithAssert(value bool) *NodeMetricsResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *NodeMetricsResultItemApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *NodeMetricsResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Level = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *NodeMetricsResultItemApplyConfiguration) WithValue(value string) *NodeMetricsResultItemApplyConfiguration { + b.Value = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *NodeMetricsResultItemApplyConfiguration) WithNodeName(value string) *NodeMetricsResultItemApplyConfiguration { + b.NodeName = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/oparule.go b/clients/applyconfiguration/kubeeye/v1alpha2/oparule.go new file mode 100644 index 00000000..ed114fef --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/oparule.go @@ -0,0 +1,75 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// OpaRuleApplyConfiguration represents a declarative configuration of the OpaRule type for use +// with apply. +type OpaRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + Module *string `json:"module,omitempty"` +} + +// OpaRuleApplyConfiguration constructs a declarative configuration of the OpaRule type for use with +// apply. +func OpaRule() *OpaRuleApplyConfiguration { + return &OpaRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *OpaRuleApplyConfiguration) WithName(value string) *OpaRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *OpaRuleApplyConfiguration) WithRule(value string) *OpaRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *OpaRuleApplyConfiguration) WithDesc(value string) *OpaRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *OpaRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *OpaRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithModule sets the Module field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Module field is set to the value of the last call. +func (b *OpaRuleApplyConfiguration) WithModule(value string) *OpaRuleApplyConfiguration { + b.Module = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/prometheusconfig.go b/clients/applyconfiguration/kubeeye/v1alpha2/prometheusconfig.go new file mode 100644 index 00000000..46525db9 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/prometheusconfig.go @@ -0,0 +1,65 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// PrometheusConfigApplyConfiguration represents a declarative configuration of the PrometheusConfig type for use +// with apply. +type PrometheusConfigApplyConfiguration struct { + Endpoint *string `json:"endpoint,omitempty"` + BasicToken *string `json:"basicToken,omitempty"` + BearerToken *string `json:"bearerToken,omitempty"` + InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` +} + +// PrometheusConfigApplyConfiguration constructs a declarative configuration of the PrometheusConfig type for use with +// apply. +func PrometheusConfig() *PrometheusConfigApplyConfiguration { + return &PrometheusConfigApplyConfiguration{} +} + +// WithEndpoint sets the Endpoint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Endpoint field is set to the value of the last call. +func (b *PrometheusConfigApplyConfiguration) WithEndpoint(value string) *PrometheusConfigApplyConfiguration { + b.Endpoint = &value + return b +} + +// WithBasicToken sets the BasicToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasicToken field is set to the value of the last call. +func (b *PrometheusConfigApplyConfiguration) WithBasicToken(value string) *PrometheusConfigApplyConfiguration { + b.BasicToken = &value + return b +} + +// WithBearerToken sets the BearerToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BearerToken field is set to the value of the last call. +func (b *PrometheusConfigApplyConfiguration) WithBearerToken(value string) *PrometheusConfigApplyConfiguration { + b.BearerToken = &value + return b +} + +// WithInsecureSkipVerify sets the InsecureSkipVerify field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InsecureSkipVerify field is set to the value of the last call. +func (b *PrometheusConfigApplyConfiguration) WithInsecureSkipVerify(value bool) *PrometheusConfigApplyConfiguration { + b.InsecureSkipVerify = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/prometheusresult.go b/clients/applyconfiguration/kubeeye/v1alpha2/prometheusresult.go new file mode 100644 index 00000000..a57e9802 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/prometheusresult.go @@ -0,0 +1,85 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// PrometheusResultApplyConfiguration represents a declarative configuration of the PrometheusResult type for use +// with apply. +type PrometheusResultApplyConfiguration struct { + BaseResultApplyConfiguration `json:",inline"` + Result *string `json:"result,omitempty"` + RawDataEnabled *bool `json:"rawDataEnabled,omitempty"` + Rule *string `json:"rule,omitempty"` +} + +// PrometheusResultApplyConfiguration constructs a declarative configuration of the PrometheusResult type for use with +// apply. +func PrometheusResult() *PrometheusResultApplyConfiguration { + return &PrometheusResultApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PrometheusResultApplyConfiguration) WithName(value string) *PrometheusResultApplyConfiguration { + b.BaseResultApplyConfiguration.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *PrometheusResultApplyConfiguration) WithAssert(value bool) *PrometheusResultApplyConfiguration { + b.BaseResultApplyConfiguration.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *PrometheusResultApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *PrometheusResultApplyConfiguration { + b.BaseResultApplyConfiguration.Level = &value + return b +} + +// WithResult sets the Result field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Result field is set to the value of the last call. +func (b *PrometheusResultApplyConfiguration) WithResult(value string) *PrometheusResultApplyConfiguration { + b.Result = &value + return b +} + +// WithRawDataEnabled sets the RawDataEnabled field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RawDataEnabled field is set to the value of the last call. +func (b *PrometheusResultApplyConfiguration) WithRawDataEnabled(value bool) *PrometheusResultApplyConfiguration { + b.RawDataEnabled = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *PrometheusResultApplyConfiguration) WithRule(value string) *PrometheusResultApplyConfiguration { + b.Rule = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/prometheusrule.go b/clients/applyconfiguration/kubeeye/v1alpha2/prometheusrule.go new file mode 100644 index 00000000..41b8e78f --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/prometheusrule.go @@ -0,0 +1,84 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// PrometheusRuleApplyConfiguration represents a declarative configuration of the PrometheusRule type for use +// with apply. +type PrometheusRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + Prometheus *PrometheusConfigApplyConfiguration `json:"prometheus,omitempty"` + RawDataEnabled *bool `json:"rawDataEnabled,omitempty"` +} + +// PrometheusRuleApplyConfiguration constructs a declarative configuration of the PrometheusRule type for use with +// apply. +func PrometheusRule() *PrometheusRuleApplyConfiguration { + return &PrometheusRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithName(value string) *PrometheusRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithRule(value string) *PrometheusRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithDesc(value string) *PrometheusRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *PrometheusRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithPrometheus sets the Prometheus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Prometheus field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithPrometheus(value *PrometheusConfigApplyConfiguration) *PrometheusRuleApplyConfiguration { + b.Prometheus = value + return b +} + +// WithRawDataEnabled sets the RawDataEnabled field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RawDataEnabled field is set to the value of the last call. +func (b *PrometheusRuleApplyConfiguration) WithRawDataEnabled(value bool) *PrometheusRuleApplyConfiguration { + b.RawDataEnabled = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/resourceresult.go b/clients/applyconfiguration/kubeeye/v1alpha2/resourceresult.go new file mode 100644 index 00000000..d5841ae5 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/resourceresult.go @@ -0,0 +1,70 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// ResourceResultApplyConfiguration represents a declarative configuration of the ResourceResult type for use +// with apply. +type ResourceResultApplyConfiguration struct { + NameSpace *string `json:"namespace,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + Name *string `json:"name,omitempty"` + ResultItems []ResultItemApplyConfiguration `json:"resultItems,omitempty"` +} + +// ResourceResultApplyConfiguration constructs a declarative configuration of the ResourceResult type for use with +// apply. +func ResourceResult() *ResourceResultApplyConfiguration { + return &ResourceResultApplyConfiguration{} +} + +// WithNameSpace sets the NameSpace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NameSpace field is set to the value of the last call. +func (b *ResourceResultApplyConfiguration) WithNameSpace(value string) *ResourceResultApplyConfiguration { + b.NameSpace = &value + return b +} + +// WithResourceType sets the ResourceType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceType field is set to the value of the last call. +func (b *ResourceResultApplyConfiguration) WithResourceType(value string) *ResourceResultApplyConfiguration { + b.ResourceType = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceResultApplyConfiguration) WithName(value string) *ResourceResultApplyConfiguration { + b.Name = &value + return b +} + +// WithResultItems adds the given value to the ResultItems field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResultItems field. +func (b *ResourceResultApplyConfiguration) WithResultItems(values ...*ResultItemApplyConfiguration) *ResourceResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResultItems") + } + b.ResultItems = append(b.ResultItems, *values[i]) + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/resourcestype.go b/clients/applyconfiguration/kubeeye/v1alpha2/resourcestype.go new file mode 100644 index 00000000..043ad8b0 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/resourcestype.go @@ -0,0 +1,47 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// ResourcesTypeApplyConfiguration represents a declarative configuration of the ResourcesType type for use +// with apply. +type ResourcesTypeApplyConfiguration struct { + Mount *string `json:"mount,omitempty"` + Type *string `json:"type,omitempty"` +} + +// ResourcesTypeApplyConfiguration constructs a declarative configuration of the ResourcesType type for use with +// apply. +func ResourcesType() *ResourcesTypeApplyConfiguration { + return &ResourcesTypeApplyConfiguration{} +} + +// WithMount sets the Mount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mount field is set to the value of the last call. +func (b *ResourcesTypeApplyConfiguration) WithMount(value string) *ResourcesTypeApplyConfiguration { + b.Mount = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ResourcesTypeApplyConfiguration) WithType(value string) *ResourcesTypeApplyConfiguration { + b.Type = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/resultitem.go b/clients/applyconfiguration/kubeeye/v1alpha2/resultitem.go new file mode 100644 index 00000000..5c51629f --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/resultitem.go @@ -0,0 +1,56 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// ResultItemApplyConfiguration represents a declarative configuration of the ResultItem type for use +// with apply. +type ResultItemApplyConfiguration struct { + Level *string `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// ResultItemApplyConfiguration constructs a declarative configuration of the ResultItem type for use with +// apply. +func ResultItem() *ResultItemApplyConfiguration { + return &ResultItemApplyConfiguration{} +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *ResultItemApplyConfiguration) WithLevel(value string) *ResultItemApplyConfiguration { + b.Level = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ResultItemApplyConfiguration) WithMessage(value string) *ResultItemApplyConfiguration { + b.Message = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ResultItemApplyConfiguration) WithReason(value string) *ResultItemApplyConfiguration { + b.Reason = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/ruleitembases.go b/clients/applyconfiguration/kubeeye/v1alpha2/ruleitembases.go new file mode 100644 index 00000000..1e41468b --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/ruleitembases.go @@ -0,0 +1,69 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// RuleItemBasesApplyConfiguration represents a declarative configuration of the RuleItemBases type for use +// with apply. +type RuleItemBasesApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Rule *string `json:"rule,omitempty"` + Desc *string `json:"desc,omitempty"` + Level *kubeeyev1alpha2.Level `json:"level,omitempty"` +} + +// RuleItemBasesApplyConfiguration constructs a declarative configuration of the RuleItemBases type for use with +// apply. +func RuleItemBases() *RuleItemBasesApplyConfiguration { + return &RuleItemBasesApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *RuleItemBasesApplyConfiguration) WithName(value string) *RuleItemBasesApplyConfiguration { + b.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *RuleItemBasesApplyConfiguration) WithRule(value string) *RuleItemBasesApplyConfiguration { + b.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *RuleItemBasesApplyConfiguration) WithDesc(value string) *RuleItemBasesApplyConfiguration { + b.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *RuleItemBasesApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *RuleItemBasesApplyConfiguration { + b.Level = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/scoreinfo.go b/clients/applyconfiguration/kubeeye/v1alpha2/scoreinfo.go new file mode 100644 index 00000000..b4a8f745 --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/scoreinfo.go @@ -0,0 +1,83 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// ScoreInfoApplyConfiguration represents a declarative configuration of the ScoreInfo type for use +// with apply. +type ScoreInfoApplyConfiguration struct { + Score *int `json:"score,omitempty"` + Total *int `json:"total,omitempty"` + Dangerous *int `json:"dangerous,omitempty"` + Warning *int `json:"warning,omitempty"` + Ignore *int `json:"ignore,omitempty"` + Passing *int `json:"passing,omitempty"` +} + +// ScoreInfoApplyConfiguration constructs a declarative configuration of the ScoreInfo type for use with +// apply. +func ScoreInfo() *ScoreInfoApplyConfiguration { + return &ScoreInfoApplyConfiguration{} +} + +// WithScore sets the Score field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Score field is set to the value of the last call. +func (b *ScoreInfoApplyConfiguration) WithScore(value int) *ScoreInfoApplyConfiguration { + b.Score = &value + return b +} + +// WithTotal sets the Total field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Total field is set to the value of the last call. +func (b *ScoreInfoApplyConfiguration) WithTotal(value int) *ScoreInfoApplyConfiguration { + b.Total = &value + return b +} + +// WithDangerous sets the Dangerous field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Dangerous field is set to the value of the last call. +func (b *ScoreInfoApplyConfiguration) WithDangerous(value int) *ScoreInfoApplyConfiguration { + b.Dangerous = &value + return b +} + +// WithWarning sets the Warning field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Warning field is set to the value of the last call. +func (b *ScoreInfoApplyConfiguration) WithWarning(value int) *ScoreInfoApplyConfiguration { + b.Warning = &value + return b +} + +// WithIgnore sets the Ignore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ignore field is set to the value of the last call. +func (b *ScoreInfoApplyConfiguration) WithIgnore(value int) *ScoreInfoApplyConfiguration { + b.Ignore = &value + return b +} + +// WithPassing sets the Passing field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Passing field is set to the value of the last call. +func (b *ScoreInfoApplyConfiguration) WithPassing(value int) *ScoreInfoApplyConfiguration { + b.Passing = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/serviceconnectresultitem.go b/clients/applyconfiguration/kubeeye/v1alpha2/serviceconnectresultitem.go new file mode 100644 index 00000000..3a64870f --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/serviceconnectresultitem.go @@ -0,0 +1,76 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// ServiceConnectResultItemApplyConfiguration represents a declarative configuration of the ServiceConnectResultItem type for use +// with apply. +type ServiceConnectResultItemApplyConfiguration struct { + BaseResultApplyConfiguration `json:",inline"` + Namespace *string `json:"namespace,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` +} + +// ServiceConnectResultItemApplyConfiguration constructs a declarative configuration of the ServiceConnectResultItem type for use with +// apply. +func ServiceConnectResultItem() *ServiceConnectResultItemApplyConfiguration { + return &ServiceConnectResultItemApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceConnectResultItemApplyConfiguration) WithName(value string) *ServiceConnectResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Name = &value + return b +} + +// WithAssert sets the Assert field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assert field is set to the value of the last call. +func (b *ServiceConnectResultItemApplyConfiguration) WithAssert(value bool) *ServiceConnectResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Assert = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *ServiceConnectResultItemApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *ServiceConnectResultItemApplyConfiguration { + b.BaseResultApplyConfiguration.Level = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceConnectResultItemApplyConfiguration) WithNamespace(value string) *ServiceConnectResultItemApplyConfiguration { + b.Namespace = &value + return b +} + +// WithEndpoint sets the Endpoint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Endpoint field is set to the value of the last call. +func (b *ServiceConnectResultItemApplyConfiguration) WithEndpoint(value string) *ServiceConnectResultItemApplyConfiguration { + b.Endpoint = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/serviceconnectrule.go b/clients/applyconfiguration/kubeeye/v1alpha2/serviceconnectrule.go new file mode 100644 index 00000000..0fe2f09d --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/serviceconnectrule.go @@ -0,0 +1,84 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// ServiceConnectRuleApplyConfiguration represents a declarative configuration of the ServiceConnectRule type for use +// with apply. +type ServiceConnectRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + Namespace *string `json:"namespace,omitempty"` + Workspace *string `json:"workspace,omitempty"` +} + +// ServiceConnectRuleApplyConfiguration constructs a declarative configuration of the ServiceConnectRule type for use with +// apply. +func ServiceConnectRule() *ServiceConnectRuleApplyConfiguration { + return &ServiceConnectRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceConnectRuleApplyConfiguration) WithName(value string) *ServiceConnectRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *ServiceConnectRuleApplyConfiguration) WithRule(value string) *ServiceConnectRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *ServiceConnectRuleApplyConfiguration) WithDesc(value string) *ServiceConnectRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *ServiceConnectRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *ServiceConnectRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceConnectRuleApplyConfiguration) WithNamespace(value string) *ServiceConnectRuleApplyConfiguration { + b.Namespace = &value + return b +} + +// WithWorkspace sets the Workspace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Workspace field is set to the value of the last call. +func (b *ServiceConnectRuleApplyConfiguration) WithWorkspace(value string) *ServiceConnectRuleApplyConfiguration { + b.Workspace = &value + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/sysrule.go b/clients/applyconfiguration/kubeeye/v1alpha2/sysrule.go new file mode 100644 index 00000000..6f68cd9f --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/sysrule.go @@ -0,0 +1,89 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// SysRuleApplyConfiguration represents a declarative configuration of the SysRule type for use +// with apply. +type SysRuleApplyConfiguration struct { + RuleItemBasesApplyConfiguration `json:",inline"` + NodeApplyConfiguration `json:",inline"` +} + +// SysRuleApplyConfiguration constructs a declarative configuration of the SysRule type for use with +// apply. +func SysRule() *SysRuleApplyConfiguration { + return &SysRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SysRuleApplyConfiguration) WithName(value string) *SysRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Name = &value + return b +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *SysRuleApplyConfiguration) WithRule(value string) *SysRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Rule = &value + return b +} + +// WithDesc sets the Desc field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Desc field is set to the value of the last call. +func (b *SysRuleApplyConfiguration) WithDesc(value string) *SysRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Desc = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *SysRuleApplyConfiguration) WithLevel(value kubeeyev1alpha2.Level) *SysRuleApplyConfiguration { + b.RuleItemBasesApplyConfiguration.Level = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *SysRuleApplyConfiguration) WithNodeName(value string) *SysRuleApplyConfiguration { + b.NodeApplyConfiguration.NodeName = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *SysRuleApplyConfiguration) WithNodeSelector(entries map[string]string) *SysRuleApplyConfiguration { + if b.NodeApplyConfiguration.NodeSelector == nil && len(entries) > 0 { + b.NodeApplyConfiguration.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeApplyConfiguration.NodeSelector[k] = v + } + return b +} diff --git a/clients/applyconfiguration/kubeeye/v1alpha2/tasknames.go b/clients/applyconfiguration/kubeeye/v1alpha2/tasknames.go new file mode 100644 index 00000000..16ba526c --- /dev/null +++ b/clients/applyconfiguration/kubeeye/v1alpha2/tasknames.go @@ -0,0 +1,51 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" +) + +// TaskNamesApplyConfiguration represents a declarative configuration of the TaskNames type for use +// with apply. +type TaskNamesApplyConfiguration struct { + Name *string `json:"name,omitempty"` + TaskStatus *kubeeyev1alpha2.Phase `json:"taskStatus,omitempty"` +} + +// TaskNamesApplyConfiguration constructs a declarative configuration of the TaskNames type for use with +// apply. +func TaskNames() *TaskNamesApplyConfiguration { + return &TaskNamesApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TaskNamesApplyConfiguration) WithName(value string) *TaskNamesApplyConfiguration { + b.Name = &value + return b +} + +// WithTaskStatus sets the TaskStatus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TaskStatus field is set to the value of the last call. +func (b *TaskNamesApplyConfiguration) WithTaskStatus(value kubeeyev1alpha2.Phase) *TaskNamesApplyConfiguration { + b.TaskStatus = &value + return b +} diff --git a/clients/applyconfiguration/utils.go b/clients/applyconfiguration/utils.go new file mode 100644 index 00000000..6c20d27c --- /dev/null +++ b/clients/applyconfiguration/utils.go @@ -0,0 +1,125 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfiguration + +import ( + v1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + internal "github.com/kubesphere/kubeeye/clients/applyconfiguration/internal" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=kubeeye, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithKind("BaseResult"): + return &kubeeyev1alpha2.BaseResultApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("Cluster"): + return &kubeeyev1alpha2.ClusterApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ClusterInfo"): + return &kubeeyev1alpha2.ClusterInfoApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CommandResultItem"): + return &kubeeyev1alpha2.CommandResultItemApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ComponentResultItem"): + return &kubeeyev1alpha2.ComponentResultItemApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CustomCommandRule"): + return &kubeeyev1alpha2.CustomCommandRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ExtraInfo"): + return &kubeeyev1alpha2.ExtraInfoApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("FileChangeResultItem"): + return &kubeeyev1alpha2.FileChangeResultItemApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("FileChangeRule"): + return &kubeeyev1alpha2.FileChangeRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("FileFilterRule"): + return &kubeeyev1alpha2.FileFilterRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectPlan"): + return &kubeeyev1alpha2.InspectPlanApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectPlanSpec"): + return &kubeeyev1alpha2.InspectPlanSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectPlanStatus"): + return &kubeeyev1alpha2.InspectPlanStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectResult"): + return &kubeeyev1alpha2.InspectResultApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectResultSpec"): + return &kubeeyev1alpha2.InspectResultSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectResultStatus"): + return &kubeeyev1alpha2.InspectResultStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectRule"): + return &kubeeyev1alpha2.InspectRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectRuleNames"): + return &kubeeyev1alpha2.InspectRuleNamesApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectRuleSpec"): + return &kubeeyev1alpha2.InspectRuleSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectRuleStatus"): + return &kubeeyev1alpha2.InspectRuleStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectTask"): + return &kubeeyev1alpha2.InspectTaskApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectTaskSpec"): + return &kubeeyev1alpha2.InspectTaskSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("InspectTaskStatus"): + return &kubeeyev1alpha2.InspectTaskStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("JobPhase"): + return &kubeeyev1alpha2.JobPhaseApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("KubeeyeOpaResult"): + return &kubeeyev1alpha2.KubeeyeOpaResultApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("Node"): + return &kubeeyev1alpha2.NodeApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("NodeInfoResultItem"): + return &kubeeyev1alpha2.NodeInfoResultItemApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("NodeInfoRule"): + return &kubeeyev1alpha2.NodeInfoRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("NodeMetricsResultItem"): + return &kubeeyev1alpha2.NodeMetricsResultItemApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("OpaRule"): + return &kubeeyev1alpha2.OpaRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("PrometheusConfig"): + return &kubeeyev1alpha2.PrometheusConfigApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("PrometheusResult"): + return &kubeeyev1alpha2.PrometheusResultApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("PrometheusRule"): + return &kubeeyev1alpha2.PrometheusRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ResourceResult"): + return &kubeeyev1alpha2.ResourceResultApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ResourcesType"): + return &kubeeyev1alpha2.ResourcesTypeApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ResultItem"): + return &kubeeyev1alpha2.ResultItemApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("RuleItemBases"): + return &kubeeyev1alpha2.RuleItemBasesApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ScoreInfo"): + return &kubeeyev1alpha2.ScoreInfoApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ServiceConnectResultItem"): + return &kubeeyev1alpha2.ServiceConnectResultItemApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ServiceConnectRule"): + return &kubeeyev1alpha2.ServiceConnectRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("SysRule"): + return &kubeeyev1alpha2.SysRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TaskNames"): + return &kubeeyev1alpha2.TaskNamesApplyConfiguration{} + + } + return nil +} + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +} diff --git a/clients/clientset/versioned/clientset.go b/clients/clientset/versioned/clientset.go new file mode 100644 index 00000000..5cee4de6 --- /dev/null +++ b/clients/clientset/versioned/clientset.go @@ -0,0 +1,119 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + fmt "fmt" + http "net/http" + + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + KubeeyeV1alpha2() kubeeyev1alpha2.KubeeyeV1alpha2Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + kubeeyeV1alpha2 *kubeeyev1alpha2.KubeeyeV1alpha2Client +} + +// KubeeyeV1alpha2 retrieves the KubeeyeV1alpha2Client +func (c *Clientset) KubeeyeV1alpha2() kubeeyev1alpha2.KubeeyeV1alpha2Interface { + return c.kubeeyeV1alpha2 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.kubeeyeV1alpha2, err = kubeeyev1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.kubeeyeV1alpha2 = kubeeyev1alpha2.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/clients/clientset/versioned/fake/clientset_generated.go b/clients/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000..72318843 --- /dev/null +++ b/clients/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,121 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + applyconfiguration "github.com/kubesphere/kubeeye/clients/applyconfiguration" + clientset "github.com/kubesphere/kubeeye/clients/clientset/versioned" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2" + fakekubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +// NewClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfiguration.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// KubeeyeV1alpha2 retrieves the KubeeyeV1alpha2Client +func (c *Clientset) KubeeyeV1alpha2() kubeeyev1alpha2.KubeeyeV1alpha2Interface { + return &fakekubeeyev1alpha2.FakeKubeeyeV1alpha2{Fake: &c.Fake} +} diff --git a/clients/clientset/versioned/fake/doc.go b/clients/clientset/versioned/fake/doc.go new file mode 100644 index 00000000..bc410d47 --- /dev/null +++ b/clients/clientset/versioned/fake/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/clients/clientset/versioned/fake/register.go b/clients/clientset/versioned/fake/register.go new file mode 100644 index 00000000..212cad9d --- /dev/null +++ b/clients/clientset/versioned/fake/register.go @@ -0,0 +1,55 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + kubeeyev1alpha2.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/clients/clientset/versioned/scheme/doc.go b/clients/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000..c9b70b54 --- /dev/null +++ b/clients/clientset/versioned/scheme/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/clients/clientset/versioned/scheme/register.go b/clients/clientset/versioned/scheme/register.go new file mode 100644 index 00000000..3ab89452 --- /dev/null +++ b/clients/clientset/versioned/scheme/register.go @@ -0,0 +1,55 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + kubeeyev1alpha2.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/doc.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/doc.go new file mode 100644 index 00000000..8fd962b9 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha2 diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/doc.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/doc.go new file mode 100644 index 00000000..a6330724 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectplan.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectplan.go new file mode 100644 index 00000000..722a4823 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectplan.go @@ -0,0 +1,52 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + typedkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeInspectPlans implements InspectPlanInterface +type fakeInspectPlans struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.InspectPlan, *v1alpha2.InspectPlanList, *kubeeyev1alpha2.InspectPlanApplyConfiguration] + Fake *FakeKubeeyeV1alpha2 +} + +func newFakeInspectPlans(fake *FakeKubeeyeV1alpha2) typedkubeeyev1alpha2.InspectPlanInterface { + return &fakeInspectPlans{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.InspectPlan, *v1alpha2.InspectPlanList, *kubeeyev1alpha2.InspectPlanApplyConfiguration]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("inspectplans"), + v1alpha2.SchemeGroupVersion.WithKind("InspectPlan"), + func() *v1alpha2.InspectPlan { return &v1alpha2.InspectPlan{} }, + func() *v1alpha2.InspectPlanList { return &v1alpha2.InspectPlanList{} }, + func(dst, src *v1alpha2.InspectPlanList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.InspectPlanList) []*v1alpha2.InspectPlan { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.InspectPlanList, items []*v1alpha2.InspectPlan) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectresult.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectresult.go new file mode 100644 index 00000000..65aa7df8 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectresult.go @@ -0,0 +1,52 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + typedkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeInspectResults implements InspectResultInterface +type fakeInspectResults struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.InspectResult, *v1alpha2.InspectResultList, *kubeeyev1alpha2.InspectResultApplyConfiguration] + Fake *FakeKubeeyeV1alpha2 +} + +func newFakeInspectResults(fake *FakeKubeeyeV1alpha2) typedkubeeyev1alpha2.InspectResultInterface { + return &fakeInspectResults{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.InspectResult, *v1alpha2.InspectResultList, *kubeeyev1alpha2.InspectResultApplyConfiguration]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("inspectresults"), + v1alpha2.SchemeGroupVersion.WithKind("InspectResult"), + func() *v1alpha2.InspectResult { return &v1alpha2.InspectResult{} }, + func() *v1alpha2.InspectResultList { return &v1alpha2.InspectResultList{} }, + func(dst, src *v1alpha2.InspectResultList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.InspectResultList) []*v1alpha2.InspectResult { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.InspectResultList, items []*v1alpha2.InspectResult) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectrule.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectrule.go new file mode 100644 index 00000000..1ea0e63f --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspectrule.go @@ -0,0 +1,52 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + typedkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeInspectRules implements InspectRuleInterface +type fakeInspectRules struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.InspectRule, *v1alpha2.InspectRuleList, *kubeeyev1alpha2.InspectRuleApplyConfiguration] + Fake *FakeKubeeyeV1alpha2 +} + +func newFakeInspectRules(fake *FakeKubeeyeV1alpha2) typedkubeeyev1alpha2.InspectRuleInterface { + return &fakeInspectRules{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.InspectRule, *v1alpha2.InspectRuleList, *kubeeyev1alpha2.InspectRuleApplyConfiguration]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("inspectrules"), + v1alpha2.SchemeGroupVersion.WithKind("InspectRule"), + func() *v1alpha2.InspectRule { return &v1alpha2.InspectRule{} }, + func() *v1alpha2.InspectRuleList { return &v1alpha2.InspectRuleList{} }, + func(dst, src *v1alpha2.InspectRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.InspectRuleList) []*v1alpha2.InspectRule { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.InspectRuleList, items []*v1alpha2.InspectRule) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspecttask.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspecttask.go new file mode 100644 index 00000000..46568e49 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_inspecttask.go @@ -0,0 +1,52 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + typedkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeInspectTasks implements InspectTaskInterface +type fakeInspectTasks struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.InspectTask, *v1alpha2.InspectTaskList, *kubeeyev1alpha2.InspectTaskApplyConfiguration] + Fake *FakeKubeeyeV1alpha2 +} + +func newFakeInspectTasks(fake *FakeKubeeyeV1alpha2) typedkubeeyev1alpha2.InspectTaskInterface { + return &fakeInspectTasks{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.InspectTask, *v1alpha2.InspectTaskList, *kubeeyev1alpha2.InspectTaskApplyConfiguration]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("inspecttasks"), + v1alpha2.SchemeGroupVersion.WithKind("InspectTask"), + func() *v1alpha2.InspectTask { return &v1alpha2.InspectTask{} }, + func() *v1alpha2.InspectTaskList { return &v1alpha2.InspectTaskList{} }, + func(dst, src *v1alpha2.InspectTaskList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.InspectTaskList) []*v1alpha2.InspectTask { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.InspectTaskList, items []*v1alpha2.InspectTask) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_kubeeye_client.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_kubeeye_client.go new file mode 100644 index 00000000..5125c64f --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/fake/fake_kubeeye_client.go @@ -0,0 +1,51 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha2 "github.com/kubesphere/kubeeye/clients/clientset/versioned/typed/kubeeye/v1alpha2" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeKubeeyeV1alpha2 struct { + *testing.Fake +} + +func (c *FakeKubeeyeV1alpha2) InspectPlans() v1alpha2.InspectPlanInterface { + return newFakeInspectPlans(c) +} + +func (c *FakeKubeeyeV1alpha2) InspectResults() v1alpha2.InspectResultInterface { + return newFakeInspectResults(c) +} + +func (c *FakeKubeeyeV1alpha2) InspectRules() v1alpha2.InspectRuleInterface { + return newFakeInspectRules(c) +} + +func (c *FakeKubeeyeV1alpha2) InspectTasks() v1alpha2.InspectTaskInterface { + return newFakeInspectTasks(c) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeKubeeyeV1alpha2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/generated_expansion.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/generated_expansion.go new file mode 100644 index 00000000..902e827b --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/generated_expansion.go @@ -0,0 +1,26 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +type InspectPlanExpansion interface{} + +type InspectResultExpansion interface{} + +type InspectRuleExpansion interface{} + +type InspectTaskExpansion interface{} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectplan.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectplan.go new file mode 100644 index 00000000..38ef267b --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectplan.go @@ -0,0 +1,73 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + applyconfigurationkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + scheme "github.com/kubesphere/kubeeye/clients/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// InspectPlansGetter has a method to return a InspectPlanInterface. +// A group's client should implement this interface. +type InspectPlansGetter interface { + InspectPlans() InspectPlanInterface +} + +// InspectPlanInterface has methods to work with InspectPlan resources. +type InspectPlanInterface interface { + Create(ctx context.Context, inspectPlan *kubeeyev1alpha2.InspectPlan, opts v1.CreateOptions) (*kubeeyev1alpha2.InspectPlan, error) + Update(ctx context.Context, inspectPlan *kubeeyev1alpha2.InspectPlan, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectPlan, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, inspectPlan *kubeeyev1alpha2.InspectPlan, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectPlan, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubeeyev1alpha2.InspectPlan, error) + List(ctx context.Context, opts v1.ListOptions) (*kubeeyev1alpha2.InspectPlanList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeeyev1alpha2.InspectPlan, err error) + Apply(ctx context.Context, inspectPlan *applyconfigurationkubeeyev1alpha2.InspectPlanApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectPlan, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, inspectPlan *applyconfigurationkubeeyev1alpha2.InspectPlanApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectPlan, err error) + InspectPlanExpansion +} + +// inspectPlans implements InspectPlanInterface +type inspectPlans struct { + *gentype.ClientWithListAndApply[*kubeeyev1alpha2.InspectPlan, *kubeeyev1alpha2.InspectPlanList, *applyconfigurationkubeeyev1alpha2.InspectPlanApplyConfiguration] +} + +// newInspectPlans returns a InspectPlans +func newInspectPlans(c *KubeeyeV1alpha2Client) *inspectPlans { + return &inspectPlans{ + gentype.NewClientWithListAndApply[*kubeeyev1alpha2.InspectPlan, *kubeeyev1alpha2.InspectPlanList, *applyconfigurationkubeeyev1alpha2.InspectPlanApplyConfiguration]( + "inspectplans", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *kubeeyev1alpha2.InspectPlan { return &kubeeyev1alpha2.InspectPlan{} }, + func() *kubeeyev1alpha2.InspectPlanList { return &kubeeyev1alpha2.InspectPlanList{} }, + ), + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectresult.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectresult.go new file mode 100644 index 00000000..8147ce69 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectresult.go @@ -0,0 +1,73 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + applyconfigurationkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + scheme "github.com/kubesphere/kubeeye/clients/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// InspectResultsGetter has a method to return a InspectResultInterface. +// A group's client should implement this interface. +type InspectResultsGetter interface { + InspectResults() InspectResultInterface +} + +// InspectResultInterface has methods to work with InspectResult resources. +type InspectResultInterface interface { + Create(ctx context.Context, inspectResult *kubeeyev1alpha2.InspectResult, opts v1.CreateOptions) (*kubeeyev1alpha2.InspectResult, error) + Update(ctx context.Context, inspectResult *kubeeyev1alpha2.InspectResult, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectResult, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, inspectResult *kubeeyev1alpha2.InspectResult, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectResult, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubeeyev1alpha2.InspectResult, error) + List(ctx context.Context, opts v1.ListOptions) (*kubeeyev1alpha2.InspectResultList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeeyev1alpha2.InspectResult, err error) + Apply(ctx context.Context, inspectResult *applyconfigurationkubeeyev1alpha2.InspectResultApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectResult, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, inspectResult *applyconfigurationkubeeyev1alpha2.InspectResultApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectResult, err error) + InspectResultExpansion +} + +// inspectResults implements InspectResultInterface +type inspectResults struct { + *gentype.ClientWithListAndApply[*kubeeyev1alpha2.InspectResult, *kubeeyev1alpha2.InspectResultList, *applyconfigurationkubeeyev1alpha2.InspectResultApplyConfiguration] +} + +// newInspectResults returns a InspectResults +func newInspectResults(c *KubeeyeV1alpha2Client) *inspectResults { + return &inspectResults{ + gentype.NewClientWithListAndApply[*kubeeyev1alpha2.InspectResult, *kubeeyev1alpha2.InspectResultList, *applyconfigurationkubeeyev1alpha2.InspectResultApplyConfiguration]( + "inspectresults", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *kubeeyev1alpha2.InspectResult { return &kubeeyev1alpha2.InspectResult{} }, + func() *kubeeyev1alpha2.InspectResultList { return &kubeeyev1alpha2.InspectResultList{} }, + ), + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectrule.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectrule.go new file mode 100644 index 00000000..d23c5af3 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspectrule.go @@ -0,0 +1,73 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + applyconfigurationkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + scheme "github.com/kubesphere/kubeeye/clients/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// InspectRulesGetter has a method to return a InspectRuleInterface. +// A group's client should implement this interface. +type InspectRulesGetter interface { + InspectRules() InspectRuleInterface +} + +// InspectRuleInterface has methods to work with InspectRule resources. +type InspectRuleInterface interface { + Create(ctx context.Context, inspectRule *kubeeyev1alpha2.InspectRule, opts v1.CreateOptions) (*kubeeyev1alpha2.InspectRule, error) + Update(ctx context.Context, inspectRule *kubeeyev1alpha2.InspectRule, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectRule, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, inspectRule *kubeeyev1alpha2.InspectRule, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectRule, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubeeyev1alpha2.InspectRule, error) + List(ctx context.Context, opts v1.ListOptions) (*kubeeyev1alpha2.InspectRuleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeeyev1alpha2.InspectRule, err error) + Apply(ctx context.Context, inspectRule *applyconfigurationkubeeyev1alpha2.InspectRuleApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectRule, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, inspectRule *applyconfigurationkubeeyev1alpha2.InspectRuleApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectRule, err error) + InspectRuleExpansion +} + +// inspectRules implements InspectRuleInterface +type inspectRules struct { + *gentype.ClientWithListAndApply[*kubeeyev1alpha2.InspectRule, *kubeeyev1alpha2.InspectRuleList, *applyconfigurationkubeeyev1alpha2.InspectRuleApplyConfiguration] +} + +// newInspectRules returns a InspectRules +func newInspectRules(c *KubeeyeV1alpha2Client) *inspectRules { + return &inspectRules{ + gentype.NewClientWithListAndApply[*kubeeyev1alpha2.InspectRule, *kubeeyev1alpha2.InspectRuleList, *applyconfigurationkubeeyev1alpha2.InspectRuleApplyConfiguration]( + "inspectrules", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *kubeeyev1alpha2.InspectRule { return &kubeeyev1alpha2.InspectRule{} }, + func() *kubeeyev1alpha2.InspectRuleList { return &kubeeyev1alpha2.InspectRuleList{} }, + ), + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspecttask.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspecttask.go new file mode 100644 index 00000000..be751694 --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/inspecttask.go @@ -0,0 +1,73 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + applyconfigurationkubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/applyconfiguration/kubeeye/v1alpha2" + scheme "github.com/kubesphere/kubeeye/clients/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// InspectTasksGetter has a method to return a InspectTaskInterface. +// A group's client should implement this interface. +type InspectTasksGetter interface { + InspectTasks() InspectTaskInterface +} + +// InspectTaskInterface has methods to work with InspectTask resources. +type InspectTaskInterface interface { + Create(ctx context.Context, inspectTask *kubeeyev1alpha2.InspectTask, opts v1.CreateOptions) (*kubeeyev1alpha2.InspectTask, error) + Update(ctx context.Context, inspectTask *kubeeyev1alpha2.InspectTask, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectTask, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, inspectTask *kubeeyev1alpha2.InspectTask, opts v1.UpdateOptions) (*kubeeyev1alpha2.InspectTask, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubeeyev1alpha2.InspectTask, error) + List(ctx context.Context, opts v1.ListOptions) (*kubeeyev1alpha2.InspectTaskList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeeyev1alpha2.InspectTask, err error) + Apply(ctx context.Context, inspectTask *applyconfigurationkubeeyev1alpha2.InspectTaskApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectTask, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, inspectTask *applyconfigurationkubeeyev1alpha2.InspectTaskApplyConfiguration, opts v1.ApplyOptions) (result *kubeeyev1alpha2.InspectTask, err error) + InspectTaskExpansion +} + +// inspectTasks implements InspectTaskInterface +type inspectTasks struct { + *gentype.ClientWithListAndApply[*kubeeyev1alpha2.InspectTask, *kubeeyev1alpha2.InspectTaskList, *applyconfigurationkubeeyev1alpha2.InspectTaskApplyConfiguration] +} + +// newInspectTasks returns a InspectTasks +func newInspectTasks(c *KubeeyeV1alpha2Client) *inspectTasks { + return &inspectTasks{ + gentype.NewClientWithListAndApply[*kubeeyev1alpha2.InspectTask, *kubeeyev1alpha2.InspectTaskList, *applyconfigurationkubeeyev1alpha2.InspectTaskApplyConfiguration]( + "inspecttasks", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *kubeeyev1alpha2.InspectTask { return &kubeeyev1alpha2.InspectTask{} }, + func() *kubeeyev1alpha2.InspectTaskList { return &kubeeyev1alpha2.InspectTaskList{} }, + ), + } +} diff --git a/clients/clientset/versioned/typed/kubeeye/v1alpha2/kubeeye_client.go b/clients/clientset/versioned/typed/kubeeye/v1alpha2/kubeeye_client.go new file mode 100644 index 00000000..fce6edaf --- /dev/null +++ b/clients/clientset/versioned/typed/kubeeye/v1alpha2/kubeeye_client.go @@ -0,0 +1,121 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + http "net/http" + + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + scheme "github.com/kubesphere/kubeeye/clients/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type KubeeyeV1alpha2Interface interface { + RESTClient() rest.Interface + InspectPlansGetter + InspectResultsGetter + InspectRulesGetter + InspectTasksGetter +} + +// KubeeyeV1alpha2Client is used to interact with features provided by the kubeeye group. +type KubeeyeV1alpha2Client struct { + restClient rest.Interface +} + +func (c *KubeeyeV1alpha2Client) InspectPlans() InspectPlanInterface { + return newInspectPlans(c) +} + +func (c *KubeeyeV1alpha2Client) InspectResults() InspectResultInterface { + return newInspectResults(c) +} + +func (c *KubeeyeV1alpha2Client) InspectRules() InspectRuleInterface { + return newInspectRules(c) +} + +func (c *KubeeyeV1alpha2Client) InspectTasks() InspectTaskInterface { + return newInspectTasks(c) +} + +// NewForConfig creates a new KubeeyeV1alpha2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*KubeeyeV1alpha2Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new KubeeyeV1alpha2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*KubeeyeV1alpha2Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &KubeeyeV1alpha2Client{client}, nil +} + +// NewForConfigOrDie creates a new KubeeyeV1alpha2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *KubeeyeV1alpha2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new KubeeyeV1alpha2Client for the given RESTClient. +func New(c rest.Interface) *KubeeyeV1alpha2Client { + return &KubeeyeV1alpha2Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := kubeeyev1alpha2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *KubeeyeV1alpha2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/clients/informers/externalversions/factory.go b/clients/informers/externalversions/factory.go new file mode 100644 index 00000000..ba15c616 --- /dev/null +++ b/clients/informers/externalversions/factory.go @@ -0,0 +1,261 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/kubesphere/kubeeye/clients/clientset/versioned" + internalinterfaces "github.com/kubesphere/kubeeye/clients/informers/externalversions/internalinterfaces" + kubeeye "github.com/kubesphere/kubeeye/clients/informers/externalversions/kubeeye" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + transform cache.TransformFunc + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + if f.shuttingDown { + return + } + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() + f.startedInformers[informerType] = true + } + } +} + +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + + Kubeeye() kubeeye.Interface +} + +func (f *sharedInformerFactory) Kubeeye() kubeeye.Interface { + return kubeeye.New(f, f.namespace, f.tweakListOptions) +} diff --git a/clients/informers/externalversions/generic.go b/clients/informers/externalversions/generic.go new file mode 100644 index 00000000..a5d5c424 --- /dev/null +++ b/clients/informers/externalversions/generic.go @@ -0,0 +1,67 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + fmt "fmt" + + v1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=kubeeye, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithResource("inspectplans"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeeye().V1alpha2().InspectPlans().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("inspectresults"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeeye().V1alpha2().InspectResults().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("inspectrules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeeye().V1alpha2().InspectRules().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("inspecttasks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Kubeeye().V1alpha2().InspectTasks().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/clients/informers/externalversions/internalinterfaces/factory_interfaces.go b/clients/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 00000000..c20c6f54 --- /dev/null +++ b/clients/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,39 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/kubesphere/kubeeye/clients/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/clients/informers/externalversions/kubeeye/interface.go b/clients/informers/externalversions/kubeeye/interface.go new file mode 100644 index 00000000..fb1aea7c --- /dev/null +++ b/clients/informers/externalversions/kubeeye/interface.go @@ -0,0 +1,45 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package kubeeye + +import ( + internalinterfaces "github.com/kubesphere/kubeeye/clients/informers/externalversions/internalinterfaces" + v1alpha2 "github.com/kubesphere/kubeeye/clients/informers/externalversions/kubeeye/v1alpha2" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha2 provides access to shared informers for resources in V1alpha2. + V1alpha2() v1alpha2.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha2 returns a new v1alpha2.Interface. +func (g *group) V1alpha2() v1alpha2.Interface { + return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/clients/informers/externalversions/kubeeye/v1alpha2/inspectplan.go b/clients/informers/externalversions/kubeeye/v1alpha2/inspectplan.go new file mode 100644 index 00000000..277535a9 --- /dev/null +++ b/clients/informers/externalversions/kubeeye/v1alpha2/inspectplan.go @@ -0,0 +1,88 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + time "time" + + apiskubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + versioned "github.com/kubesphere/kubeeye/clients/clientset/versioned" + internalinterfaces "github.com/kubesphere/kubeeye/clients/informers/externalversions/internalinterfaces" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/listers/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InspectPlanInformer provides access to a shared informer and lister for +// InspectPlans. +type InspectPlanInformer interface { + Informer() cache.SharedIndexInformer + Lister() kubeeyev1alpha2.InspectPlanLister +} + +type inspectPlanInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInspectPlanInformer constructs a new informer for InspectPlan type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInspectPlanInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInspectPlanInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInspectPlanInformer constructs a new informer for InspectPlan type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInspectPlanInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectPlans().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectPlans().Watch(context.TODO(), options) + }, + }, + &apiskubeeyev1alpha2.InspectPlan{}, + resyncPeriod, + indexers, + ) +} + +func (f *inspectPlanInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInspectPlanInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inspectPlanInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiskubeeyev1alpha2.InspectPlan{}, f.defaultInformer) +} + +func (f *inspectPlanInformer) Lister() kubeeyev1alpha2.InspectPlanLister { + return kubeeyev1alpha2.NewInspectPlanLister(f.Informer().GetIndexer()) +} diff --git a/clients/informers/externalversions/kubeeye/v1alpha2/inspectresult.go b/clients/informers/externalversions/kubeeye/v1alpha2/inspectresult.go new file mode 100644 index 00000000..230f5cfd --- /dev/null +++ b/clients/informers/externalversions/kubeeye/v1alpha2/inspectresult.go @@ -0,0 +1,88 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + time "time" + + apiskubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + versioned "github.com/kubesphere/kubeeye/clients/clientset/versioned" + internalinterfaces "github.com/kubesphere/kubeeye/clients/informers/externalversions/internalinterfaces" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/listers/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InspectResultInformer provides access to a shared informer and lister for +// InspectResults. +type InspectResultInformer interface { + Informer() cache.SharedIndexInformer + Lister() kubeeyev1alpha2.InspectResultLister +} + +type inspectResultInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInspectResultInformer constructs a new informer for InspectResult type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInspectResultInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInspectResultInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInspectResultInformer constructs a new informer for InspectResult type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInspectResultInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectResults().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectResults().Watch(context.TODO(), options) + }, + }, + &apiskubeeyev1alpha2.InspectResult{}, + resyncPeriod, + indexers, + ) +} + +func (f *inspectResultInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInspectResultInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inspectResultInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiskubeeyev1alpha2.InspectResult{}, f.defaultInformer) +} + +func (f *inspectResultInformer) Lister() kubeeyev1alpha2.InspectResultLister { + return kubeeyev1alpha2.NewInspectResultLister(f.Informer().GetIndexer()) +} diff --git a/clients/informers/externalversions/kubeeye/v1alpha2/inspectrule.go b/clients/informers/externalversions/kubeeye/v1alpha2/inspectrule.go new file mode 100644 index 00000000..dda946b5 --- /dev/null +++ b/clients/informers/externalversions/kubeeye/v1alpha2/inspectrule.go @@ -0,0 +1,88 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + time "time" + + apiskubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + versioned "github.com/kubesphere/kubeeye/clients/clientset/versioned" + internalinterfaces "github.com/kubesphere/kubeeye/clients/informers/externalversions/internalinterfaces" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/listers/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InspectRuleInformer provides access to a shared informer and lister for +// InspectRules. +type InspectRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() kubeeyev1alpha2.InspectRuleLister +} + +type inspectRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInspectRuleInformer constructs a new informer for InspectRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInspectRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInspectRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInspectRuleInformer constructs a new informer for InspectRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInspectRuleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectRules().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectRules().Watch(context.TODO(), options) + }, + }, + &apiskubeeyev1alpha2.InspectRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *inspectRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInspectRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inspectRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiskubeeyev1alpha2.InspectRule{}, f.defaultInformer) +} + +func (f *inspectRuleInformer) Lister() kubeeyev1alpha2.InspectRuleLister { + return kubeeyev1alpha2.NewInspectRuleLister(f.Informer().GetIndexer()) +} diff --git a/clients/informers/externalversions/kubeeye/v1alpha2/inspecttask.go b/clients/informers/externalversions/kubeeye/v1alpha2/inspecttask.go new file mode 100644 index 00000000..705cf753 --- /dev/null +++ b/clients/informers/externalversions/kubeeye/v1alpha2/inspecttask.go @@ -0,0 +1,88 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + context "context" + time "time" + + apiskubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + versioned "github.com/kubesphere/kubeeye/clients/clientset/versioned" + internalinterfaces "github.com/kubesphere/kubeeye/clients/informers/externalversions/internalinterfaces" + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/clients/listers/kubeeye/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InspectTaskInformer provides access to a shared informer and lister for +// InspectTasks. +type InspectTaskInformer interface { + Informer() cache.SharedIndexInformer + Lister() kubeeyev1alpha2.InspectTaskLister +} + +type inspectTaskInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInspectTaskInformer constructs a new informer for InspectTask type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInspectTaskInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInspectTaskInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInspectTaskInformer constructs a new informer for InspectTask type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInspectTaskInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectTasks().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KubeeyeV1alpha2().InspectTasks().Watch(context.TODO(), options) + }, + }, + &apiskubeeyev1alpha2.InspectTask{}, + resyncPeriod, + indexers, + ) +} + +func (f *inspectTaskInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInspectTaskInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *inspectTaskInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiskubeeyev1alpha2.InspectTask{}, f.defaultInformer) +} + +func (f *inspectTaskInformer) Lister() kubeeyev1alpha2.InspectTaskLister { + return kubeeyev1alpha2.NewInspectTaskLister(f.Informer().GetIndexer()) +} diff --git a/clients/informers/externalversions/kubeeye/v1alpha2/interface.go b/clients/informers/externalversions/kubeeye/v1alpha2/interface.go new file mode 100644 index 00000000..4377de05 --- /dev/null +++ b/clients/informers/externalversions/kubeeye/v1alpha2/interface.go @@ -0,0 +1,65 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + internalinterfaces "github.com/kubesphere/kubeeye/clients/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // InspectPlans returns a InspectPlanInformer. + InspectPlans() InspectPlanInformer + // InspectResults returns a InspectResultInformer. + InspectResults() InspectResultInformer + // InspectRules returns a InspectRuleInformer. + InspectRules() InspectRuleInformer + // InspectTasks returns a InspectTaskInformer. + InspectTasks() InspectTaskInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// InspectPlans returns a InspectPlanInformer. +func (v *version) InspectPlans() InspectPlanInformer { + return &inspectPlanInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// InspectResults returns a InspectResultInformer. +func (v *version) InspectResults() InspectResultInformer { + return &inspectResultInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// InspectRules returns a InspectRuleInformer. +func (v *version) InspectRules() InspectRuleInformer { + return &inspectRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// InspectTasks returns a InspectTaskInformer. +func (v *version) InspectTasks() InspectTaskInformer { + return &inspectTaskInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/clients/listers/kubeeye/v1alpha2/expansion_generated.go b/clients/listers/kubeeye/v1alpha2/expansion_generated.go new file mode 100644 index 00000000..bc2cb57b --- /dev/null +++ b/clients/listers/kubeeye/v1alpha2/expansion_generated.go @@ -0,0 +1,34 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +// InspectPlanListerExpansion allows custom methods to be added to +// InspectPlanLister. +type InspectPlanListerExpansion interface{} + +// InspectResultListerExpansion allows custom methods to be added to +// InspectResultLister. +type InspectResultListerExpansion interface{} + +// InspectRuleListerExpansion allows custom methods to be added to +// InspectRuleLister. +type InspectRuleListerExpansion interface{} + +// InspectTaskListerExpansion allows custom methods to be added to +// InspectTaskLister. +type InspectTaskListerExpansion interface{} diff --git a/clients/listers/kubeeye/v1alpha2/inspectplan.go b/clients/listers/kubeeye/v1alpha2/inspectplan.go new file mode 100644 index 00000000..b9a21494 --- /dev/null +++ b/clients/listers/kubeeye/v1alpha2/inspectplan.go @@ -0,0 +1,47 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// InspectPlanLister helps list InspectPlans. +// All objects returned here must be treated as read-only. +type InspectPlanLister interface { + // List lists all InspectPlans in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*kubeeyev1alpha2.InspectPlan, err error) + // Get retrieves the InspectPlan from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*kubeeyev1alpha2.InspectPlan, error) + InspectPlanListerExpansion +} + +// inspectPlanLister implements the InspectPlanLister interface. +type inspectPlanLister struct { + listers.ResourceIndexer[*kubeeyev1alpha2.InspectPlan] +} + +// NewInspectPlanLister returns a new InspectPlanLister. +func NewInspectPlanLister(indexer cache.Indexer) InspectPlanLister { + return &inspectPlanLister{listers.New[*kubeeyev1alpha2.InspectPlan](indexer, kubeeyev1alpha2.Resource("inspectplan"))} +} diff --git a/clients/listers/kubeeye/v1alpha2/inspectresult.go b/clients/listers/kubeeye/v1alpha2/inspectresult.go new file mode 100644 index 00000000..fdff0d1c --- /dev/null +++ b/clients/listers/kubeeye/v1alpha2/inspectresult.go @@ -0,0 +1,47 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// InspectResultLister helps list InspectResults. +// All objects returned here must be treated as read-only. +type InspectResultLister interface { + // List lists all InspectResults in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*kubeeyev1alpha2.InspectResult, err error) + // Get retrieves the InspectResult from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*kubeeyev1alpha2.InspectResult, error) + InspectResultListerExpansion +} + +// inspectResultLister implements the InspectResultLister interface. +type inspectResultLister struct { + listers.ResourceIndexer[*kubeeyev1alpha2.InspectResult] +} + +// NewInspectResultLister returns a new InspectResultLister. +func NewInspectResultLister(indexer cache.Indexer) InspectResultLister { + return &inspectResultLister{listers.New[*kubeeyev1alpha2.InspectResult](indexer, kubeeyev1alpha2.Resource("inspectresult"))} +} diff --git a/clients/listers/kubeeye/v1alpha2/inspectrule.go b/clients/listers/kubeeye/v1alpha2/inspectrule.go new file mode 100644 index 00000000..5fcbe306 --- /dev/null +++ b/clients/listers/kubeeye/v1alpha2/inspectrule.go @@ -0,0 +1,47 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// InspectRuleLister helps list InspectRules. +// All objects returned here must be treated as read-only. +type InspectRuleLister interface { + // List lists all InspectRules in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*kubeeyev1alpha2.InspectRule, err error) + // Get retrieves the InspectRule from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*kubeeyev1alpha2.InspectRule, error) + InspectRuleListerExpansion +} + +// inspectRuleLister implements the InspectRuleLister interface. +type inspectRuleLister struct { + listers.ResourceIndexer[*kubeeyev1alpha2.InspectRule] +} + +// NewInspectRuleLister returns a new InspectRuleLister. +func NewInspectRuleLister(indexer cache.Indexer) InspectRuleLister { + return &inspectRuleLister{listers.New[*kubeeyev1alpha2.InspectRule](indexer, kubeeyev1alpha2.Resource("inspectrule"))} +} diff --git a/clients/listers/kubeeye/v1alpha2/inspecttask.go b/clients/listers/kubeeye/v1alpha2/inspecttask.go new file mode 100644 index 00000000..53db7a54 --- /dev/null +++ b/clients/listers/kubeeye/v1alpha2/inspecttask.go @@ -0,0 +1,47 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + kubeeyev1alpha2 "github.com/kubesphere/kubeeye/apis/kubeeye/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// InspectTaskLister helps list InspectTasks. +// All objects returned here must be treated as read-only. +type InspectTaskLister interface { + // List lists all InspectTasks in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*kubeeyev1alpha2.InspectTask, err error) + // Get retrieves the InspectTask from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*kubeeyev1alpha2.InspectTask, error) + InspectTaskListerExpansion +} + +// inspectTaskLister implements the InspectTaskLister interface. +type inspectTaskLister struct { + listers.ResourceIndexer[*kubeeyev1alpha2.InspectTask] +} + +// NewInspectTaskLister returns a new InspectTaskLister. +func NewInspectTaskLister(indexer cache.Indexer) InspectTaskLister { + return &inspectTaskLister{listers.New[*kubeeyev1alpha2.InspectTask](indexer, kubeeyev1alpha2.Resource("inspecttask"))} +}