diff --git a/.golangci.yaml b/.golangci.yaml index 0a7781dc..c8f92f69 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,31 +1,43 @@ run: + concurrency: 4 + allow-parallel-runners: true timeout: 5m linters: + # temporarily disabled linters + disable: + - funlen + - goconst + - lll + enable: - - ineffassign - - misspell - - goimports - - govet + - asciicheck + - dogsled + - durationcheck + - dupl + - errcheck + - forcetypeassert + - gocyclo + - godot - gofmt - goimports - - godot - - predeclared - - unconvert - - whitespace - - unused - - unconvert - - dogsled + - goprintffuncname + - gosimple + - govet + - importas + - ineffassign - misspell + - nakedret - paralleltest - prealloc - - importas - - asciicheck + - predeclared + - staticcheck - stylecheck - - durationcheck + - typecheck + - unconvert - unparam - - goprintffuncname - - forcetypeassert + - unused + - whitespace severity: default-severity: error @@ -43,3 +55,18 @@ issues: - path: _gen\.go linters: - typecheck + - path: _test\.go + linters: + - dupl + - funlen + - lll + - goconst + - path: track_controller.go + linters: + - dupl + - path: constants + linters: + - lll + - linters: + - lll + source: "^// [+]kubebuilder" diff --git a/Dockerfile b/Dockerfile index b0710194..9df157f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN --mount=type=ssh --mount=type=secret,id=github_pat GITHUB_PAT_PATH=/run/secr # Copy the go source COPY main.go main.go COPY apis/ apis/ -COPY applyconfiguration/ applyconfiguration/ +COPY client/applyconfiguration/ client/applyconfiguration/ COPY common/ common/ COPY controllers/ controllers/ COPY domain/ domain/ diff --git a/Makefile b/Makefile index a4e9ee94..382565e1 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,6 @@ IMG ?= controller:latest CRD_OPTIONS ?= "crd" # Docker image name for the mkdocs based local development setup IMAGE=metal-api/documentation -# Kubebuilder assets version used to run testing environment -KUBE_VERSION ?= 1.28.3 -# Vgopath version -VGOPATH_VERSION ?= v0.1.3 -# Models schema version -MODELS_SCHEMA_VERSION ?= v0.1.1 -# Controller tools version -CONTROLLER_TOOLS_VERSION ?= v0.13.0 -# Code generator version -CODE_GENERATOR_VERSION ?= v0.28.4 GOPRIVATE ?= "github.com/onmetal/*" @@ -65,36 +55,46 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases .PHONY: generate -generate: controller-gen vgopath openapi-gen models-schema applyconfiguration-gen ## Generate DeepCopy, DeepCopyInto, and DeepCopyObject method implementations and applyconfiguration. - $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." +generate: vgopath openapi-gen models-schema applyconfiguration-gen deepcopy-gen client-gen ## Generate DeepCopy, DeepCopyInto, and DeepCopyObject method implementations and applyconfiguration. + @VGOPATH=$(VGOPATH) \ + MODELS_SCHEMA=$(MODELS_SCHEMA) \ + DEEPCOPY_GEN=$(DEEPCOPY_GEN) \ + CLIENT_GEN=$(CLIENT_GEN) \ + OPENAPI_GEN=$(OPENAPI_GEN) \ + APPLYCONFIGURATION_GEN=$(APPLYCONFIGURATION_GEN) \ hack/generate.sh .PHONY: fmt -fmt: ## Run go fmt against code. +fmt: goimports go fmt ./... + $(GOIMPORTS) -w . .PHONY: vet vet: ## Run go vet against code. go vet ./... .PHONY: lint -lint: - golangci-lint run ./... +lint: golangci-lint + $(GOLANGCI_LINT) run -.PHONY: addlicense -addlicense: ## Add license headers to all go files. - find . -name '*.go' -exec go run github.com/google/addlicense -c 'OnMetal authors' {} + +.PHONY: lint-fix +lint-fix: golangci-lint + $(GOLANGCI_LINT) run --fix + +.PHONY: add-license +add-license: addlicense ## Add license header to all .go files in project + @find . -name '*.go' -exec $(ADDLICENSE) -f hack/license-header.txt {} + -.PHONY: checklicense -checklicense: ## Check that every file has a license header present. - find . -name '*.go' -exec go run github.com/google/addlicense -check -c 'OnMetal authors' {} + +.PHONY: check-license +check-license: addlicense ## Check license header presence in all .go files in project + @find . -name '*.go' -exec $(ADDLICENSE) -check -c 'IronCore authors' {} + .PHONY: check -check: manifests generate addlicense lint test # Generate manifests, code, lint, add licenses, test +check: manifests generate add-license lint test # Generate manifests, code, lint, add licenses, test .PHONY: docs -docs: ## Run go generate to generate API reference documentation. - go generate ./... +docs: gen-crd-api-reference-docs ## Run go generate to generate API reference documentation. + $(GEN_CRD_API_REFERENCE_DOCS) -api-dir ./apis/metal/v1alpha4 -config ./hack/api-reference/template.json -template-dir ./hack/api-reference/template -out-file ./docs/api-reference/metal.md .PHONY: start-docs start-docs: ## Start the local mkdocs based development environment. @@ -105,10 +105,9 @@ start-docs: ## Start the local mkdocs based development environment. clean-docs: ## Remove all local mkdocs Docker images (cleanup). docker container prune --force --filter "label=project=metal_api_documentation" -ENVTEST_ASSETS_DIR=$(shell pwd)/testbin .PHONY: test -test: manifests generate fmt vet ## Run tests. - source $(shell pwd)/hack/setup-envtest.sh; VERSION=${KUBE_VERSION} fetch_envtest_tools; VERSION=${KUBE_VERSION} setup_envtest_env; \ +test: envtest + @KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" \ KUBEBUILDER_CONTROLPLANE_START_TIMEOUT=600s KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT=600s go test ./... -coverprofile cover.out ##@ Build @@ -148,41 +147,105 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) build config/default | kubectl delete -f - -CONTROLLER_GEN = $(shell pwd)/bin/controller-gen +### AUXILIARY ### +LOCAL_BIN ?= $(shell pwd)/bin +$(LOCAL_BIN): + mkdir -p $(LOCAL_BIN) + +## Tools locations +ADDLICENSE ?= $(LOCAL_BIN)/addlicense +CONTROLLER_GEN ?= $(LOCAL_BIN)/controller-gen +GOLANGCI_LINT ?= $(LOCAL_BIN)/golangci-lint +GOIMPORTS ?= $(LOCAL_BIN)/goimports +ENVTEST ?= $(LOCAL_BIN)/setup-envtest +DEEPCOPY_GEN ?= $(LOCAL_BIN)/deepcopy-gen +CLIENT_GEN ?= $(LOCAL_BIN)/client-gen +LISTER_GEN ?= $(LOCAL_BIN)/lister-gen +INFORMER_GEN ?= $(LOCAL_BIN)/informer-gen +DEFAULTER_GEN ?= $(LOCAL_BIN)/defaulter-gen +CONVERSION_GEN ?= $(LOCAL_BIN)/conversion-gen +OPENAPI_GEN ?= $(LOCAL_BIN)/openapi-gen +APPLYCONFIGURATION_GEN ?= $(LOCAL_BIN)/applyconfiguration-gen +MODELS_SCHEMA ?= $(LOCAL_BIN)/models-schema +VGOPATH ?= $(LOCAL_BIN)/vgopath +GEN_CRD_API_REFERENCE_DOCS ?= $(LOCAL_BIN)/gen-crd-api-reference-docs +KUSTOMIZE ?= $(LOCAL_BIN)/kustomize + +## Tools versions +ADDLICENSE_VERSION ?= v1.1.1 +CONTROLLER_GEN_VERSION ?= v0.13.0 +GOLANGCI_LINT_VERSION ?= v1.55.2 +GOIMPORTS_VERSION ?= v0.16.1 +ENVTEST_K8S_VERSION ?= 1.28.3 +CODE_GENERATOR_VERSION ?= v0.28.3 +VGOPATH_VERSION ?= v0.1.3 +MODELS_SCHEMA_VERSION ?= main +GEN_CRD_API_REFERENCE_DOCS_VERSION ?= v0.3.0 +KUSTOMIZE_VERSION ?= v4.5.4 + +.PHONY: addlicense +addlicense: $(ADDLICENSE) +$(ADDLICENSE): $(LOCAL_BIN) + @test -s $(ADDLICENSE) || GOBIN=$(LOCAL_BIN) go install github.com/google/addlicense@$(ADDLICENSE_VERSION) + .PHONY: controller-gen -controller-gen: ## Download controller-gen locally if necessary. - $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)) +controller-gen: $(CONTROLLER_GEN) +$(CONTROLLER_GEN): $(LOCAL_BIN) + @test -s $(CONTROLLER_GEN) && $(CONTROLLER_GEN) --version | grep -q $(CONTROLLER_GEN_VERSION) || \ + GOBIN=$(LOCAL_BIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) + +.PHONY: golangci-lint +golangci-lint: $(GOLANGCI_LINT) +$(GOLANGCI_LINT): $(LOCAL_BIN) + @test -s $(GOLANGCI_LINT) && $(GOLANGCI_LINT) --version | grep -q $(GOLANGCI_LINT_VERSION) || \ + GOBIN=$(LOCAL_BIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) + +.PHONY: goimports +goimports: $(GOIMPORTS) +$(GOIMPORTS): $(LOCAL_BIN) + @test -s $(GOIMPORTS) || GOBIN=$(LOCAL_BIN) go install golang.org/x/tools/cmd/goimports@$(GOIMPORTS_VERSION) + +.PHONY: envtest +envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. +$(ENVTEST): $(LOCAL_BIN) + @test -s $(ENVTEST) || GOBIN=$(LOCAL_BIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest -VGOPATH = $(shell pwd)/bin/vgopath .PHONY: vgopath -vgopath: ## Download vgopath locally if necessary. - $(call go-get-tool,$(VGOPATH),github.com/ironcore-dev/vgopath@$(VGOPATH_VERSION)) +vgopath: $(VGOPATH) +$(VGOPATH): $(LOCAL_BIN) + @test -s $(VGOPATH) || GOBIN=$(LOCAL_BIN) go install github.com/ironcore-dev/vgopath@$(VGOPATH_VERSION) + +.PHONY: deepcopy-gen +deepcopy-gen: $(DEEPCOPY_GEN) +$(DEEPCOPY_GEN): $(LOCAL_BIN) + @test -s $(DEEPCOPY_GEN) || GOBIN=$(LOCAL_BIN) go install k8s.io/code-generator/cmd/deepcopy-gen@$(CODE_GENERATOR_VERSION) -OPENAPI_GEN = $(shell pwd)/bin/openapi-gen .PHONY: openapi-gen -openapi-gen: ## Download openapi-gen locally if necessary. - $(call go-get-tool,$(OPENAPI_GEN),k8s.io/code-generator/cmd/openapi-gen@$(CODE_GENERATOR_VERSION)) +openapi-gen: $(OPENAPI_GEN) +$(OPENAPI_GEN): $(LOCAL_BIN) + @test -s $(OPENAPI_GEN) || GOBIN=$(LOCAL_BIN) go install k8s.io/code-generator/cmd/openapi-gen@$(CODE_GENERATOR_VERSION) -MODELS_SCHEMA = $(shell pwd)/bin/models-schema .PHONY: models-schema -models-schema: ## Download models-schema locally if necessary. - $(call go-get-tool,$(MODELS_SCHEMA),github.com/onmetal/onmetal-api/models-schema@$(MODELS_SCHEMA_VERSION)) +models-schema: $(MODELS_SCHEMA) +$(MODELS_SCHEMA): $(LOCALBIN) + @test -s $(MODELS_SCHEMA) || GOBIN=$(LOCAL_BIN) go install github.com/ironcore-dev/ironcore/models-schema@$(MODELS_SCHEMA_VERSION) + +.PHONY: gen-crd-api-reference-docs +gen-crd-api-reference-docs: $(GEN_CRD_API_REFERENCE_DOCS) ## Download gen-crd-api-reference-docs locally if necessary. +$(GEN_CRD_API_REFERENCE_DOCS): $(LOCAL_BIN) + @test -s $(GEN_CRD_API_REFERENCE_DOCS) || GOBIN=$(LOCAL_BIN) go install github.com/ahmetb/gen-crd-api-reference-docs@$(GEN_CRD_API_REFERENCE_DOCS_VERSION) -APPLYCONFIGURATION_GEN = $(shell pwd)/bin/applyconfiguration-gen .PHONY: applyconfiguration-gen -applyconfiguration-gen: ## Download applyconfiguration-gen locally if necessary. - $(call go-get-tool,$(APPLYCONFIGURATION_GEN),k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODE_GENERATOR_VERSION)) +applyconfiguration-gen: $(APPLYCONFIGURATION_GEN) ## Download applyconfiguration-gen locally if necessary. +$(APPLYCONFIGURATION_GEN): $(LOCALBIN) + @test -s $(APPLYCONFIGURATION_GEN) || GOBIN=$(LOCAL_BIN) go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODE_GENERATOR_VERSION) + +.PHONY: client-gen +client-gen: $(CLIENT_GEN) ## Download client-gen locally if necessary. +$(CLIENT_GEN): $(LOCALBIN) + @test -s $(CLIENT_GEN) || GOBIN=$(LOCAL_BIN) go install k8s.io/code-generator/cmd/client-gen@$(CODE_GENERATOR_VERSION) -KUSTOMIZE = $(shell pwd)/bin/kustomize .PHONY: kustomize -kustomize: ## Download kustomize locally if necessary. - $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.4) - -# go-get-tool will 'go install' any package $2 and install it to $1. -PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) -define go-get-tool -@[ -f $(1) ] || { \ -set -e ; \ -GOBIN=$(PROJECT_DIR)/bin go install $(2) ; \ -} -endef +kustomize: $(KUSTOMIZE) +$(KUSTOMIZE): $(LOCAL_BIN) + @test -s $(KUSTOMIZE) || GOBIN=$(LOCAL_BIN) go install sigs.k8s.io/kustomize/kustomize/v4@$(KUSTOMIZE_VERSION) diff --git a/apis/metal/v1alpha4/aggregate_types.go b/apis/metal/v1alpha4/aggregate_types.go index 8045091c..ea1d0010 100644 --- a/apis/metal/v1alpha4/aggregate_types.go +++ b/apis/metal/v1alpha4/aggregate_types.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -58,6 +45,7 @@ type AggregateStatus struct{} // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // Aggregate is the Schema for the aggregates API. @@ -70,6 +58,7 @@ type Aggregate struct { } // +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // AggregateList contains a list of Aggregate. type AggregateList struct { diff --git a/apis/metal/v1alpha4/aggregate_webhook.go b/apis/metal/v1alpha4/aggregate_webhook.go index 30dd50ce..458c10f9 100644 --- a/apis/metal/v1alpha4/aggregate_webhook.go +++ b/apis/metal/v1alpha4/aggregate_webhook.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/aggregate_webhook_test.go b/apis/metal/v1alpha4/aggregate_webhook_test.go index 1d0b921e..cab63c1c 100644 --- a/apis/metal/v1alpha4/aggregate_webhook_test.go +++ b/apis/metal/v1alpha4/aggregate_webhook_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/aggregationresults_types.go b/apis/metal/v1alpha4/aggregationresults_types.go index 17d421c7..8630fdff 100644 --- a/apis/metal/v1alpha4/aggregationresults_types.go +++ b/apis/metal/v1alpha4/aggregationresults_types.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/benchmark_types.go b/apis/metal/v1alpha4/benchmark_types.go index f0675dc5..04598e50 100644 --- a/apis/metal/v1alpha4/benchmark_types.go +++ b/apis/metal/v1alpha4/benchmark_types.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -53,6 +40,7 @@ type BenchmarkDeviation struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // Benchmark is the Schema for the machines API. diff --git a/apis/metal/v1alpha4/common_types.go b/apis/metal/v1alpha4/common_types.go index bce829d5..1c27d27b 100644 --- a/apis/metal/v1alpha4/common_types.go +++ b/apis/metal/v1alpha4/common_types.go @@ -1,18 +1,5 @@ -/* -Copyright 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/constraint_types.go b/apis/metal/v1alpha4/constraint_types.go index 73d90710..a4b84251 100644 --- a/apis/metal/v1alpha4/constraint_types.go +++ b/apis/metal/v1alpha4/constraint_types.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/constraintval_types.go b/apis/metal/v1alpha4/constraintval_types.go index 5970e75f..31c1175b 100644 --- a/apis/metal/v1alpha4/constraintval_types.go +++ b/apis/metal/v1alpha4/constraintval_types.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/doc.go b/apis/metal/v1alpha4/doc.go index 7089aaa3..973e5322 100644 --- a/apis/metal/v1alpha4/doc.go +++ b/apis/metal/v1alpha4/doc.go @@ -1,18 +1,5 @@ -/* -Copyright 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // +k8s:deepcopy-gen=package // +k8s:openapi-gen=true diff --git a/apis/metal/v1alpha4/funcs.go b/apis/metal/v1alpha4/funcs.go index bdf58770..35886aa1 100644 --- a/apis/metal/v1alpha4/funcs.go +++ b/apis/metal/v1alpha4/funcs.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/funcs_test.go b/apis/metal/v1alpha4/funcs_test.go index 0675b41d..b5949d1a 100644 --- a/apis/metal/v1alpha4/funcs_test.go +++ b/apis/metal/v1alpha4/funcs_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/groupversion_info.go b/apis/metal/v1alpha4/groupversion_info.go index 8418a38f..d8cec24e 100644 --- a/apis/metal/v1alpha4/groupversion_info.go +++ b/apis/metal/v1alpha4/groupversion_info.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Package v1alpha4 contains API Schema definitions for the switch v1beta1 API group // +kubebuilder:object:generate=true diff --git a/apis/metal/v1alpha4/inventory_types.go b/apis/metal/v1alpha4/inventory_types.go index dec7bf1a..74596266 100644 --- a/apis/metal/v1alpha4/inventory_types.go +++ b/apis/metal/v1alpha4/inventory_types.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -420,6 +407,7 @@ type InventoryStatuses struct { // +kubebuilder:printcolumn:name="Disks",type=string,JSONPath=`.status.computed.default.blocks.count`,description="Hardware disk count" // +kubebuilder:printcolumn:name="Storage",type=string,JSONPath=`.status.computed.default.blocks.capacity`,description="Total amount of disk capacity" // +kubebuilder:printcolumn:name="NICs",type=string,JSONPath=`.status.computed.default.nics.count`,description="Total amount of hardware network interfaces" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // Inventory is the Schema for the inventories API. @@ -432,6 +420,7 @@ type Inventory struct { } // +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // InventoryList contains a list of Inventory. type InventoryList struct { diff --git a/apis/metal/v1alpha4/jsonpath_types.go b/apis/metal/v1alpha4/jsonpath_types.go index 6a21f256..3fe48858 100644 --- a/apis/metal/v1alpha4/jsonpath_types.go +++ b/apis/metal/v1alpha4/jsonpath_types.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/machine_types.go b/apis/metal/v1alpha4/machine_types.go index b8b0927d..1abcfd52 100644 --- a/apis/metal/v1alpha4/machine_types.go +++ b/apis/metal/v1alpha4/machine_types.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -204,6 +191,7 @@ type ResourceReference struct { // +kubebuilder:printcolumn:name="Redundancy",type=string,JSONPath=`.status.network.redundancy` // +kubebuilder:printcolumn:name="Reservation Status",type=string,JSONPath=`.status.reservation.status` // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // Machine - is the data structure for a Machine resource. @@ -217,6 +205,7 @@ type Machine struct { } // +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // MachineList - contains a list of Machine. type MachineList struct { diff --git a/apis/metal/v1alpha4/switch_test.go b/apis/metal/v1alpha4/networkswitch_test.go similarity index 93% rename from apis/metal/v1alpha4/switch_test.go rename to apis/metal/v1alpha4/networkswitch_test.go index 3ce1aef6..e9ecc201 100644 --- a/apis/metal/v1alpha4/switch_test.go +++ b/apis/metal/v1alpha4/networkswitch_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/switch_types.go b/apis/metal/v1alpha4/networkswitch_types.go similarity index 98% rename from apis/metal/v1alpha4/switch_types.go rename to apis/metal/v1alpha4/networkswitch_types.go index dae2b41c..775aa3e9 100644 --- a/apis/metal/v1alpha4/switch_types.go +++ b/apis/metal/v1alpha4/networkswitch_types.go @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - * - * 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. - */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -271,6 +258,7 @@ type ConditionSpec struct { // +kubebuilder:printcolumn:name="Layer",type=integer,JSONPath=`.status.layer`,description="Vertical level in switches' connections hierarchy" // +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`,description="NetworkSwitch state" // +kubebuilder:printcolumn:name="Message",priority=1,type=string,JSONPath=`.status.message`,description="NetworkSwitch state message reports about any issues during processing" +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // NetworkSwitch is the Schema for switches API. @@ -283,6 +271,7 @@ type NetworkSwitch struct { } // +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // NetworkSwitchList contains a list of NetworkSwitch. type NetworkSwitchList struct { diff --git a/apis/metal/v1alpha4/switch_webhook.go b/apis/metal/v1alpha4/networkswitch_webhook.go similarity index 83% rename from apis/metal/v1alpha4/switch_webhook.go rename to apis/metal/v1alpha4/networkswitch_webhook.go index e8e22055..ed09db17 100644 --- a/apis/metal/v1alpha4/switch_webhook.go +++ b/apis/metal/v1alpha4/networkswitch_webhook.go @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - * - * 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. - */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -43,7 +30,7 @@ var switchlog = logf.Log.WithName("networkswitch-resource") // - if no inventoried label then inventory-ref label is not allowed // - inventoried label can be only "false" or "true" // - inventory-ref label can be only valid UUID. -func validateInventoryLabels(switchObject *NetworkSwitch) (err error) { +func validateInventoryLabels(switchObject *NetworkSwitch) error { inventoried, inventoriedOk := switchObject.Labels["metal.ironcore.dev/inventoried"] if !inventoriedOk { @@ -56,7 +43,7 @@ which does not contain reference to Inventory object in .spec.inventoryRef.name } inventoryRef := switchObject.Spec.InventoryRef.Name - _, err = uuid.Parse(inventoryRef) + _, err := uuid.Parse(inventoryRef) if err != nil { return fmt.Errorf(".spec.inventoryRef label must be a valid UUID, but current value is %s", inventoryRef) } @@ -71,13 +58,13 @@ which does not contain reference to Inventory object in .spec.inventoryRef.name // validateOverrides validates switch interface overrides with following conditions: // MTU, FEC, Lanes can be only set for non-north interfaces. -func validateOverrides(currentState *NetworkSwitch, newState *NetworkSwitch) (err error) { +func validateOverrides(currentState *NetworkSwitch, newState *NetworkSwitch) error { var errList field.ErrorList if newState.Spec.Interfaces == nil { - return + return nil } if newState.Spec.Interfaces.Overrides == nil { - return + return nil } newInterfaces := newState.Spec.Interfaces.Overrides currentInterfaces := currentState.Status.Interfaces @@ -87,16 +74,16 @@ func validateOverrides(currentState *NetworkSwitch, newState *NetworkSwitch) (er "interface override webhook", "Current switch object does not contain interfaces information in its Status, looks like it was just created, skipping validation", currentState.Name) - return + return nil } for _, newInterface := range newInterfaces { currentInterface, ok := currentInterfaces[newInterface.GetName()] if !ok { - err = errors.Errorf( + err := errors.Errorf( "%s interface override for update was not found in the interfaces status, probably one does not exists", newInterface.GetName()) - return + return err } if currentInterface.GetDirection() == constants.DirectionSouth { @@ -132,7 +119,7 @@ func validateOverrides(currentState *NetworkSwitch, newState *NetworkSwitch) (er errList) } - return + return nil } func (in *NetworkSwitch) SetupWebhookWithManager(mgr ctrl.Manager) error { @@ -180,50 +167,50 @@ func (in *NetworkSwitch) setDefaultConfigSelector() { var _ webhook.Validator = &NetworkSwitch{} // ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (in *NetworkSwitch) ValidateCreate() (warnings admission.Warnings, err error) { +func (in *NetworkSwitch) ValidateCreate() (admission.Warnings, error) { switchlog.Info("validate create", "name", in.Name) - err = validateInventoryLabels(in) - return + err := validateInventoryLabels(in) + return nil, err } // ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (in *NetworkSwitch) ValidateUpdate(old runtime.Object) (warnings admission.Warnings, err error) { +func (in *NetworkSwitch) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { switchlog.Info("validate update", "name", in.Name) - err = validateInventoryLabels(in) + err := validateInventoryLabels(in) if err != nil { - return + return nil, err } currentState, ok := old.(*NetworkSwitch) if !ok { err = errors.New("failed to cast previous object version to NetworkSwitch resource type") - return + return nil, err } if currentState.Spec.InventoryRef == nil && in.Spec.InventoryRef == nil { - return + return nil, nil } if currentState.Spec.InventoryRef == nil && in.Spec.InventoryRef != nil { - return + return nil, nil } if currentState.Spec.InventoryRef != nil && in.Spec.InventoryRef == nil { err = errors.New("cannot change inventory reference, operation denied") - return + return nil, err } if currentState.GetInventoryRef() != in.GetInventoryRef() { err = errors.New("cannot change inventory reference, operation denied") - return + return nil, err } err = validateOverrides(currentState, in) - return + return nil, err } // ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (in *NetworkSwitch) ValidateDelete() (warnings admission.Warnings, err error) { +func (in *NetworkSwitch) ValidateDelete() (admission.Warnings, error) { switchlog.Info("validate delete", "name", in.Name) - return + return nil, nil } diff --git a/apis/metal/v1alpha4/switch_webhook_test.go b/apis/metal/v1alpha4/networkswitch_webhook_test.go similarity index 92% rename from apis/metal/v1alpha4/switch_webhook_test.go rename to apis/metal/v1alpha4/networkswitch_webhook_test.go index e303c788..d605303d 100644 --- a/apis/metal/v1alpha4/switch_webhook_test.go +++ b/apis/metal/v1alpha4/networkswitch_webhook_test.go @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - * - * 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. - */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/size_types.go b/apis/metal/v1alpha4/size_types.go index 102ff73c..ab596672 100644 --- a/apis/metal/v1alpha4/size_types.go +++ b/apis/metal/v1alpha4/size_types.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -43,6 +30,8 @@ type SizeStatus struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient // Size is the Schema for the sizes API. type Size struct { @@ -54,6 +43,7 @@ type Size struct { } // +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SizeList contains a list of Size. type SizeList struct { diff --git a/apis/metal/v1alpha4/size_types_test.go b/apis/metal/v1alpha4/size_types_test.go index 9d35645f..b2ecbc53 100644 --- a/apis/metal/v1alpha4/size_types_test.go +++ b/apis/metal/v1alpha4/size_types_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/size_webhook.go b/apis/metal/v1alpha4/size_webhook.go index 725600a0..4eae4dc0 100644 --- a/apis/metal/v1alpha4/size_webhook.go +++ b/apis/metal/v1alpha4/size_webhook.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/size_webhook_test.go b/apis/metal/v1alpha4/size_webhook_test.go index 92fed0d8..96f57a5a 100644 --- a/apis/metal/v1alpha4/size_webhook_test.go +++ b/apis/metal/v1alpha4/size_webhook_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/switchconfig_types.go b/apis/metal/v1alpha4/switchconfig_types.go index 4c60112d..029f0a5e 100644 --- a/apis/metal/v1alpha4/switchconfig_types.go +++ b/apis/metal/v1alpha4/switchconfig_types.go @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - * - * 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. - */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 @@ -69,6 +56,7 @@ type SwitchConfigStatus struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:resource:shortName=sc +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // SwitchConfig is the Schema for switch config API. @@ -81,6 +69,7 @@ type SwitchConfig struct { } // +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SwitchConfigList contains a list of SwitchConfig. type SwitchConfigList struct { diff --git a/apis/metal/v1alpha4/switchconfig_webhook.go b/apis/metal/v1alpha4/switchconfig_webhook.go index 5708912d..961fea35 100644 --- a/apis/metal/v1alpha4/switchconfig_webhook.go +++ b/apis/metal/v1alpha4/switchconfig_webhook.go @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - * - * 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. - */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/switchconfig_webhook_test.go b/apis/metal/v1alpha4/switchconfig_webhook_test.go index 863ef90e..45230c2d 100644 --- a/apis/metal/v1alpha4/switchconfig_webhook_test.go +++ b/apis/metal/v1alpha4/switchconfig_webhook_test.go @@ -1,18 +1,5 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - * - * 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. - */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/unit_test.go b/apis/metal/v1alpha4/unit_test.go index 395aa5e1..c1782794 100644 --- a/apis/metal/v1alpha4/unit_test.go +++ b/apis/metal/v1alpha4/unit_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/webhook_suite_test.go b/apis/metal/v1alpha4/webhook_suite_test.go index 99fb7c2e..de56d618 100644 --- a/apis/metal/v1alpha4/webhook_suite_test.go +++ b/apis/metal/v1alpha4/webhook_suite_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1alpha4 diff --git a/apis/metal/v1alpha4/zz_generated.deepcopy.go b/apis/metal/v1alpha4/zz_generated.deepcopy.go index 3ef6035d..b4021628 100644 --- a/apis/metal/v1alpha4/zz_generated.deepcopy.go +++ b/apis/metal/v1alpha4/zz_generated.deepcopy.go @@ -1,29 +1,17 @@ //go:build !ignore_autogenerated +// +build !ignore_autogenerated -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 -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 controller-gen. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha4 import ( corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -39,6 +27,7 @@ func (in *AdditionalIPSpec) DeepCopyInto(out *AdditionalIPSpec) { *out = new(v1.LabelSelector) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalIPSpec. @@ -64,6 +53,7 @@ func (in *AddressFamiliesMap) DeepCopyInto(out *AddressFamiliesMap) { *out = new(bool) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressFamiliesMap. @@ -93,6 +83,7 @@ func (in *Addresses) DeepCopyInto(out *Addresses) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Addresses. @@ -112,6 +103,7 @@ func (in *Aggregate) DeepCopyInto(out *Aggregate) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Aggregate. @@ -137,6 +129,7 @@ func (in *AggregateItem) DeepCopyInto(out *AggregateItem) { *out = *in out.SourcePath = in.SourcePath out.TargetPath = in.TargetPath + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregateItem. @@ -161,6 +154,7 @@ func (in *AggregateList) DeepCopyInto(out *AggregateList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregateList. @@ -189,6 +183,7 @@ func (in *AggregateSpec) DeepCopyInto(out *AggregateSpec) { *out = make([]AggregateItem, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregateSpec. @@ -204,6 +199,7 @@ func (in *AggregateSpec) DeepCopy() *AggregateSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AggregateStatus) DeepCopyInto(out *AggregateStatus) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregateStatus. @@ -223,6 +219,7 @@ func (in *Benchmark) DeepCopyInto(out *Benchmark) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Benchmark. @@ -246,6 +243,7 @@ func (in *Benchmark) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BenchmarkDeviation) DeepCopyInto(out *BenchmarkDeviation) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BenchmarkDeviation. @@ -264,6 +262,7 @@ func (in BenchmarkDeviations) DeepCopyInto(out *BenchmarkDeviations) { in := &in *out = make(BenchmarkDeviations, len(*in)) copy(*out, *in) + return } } @@ -289,6 +288,7 @@ func (in *BenchmarkList) DeepCopyInto(out *BenchmarkList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BenchmarkList. @@ -312,6 +312,7 @@ func (in *BenchmarkList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BenchmarkResult) DeepCopyInto(out *BenchmarkResult) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BenchmarkResult. @@ -335,14 +336,14 @@ func (in *BenchmarkSpec) DeepCopyInto(out *BenchmarkSpec) { if val == nil { (*out)[key] = nil } else { - inVal := (*in)[key] - in, out := &inVal, &outVal + in, out := &val, &outVal *out = make(Benchmarks, len(*in)) copy(*out, *in) } (*out)[key] = outVal } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BenchmarkSpec. @@ -366,14 +367,14 @@ func (in *BenchmarkStatus) DeepCopyInto(out *BenchmarkStatus) { if val == nil { (*out)[key] = nil } else { - inVal := (*in)[key] - in, out := &inVal, &outVal + in, out := &val, &outVal *out = make(BenchmarkDeviations, len(*in)) copy(*out, *in) } (*out)[key] = outVal } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BenchmarkStatus. @@ -392,6 +393,7 @@ func (in Benchmarks) DeepCopyInto(out *Benchmarks) { in := &in *out = make(Benchmarks, len(*in)) copy(*out, *in) + return } } @@ -413,6 +415,7 @@ func (in *BlockSpec) DeepCopyInto(out *BlockSpec) { *out = new(PartitionTableSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockSpec. @@ -450,6 +453,7 @@ func (in *CPUSpec) DeepCopyInto(out *CPUSpec) { copy(*out, *in) } out.BogoMIPS = in.BogoMIPS.DeepCopy() + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUSpec. @@ -495,6 +499,7 @@ func (in *ConditionSpec) DeepCopyInto(out *ConditionSpec) { *out = new(string) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionSpec. @@ -517,13 +522,13 @@ func (in ConnectionsMap) DeepCopyInto(out *ConnectionsMap) { if val == nil { (*out)[key] = nil } else { - inVal := (*in)[key] - in, out := &inVal, &outVal + in, out := &val, &outVal *out = new(NetworkSwitchList) (*in).DeepCopyInto(*out) } (*out)[key] = outVal } + return } } @@ -571,6 +576,7 @@ func (in *ConstraintSpec) DeepCopyInto(out *ConstraintSpec) { x := (*in).DeepCopy() *out = &x } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConstraintSpec. @@ -596,6 +602,7 @@ func (in *ConstraintValSpec) DeepCopyInto(out *ConstraintValSpec) { x := (*in).DeepCopy() *out = &x } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConstraintValSpec. @@ -611,6 +618,7 @@ func (in *ConstraintValSpec) DeepCopy() *ConstraintValSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DistroSpec) DeepCopyInto(out *DistroSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DistroSpec. @@ -636,6 +644,7 @@ func (in *FieldSelectorSpec) DeepCopyInto(out *FieldSelectorSpec) { *out = new(corev1.ObjectFieldSelector) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FieldSelectorSpec. @@ -676,6 +685,7 @@ func (in *GeneralIPAMSpec) DeepCopyInto(out *GeneralIPAMSpec) { *out = new(IPAMSelectionSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GeneralIPAMSpec. @@ -691,6 +701,7 @@ func (in *GeneralIPAMSpec) DeepCopy() *GeneralIPAMSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HostSpec) DeepCopyInto(out *HostSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostSpec. @@ -716,6 +727,7 @@ func (in *IPAMSelectionSpec) DeepCopyInto(out *IPAMSelectionSpec) { *out = new(FieldSelectorSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAMSelectionSpec. @@ -741,6 +753,7 @@ func (in *IPAMSpec) DeepCopyInto(out *IPAMSpec) { *out = new(IPAMSelectionSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAMSpec. @@ -786,6 +799,7 @@ func (in *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) { *out = new(string) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressSpec. @@ -801,6 +815,7 @@ func (in *IPAddressSpec) DeepCopy() *IPAddressSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IPMISpec) DeepCopyInto(out *IPMISpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPMISpec. @@ -821,6 +836,7 @@ func (in *Identity) DeepCopyInto(out *Identity) { *out = make([]Internal, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. @@ -843,6 +859,7 @@ func (in *Interface) DeepCopyInto(out *Interface) { } in.Addresses.DeepCopyInto(&out.Addresses) in.Peer.DeepCopyInto(&out.Peer) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Interface. @@ -879,6 +896,7 @@ func (in *InterfaceOverridesSpec) DeepCopyInto(out *InterfaceOverridesSpec) { } } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceOverridesSpec. @@ -930,6 +948,7 @@ func (in *InterfaceSpec) DeepCopyInto(out *InterfaceSpec) { *out = new(PeerSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceSpec. @@ -961,6 +980,7 @@ func (in *InterfacesSpec) DeepCopyInto(out *InterfacesSpec) { } } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfacesSpec. @@ -976,6 +996,7 @@ func (in *InterfacesSpec) DeepCopy() *InterfacesSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Internal) DeepCopyInto(out *Internal) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Internal. @@ -995,6 +1016,7 @@ func (in *Inventory) DeepCopyInto(out *Inventory) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Inventory. @@ -1027,6 +1049,7 @@ func (in *InventoryList) DeepCopyInto(out *InventoryList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryList. @@ -1115,6 +1138,7 @@ func (in *InventorySpec) DeepCopyInto(out *InventorySpec) { *out = new(DistroSpec) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventorySpec. @@ -1132,6 +1156,7 @@ func (in *InventoryStatus) DeepCopyInto(out *InventoryStatus) { *out = *in in.Computed.DeepCopyInto(&out.Computed) out.InventoryStatuses = in.InventoryStatuses + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryStatus. @@ -1147,6 +1172,7 @@ func (in *InventoryStatus) DeepCopy() *InventoryStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InventoryStatuses) DeepCopyInto(out *InventoryStatuses) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryStatuses. @@ -1162,6 +1188,7 @@ func (in *InventoryStatuses) DeepCopy() *InventoryStatuses { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JSONPath) DeepCopyInto(out *JSONPath) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONPath. @@ -1182,6 +1209,7 @@ func (in *LLDPSpec) DeepCopyInto(out *LLDPSpec) { *out = make([]LLDPCapabilities, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LLDPSpec. @@ -1199,6 +1227,7 @@ func (in *LoopbackAddresses) DeepCopyInto(out *LoopbackAddresses) { *out = *in in.IPv4.DeepCopyInto(&out.IPv4) in.IPv6.DeepCopyInto(&out.IPv6) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoopbackAddresses. @@ -1218,6 +1247,7 @@ func (in *Machine) DeepCopyInto(out *Machine) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. @@ -1250,6 +1280,7 @@ func (in *MachineList) DeepCopyInto(out *MachineList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. @@ -1274,6 +1305,7 @@ func (in *MachineList) DeepCopyObject() runtime.Object { func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { *out = *in in.Identity.DeepCopyInto(&out.Identity) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. @@ -1291,6 +1323,7 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { *out = *in in.Network.DeepCopyInto(&out.Network) in.Reservation.DeepCopyInto(&out.Reservation) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. @@ -1306,6 +1339,7 @@ func (in *MachineStatus) DeepCopy() *MachineStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MemorySpec) DeepCopyInto(out *MemorySpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemorySpec. @@ -1321,6 +1355,7 @@ func (in *MemorySpec) DeepCopy() *MemorySpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NDPSpec) DeepCopyInto(out *NDPSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NDPSpec. @@ -1348,6 +1383,7 @@ func (in *NICSpec) DeepCopyInto(out *NICSpec) { *out = make([]NDPSpec, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NICSpec. @@ -1371,6 +1407,7 @@ func (in *Network) DeepCopyInto(out *Network) { } } in.Loopbacks.DeepCopyInto(&out.Loopbacks) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. @@ -1390,6 +1427,7 @@ func (in *NetworkSwitch) DeepCopyInto(out *NetworkSwitch) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSwitch. @@ -1422,6 +1460,7 @@ func (in *NetworkSwitchList) DeepCopyInto(out *NetworkSwitchList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSwitchList. @@ -1485,6 +1524,7 @@ func (in *NetworkSwitchSpec) DeepCopyInto(out *NetworkSwitchSpec) { *out = new(InterfacesSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSwitchSpec. @@ -1510,8 +1550,7 @@ func (in *NetworkSwitchStatus) DeepCopyInto(out *NetworkSwitchStatus) { if val == nil { (*out)[key] = nil } else { - inVal := (*in)[key] - in, out := &inVal, &outVal + in, out := &val, &outVal *out = new(InterfaceSpec) (*in).DeepCopyInto(*out) } @@ -1561,6 +1600,7 @@ func (in *NetworkSwitchStatus) DeepCopyInto(out *NetworkSwitchStatus) { } } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSwitchStatus. @@ -1591,6 +1631,7 @@ func (in *NumaSpec) DeepCopyInto(out *NumaSpec) { *out = new(MemorySpec) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NumaSpec. @@ -1616,6 +1657,7 @@ func (in *ObjectReference) DeepCopyInto(out *ObjectReference) { *out = new(string) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference. @@ -1631,6 +1673,7 @@ func (in *ObjectReference) DeepCopy() *ObjectReference { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PCIDeviceDescriptionSpec) DeepCopyInto(out *PCIDeviceDescriptionSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PCIDeviceDescriptionSpec. @@ -1681,6 +1724,7 @@ func (in *PCIDeviceSpec) DeepCopyInto(out *PCIDeviceSpec) { *out = new(PCIDeviceDescriptionSpec) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PCIDeviceSpec. @@ -1696,6 +1740,7 @@ func (in *PCIDeviceSpec) DeepCopy() *PCIDeviceSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PartitionSpec) DeepCopyInto(out *PartitionSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PartitionSpec. @@ -1716,6 +1761,7 @@ func (in *PartitionTableSpec) DeepCopyInto(out *PartitionTableSpec) { *out = make([]PartitionSpec, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PartitionTableSpec. @@ -1736,6 +1782,7 @@ func (in *Peer) DeepCopyInto(out *Peer) { *out = new(ResourceReference) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Peer. @@ -1776,6 +1823,7 @@ func (in *PeerInfoSpec) DeepCopyInto(out *PeerInfoSpec) { *out = new(string) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerInfoSpec. @@ -1801,6 +1849,7 @@ func (in *PeerSpec) DeepCopyInto(out *PeerSpec) { *out = new(PeerInfoSpec) (*in).DeepCopyInto(*out) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerSpec. @@ -1846,6 +1895,7 @@ func (in *PortParametersSpec) DeepCopyInto(out *PortParametersSpec) { *out = new(string) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortParametersSpec. @@ -1871,6 +1921,7 @@ func (in *RegionSpec) DeepCopyInto(out *RegionSpec) { *out = new(string) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionSpec. @@ -1891,6 +1942,7 @@ func (in *Reservation) DeepCopyInto(out *Reservation) { *out = new(ResourceReference) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reservation. @@ -1906,6 +1958,7 @@ func (in *Reservation) DeepCopy() *Reservation { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceReference) DeepCopyInto(out *ResourceReference) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReference. @@ -1925,6 +1978,7 @@ func (in *Size) DeepCopyInto(out *Size) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Size. @@ -1957,6 +2011,7 @@ func (in *SizeList) DeepCopyInto(out *SizeList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SizeList. @@ -1987,6 +2042,7 @@ func (in *SizeSpec) DeepCopyInto(out *SizeSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SizeSpec. @@ -2002,6 +2058,7 @@ func (in *SizeSpec) DeepCopy() *SizeSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SizeStatus) DeepCopyInto(out *SizeStatus) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SizeStatus. @@ -2042,6 +2099,7 @@ func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { *out = new(string) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. @@ -2061,6 +2119,7 @@ func (in *SwitchConfig) DeepCopyInto(out *SwitchConfig) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SwitchConfig. @@ -2093,6 +2152,7 @@ func (in *SwitchConfigList) DeepCopyInto(out *SwitchConfigList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SwitchConfigList. @@ -2136,6 +2196,7 @@ func (in *SwitchConfigSpec) DeepCopyInto(out *SwitchConfigSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SwitchConfigSpec. @@ -2151,6 +2212,7 @@ func (in *SwitchConfigSpec) DeepCopy() *SwitchConfigSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SwitchConfigStatus) DeepCopyInto(out *SwitchConfigStatus) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SwitchConfigStatus. @@ -2166,6 +2228,7 @@ func (in *SwitchConfigStatus) DeepCopy() *SwitchConfigStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SystemSpec) DeepCopyInto(out *SystemSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemSpec. @@ -2182,6 +2245,7 @@ func (in *SystemSpec) DeepCopy() *SystemSpec { func (in *ValidationInventory) DeepCopyInto(out *ValidationInventory) { *out = *in in.Spec.DeepCopyInto(&out.Spec) + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidationInventory. @@ -2197,6 +2261,7 @@ func (in *ValidationInventory) DeepCopy() *ValidationInventory { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtSpec) DeepCopyInto(out *VirtSpec) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtSpec. diff --git a/applyconfiguration/metal/v1alpha4/peerspec.go b/applyconfiguration/metal/v1alpha4/peerspec.go deleted file mode 100644 index bf5ae5ad..00000000 --- a/applyconfiguration/metal/v1alpha4/peerspec.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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 v1alpha4 - -// PeerSpecApplyConfiguration represents an declarative configuration of the PeerSpec type for use -// with apply. -type PeerSpecApplyConfiguration struct { - ObjectReferenceApplyConfiguration `json:",inline"` - PeerInfoSpecApplyConfiguration `json:",inline"` -} - -// PeerSpecApplyConfiguration constructs an declarative configuration of the PeerSpec type for use with -// apply. -func PeerSpec() *PeerSpecApplyConfiguration { - return &PeerSpecApplyConfiguration{} -} diff --git a/applyconfiguration/internal/internal.go b/client/applyconfiguration/internal/internal.go similarity index 93% rename from applyconfiguration/internal/internal.go rename to client/applyconfiguration/internal/internal.go index 0d707d5e..463a89b9 100644 --- a/applyconfiguration/internal/internal.go +++ b/client/applyconfiguration/internal/internal.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -341,6 +328,46 @@ var schemaYAML = typed.YAMLObject(`types: - name: state type: scalar: boolean +- name: com.github.ironcore-dev.metal.apis.metal.v1alpha4.ConstraintSpec + map: + fields: + - name: agg + type: + scalar: string + - name: eq + type: + namedType: com.github.ironcore-dev.metal.apis.metal.v1alpha4.ConstraintValSpec + - name: gt + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: gte + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: lt + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: lte + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: neq + type: + namedType: com.github.ironcore-dev.metal.apis.metal.v1alpha4.ConstraintValSpec + - name: path + type: + namedType: com.github.ironcore-dev.metal.apis.metal.v1alpha4.JSONPath + default: {} +- name: com.github.ironcore-dev.metal.apis.metal.v1alpha4.ConstraintValSpec + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable - name: com.github.ironcore-dev.metal.apis.metal.v1alpha4.DistroSpec map: fields: @@ -1171,6 +1198,48 @@ var schemaYAML = typed.YAMLObject(`types: - name: namespace type: scalar: string +- name: com.github.ironcore-dev.metal.apis.metal.v1alpha4.Size + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.ironcore-dev.metal.apis.metal.v1alpha4.SizeSpec + default: {} + - name: status + type: + namedType: com.github.ironcore-dev.metal.apis.metal.v1alpha4.SizeStatus + default: {} +- name: com.github.ironcore-dev.metal.apis.metal.v1alpha4.SizeSpec + map: + fields: + - name: constraints + type: + list: + elementType: + namedType: com.github.ironcore-dev.metal.apis.metal.v1alpha4.ConstraintSpec + elementRelationship: atomic +- name: com.github.ironcore-dev.metal.apis.metal.v1alpha4.SizeStatus + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable - name: com.github.ironcore-dev.metal.apis.metal.v1alpha4.SubnetSpec map: fields: diff --git a/client/applyconfiguration/meta/v1/labelselector.go b/client/applyconfiguration/meta/v1/labelselector.go new file mode 100644 index 00000000..0a4ebaa8 --- /dev/null +++ b/client/applyconfiguration/meta/v1/labelselector.go @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LabelSelectorApplyConfiguration represents an declarative configuration of the LabelSelector type for use +// with apply. +type LabelSelectorApplyConfiguration struct { + MatchLabels map[string]string `json:"matchLabels,omitempty"` + MatchExpressions []LabelSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` +} + +// LabelSelectorApplyConfiguration constructs an declarative configuration of the LabelSelector type for use with +// apply. +func LabelSelector() *LabelSelectorApplyConfiguration { + return &LabelSelectorApplyConfiguration{} +} + +// WithMatchLabels puts the entries into the MatchLabels 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 MatchLabels field, +// overwriting an existing map entries in MatchLabels field with the same key. +func (b *LabelSelectorApplyConfiguration) WithMatchLabels(entries map[string]string) *LabelSelectorApplyConfiguration { + if b.MatchLabels == nil && len(entries) > 0 { + b.MatchLabels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.MatchLabels[k] = v + } + return b +} + +// WithMatchExpressions adds the given value to the MatchExpressions 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 MatchExpressions field. +func (b *LabelSelectorApplyConfiguration) WithMatchExpressions(values ...*LabelSelectorRequirementApplyConfiguration) *LabelSelectorApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchExpressions") + } + b.MatchExpressions = append(b.MatchExpressions, *values[i]) + } + return b +} diff --git a/client/applyconfiguration/meta/v1/labelselectorrequirement.go b/client/applyconfiguration/meta/v1/labelselectorrequirement.go new file mode 100644 index 00000000..ce4cbec9 --- /dev/null +++ b/client/applyconfiguration/meta/v1/labelselectorrequirement.go @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LabelSelectorRequirementApplyConfiguration represents an declarative configuration of the LabelSelectorRequirement type for use +// with apply. +type LabelSelectorRequirementApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Operator *v1.LabelSelectorOperator `json:"operator,omitempty"` + Values []string `json:"values,omitempty"` +} + +// LabelSelectorRequirementApplyConfiguration constructs an declarative configuration of the LabelSelectorRequirement type for use with +// apply. +func LabelSelectorRequirement() *LabelSelectorRequirementApplyConfiguration { + return &LabelSelectorRequirementApplyConfiguration{} +} + +// WithKey sets the Key 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 Key field is set to the value of the last call. +func (b *LabelSelectorRequirementApplyConfiguration) WithKey(value string) *LabelSelectorRequirementApplyConfiguration { + b.Key = &value + return b +} + +// WithOperator sets the Operator 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 Operator field is set to the value of the last call. +func (b *LabelSelectorRequirementApplyConfiguration) WithOperator(value v1.LabelSelectorOperator) *LabelSelectorRequirementApplyConfiguration { + b.Operator = &value + return b +} + +// WithValues adds the given value to the Values 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 Values field. +func (b *LabelSelectorRequirementApplyConfiguration) WithValues(values ...string) *LabelSelectorRequirementApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/client/applyconfiguration/meta/v1/managedfieldsentry.go b/client/applyconfiguration/meta/v1/managedfieldsentry.go new file mode 100644 index 00000000..e5baa060 --- /dev/null +++ b/client/applyconfiguration/meta/v1/managedfieldsentry.go @@ -0,0 +1,84 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ManagedFieldsEntryApplyConfiguration represents an declarative configuration of the ManagedFieldsEntry type for use +// with apply. +type ManagedFieldsEntryApplyConfiguration struct { + Manager *string `json:"manager,omitempty"` + Operation *v1.ManagedFieldsOperationType `json:"operation,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` + Time *v1.Time `json:"time,omitempty"` + FieldsType *string `json:"fieldsType,omitempty"` + FieldsV1 *v1.FieldsV1 `json:"fieldsV1,omitempty"` + Subresource *string `json:"subresource,omitempty"` +} + +// ManagedFieldsEntryApplyConfiguration constructs an declarative configuration of the ManagedFieldsEntry type for use with +// apply. +func ManagedFieldsEntry() *ManagedFieldsEntryApplyConfiguration { + return &ManagedFieldsEntryApplyConfiguration{} +} + +// WithManager sets the Manager 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 Manager field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithManager(value string) *ManagedFieldsEntryApplyConfiguration { + b.Manager = &value + return b +} + +// WithOperation sets the Operation 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 Operation field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithOperation(value v1.ManagedFieldsOperationType) *ManagedFieldsEntryApplyConfiguration { + b.Operation = &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 *ManagedFieldsEntryApplyConfiguration) WithAPIVersion(value string) *ManagedFieldsEntryApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithTime sets the Time 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 Time field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithTime(value v1.Time) *ManagedFieldsEntryApplyConfiguration { + b.Time = &value + return b +} + +// WithFieldsType sets the FieldsType 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 FieldsType field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsType(value string) *ManagedFieldsEntryApplyConfiguration { + b.FieldsType = &value + return b +} + +// WithFieldsV1 sets the FieldsV1 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 FieldsV1 field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsV1(value v1.FieldsV1) *ManagedFieldsEntryApplyConfiguration { + b.FieldsV1 = &value + return b +} + +// WithSubresource sets the Subresource 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 Subresource field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithSubresource(value string) *ManagedFieldsEntryApplyConfiguration { + b.Subresource = &value + return b +} diff --git a/client/applyconfiguration/meta/v1/objectmeta.go b/client/applyconfiguration/meta/v1/objectmeta.go new file mode 100644 index 00000000..2bff06c8 --- /dev/null +++ b/client/applyconfiguration/meta/v1/objectmeta.go @@ -0,0 +1,158 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// ObjectMetaApplyConfiguration represents an declarative configuration of the ObjectMeta type for use +// with apply. +type ObjectMetaApplyConfiguration struct { + Name *string `json:"name,omitempty"` + GenerateName *string `json:"generateName,omitempty"` + Namespace *string `json:"namespace,omitempty"` + UID *types.UID `json:"uid,omitempty"` + ResourceVersion *string `json:"resourceVersion,omitempty"` + Generation *int64 `json:"generation,omitempty"` + CreationTimestamp *v1.Time `json:"creationTimestamp,omitempty"` + DeletionTimestamp *v1.Time `json:"deletionTimestamp,omitempty"` + DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + OwnerReferences []OwnerReferenceApplyConfiguration `json:"ownerReferences,omitempty"` + Finalizers []string `json:"finalizers,omitempty"` +} + +// ObjectMetaApplyConfiguration constructs an declarative configuration of the ObjectMeta type for use with +// apply. +func ObjectMeta() *ObjectMetaApplyConfiguration { + return &ObjectMetaApplyConfiguration{} +} + +// 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 *ObjectMetaApplyConfiguration) WithName(value string) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithGenerateName(value string) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithNamespace(value string) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithUID(value types.UID) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithResourceVersion(value string) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithGeneration(value int64) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithCreationTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ObjectMetaApplyConfiguration { + b.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 *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.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 *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.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 *ObjectMetaApplyConfiguration) WithOwnerReferences(values ...*OwnerReferenceApplyConfiguration) *ObjectMetaApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.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 *ObjectMetaApplyConfiguration) WithFinalizers(values ...string) *ObjectMetaApplyConfiguration { + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} diff --git a/client/applyconfiguration/meta/v1/ownerreference.go b/client/applyconfiguration/meta/v1/ownerreference.go new file mode 100644 index 00000000..089008a3 --- /dev/null +++ b/client/applyconfiguration/meta/v1/ownerreference.go @@ -0,0 +1,75 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// OwnerReferenceApplyConfiguration represents an declarative configuration of the OwnerReference type for use +// with apply. +type OwnerReferenceApplyConfiguration struct { + APIVersion *string `json:"apiVersion,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + UID *types.UID `json:"uid,omitempty"` + Controller *bool `json:"controller,omitempty"` + BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty"` +} + +// OwnerReferenceApplyConfiguration constructs an declarative configuration of the OwnerReference type for use with +// apply. +func OwnerReference() *OwnerReferenceApplyConfiguration { + return &OwnerReferenceApplyConfiguration{} +} + +// 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 *OwnerReferenceApplyConfiguration) WithAPIVersion(value string) *OwnerReferenceApplyConfiguration { + b.APIVersion = &value + 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 *OwnerReferenceApplyConfiguration) WithKind(value string) *OwnerReferenceApplyConfiguration { + b.Kind = &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 *OwnerReferenceApplyConfiguration) WithName(value string) *OwnerReferenceApplyConfiguration { + b.Name = &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 *OwnerReferenceApplyConfiguration) WithUID(value types.UID) *OwnerReferenceApplyConfiguration { + b.UID = &value + return b +} + +// WithController sets the Controller 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 Controller field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithController(value bool) *OwnerReferenceApplyConfiguration { + b.Controller = &value + return b +} + +// WithBlockOwnerDeletion sets the BlockOwnerDeletion 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 BlockOwnerDeletion field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithBlockOwnerDeletion(value bool) *OwnerReferenceApplyConfiguration { + b.BlockOwnerDeletion = &value + return b +} diff --git a/client/applyconfiguration/meta/v1/typemeta.go b/client/applyconfiguration/meta/v1/typemeta.go new file mode 100644 index 00000000..282cbaa9 --- /dev/null +++ b/client/applyconfiguration/meta/v1/typemeta.go @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// TypeMetaApplyConfiguration represents an declarative configuration of the TypeMeta type for use +// with apply. +type TypeMetaApplyConfiguration struct { + Kind *string `json:"kind,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` +} + +// TypeMetaApplyConfiguration constructs an declarative configuration of the TypeMeta type for use with +// apply. +func TypeMeta() *TypeMetaApplyConfiguration { + return &TypeMetaApplyConfiguration{} +} + +// 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 *TypeMetaApplyConfiguration) WithKind(value string) *TypeMetaApplyConfiguration { + b.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 *TypeMetaApplyConfiguration) WithAPIVersion(value string) *TypeMetaApplyConfiguration { + b.APIVersion = &value + return b +} diff --git a/applyconfiguration/metal/v1alpha4/additionalipspec.go b/client/applyconfiguration/metal/v1alpha4/additionalipspec.go similarity index 59% rename from applyconfiguration/metal/v1alpha4/additionalipspec.go rename to client/applyconfiguration/metal/v1alpha4/additionalipspec.go index 79ee5c26..03bb5c45 100644 --- a/applyconfiguration/metal/v1alpha4/additionalipspec.go +++ b/client/applyconfiguration/metal/v1alpha4/additionalipspec.go @@ -1,32 +1,19 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha4 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" ) // AdditionalIPSpecApplyConfiguration represents an declarative configuration of the AdditionalIPSpec type for use // with apply. type AdditionalIPSpecApplyConfiguration struct { - Address *string `json:"address,omitempty"` - ParentSubnet *v1.LabelSelector `json:"parentSubnet,omitempty"` + Address *string `json:"address,omitempty"` + ParentSubnet *v1.LabelSelectorApplyConfiguration `json:"parentSubnet,omitempty"` } // AdditionalIPSpecApplyConfiguration constructs an declarative configuration of the AdditionalIPSpec type for use with @@ -46,7 +33,7 @@ func (b *AdditionalIPSpecApplyConfiguration) WithAddress(value string) *Addition // WithParentSubnet sets the ParentSubnet 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 ParentSubnet field is set to the value of the last call. -func (b *AdditionalIPSpecApplyConfiguration) WithParentSubnet(value v1.LabelSelector) *AdditionalIPSpecApplyConfiguration { - b.ParentSubnet = &value +func (b *AdditionalIPSpecApplyConfiguration) WithParentSubnet(value *v1.LabelSelectorApplyConfiguration) *AdditionalIPSpecApplyConfiguration { + b.ParentSubnet = value return b } diff --git a/applyconfiguration/metal/v1alpha4/addresses.go b/client/applyconfiguration/metal/v1alpha4/addresses.go similarity index 70% rename from applyconfiguration/metal/v1alpha4/addresses.go rename to client/applyconfiguration/metal/v1alpha4/addresses.go index 14d1093c..a0e5838d 100644 --- a/applyconfiguration/metal/v1alpha4/addresses.go +++ b/client/applyconfiguration/metal/v1alpha4/addresses.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/addressfamiliesmap.go b/client/applyconfiguration/metal/v1alpha4/addressfamiliesmap.go similarity index 68% rename from applyconfiguration/metal/v1alpha4/addressfamiliesmap.go rename to client/applyconfiguration/metal/v1alpha4/addressfamiliesmap.go index 5be74436..cea5dfeb 100644 --- a/applyconfiguration/metal/v1alpha4/addressfamiliesmap.go +++ b/client/applyconfiguration/metal/v1alpha4/addressfamiliesmap.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/aggregate.go b/client/applyconfiguration/metal/v1alpha4/aggregate.go similarity index 93% rename from applyconfiguration/metal/v1alpha4/aggregate.go rename to client/applyconfiguration/metal/v1alpha4/aggregate.go index 52616766..9a81723b 100644 --- a/applyconfiguration/metal/v1alpha4/aggregate.go +++ b/client/applyconfiguration/metal/v1alpha4/aggregate.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -20,11 +7,11 @@ package v1alpha4 import ( metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - internal "github.com/ironcore-dev/metal/applyconfiguration/internal" + internal "github.com/ironcore-dev/metal/client/applyconfiguration/internal" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // AggregateApplyConfiguration represents an declarative configuration of the Aggregate type for use diff --git a/applyconfiguration/metal/v1alpha4/aggregateitem.go b/client/applyconfiguration/metal/v1alpha4/aggregateitem.go similarity index 76% rename from applyconfiguration/metal/v1alpha4/aggregateitem.go rename to client/applyconfiguration/metal/v1alpha4/aggregateitem.go index 0aa3473d..24516aa6 100644 --- a/applyconfiguration/metal/v1alpha4/aggregateitem.go +++ b/client/applyconfiguration/metal/v1alpha4/aggregateitem.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/aggregatespec.go b/client/applyconfiguration/metal/v1alpha4/aggregatespec.go similarity index 64% rename from applyconfiguration/metal/v1alpha4/aggregatespec.go rename to client/applyconfiguration/metal/v1alpha4/aggregatespec.go index 4279f1d3..4bbb2fcc 100644 --- a/applyconfiguration/metal/v1alpha4/aggregatespec.go +++ b/client/applyconfiguration/metal/v1alpha4/aggregatespec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/benchmark.go b/client/applyconfiguration/metal/v1alpha4/benchmark.go similarity index 93% rename from applyconfiguration/metal/v1alpha4/benchmark.go rename to client/applyconfiguration/metal/v1alpha4/benchmark.go index cc768188..652992e2 100644 --- a/applyconfiguration/metal/v1alpha4/benchmark.go +++ b/client/applyconfiguration/metal/v1alpha4/benchmark.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -20,11 +7,11 @@ package v1alpha4 import ( metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - internal "github.com/ironcore-dev/metal/applyconfiguration/internal" + internal "github.com/ironcore-dev/metal/client/applyconfiguration/internal" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // BenchmarkApplyConfiguration represents an declarative configuration of the Benchmark type for use diff --git a/applyconfiguration/metal/v1alpha4/benchmarkdeviation.go b/client/applyconfiguration/metal/v1alpha4/benchmarkdeviation.go similarity index 68% rename from applyconfiguration/metal/v1alpha4/benchmarkdeviation.go rename to client/applyconfiguration/metal/v1alpha4/benchmarkdeviation.go index 5bf5da68..e20564b6 100644 --- a/applyconfiguration/metal/v1alpha4/benchmarkdeviation.go +++ b/client/applyconfiguration/metal/v1alpha4/benchmarkdeviation.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/benchmarkresult.go b/client/applyconfiguration/metal/v1alpha4/benchmarkresult.go similarity index 68% rename from applyconfiguration/metal/v1alpha4/benchmarkresult.go rename to client/applyconfiguration/metal/v1alpha4/benchmarkresult.go index 9f0a2077..7adfbb88 100644 --- a/applyconfiguration/metal/v1alpha4/benchmarkresult.go +++ b/client/applyconfiguration/metal/v1alpha4/benchmarkresult.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/benchmarkspec.go b/client/applyconfiguration/metal/v1alpha4/benchmarkspec.go similarity index 67% rename from applyconfiguration/metal/v1alpha4/benchmarkspec.go rename to client/applyconfiguration/metal/v1alpha4/benchmarkspec.go index 30afa7c6..f66ec292 100644 --- a/applyconfiguration/metal/v1alpha4/benchmarkspec.go +++ b/client/applyconfiguration/metal/v1alpha4/benchmarkspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/benchmarkstatus.go b/client/applyconfiguration/metal/v1alpha4/benchmarkstatus.go similarity index 69% rename from applyconfiguration/metal/v1alpha4/benchmarkstatus.go rename to client/applyconfiguration/metal/v1alpha4/benchmarkstatus.go index f7528172..241bbe41 100644 --- a/applyconfiguration/metal/v1alpha4/benchmarkstatus.go +++ b/client/applyconfiguration/metal/v1alpha4/benchmarkstatus.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/blockspec.go b/client/applyconfiguration/metal/v1alpha4/blockspec.go similarity index 85% rename from applyconfiguration/metal/v1alpha4/blockspec.go rename to client/applyconfiguration/metal/v1alpha4/blockspec.go index 3b820b22..61c124e6 100644 --- a/applyconfiguration/metal/v1alpha4/blockspec.go +++ b/client/applyconfiguration/metal/v1alpha4/blockspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/conditionspec.go b/client/applyconfiguration/metal/v1alpha4/conditionspec.go similarity index 84% rename from applyconfiguration/metal/v1alpha4/conditionspec.go rename to client/applyconfiguration/metal/v1alpha4/conditionspec.go index 2dcd298b..0762feb9 100644 --- a/applyconfiguration/metal/v1alpha4/conditionspec.go +++ b/client/applyconfiguration/metal/v1alpha4/conditionspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/client/applyconfiguration/metal/v1alpha4/constraintspec.go b/client/applyconfiguration/metal/v1alpha4/constraintspec.go new file mode 100644 index 00000000..299f5956 --- /dev/null +++ b/client/applyconfiguration/metal/v1alpha4/constraintspec.go @@ -0,0 +1,94 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// ConstraintSpecApplyConfiguration represents an declarative configuration of the ConstraintSpec type for use +// with apply. +type ConstraintSpecApplyConfiguration struct { + Path *v1alpha4.JSONPath `json:"path,omitempty"` + Aggregate *v1alpha4.AggregateType `json:"agg,omitempty"` + Equal *v1alpha4.ConstraintValSpec `json:"eq,omitempty"` + NotEqual *v1alpha4.ConstraintValSpec `json:"neq,omitempty"` + LessThan *resource.Quantity `json:"lt,omitempty"` + LessThanOrEqual *resource.Quantity `json:"lte,omitempty"` + GreaterThan *resource.Quantity `json:"gt,omitempty"` + GreaterThanOrEqual *resource.Quantity `json:"gte,omitempty"` +} + +// ConstraintSpecApplyConfiguration constructs an declarative configuration of the ConstraintSpec type for use with +// apply. +func ConstraintSpec() *ConstraintSpecApplyConfiguration { + return &ConstraintSpecApplyConfiguration{} +} + +// 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 *ConstraintSpecApplyConfiguration) WithPath(value v1alpha4.JSONPath) *ConstraintSpecApplyConfiguration { + b.Path = &value + return b +} + +// WithAggregate sets the Aggregate 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 Aggregate field is set to the value of the last call. +func (b *ConstraintSpecApplyConfiguration) WithAggregate(value v1alpha4.AggregateType) *ConstraintSpecApplyConfiguration { + b.Aggregate = &value + return b +} + +// WithEqual sets the Equal 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 Equal field is set to the value of the last call. +func (b *ConstraintSpecApplyConfiguration) WithEqual(value v1alpha4.ConstraintValSpec) *ConstraintSpecApplyConfiguration { + b.Equal = &value + return b +} + +// WithNotEqual sets the NotEqual 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 NotEqual field is set to the value of the last call. +func (b *ConstraintSpecApplyConfiguration) WithNotEqual(value v1alpha4.ConstraintValSpec) *ConstraintSpecApplyConfiguration { + b.NotEqual = &value + return b +} + +// WithLessThan sets the LessThan 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 LessThan field is set to the value of the last call. +func (b *ConstraintSpecApplyConfiguration) WithLessThan(value resource.Quantity) *ConstraintSpecApplyConfiguration { + b.LessThan = &value + return b +} + +// WithLessThanOrEqual sets the LessThanOrEqual 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 LessThanOrEqual field is set to the value of the last call. +func (b *ConstraintSpecApplyConfiguration) WithLessThanOrEqual(value resource.Quantity) *ConstraintSpecApplyConfiguration { + b.LessThanOrEqual = &value + return b +} + +// WithGreaterThan sets the GreaterThan 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 GreaterThan field is set to the value of the last call. +func (b *ConstraintSpecApplyConfiguration) WithGreaterThan(value resource.Quantity) *ConstraintSpecApplyConfiguration { + b.GreaterThan = &value + return b +} + +// WithGreaterThanOrEqual sets the GreaterThanOrEqual 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 GreaterThanOrEqual field is set to the value of the last call. +func (b *ConstraintSpecApplyConfiguration) WithGreaterThanOrEqual(value resource.Quantity) *ConstraintSpecApplyConfiguration { + b.GreaterThanOrEqual = &value + return b +} diff --git a/applyconfiguration/metal/v1alpha4/cpuspec.go b/client/applyconfiguration/metal/v1alpha4/cpuspec.go similarity index 94% rename from applyconfiguration/metal/v1alpha4/cpuspec.go rename to client/applyconfiguration/metal/v1alpha4/cpuspec.go index 5e33ddde..43007d94 100644 --- a/applyconfiguration/metal/v1alpha4/cpuspec.go +++ b/client/applyconfiguration/metal/v1alpha4/cpuspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/distrospec.go b/client/applyconfiguration/metal/v1alpha4/distrospec.go similarity index 86% rename from applyconfiguration/metal/v1alpha4/distrospec.go rename to client/applyconfiguration/metal/v1alpha4/distrospec.go index 8d0d3942..22481fc1 100644 --- a/applyconfiguration/metal/v1alpha4/distrospec.go +++ b/client/applyconfiguration/metal/v1alpha4/distrospec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/fieldselectorspec.go b/client/applyconfiguration/metal/v1alpha4/fieldselectorspec.go similarity index 70% rename from applyconfiguration/metal/v1alpha4/fieldselectorspec.go rename to client/applyconfiguration/metal/v1alpha4/fieldselectorspec.go index 428e79b4..5e0ddc48 100644 --- a/applyconfiguration/metal/v1alpha4/fieldselectorspec.go +++ b/client/applyconfiguration/metal/v1alpha4/fieldselectorspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/generalipamspec.go b/client/applyconfiguration/metal/v1alpha4/generalipamspec.go similarity index 84% rename from applyconfiguration/metal/v1alpha4/generalipamspec.go rename to client/applyconfiguration/metal/v1alpha4/generalipamspec.go index e94c8795..194b3b31 100644 --- a/applyconfiguration/metal/v1alpha4/generalipamspec.go +++ b/client/applyconfiguration/metal/v1alpha4/generalipamspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/hostspec.go b/client/applyconfiguration/metal/v1alpha4/hostspec.go similarity index 57% rename from applyconfiguration/metal/v1alpha4/hostspec.go rename to client/applyconfiguration/metal/v1alpha4/hostspec.go index 6480dec7..5d337237 100644 --- a/applyconfiguration/metal/v1alpha4/hostspec.go +++ b/client/applyconfiguration/metal/v1alpha4/hostspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/identity.go b/client/applyconfiguration/metal/v1alpha4/identity.go similarity index 79% rename from applyconfiguration/metal/v1alpha4/identity.go rename to client/applyconfiguration/metal/v1alpha4/identity.go index 17b7808e..d582a8cd 100644 --- a/applyconfiguration/metal/v1alpha4/identity.go +++ b/client/applyconfiguration/metal/v1alpha4/identity.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/interface.go b/client/applyconfiguration/metal/v1alpha4/interface.go similarity index 85% rename from applyconfiguration/metal/v1alpha4/interface.go rename to client/applyconfiguration/metal/v1alpha4/interface.go index 1355f724..6f73e937 100644 --- a/applyconfiguration/metal/v1alpha4/interface.go +++ b/client/applyconfiguration/metal/v1alpha4/interface.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/interfaceoverridesspec.go b/client/applyconfiguration/metal/v1alpha4/interfaceoverridesspec.go similarity index 74% rename from applyconfiguration/metal/v1alpha4/interfaceoverridesspec.go rename to client/applyconfiguration/metal/v1alpha4/interfaceoverridesspec.go index 5e7d7f42..fb0762ff 100644 --- a/applyconfiguration/metal/v1alpha4/interfaceoverridesspec.go +++ b/client/applyconfiguration/metal/v1alpha4/interfaceoverridesspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/interfacespec.go b/client/applyconfiguration/metal/v1alpha4/interfacespec.go similarity index 83% rename from applyconfiguration/metal/v1alpha4/interfacespec.go rename to client/applyconfiguration/metal/v1alpha4/interfacespec.go index e9f37ef3..1755fc7c 100644 --- a/applyconfiguration/metal/v1alpha4/interfacespec.go +++ b/client/applyconfiguration/metal/v1alpha4/interfacespec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/interfacesspec.go b/client/applyconfiguration/metal/v1alpha4/interfacesspec.go similarity index 73% rename from applyconfiguration/metal/v1alpha4/interfacesspec.go rename to client/applyconfiguration/metal/v1alpha4/interfacesspec.go index 2b44c61a..6d6d9a2c 100644 --- a/applyconfiguration/metal/v1alpha4/interfacesspec.go +++ b/client/applyconfiguration/metal/v1alpha4/interfacesspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/internal.go b/client/applyconfiguration/metal/v1alpha4/internal.go similarity index 67% rename from applyconfiguration/metal/v1alpha4/internal.go rename to client/applyconfiguration/metal/v1alpha4/internal.go index b4f1ad6d..275e5417 100644 --- a/applyconfiguration/metal/v1alpha4/internal.go +++ b/client/applyconfiguration/metal/v1alpha4/internal.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/inventory.go b/client/applyconfiguration/metal/v1alpha4/inventory.go similarity index 93% rename from applyconfiguration/metal/v1alpha4/inventory.go rename to client/applyconfiguration/metal/v1alpha4/inventory.go index d673958d..30b46a47 100644 --- a/applyconfiguration/metal/v1alpha4/inventory.go +++ b/client/applyconfiguration/metal/v1alpha4/inventory.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -20,11 +7,11 @@ package v1alpha4 import ( metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - internal "github.com/ironcore-dev/metal/applyconfiguration/internal" + internal "github.com/ironcore-dev/metal/client/applyconfiguration/internal" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // InventoryApplyConfiguration represents an declarative configuration of the Inventory type for use diff --git a/applyconfiguration/metal/v1alpha4/inventoryspec.go b/client/applyconfiguration/metal/v1alpha4/inventoryspec.go similarity index 91% rename from applyconfiguration/metal/v1alpha4/inventoryspec.go rename to client/applyconfiguration/metal/v1alpha4/inventoryspec.go index d4079f4b..5df4acfa 100644 --- a/applyconfiguration/metal/v1alpha4/inventoryspec.go +++ b/client/applyconfiguration/metal/v1alpha4/inventoryspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/inventorystatus.go b/client/applyconfiguration/metal/v1alpha4/inventorystatus.go similarity index 72% rename from applyconfiguration/metal/v1alpha4/inventorystatus.go rename to client/applyconfiguration/metal/v1alpha4/inventorystatus.go index c0ee04bc..b972dbf7 100644 --- a/applyconfiguration/metal/v1alpha4/inventorystatus.go +++ b/client/applyconfiguration/metal/v1alpha4/inventorystatus.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/inventorystatuses.go b/client/applyconfiguration/metal/v1alpha4/inventorystatuses.go similarity index 69% rename from applyconfiguration/metal/v1alpha4/inventorystatuses.go rename to client/applyconfiguration/metal/v1alpha4/inventorystatuses.go index dd1df040..4c0cfde5 100644 --- a/applyconfiguration/metal/v1alpha4/inventorystatuses.go +++ b/client/applyconfiguration/metal/v1alpha4/inventorystatuses.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/ipaddressspec.go b/client/applyconfiguration/metal/v1alpha4/ipaddressspec.go similarity index 76% rename from applyconfiguration/metal/v1alpha4/ipaddressspec.go rename to client/applyconfiguration/metal/v1alpha4/ipaddressspec.go index a553ac7e..4c23e408 100644 --- a/applyconfiguration/metal/v1alpha4/ipaddressspec.go +++ b/client/applyconfiguration/metal/v1alpha4/ipaddressspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/ipamselectionspec.go b/client/applyconfiguration/metal/v1alpha4/ipamselectionspec.go similarity index 63% rename from applyconfiguration/metal/v1alpha4/ipamselectionspec.go rename to client/applyconfiguration/metal/v1alpha4/ipamselectionspec.go index 737f1dac..72097f56 100644 --- a/applyconfiguration/metal/v1alpha4/ipamselectionspec.go +++ b/client/applyconfiguration/metal/v1alpha4/ipamselectionspec.go @@ -1,31 +1,18 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha4 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" ) // IPAMSelectionSpecApplyConfiguration represents an declarative configuration of the IPAMSelectionSpec type for use // with apply. type IPAMSelectionSpecApplyConfiguration struct { - LabelSelector *v1.LabelSelector `json:"labelSelector,omitempty"` + LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` FieldSelector *FieldSelectorSpecApplyConfiguration `json:"fieldSelector,omitempty"` } @@ -38,8 +25,8 @@ func IPAMSelectionSpec() *IPAMSelectionSpecApplyConfiguration { // WithLabelSelector sets the LabelSelector 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 LabelSelector field is set to the value of the last call. -func (b *IPAMSelectionSpecApplyConfiguration) WithLabelSelector(value v1.LabelSelector) *IPAMSelectionSpecApplyConfiguration { - b.LabelSelector = &value +func (b *IPAMSelectionSpecApplyConfiguration) WithLabelSelector(value *v1.LabelSelectorApplyConfiguration) *IPAMSelectionSpecApplyConfiguration { + b.LabelSelector = value return b } diff --git a/applyconfiguration/metal/v1alpha4/ipamspec.go b/client/applyconfiguration/metal/v1alpha4/ipamspec.go similarity index 70% rename from applyconfiguration/metal/v1alpha4/ipamspec.go rename to client/applyconfiguration/metal/v1alpha4/ipamspec.go index dfe50c4a..d6520054 100644 --- a/applyconfiguration/metal/v1alpha4/ipamspec.go +++ b/client/applyconfiguration/metal/v1alpha4/ipamspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/ipmispec.go b/client/applyconfiguration/metal/v1alpha4/ipmispec.go similarity index 68% rename from applyconfiguration/metal/v1alpha4/ipmispec.go rename to client/applyconfiguration/metal/v1alpha4/ipmispec.go index e46d4a5c..9edbe93c 100644 --- a/applyconfiguration/metal/v1alpha4/ipmispec.go +++ b/client/applyconfiguration/metal/v1alpha4/ipmispec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/lldpspec.go b/client/applyconfiguration/metal/v1alpha4/lldpspec.go similarity index 85% rename from applyconfiguration/metal/v1alpha4/lldpspec.go rename to client/applyconfiguration/metal/v1alpha4/lldpspec.go index 908a0e4b..5d3986dc 100644 --- a/applyconfiguration/metal/v1alpha4/lldpspec.go +++ b/client/applyconfiguration/metal/v1alpha4/lldpspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/loopbackaddresses.go b/client/applyconfiguration/metal/v1alpha4/loopbackaddresses.go similarity index 70% rename from applyconfiguration/metal/v1alpha4/loopbackaddresses.go rename to client/applyconfiguration/metal/v1alpha4/loopbackaddresses.go index 622914c4..8abd18c2 100644 --- a/applyconfiguration/metal/v1alpha4/loopbackaddresses.go +++ b/client/applyconfiguration/metal/v1alpha4/loopbackaddresses.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/machine.go b/client/applyconfiguration/metal/v1alpha4/machine.go similarity index 93% rename from applyconfiguration/metal/v1alpha4/machine.go rename to client/applyconfiguration/metal/v1alpha4/machine.go index 45c5d00e..571ab91f 100644 --- a/applyconfiguration/metal/v1alpha4/machine.go +++ b/client/applyconfiguration/metal/v1alpha4/machine.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -20,11 +7,11 @@ package v1alpha4 import ( metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - internal "github.com/ironcore-dev/metal/applyconfiguration/internal" + internal "github.com/ironcore-dev/metal/client/applyconfiguration/internal" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MachineApplyConfiguration represents an declarative configuration of the Machine type for use diff --git a/applyconfiguration/metal/v1alpha4/machinespec.go b/client/applyconfiguration/metal/v1alpha4/machinespec.go similarity index 79% rename from applyconfiguration/metal/v1alpha4/machinespec.go rename to client/applyconfiguration/metal/v1alpha4/machinespec.go index 1e5caef1..f463a73b 100644 --- a/applyconfiguration/metal/v1alpha4/machinespec.go +++ b/client/applyconfiguration/metal/v1alpha4/machinespec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/machinestatus.go b/client/applyconfiguration/metal/v1alpha4/machinestatus.go similarity index 82% rename from applyconfiguration/metal/v1alpha4/machinestatus.go rename to client/applyconfiguration/metal/v1alpha4/machinestatus.go index 495ac5c8..f33ce4c8 100644 --- a/applyconfiguration/metal/v1alpha4/machinestatus.go +++ b/client/applyconfiguration/metal/v1alpha4/machinestatus.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/memoryspec.go b/client/applyconfiguration/metal/v1alpha4/memoryspec.go similarity index 58% rename from applyconfiguration/metal/v1alpha4/memoryspec.go rename to client/applyconfiguration/metal/v1alpha4/memoryspec.go index f8314a56..43ef8d71 100644 --- a/applyconfiguration/metal/v1alpha4/memoryspec.go +++ b/client/applyconfiguration/metal/v1alpha4/memoryspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/ndpspec.go b/client/applyconfiguration/metal/v1alpha4/ndpspec.go similarity index 73% rename from applyconfiguration/metal/v1alpha4/ndpspec.go rename to client/applyconfiguration/metal/v1alpha4/ndpspec.go index 5730a088..e0fa93c5 100644 --- a/applyconfiguration/metal/v1alpha4/ndpspec.go +++ b/client/applyconfiguration/metal/v1alpha4/ndpspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/network.go b/client/applyconfiguration/metal/v1alpha4/network.go similarity index 84% rename from applyconfiguration/metal/v1alpha4/network.go rename to client/applyconfiguration/metal/v1alpha4/network.go index cabba87d..a596a8e5 100644 --- a/applyconfiguration/metal/v1alpha4/network.go +++ b/client/applyconfiguration/metal/v1alpha4/network.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/networkswitch.go b/client/applyconfiguration/metal/v1alpha4/networkswitch.go similarity index 94% rename from applyconfiguration/metal/v1alpha4/networkswitch.go rename to client/applyconfiguration/metal/v1alpha4/networkswitch.go index f0b0c78b..ea32732b 100644 --- a/applyconfiguration/metal/v1alpha4/networkswitch.go +++ b/client/applyconfiguration/metal/v1alpha4/networkswitch.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -20,11 +7,11 @@ package v1alpha4 import ( metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - internal "github.com/ironcore-dev/metal/applyconfiguration/internal" + internal "github.com/ironcore-dev/metal/client/applyconfiguration/internal" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NetworkSwitchApplyConfiguration represents an declarative configuration of the NetworkSwitch type for use diff --git a/applyconfiguration/metal/v1alpha4/networkswitchspec.go b/client/applyconfiguration/metal/v1alpha4/networkswitchspec.go similarity index 73% rename from applyconfiguration/metal/v1alpha4/networkswitchspec.go rename to client/applyconfiguration/metal/v1alpha4/networkswitchspec.go index 2ef6ee79..f9d8c9a7 100644 --- a/applyconfiguration/metal/v1alpha4/networkswitchspec.go +++ b/client/applyconfiguration/metal/v1alpha4/networkswitchspec.go @@ -1,39 +1,26 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha4 import ( + metav1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // NetworkSwitchSpecApplyConfiguration represents an declarative configuration of the NetworkSwitchSpec type for use // with apply. type NetworkSwitchSpecApplyConfiguration struct { - InventoryRef *v1.LocalObjectReference `json:"inventoryRef,omitempty"` - ConfigSelector *metav1.LabelSelector `json:"configSelector,omitempty"` - Managed *bool `json:"managed,omitempty"` - Cordon *bool `json:"cordon,omitempty"` - TopSpine *bool `json:"topSpine,omitempty"` - ScanPorts *bool `json:"scanPorts,omitempty"` - IPAM *IPAMSpecApplyConfiguration `json:"ipam,omitempty"` - Interfaces *InterfacesSpecApplyConfiguration `json:"interfaces,omitempty"` + InventoryRef *v1.LocalObjectReference `json:"inventoryRef,omitempty"` + ConfigSelector *metav1.LabelSelectorApplyConfiguration `json:"configSelector,omitempty"` + Managed *bool `json:"managed,omitempty"` + Cordon *bool `json:"cordon,omitempty"` + TopSpine *bool `json:"topSpine,omitempty"` + ScanPorts *bool `json:"scanPorts,omitempty"` + IPAM *IPAMSpecApplyConfiguration `json:"ipam,omitempty"` + Interfaces *InterfacesSpecApplyConfiguration `json:"interfaces,omitempty"` } // NetworkSwitchSpecApplyConfiguration constructs an declarative configuration of the NetworkSwitchSpec type for use with @@ -53,8 +40,8 @@ func (b *NetworkSwitchSpecApplyConfiguration) WithInventoryRef(value v1.LocalObj // WithConfigSelector sets the ConfigSelector 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 ConfigSelector field is set to the value of the last call. -func (b *NetworkSwitchSpecApplyConfiguration) WithConfigSelector(value metav1.LabelSelector) *NetworkSwitchSpecApplyConfiguration { - b.ConfigSelector = &value +func (b *NetworkSwitchSpecApplyConfiguration) WithConfigSelector(value *metav1.LabelSelectorApplyConfiguration) *NetworkSwitchSpecApplyConfiguration { + b.ConfigSelector = value return b } diff --git a/applyconfiguration/metal/v1alpha4/networkswitchstatus.go b/client/applyconfiguration/metal/v1alpha4/networkswitchstatus.go similarity index 92% rename from applyconfiguration/metal/v1alpha4/networkswitchstatus.go rename to client/applyconfiguration/metal/v1alpha4/networkswitchstatus.go index 988824ae..af235c3c 100644 --- a/applyconfiguration/metal/v1alpha4/networkswitchstatus.go +++ b/client/applyconfiguration/metal/v1alpha4/networkswitchstatus.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/nicspec.go b/client/applyconfiguration/metal/v1alpha4/nicspec.go similarity index 88% rename from applyconfiguration/metal/v1alpha4/nicspec.go rename to client/applyconfiguration/metal/v1alpha4/nicspec.go index eec748c9..47bead2b 100644 --- a/applyconfiguration/metal/v1alpha4/nicspec.go +++ b/client/applyconfiguration/metal/v1alpha4/nicspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/numaspec.go b/client/applyconfiguration/metal/v1alpha4/numaspec.go similarity index 79% rename from applyconfiguration/metal/v1alpha4/numaspec.go rename to client/applyconfiguration/metal/v1alpha4/numaspec.go index 6d6ae28b..32d9ee76 100644 --- a/applyconfiguration/metal/v1alpha4/numaspec.go +++ b/client/applyconfiguration/metal/v1alpha4/numaspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/objectreference.go b/client/applyconfiguration/metal/v1alpha4/objectreference.go similarity index 68% rename from applyconfiguration/metal/v1alpha4/objectreference.go rename to client/applyconfiguration/metal/v1alpha4/objectreference.go index dacb92c5..8fd0e07e 100644 --- a/applyconfiguration/metal/v1alpha4/objectreference.go +++ b/client/applyconfiguration/metal/v1alpha4/objectreference.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/partitionspec.go b/client/applyconfiguration/metal/v1alpha4/partitionspec.go similarity index 73% rename from applyconfiguration/metal/v1alpha4/partitionspec.go rename to client/applyconfiguration/metal/v1alpha4/partitionspec.go index 162d66e6..01603f2a 100644 --- a/applyconfiguration/metal/v1alpha4/partitionspec.go +++ b/client/applyconfiguration/metal/v1alpha4/partitionspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/partitiontablespec.go b/client/applyconfiguration/metal/v1alpha4/partitiontablespec.go similarity index 72% rename from applyconfiguration/metal/v1alpha4/partitiontablespec.go rename to client/applyconfiguration/metal/v1alpha4/partitiontablespec.go index d2689ca5..b808d595 100644 --- a/applyconfiguration/metal/v1alpha4/partitiontablespec.go +++ b/client/applyconfiguration/metal/v1alpha4/partitiontablespec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/pcidevicedescriptionspec.go b/client/applyconfiguration/metal/v1alpha4/pcidevicedescriptionspec.go similarity index 69% rename from applyconfiguration/metal/v1alpha4/pcidevicedescriptionspec.go rename to client/applyconfiguration/metal/v1alpha4/pcidevicedescriptionspec.go index e3311930..79b1ed55 100644 --- a/applyconfiguration/metal/v1alpha4/pcidevicedescriptionspec.go +++ b/client/applyconfiguration/metal/v1alpha4/pcidevicedescriptionspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/pcidevicespec.go b/client/applyconfiguration/metal/v1alpha4/pcidevicespec.go similarity index 89% rename from applyconfiguration/metal/v1alpha4/pcidevicespec.go rename to client/applyconfiguration/metal/v1alpha4/pcidevicespec.go index 80addfdd..4c0ad27f 100644 --- a/applyconfiguration/metal/v1alpha4/pcidevicespec.go +++ b/client/applyconfiguration/metal/v1alpha4/pcidevicespec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/peer.go b/client/applyconfiguration/metal/v1alpha4/peer.go similarity index 82% rename from applyconfiguration/metal/v1alpha4/peer.go rename to client/applyconfiguration/metal/v1alpha4/peer.go index e52bb61f..6858ab6c 100644 --- a/applyconfiguration/metal/v1alpha4/peer.go +++ b/client/applyconfiguration/metal/v1alpha4/peer.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/peerinfospec.go b/client/applyconfiguration/metal/v1alpha4/peerinfospec.go similarity index 81% rename from applyconfiguration/metal/v1alpha4/peerinfospec.go rename to client/applyconfiguration/metal/v1alpha4/peerinfospec.go index b327edc8..81efaf0f 100644 --- a/applyconfiguration/metal/v1alpha4/peerinfospec.go +++ b/client/applyconfiguration/metal/v1alpha4/peerinfospec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/client/applyconfiguration/metal/v1alpha4/peerspec.go b/client/applyconfiguration/metal/v1alpha4/peerspec.go new file mode 100644 index 00000000..22937108 --- /dev/null +++ b/client/applyconfiguration/metal/v1alpha4/peerspec.go @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha4 + +// PeerSpecApplyConfiguration represents an declarative configuration of the PeerSpec type for use +// with apply. +type PeerSpecApplyConfiguration struct { + ObjectReferenceApplyConfiguration `json:",inline"` + PeerInfoSpecApplyConfiguration `json:",inline"` +} + +// PeerSpecApplyConfiguration constructs an declarative configuration of the PeerSpec type for use with +// apply. +func PeerSpec() *PeerSpecApplyConfiguration { + return &PeerSpecApplyConfiguration{} +} diff --git a/applyconfiguration/metal/v1alpha4/portparametersspec.go b/client/applyconfiguration/metal/v1alpha4/portparametersspec.go similarity index 83% rename from applyconfiguration/metal/v1alpha4/portparametersspec.go rename to client/applyconfiguration/metal/v1alpha4/portparametersspec.go index fbfea232..1c584705 100644 --- a/applyconfiguration/metal/v1alpha4/portparametersspec.go +++ b/client/applyconfiguration/metal/v1alpha4/portparametersspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/regionspec.go b/client/applyconfiguration/metal/v1alpha4/regionspec.go similarity index 68% rename from applyconfiguration/metal/v1alpha4/regionspec.go rename to client/applyconfiguration/metal/v1alpha4/regionspec.go index 84383463..60f881aa 100644 --- a/applyconfiguration/metal/v1alpha4/regionspec.go +++ b/client/applyconfiguration/metal/v1alpha4/regionspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/reservation.go b/client/applyconfiguration/metal/v1alpha4/reservation.go similarity index 75% rename from applyconfiguration/metal/v1alpha4/reservation.go rename to client/applyconfiguration/metal/v1alpha4/reservation.go index 405ad199..88c6f5a2 100644 --- a/applyconfiguration/metal/v1alpha4/reservation.go +++ b/client/applyconfiguration/metal/v1alpha4/reservation.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/resourcereference.go b/client/applyconfiguration/metal/v1alpha4/resourcereference.go similarity index 78% rename from applyconfiguration/metal/v1alpha4/resourcereference.go rename to client/applyconfiguration/metal/v1alpha4/resourcereference.go index bd0d4ae8..ab3a7c0c 100644 --- a/applyconfiguration/metal/v1alpha4/resourcereference.go +++ b/client/applyconfiguration/metal/v1alpha4/resourcereference.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/client/applyconfiguration/metal/v1alpha4/size.go b/client/applyconfiguration/metal/v1alpha4/size.go new file mode 100644 index 00000000..55111618 --- /dev/null +++ b/client/applyconfiguration/metal/v1alpha4/size.go @@ -0,0 +1,245 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + internal "github.com/ironcore-dev/metal/client/applyconfiguration/internal" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// SizeApplyConfiguration represents an declarative configuration of the Size type for use +// with apply. +type SizeApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *SizeSpecApplyConfiguration `json:"spec,omitempty"` + Status *metalv1alpha4.SizeStatus `json:"status,omitempty"` +} + +// Size constructs an declarative configuration of the Size type for use with +// apply. +func Size(name, namespace string) *SizeApplyConfiguration { + b := &SizeApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Size") + b.WithAPIVersion("metal.ironcore.dev/v1alpha4") + return b +} + +// ExtractSize extracts the applied configuration owned by fieldManager from +// size. If no managedFields are found in size for fieldManager, a +// SizeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// size must be a unmodified Size API object that was retrieved from the Kubernetes API. +// ExtractSize provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractSize(size *metalv1alpha4.Size, fieldManager string) (*SizeApplyConfiguration, error) { + return extractSize(size, fieldManager, "") +} + +// ExtractSizeStatus is the same as ExtractSize except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractSizeStatus(size *metalv1alpha4.Size, fieldManager string) (*SizeApplyConfiguration, error) { + return extractSize(size, fieldManager, "status") +} + +func extractSize(size *metalv1alpha4.Size, fieldManager string, subresource string) (*SizeApplyConfiguration, error) { + b := &SizeApplyConfiguration{} + err := managedfields.ExtractInto(size, internal.Parser().Type("com.github.ironcore-dev.metal.apis.metal.v1alpha4.Size"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(size.Name) + b.WithNamespace(size.Namespace) + + b.WithKind("Size") + b.WithAPIVersion("metal.ironcore.dev/v1alpha4") + return b, nil +} + +// 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 *SizeApplyConfiguration) WithKind(value string) *SizeApplyConfiguration { + b.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 *SizeApplyConfiguration) WithAPIVersion(value string) *SizeApplyConfiguration { + b.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 *SizeApplyConfiguration) WithName(value string) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithGenerateName(value string) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithNamespace(value string) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithUID(value types.UID) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithResourceVersion(value string) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithGeneration(value int64) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.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 *SizeApplyConfiguration) WithLabels(entries map[string]string) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.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 *SizeApplyConfiguration) WithAnnotations(entries map[string]string) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.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 *SizeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.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 *SizeApplyConfiguration) WithFinalizers(values ...string) *SizeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *SizeApplyConfiguration) 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 *SizeApplyConfiguration) WithSpec(value *SizeSpecApplyConfiguration) *SizeApplyConfiguration { + 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 *SizeApplyConfiguration) WithStatus(value metalv1alpha4.SizeStatus) *SizeApplyConfiguration { + b.Status = &value + return b +} diff --git a/client/applyconfiguration/metal/v1alpha4/sizespec.go b/client/applyconfiguration/metal/v1alpha4/sizespec.go new file mode 100644 index 00000000..db4dcf49 --- /dev/null +++ b/client/applyconfiguration/metal/v1alpha4/sizespec.go @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha4 + +// SizeSpecApplyConfiguration represents an declarative configuration of the SizeSpec type for use +// with apply. +type SizeSpecApplyConfiguration struct { + Constraints []ConstraintSpecApplyConfiguration `json:"constraints,omitempty"` +} + +// SizeSpecApplyConfiguration constructs an declarative configuration of the SizeSpec type for use with +// apply. +func SizeSpec() *SizeSpecApplyConfiguration { + return &SizeSpecApplyConfiguration{} +} + +// WithConstraints adds the given value to the Constraints 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 Constraints field. +func (b *SizeSpecApplyConfiguration) WithConstraints(values ...*ConstraintSpecApplyConfiguration) *SizeSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConstraints") + } + b.Constraints = append(b.Constraints, *values[i]) + } + return b +} diff --git a/applyconfiguration/metal/v1alpha4/subnetspec.go b/client/applyconfiguration/metal/v1alpha4/subnetspec.go similarity index 82% rename from applyconfiguration/metal/v1alpha4/subnetspec.go rename to client/applyconfiguration/metal/v1alpha4/subnetspec.go index 3b202570..8e081435 100644 --- a/applyconfiguration/metal/v1alpha4/subnetspec.go +++ b/client/applyconfiguration/metal/v1alpha4/subnetspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/switchconfig.go b/client/applyconfiguration/metal/v1alpha4/switchconfig.go similarity index 94% rename from applyconfiguration/metal/v1alpha4/switchconfig.go rename to client/applyconfiguration/metal/v1alpha4/switchconfig.go index 2cfdeeb4..81314098 100644 --- a/applyconfiguration/metal/v1alpha4/switchconfig.go +++ b/client/applyconfiguration/metal/v1alpha4/switchconfig.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -20,11 +7,11 @@ package v1alpha4 import ( metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - internal "github.com/ironcore-dev/metal/applyconfiguration/internal" + internal "github.com/ironcore-dev/metal/client/applyconfiguration/internal" + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // SwitchConfigApplyConfiguration represents an declarative configuration of the SwitchConfig type for use diff --git a/applyconfiguration/metal/v1alpha4/switchconfigspec.go b/client/applyconfiguration/metal/v1alpha4/switchconfigspec.go similarity index 76% rename from applyconfiguration/metal/v1alpha4/switchconfigspec.go rename to client/applyconfiguration/metal/v1alpha4/switchconfigspec.go index 296c3622..fc5cc910 100644 --- a/applyconfiguration/metal/v1alpha4/switchconfigspec.go +++ b/client/applyconfiguration/metal/v1alpha4/switchconfigspec.go @@ -1,32 +1,19 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha4 import ( + v1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // SwitchConfigSpecApplyConfiguration represents an declarative configuration of the SwitchConfigSpec type for use // with apply. type SwitchConfigSpecApplyConfiguration struct { - Switches *v1.LabelSelector `json:"switches,omitempty"` + Switches *v1.LabelSelectorApplyConfiguration `json:"switches,omitempty"` PortsDefaults *PortParametersSpecApplyConfiguration `json:"portsDefaults,omitempty"` IPAM *GeneralIPAMSpecApplyConfiguration `json:"ipam,omitempty"` RoutingConfigTemplate *corev1.LocalObjectReference `json:"routingConfigTemplate,omitempty"` @@ -41,8 +28,8 @@ func SwitchConfigSpec() *SwitchConfigSpecApplyConfiguration { // WithSwitches sets the Switches 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 Switches field is set to the value of the last call. -func (b *SwitchConfigSpecApplyConfiguration) WithSwitches(value v1.LabelSelector) *SwitchConfigSpecApplyConfiguration { - b.Switches = &value +func (b *SwitchConfigSpecApplyConfiguration) WithSwitches(value *v1.LabelSelectorApplyConfiguration) *SwitchConfigSpecApplyConfiguration { + b.Switches = value return b } diff --git a/applyconfiguration/metal/v1alpha4/systemspec.go b/client/applyconfiguration/metal/v1alpha4/systemspec.go similarity index 78% rename from applyconfiguration/metal/v1alpha4/systemspec.go rename to client/applyconfiguration/metal/v1alpha4/systemspec.go index a0af3a43..3be31afa 100644 --- a/applyconfiguration/metal/v1alpha4/systemspec.go +++ b/client/applyconfiguration/metal/v1alpha4/systemspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/metal/v1alpha4/virtspec.go b/client/applyconfiguration/metal/v1alpha4/virtspec.go similarity index 57% rename from applyconfiguration/metal/v1alpha4/virtspec.go rename to client/applyconfiguration/metal/v1alpha4/virtspec.go index 882981a8..d5fc99bd 100644 --- a/applyconfiguration/metal/v1alpha4/virtspec.go +++ b/client/applyconfiguration/metal/v1alpha4/virtspec.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. diff --git a/applyconfiguration/utils.go b/client/applyconfiguration/utils.go similarity index 84% rename from applyconfiguration/utils.go rename to client/applyconfiguration/utils.go index 8bd3f8f8..214623d4 100644 --- a/applyconfiguration/utils.go +++ b/client/applyconfiguration/utils.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. @@ -20,7 +7,9 @@ package applyconfiguration import ( v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - metalv1alpha4 "github.com/ironcore-dev/metal/applyconfiguration/metal/v1alpha4" + metav1 "github.com/ironcore-dev/metal/client/applyconfiguration/meta/v1" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -28,7 +17,21 @@ import ( // apply configuration type exists for the given GroupVersionKind. func ForKind(kind schema.GroupVersionKind) interface{} { switch kind { - // Group=metal.ironcore.dev, Version=v1alpha4 + // Group=meta.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("LabelSelector"): + return &metav1.LabelSelectorApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("LabelSelectorRequirement"): + return &metav1.LabelSelectorRequirementApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ManagedFieldsEntry"): + return &metav1.ManagedFieldsEntryApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ObjectMeta"): + return &metav1.ObjectMetaApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("OwnerReference"): + return &metav1.OwnerReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("TypeMeta"): + return &metav1.TypeMetaApplyConfiguration{} + + // Group=metal.ironcore.dev, Version=v1alpha4 case v1alpha4.SchemeGroupVersion.WithKind("AdditionalIPSpec"): return &metalv1alpha4.AdditionalIPSpecApplyConfiguration{} case v1alpha4.SchemeGroupVersion.WithKind("Addresses"): @@ -55,6 +58,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &metalv1alpha4.BlockSpecApplyConfiguration{} case v1alpha4.SchemeGroupVersion.WithKind("ConditionSpec"): return &metalv1alpha4.ConditionSpecApplyConfiguration{} + case v1alpha4.SchemeGroupVersion.WithKind("ConstraintSpec"): + return &metalv1alpha4.ConstraintSpecApplyConfiguration{} case v1alpha4.SchemeGroupVersion.WithKind("CPUSpec"): return &metalv1alpha4.CPUSpecApplyConfiguration{} case v1alpha4.SchemeGroupVersion.WithKind("DistroSpec"): @@ -143,6 +148,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &metalv1alpha4.ReservationApplyConfiguration{} case v1alpha4.SchemeGroupVersion.WithKind("ResourceReference"): return &metalv1alpha4.ResourceReferenceApplyConfiguration{} + case v1alpha4.SchemeGroupVersion.WithKind("Size"): + return &metalv1alpha4.SizeApplyConfiguration{} + case v1alpha4.SchemeGroupVersion.WithKind("SizeSpec"): + return &metalv1alpha4.SizeSpecApplyConfiguration{} case v1alpha4.SchemeGroupVersion.WithKind("SubnetSpec"): return &metalv1alpha4.SubnetSpecApplyConfiguration{} case v1alpha4.SchemeGroupVersion.WithKind("SwitchConfig"): diff --git a/client/metal/clientset.go b/client/metal/clientset.go new file mode 100644 index 00000000..e4b9c2ef --- /dev/null +++ b/client/metal/clientset.go @@ -0,0 +1,107 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package metal + +import ( + "fmt" + "net/http" + + metalv1alpha4 "github.com/ironcore-dev/metal/client/metal/typed/metal/v1alpha4" + 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 + MetalV1alpha4() metalv1alpha4.MetalV1alpha4Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + metalV1alpha4 *metalv1alpha4.MetalV1alpha4Client +} + +// MetalV1alpha4 retrieves the MetalV1alpha4Client +func (c *Clientset) MetalV1alpha4() metalv1alpha4.MetalV1alpha4Interface { + return c.metalV1alpha4 +} + +// 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.metalV1alpha4, err = metalv1alpha4.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.metalV1alpha4 = metalv1alpha4.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/client/metal/fake/clientset_generated.go b/client/metal/fake/clientset_generated.go new file mode 100644 index 00000000..b8294959 --- /dev/null +++ b/client/metal/fake/clientset_generated.go @@ -0,0 +1,72 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/ironcore-dev/metal/client/metal" + metalv1alpha4 "github.com/ironcore-dev/metal/client/metal/typed/metal/v1alpha4" + fakemetalv1alpha4 "github.com/ironcore-dev/metal/client/metal/typed/metal/v1alpha4/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 validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +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 +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// MetalV1alpha4 retrieves the MetalV1alpha4Client +func (c *Clientset) MetalV1alpha4() metalv1alpha4.MetalV1alpha4Interface { + return &fakemetalv1alpha4.FakeMetalV1alpha4{Fake: &c.Fake} +} diff --git a/client/metal/fake/doc.go b/client/metal/fake/doc.go new file mode 100644 index 00000000..e1c3fbb4 --- /dev/null +++ b/client/metal/fake/doc.go @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/client/metal/fake/register.go b/client/metal/fake/register.go new file mode 100644 index 00000000..1bc9cb6a --- /dev/null +++ b/client/metal/fake/register.go @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + 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{ + metalv1alpha4.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/client/metal/scheme/doc.go b/client/metal/scheme/doc.go new file mode 100644 index 00000000..f269c518 --- /dev/null +++ b/client/metal/scheme/doc.go @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/client/metal/scheme/register.go b/client/metal/scheme/register.go new file mode 100644 index 00000000..050f31da --- /dev/null +++ b/client/metal/scheme/register.go @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + 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{ + metalv1alpha4.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/client/metal/typed/metal/v1alpha4/aggregate.go b/client/metal/typed/metal/v1alpha4/aggregate.go new file mode 100644 index 00000000..69e9ae21 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/aggregate.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + scheme "github.com/ironcore-dev/metal/client/metal/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// AggregatesGetter has a method to return a AggregateInterface. +// A group's client should implement this interface. +type AggregatesGetter interface { + Aggregates(namespace string) AggregateInterface +} + +// AggregateInterface has methods to work with Aggregate resources. +type AggregateInterface interface { + Create(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.CreateOptions) (*v1alpha4.Aggregate, error) + Update(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.UpdateOptions) (*v1alpha4.Aggregate, error) + UpdateStatus(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.UpdateOptions) (*v1alpha4.Aggregate, 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) (*v1alpha4.Aggregate, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.AggregateList, 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 *v1alpha4.Aggregate, err error) + Apply(ctx context.Context, aggregate *metalv1alpha4.AggregateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Aggregate, err error) + ApplyStatus(ctx context.Context, aggregate *metalv1alpha4.AggregateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Aggregate, err error) + AggregateExpansion +} + +// aggregates implements AggregateInterface +type aggregates struct { + client rest.Interface + ns string +} + +// newAggregates returns a Aggregates +func newAggregates(c *MetalV1alpha4Client, namespace string) *aggregates { + return &aggregates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the aggregate, and returns the corresponding aggregate object, and an error if there is any. +func (c *aggregates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Aggregate, err error) { + result = &v1alpha4.Aggregate{} + err = c.client.Get(). + Namespace(c.ns). + Resource("aggregates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Aggregates that match those selectors. +func (c *aggregates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.AggregateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.AggregateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("aggregates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested aggregates. +func (c *aggregates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("aggregates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a aggregate and creates it. Returns the server's representation of the aggregate, and an error, if there is any. +func (c *aggregates) Create(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.CreateOptions) (result *v1alpha4.Aggregate, err error) { + result = &v1alpha4.Aggregate{} + err = c.client.Post(). + Namespace(c.ns). + Resource("aggregates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aggregate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a aggregate and updates it. Returns the server's representation of the aggregate, and an error, if there is any. +func (c *aggregates) Update(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.UpdateOptions) (result *v1alpha4.Aggregate, err error) { + result = &v1alpha4.Aggregate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("aggregates"). + Name(aggregate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aggregate). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *aggregates) UpdateStatus(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.UpdateOptions) (result *v1alpha4.Aggregate, err error) { + result = &v1alpha4.Aggregate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("aggregates"). + Name(aggregate.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aggregate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the aggregate and deletes it. Returns an error if one occurs. +func (c *aggregates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("aggregates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *aggregates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("aggregates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched aggregate. +func (c *aggregates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Aggregate, err error) { + result = &v1alpha4.Aggregate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("aggregates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied aggregate. +func (c *aggregates) Apply(ctx context.Context, aggregate *metalv1alpha4.AggregateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Aggregate, err error) { + if aggregate == nil { + return nil, fmt.Errorf("aggregate provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(aggregate) + if err != nil { + return nil, err + } + name := aggregate.Name + if name == nil { + return nil, fmt.Errorf("aggregate.Name must be provided to Apply") + } + result = &v1alpha4.Aggregate{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("aggregates"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *aggregates) ApplyStatus(ctx context.Context, aggregate *metalv1alpha4.AggregateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Aggregate, err error) { + if aggregate == nil { + return nil, fmt.Errorf("aggregate provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(aggregate) + if err != nil { + return nil, err + } + + name := aggregate.Name + if name == nil { + return nil, fmt.Errorf("aggregate.Name must be provided to Apply") + } + + result = &v1alpha4.Aggregate{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("aggregates"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/metal/typed/metal/v1alpha4/benchmark.go b/client/metal/typed/metal/v1alpha4/benchmark.go new file mode 100644 index 00000000..54929b92 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/benchmark.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + scheme "github.com/ironcore-dev/metal/client/metal/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// BenchmarksGetter has a method to return a BenchmarkInterface. +// A group's client should implement this interface. +type BenchmarksGetter interface { + Benchmarks(namespace string) BenchmarkInterface +} + +// BenchmarkInterface has methods to work with Benchmark resources. +type BenchmarkInterface interface { + Create(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.CreateOptions) (*v1alpha4.Benchmark, error) + Update(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.UpdateOptions) (*v1alpha4.Benchmark, error) + UpdateStatus(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.UpdateOptions) (*v1alpha4.Benchmark, 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) (*v1alpha4.Benchmark, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.BenchmarkList, 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 *v1alpha4.Benchmark, err error) + Apply(ctx context.Context, benchmark *metalv1alpha4.BenchmarkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Benchmark, err error) + ApplyStatus(ctx context.Context, benchmark *metalv1alpha4.BenchmarkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Benchmark, err error) + BenchmarkExpansion +} + +// benchmarks implements BenchmarkInterface +type benchmarks struct { + client rest.Interface + ns string +} + +// newBenchmarks returns a Benchmarks +func newBenchmarks(c *MetalV1alpha4Client, namespace string) *benchmarks { + return &benchmarks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the benchmark, and returns the corresponding benchmark object, and an error if there is any. +func (c *benchmarks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Benchmark, err error) { + result = &v1alpha4.Benchmark{} + err = c.client.Get(). + Namespace(c.ns). + Resource("benchmarks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Benchmarks that match those selectors. +func (c *benchmarks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.BenchmarkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.BenchmarkList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("benchmarks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested benchmarks. +func (c *benchmarks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("benchmarks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a benchmark and creates it. Returns the server's representation of the benchmark, and an error, if there is any. +func (c *benchmarks) Create(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.CreateOptions) (result *v1alpha4.Benchmark, err error) { + result = &v1alpha4.Benchmark{} + err = c.client.Post(). + Namespace(c.ns). + Resource("benchmarks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(benchmark). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a benchmark and updates it. Returns the server's representation of the benchmark, and an error, if there is any. +func (c *benchmarks) Update(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.UpdateOptions) (result *v1alpha4.Benchmark, err error) { + result = &v1alpha4.Benchmark{} + err = c.client.Put(). + Namespace(c.ns). + Resource("benchmarks"). + Name(benchmark.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(benchmark). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *benchmarks) UpdateStatus(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.UpdateOptions) (result *v1alpha4.Benchmark, err error) { + result = &v1alpha4.Benchmark{} + err = c.client.Put(). + Namespace(c.ns). + Resource("benchmarks"). + Name(benchmark.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(benchmark). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the benchmark and deletes it. Returns an error if one occurs. +func (c *benchmarks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("benchmarks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *benchmarks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("benchmarks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched benchmark. +func (c *benchmarks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Benchmark, err error) { + result = &v1alpha4.Benchmark{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("benchmarks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied benchmark. +func (c *benchmarks) Apply(ctx context.Context, benchmark *metalv1alpha4.BenchmarkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Benchmark, err error) { + if benchmark == nil { + return nil, fmt.Errorf("benchmark provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(benchmark) + if err != nil { + return nil, err + } + name := benchmark.Name + if name == nil { + return nil, fmt.Errorf("benchmark.Name must be provided to Apply") + } + result = &v1alpha4.Benchmark{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("benchmarks"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *benchmarks) ApplyStatus(ctx context.Context, benchmark *metalv1alpha4.BenchmarkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Benchmark, err error) { + if benchmark == nil { + return nil, fmt.Errorf("benchmark provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(benchmark) + if err != nil { + return nil, err + } + + name := benchmark.Name + if name == nil { + return nil, fmt.Errorf("benchmark.Name must be provided to Apply") + } + + result = &v1alpha4.Benchmark{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("benchmarks"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/metal/typed/metal/v1alpha4/doc.go b/client/metal/typed/metal/v1alpha4/doc.go new file mode 100644 index 00000000..44f1b0bf --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/doc.go @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha4 diff --git a/client/metal/typed/metal/v1alpha4/fake/doc.go b/client/metal/typed/metal/v1alpha4/fake/doc.go new file mode 100644 index 00000000..cccbd0d2 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/doc.go @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_aggregate.go b/client/metal/typed/metal/v1alpha4/fake/fake_aggregate.go new file mode 100644 index 00000000..8ac4a1a5 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_aggregate.go @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAggregates implements AggregateInterface +type FakeAggregates struct { + Fake *FakeMetalV1alpha4 + ns string +} + +var aggregatesResource = v1alpha4.SchemeGroupVersion.WithResource("aggregates") + +var aggregatesKind = v1alpha4.SchemeGroupVersion.WithKind("Aggregate") + +// Get takes name of the aggregate, and returns the corresponding aggregate object, and an error if there is any. +func (c *FakeAggregates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Aggregate, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(aggregatesResource, c.ns, name), &v1alpha4.Aggregate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Aggregate), err +} + +// List takes label and field selectors, and returns the list of Aggregates that match those selectors. +func (c *FakeAggregates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.AggregateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(aggregatesResource, aggregatesKind, c.ns, opts), &v1alpha4.AggregateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.AggregateList{ListMeta: obj.(*v1alpha4.AggregateList).ListMeta} + for _, item := range obj.(*v1alpha4.AggregateList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested aggregates. +func (c *FakeAggregates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(aggregatesResource, c.ns, opts)) + +} + +// Create takes the representation of a aggregate and creates it. Returns the server's representation of the aggregate, and an error, if there is any. +func (c *FakeAggregates) Create(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.CreateOptions) (result *v1alpha4.Aggregate, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(aggregatesResource, c.ns, aggregate), &v1alpha4.Aggregate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Aggregate), err +} + +// Update takes the representation of a aggregate and updates it. Returns the server's representation of the aggregate, and an error, if there is any. +func (c *FakeAggregates) Update(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.UpdateOptions) (result *v1alpha4.Aggregate, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(aggregatesResource, c.ns, aggregate), &v1alpha4.Aggregate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Aggregate), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeAggregates) UpdateStatus(ctx context.Context, aggregate *v1alpha4.Aggregate, opts v1.UpdateOptions) (*v1alpha4.Aggregate, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(aggregatesResource, "status", c.ns, aggregate), &v1alpha4.Aggregate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Aggregate), err +} + +// Delete takes name of the aggregate and deletes it. Returns an error if one occurs. +func (c *FakeAggregates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(aggregatesResource, c.ns, name, opts), &v1alpha4.Aggregate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAggregates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(aggregatesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.AggregateList{}) + return err +} + +// Patch applies the patch and returns the patched aggregate. +func (c *FakeAggregates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Aggregate, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(aggregatesResource, c.ns, name, pt, data, subresources...), &v1alpha4.Aggregate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Aggregate), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied aggregate. +func (c *FakeAggregates) Apply(ctx context.Context, aggregate *metalv1alpha4.AggregateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Aggregate, err error) { + if aggregate == nil { + return nil, fmt.Errorf("aggregate provided to Apply must not be nil") + } + data, err := json.Marshal(aggregate) + if err != nil { + return nil, err + } + name := aggregate.Name + if name == nil { + return nil, fmt.Errorf("aggregate.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(aggregatesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha4.Aggregate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Aggregate), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeAggregates) ApplyStatus(ctx context.Context, aggregate *metalv1alpha4.AggregateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Aggregate, err error) { + if aggregate == nil { + return nil, fmt.Errorf("aggregate provided to Apply must not be nil") + } + data, err := json.Marshal(aggregate) + if err != nil { + return nil, err + } + name := aggregate.Name + if name == nil { + return nil, fmt.Errorf("aggregate.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(aggregatesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha4.Aggregate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Aggregate), err +} diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_benchmark.go b/client/metal/typed/metal/v1alpha4/fake/fake_benchmark.go new file mode 100644 index 00000000..1fa3c987 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_benchmark.go @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBenchmarks implements BenchmarkInterface +type FakeBenchmarks struct { + Fake *FakeMetalV1alpha4 + ns string +} + +var benchmarksResource = v1alpha4.SchemeGroupVersion.WithResource("benchmarks") + +var benchmarksKind = v1alpha4.SchemeGroupVersion.WithKind("Benchmark") + +// Get takes name of the benchmark, and returns the corresponding benchmark object, and an error if there is any. +func (c *FakeBenchmarks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Benchmark, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(benchmarksResource, c.ns, name), &v1alpha4.Benchmark{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Benchmark), err +} + +// List takes label and field selectors, and returns the list of Benchmarks that match those selectors. +func (c *FakeBenchmarks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.BenchmarkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(benchmarksResource, benchmarksKind, c.ns, opts), &v1alpha4.BenchmarkList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.BenchmarkList{ListMeta: obj.(*v1alpha4.BenchmarkList).ListMeta} + for _, item := range obj.(*v1alpha4.BenchmarkList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested benchmarks. +func (c *FakeBenchmarks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(benchmarksResource, c.ns, opts)) + +} + +// Create takes the representation of a benchmark and creates it. Returns the server's representation of the benchmark, and an error, if there is any. +func (c *FakeBenchmarks) Create(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.CreateOptions) (result *v1alpha4.Benchmark, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(benchmarksResource, c.ns, benchmark), &v1alpha4.Benchmark{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Benchmark), err +} + +// Update takes the representation of a benchmark and updates it. Returns the server's representation of the benchmark, and an error, if there is any. +func (c *FakeBenchmarks) Update(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.UpdateOptions) (result *v1alpha4.Benchmark, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(benchmarksResource, c.ns, benchmark), &v1alpha4.Benchmark{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Benchmark), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBenchmarks) UpdateStatus(ctx context.Context, benchmark *v1alpha4.Benchmark, opts v1.UpdateOptions) (*v1alpha4.Benchmark, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(benchmarksResource, "status", c.ns, benchmark), &v1alpha4.Benchmark{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Benchmark), err +} + +// Delete takes name of the benchmark and deletes it. Returns an error if one occurs. +func (c *FakeBenchmarks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(benchmarksResource, c.ns, name, opts), &v1alpha4.Benchmark{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBenchmarks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(benchmarksResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.BenchmarkList{}) + return err +} + +// Patch applies the patch and returns the patched benchmark. +func (c *FakeBenchmarks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Benchmark, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(benchmarksResource, c.ns, name, pt, data, subresources...), &v1alpha4.Benchmark{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Benchmark), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied benchmark. +func (c *FakeBenchmarks) Apply(ctx context.Context, benchmark *metalv1alpha4.BenchmarkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Benchmark, err error) { + if benchmark == nil { + return nil, fmt.Errorf("benchmark provided to Apply must not be nil") + } + data, err := json.Marshal(benchmark) + if err != nil { + return nil, err + } + name := benchmark.Name + if name == nil { + return nil, fmt.Errorf("benchmark.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(benchmarksResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha4.Benchmark{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Benchmark), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeBenchmarks) ApplyStatus(ctx context.Context, benchmark *metalv1alpha4.BenchmarkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Benchmark, err error) { + if benchmark == nil { + return nil, fmt.Errorf("benchmark provided to Apply must not be nil") + } + data, err := json.Marshal(benchmark) + if err != nil { + return nil, err + } + name := benchmark.Name + if name == nil { + return nil, fmt.Errorf("benchmark.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(benchmarksResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha4.Benchmark{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Benchmark), err +} diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_inventory.go b/client/metal/typed/metal/v1alpha4/fake/fake_inventory.go new file mode 100644 index 00000000..944f05f8 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_inventory.go @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeInventories implements InventoryInterface +type FakeInventories struct { + Fake *FakeMetalV1alpha4 + ns string +} + +var inventoriesResource = v1alpha4.SchemeGroupVersion.WithResource("inventories") + +var inventoriesKind = v1alpha4.SchemeGroupVersion.WithKind("Inventory") + +// Get takes name of the inventory, and returns the corresponding inventory object, and an error if there is any. +func (c *FakeInventories) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(inventoriesResource, c.ns, name), &v1alpha4.Inventory{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Inventory), err +} + +// List takes label and field selectors, and returns the list of Inventories that match those selectors. +func (c *FakeInventories) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.InventoryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(inventoriesResource, inventoriesKind, c.ns, opts), &v1alpha4.InventoryList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.InventoryList{ListMeta: obj.(*v1alpha4.InventoryList).ListMeta} + for _, item := range obj.(*v1alpha4.InventoryList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested inventories. +func (c *FakeInventories) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(inventoriesResource, c.ns, opts)) + +} + +// Create takes the representation of a inventory and creates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *FakeInventories) Create(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.CreateOptions) (result *v1alpha4.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(inventoriesResource, c.ns, inventory), &v1alpha4.Inventory{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Inventory), err +} + +// Update takes the representation of a inventory and updates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *FakeInventories) Update(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.UpdateOptions) (result *v1alpha4.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(inventoriesResource, c.ns, inventory), &v1alpha4.Inventory{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Inventory), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeInventories) UpdateStatus(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.UpdateOptions) (*v1alpha4.Inventory, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(inventoriesResource, "status", c.ns, inventory), &v1alpha4.Inventory{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Inventory), err +} + +// Delete takes name of the inventory and deletes it. Returns an error if one occurs. +func (c *FakeInventories) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(inventoriesResource, c.ns, name, opts), &v1alpha4.Inventory{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeInventories) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(inventoriesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.InventoryList{}) + return err +} + +// Patch applies the patch and returns the patched inventory. +func (c *FakeInventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Inventory, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(inventoriesResource, c.ns, name, pt, data, subresources...), &v1alpha4.Inventory{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Inventory), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied inventory. +func (c *FakeInventories) Apply(ctx context.Context, inventory *metalv1alpha4.InventoryApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Inventory, err error) { + if inventory == nil { + return nil, fmt.Errorf("inventory provided to Apply must not be nil") + } + data, err := json.Marshal(inventory) + if err != nil { + return nil, err + } + name := inventory.Name + if name == nil { + return nil, fmt.Errorf("inventory.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(inventoriesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha4.Inventory{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Inventory), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeInventories) ApplyStatus(ctx context.Context, inventory *metalv1alpha4.InventoryApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Inventory, err error) { + if inventory == nil { + return nil, fmt.Errorf("inventory provided to Apply must not be nil") + } + data, err := json.Marshal(inventory) + if err != nil { + return nil, err + } + name := inventory.Name + if name == nil { + return nil, fmt.Errorf("inventory.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(inventoriesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha4.Inventory{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Inventory), err +} diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_machine.go b/client/metal/typed/metal/v1alpha4/fake/fake_machine.go new file mode 100644 index 00000000..1623453e --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_machine.go @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeMachines implements MachineInterface +type FakeMachines struct { + Fake *FakeMetalV1alpha4 + ns string +} + +var machinesResource = v1alpha4.SchemeGroupVersion.WithResource("machines") + +var machinesKind = v1alpha4.SchemeGroupVersion.WithKind("Machine") + +// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. +func (c *FakeMachines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(machinesResource, c.ns, name), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *FakeMachines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.MachineList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &v1alpha4.MachineList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.MachineList{ListMeta: obj.(*v1alpha4.MachineList).ListMeta} + for _, item := range obj.(*v1alpha4.MachineList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested machines. +func (c *FakeMachines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(machinesResource, c.ns, opts)) + +} + +// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *FakeMachines) Create(ctx context.Context, machine *v1alpha4.Machine, opts v1.CreateOptions) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *FakeMachines) Update(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeMachines) UpdateStatus(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (*v1alpha4.Machine, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *FakeMachines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(machinesResource, c.ns, name, opts), &v1alpha4.Machine{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMachines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(machinesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.MachineList{}) + return err +} + +// Patch applies the patch and returns the patched machine. +func (c *FakeMachines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, pt, data, subresources...), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied machine. +func (c *FakeMachines) Apply(ctx context.Context, machine *metalv1alpha4.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Machine, err error) { + if machine == nil { + return nil, fmt.Errorf("machine provided to Apply must not be nil") + } + data, err := json.Marshal(machine) + if err != nil { + return nil, err + } + name := machine.Name + if name == nil { + return nil, fmt.Errorf("machine.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeMachines) ApplyStatus(ctx context.Context, machine *metalv1alpha4.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Machine, err error) { + if machine == nil { + return nil, fmt.Errorf("machine provided to Apply must not be nil") + } + data, err := json.Marshal(machine) + if err != nil { + return nil, err + } + name := machine.Name + if name == nil { + return nil, fmt.Errorf("machine.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_metal_client.go b/client/metal/typed/metal/v1alpha4/fake/fake_metal_client.go new file mode 100644 index 00000000..7ef9d236 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_metal_client.go @@ -0,0 +1,51 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha4 "github.com/ironcore-dev/metal/client/metal/typed/metal/v1alpha4" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeMetalV1alpha4 struct { + *testing.Fake +} + +func (c *FakeMetalV1alpha4) Aggregates(namespace string) v1alpha4.AggregateInterface { + return &FakeAggregates{c, namespace} +} + +func (c *FakeMetalV1alpha4) Benchmarks(namespace string) v1alpha4.BenchmarkInterface { + return &FakeBenchmarks{c, namespace} +} + +func (c *FakeMetalV1alpha4) Inventories(namespace string) v1alpha4.InventoryInterface { + return &FakeInventories{c, namespace} +} + +func (c *FakeMetalV1alpha4) Machines(namespace string) v1alpha4.MachineInterface { + return &FakeMachines{c, namespace} +} + +func (c *FakeMetalV1alpha4) NetworkSwitches(namespace string) v1alpha4.NetworkSwitchInterface { + return &FakeNetworkSwitches{c, namespace} +} + +func (c *FakeMetalV1alpha4) Sizes(namespace string) v1alpha4.SizeInterface { + return &FakeSizes{c, namespace} +} + +func (c *FakeMetalV1alpha4) SwitchConfigs(namespace string) v1alpha4.SwitchConfigInterface { + return &FakeSwitchConfigs{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeMetalV1alpha4) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_networkswitch.go b/client/metal/typed/metal/v1alpha4/fake/fake_networkswitch.go new file mode 100644 index 00000000..9bc9b378 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_networkswitch.go @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNetworkSwitches implements NetworkSwitchInterface +type FakeNetworkSwitches struct { + Fake *FakeMetalV1alpha4 + ns string +} + +var networkswitchesResource = v1alpha4.SchemeGroupVersion.WithResource("networkswitches") + +var networkswitchesKind = v1alpha4.SchemeGroupVersion.WithKind("NetworkSwitch") + +// Get takes name of the networkSwitch, and returns the corresponding networkSwitch object, and an error if there is any. +func (c *FakeNetworkSwitches) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.NetworkSwitch, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkswitchesResource, c.ns, name), &v1alpha4.NetworkSwitch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.NetworkSwitch), err +} + +// List takes label and field selectors, and returns the list of NetworkSwitches that match those selectors. +func (c *FakeNetworkSwitches) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.NetworkSwitchList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(networkswitchesResource, networkswitchesKind, c.ns, opts), &v1alpha4.NetworkSwitchList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.NetworkSwitchList{ListMeta: obj.(*v1alpha4.NetworkSwitchList).ListMeta} + for _, item := range obj.(*v1alpha4.NetworkSwitchList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested networkSwitches. +func (c *FakeNetworkSwitches) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(networkswitchesResource, c.ns, opts)) + +} + +// Create takes the representation of a networkSwitch and creates it. Returns the server's representation of the networkSwitch, and an error, if there is any. +func (c *FakeNetworkSwitches) Create(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.CreateOptions) (result *v1alpha4.NetworkSwitch, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(networkswitchesResource, c.ns, networkSwitch), &v1alpha4.NetworkSwitch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.NetworkSwitch), err +} + +// Update takes the representation of a networkSwitch and updates it. Returns the server's representation of the networkSwitch, and an error, if there is any. +func (c *FakeNetworkSwitches) Update(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.UpdateOptions) (result *v1alpha4.NetworkSwitch, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(networkswitchesResource, c.ns, networkSwitch), &v1alpha4.NetworkSwitch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.NetworkSwitch), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNetworkSwitches) UpdateStatus(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.UpdateOptions) (*v1alpha4.NetworkSwitch, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(networkswitchesResource, "status", c.ns, networkSwitch), &v1alpha4.NetworkSwitch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.NetworkSwitch), err +} + +// Delete takes name of the networkSwitch and deletes it. Returns an error if one occurs. +func (c *FakeNetworkSwitches) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(networkswitchesResource, c.ns, name, opts), &v1alpha4.NetworkSwitch{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkSwitches) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkswitchesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.NetworkSwitchList{}) + return err +} + +// Patch applies the patch and returns the patched networkSwitch. +func (c *FakeNetworkSwitches) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.NetworkSwitch, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkswitchesResource, c.ns, name, pt, data, subresources...), &v1alpha4.NetworkSwitch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.NetworkSwitch), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied networkSwitch. +func (c *FakeNetworkSwitches) Apply(ctx context.Context, networkSwitch *metalv1alpha4.NetworkSwitchApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.NetworkSwitch, err error) { + if networkSwitch == nil { + return nil, fmt.Errorf("networkSwitch provided to Apply must not be nil") + } + data, err := json.Marshal(networkSwitch) + if err != nil { + return nil, err + } + name := networkSwitch.Name + if name == nil { + return nil, fmt.Errorf("networkSwitch.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkswitchesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha4.NetworkSwitch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.NetworkSwitch), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeNetworkSwitches) ApplyStatus(ctx context.Context, networkSwitch *metalv1alpha4.NetworkSwitchApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.NetworkSwitch, err error) { + if networkSwitch == nil { + return nil, fmt.Errorf("networkSwitch provided to Apply must not be nil") + } + data, err := json.Marshal(networkSwitch) + if err != nil { + return nil, err + } + name := networkSwitch.Name + if name == nil { + return nil, fmt.Errorf("networkSwitch.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkswitchesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha4.NetworkSwitch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.NetworkSwitch), err +} diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_size.go b/client/metal/typed/metal/v1alpha4/fake/fake_size.go new file mode 100644 index 00000000..54040bf5 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_size.go @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSizes implements SizeInterface +type FakeSizes struct { + Fake *FakeMetalV1alpha4 + ns string +} + +var sizesResource = v1alpha4.SchemeGroupVersion.WithResource("sizes") + +var sizesKind = v1alpha4.SchemeGroupVersion.WithKind("Size") + +// Get takes name of the size, and returns the corresponding size object, and an error if there is any. +func (c *FakeSizes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Size, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sizesResource, c.ns, name), &v1alpha4.Size{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Size), err +} + +// List takes label and field selectors, and returns the list of Sizes that match those selectors. +func (c *FakeSizes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.SizeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sizesResource, sizesKind, c.ns, opts), &v1alpha4.SizeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.SizeList{ListMeta: obj.(*v1alpha4.SizeList).ListMeta} + for _, item := range obj.(*v1alpha4.SizeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sizes. +func (c *FakeSizes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sizesResource, c.ns, opts)) + +} + +// Create takes the representation of a size and creates it. Returns the server's representation of the size, and an error, if there is any. +func (c *FakeSizes) Create(ctx context.Context, size *v1alpha4.Size, opts v1.CreateOptions) (result *v1alpha4.Size, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sizesResource, c.ns, size), &v1alpha4.Size{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Size), err +} + +// Update takes the representation of a size and updates it. Returns the server's representation of the size, and an error, if there is any. +func (c *FakeSizes) Update(ctx context.Context, size *v1alpha4.Size, opts v1.UpdateOptions) (result *v1alpha4.Size, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sizesResource, c.ns, size), &v1alpha4.Size{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Size), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSizes) UpdateStatus(ctx context.Context, size *v1alpha4.Size, opts v1.UpdateOptions) (*v1alpha4.Size, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(sizesResource, "status", c.ns, size), &v1alpha4.Size{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Size), err +} + +// Delete takes name of the size and deletes it. Returns an error if one occurs. +func (c *FakeSizes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(sizesResource, c.ns, name, opts), &v1alpha4.Size{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSizes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sizesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.SizeList{}) + return err +} + +// Patch applies the patch and returns the patched size. +func (c *FakeSizes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Size, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sizesResource, c.ns, name, pt, data, subresources...), &v1alpha4.Size{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Size), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied size. +func (c *FakeSizes) Apply(ctx context.Context, size *metalv1alpha4.SizeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Size, err error) { + if size == nil { + return nil, fmt.Errorf("size provided to Apply must not be nil") + } + data, err := json.Marshal(size) + if err != nil { + return nil, err + } + name := size.Name + if name == nil { + return nil, fmt.Errorf("size.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sizesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha4.Size{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Size), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeSizes) ApplyStatus(ctx context.Context, size *metalv1alpha4.SizeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Size, err error) { + if size == nil { + return nil, fmt.Errorf("size provided to Apply must not be nil") + } + data, err := json.Marshal(size) + if err != nil { + return nil, err + } + name := size.Name + if name == nil { + return nil, fmt.Errorf("size.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sizesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha4.Size{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Size), err +} diff --git a/client/metal/typed/metal/v1alpha4/fake/fake_switchconfig.go b/client/metal/typed/metal/v1alpha4/fake/fake_switchconfig.go new file mode 100644 index 00000000..6228ccd8 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/fake/fake_switchconfig.go @@ -0,0 +1,176 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSwitchConfigs implements SwitchConfigInterface +type FakeSwitchConfigs struct { + Fake *FakeMetalV1alpha4 + ns string +} + +var switchconfigsResource = v1alpha4.SchemeGroupVersion.WithResource("switchconfigs") + +var switchconfigsKind = v1alpha4.SchemeGroupVersion.WithKind("SwitchConfig") + +// Get takes name of the switchConfig, and returns the corresponding switchConfig object, and an error if there is any. +func (c *FakeSwitchConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.SwitchConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(switchconfigsResource, c.ns, name), &v1alpha4.SwitchConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.SwitchConfig), err +} + +// List takes label and field selectors, and returns the list of SwitchConfigs that match those selectors. +func (c *FakeSwitchConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.SwitchConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(switchconfigsResource, switchconfigsKind, c.ns, opts), &v1alpha4.SwitchConfigList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.SwitchConfigList{ListMeta: obj.(*v1alpha4.SwitchConfigList).ListMeta} + for _, item := range obj.(*v1alpha4.SwitchConfigList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested switchConfigs. +func (c *FakeSwitchConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(switchconfigsResource, c.ns, opts)) + +} + +// Create takes the representation of a switchConfig and creates it. Returns the server's representation of the switchConfig, and an error, if there is any. +func (c *FakeSwitchConfigs) Create(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.CreateOptions) (result *v1alpha4.SwitchConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(switchconfigsResource, c.ns, switchConfig), &v1alpha4.SwitchConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.SwitchConfig), err +} + +// Update takes the representation of a switchConfig and updates it. Returns the server's representation of the switchConfig, and an error, if there is any. +func (c *FakeSwitchConfigs) Update(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.UpdateOptions) (result *v1alpha4.SwitchConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(switchconfigsResource, c.ns, switchConfig), &v1alpha4.SwitchConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.SwitchConfig), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSwitchConfigs) UpdateStatus(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.UpdateOptions) (*v1alpha4.SwitchConfig, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(switchconfigsResource, "status", c.ns, switchConfig), &v1alpha4.SwitchConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.SwitchConfig), err +} + +// Delete takes name of the switchConfig and deletes it. Returns an error if one occurs. +func (c *FakeSwitchConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(switchconfigsResource, c.ns, name, opts), &v1alpha4.SwitchConfig{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSwitchConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(switchconfigsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.SwitchConfigList{}) + return err +} + +// Patch applies the patch and returns the patched switchConfig. +func (c *FakeSwitchConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.SwitchConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(switchconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha4.SwitchConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.SwitchConfig), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied switchConfig. +func (c *FakeSwitchConfigs) Apply(ctx context.Context, switchConfig *metalv1alpha4.SwitchConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.SwitchConfig, err error) { + if switchConfig == nil { + return nil, fmt.Errorf("switchConfig provided to Apply must not be nil") + } + data, err := json.Marshal(switchConfig) + if err != nil { + return nil, err + } + name := switchConfig.Name + if name == nil { + return nil, fmt.Errorf("switchConfig.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(switchconfigsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha4.SwitchConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.SwitchConfig), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeSwitchConfigs) ApplyStatus(ctx context.Context, switchConfig *metalv1alpha4.SwitchConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.SwitchConfig, err error) { + if switchConfig == nil { + return nil, fmt.Errorf("switchConfig provided to Apply must not be nil") + } + data, err := json.Marshal(switchConfig) + if err != nil { + return nil, err + } + name := switchConfig.Name + if name == nil { + return nil, fmt.Errorf("switchConfig.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(switchconfigsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha4.SwitchConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.SwitchConfig), err +} diff --git a/client/metal/typed/metal/v1alpha4/generated_expansion.go b/client/metal/typed/metal/v1alpha4/generated_expansion.go new file mode 100644 index 00000000..80962d1b --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/generated_expansion.go @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +type AggregateExpansion interface{} + +type BenchmarkExpansion interface{} + +type InventoryExpansion interface{} + +type MachineExpansion interface{} + +type NetworkSwitchExpansion interface{} + +type SizeExpansion interface{} + +type SwitchConfigExpansion interface{} diff --git a/client/metal/typed/metal/v1alpha4/inventory.go b/client/metal/typed/metal/v1alpha4/inventory.go new file mode 100644 index 00000000..d2b168dd --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/inventory.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + scheme "github.com/ironcore-dev/metal/client/metal/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// InventoriesGetter has a method to return a InventoryInterface. +// A group's client should implement this interface. +type InventoriesGetter interface { + Inventories(namespace string) InventoryInterface +} + +// InventoryInterface has methods to work with Inventory resources. +type InventoryInterface interface { + Create(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.CreateOptions) (*v1alpha4.Inventory, error) + Update(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.UpdateOptions) (*v1alpha4.Inventory, error) + UpdateStatus(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.UpdateOptions) (*v1alpha4.Inventory, 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) (*v1alpha4.Inventory, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.InventoryList, 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 *v1alpha4.Inventory, err error) + Apply(ctx context.Context, inventory *metalv1alpha4.InventoryApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Inventory, err error) + ApplyStatus(ctx context.Context, inventory *metalv1alpha4.InventoryApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Inventory, err error) + InventoryExpansion +} + +// inventories implements InventoryInterface +type inventories struct { + client rest.Interface + ns string +} + +// newInventories returns a Inventories +func newInventories(c *MetalV1alpha4Client, namespace string) *inventories { + return &inventories{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the inventory, and returns the corresponding inventory object, and an error if there is any. +func (c *inventories) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Inventory, err error) { + result = &v1alpha4.Inventory{} + err = c.client.Get(). + Namespace(c.ns). + Resource("inventories"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Inventories that match those selectors. +func (c *inventories) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.InventoryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.InventoryList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("inventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested inventories. +func (c *inventories) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("inventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a inventory and creates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *inventories) Create(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.CreateOptions) (result *v1alpha4.Inventory, err error) { + result = &v1alpha4.Inventory{} + err = c.client.Post(). + Namespace(c.ns). + Resource("inventories"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(inventory). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a inventory and updates it. Returns the server's representation of the inventory, and an error, if there is any. +func (c *inventories) Update(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.UpdateOptions) (result *v1alpha4.Inventory, err error) { + result = &v1alpha4.Inventory{} + err = c.client.Put(). + Namespace(c.ns). + Resource("inventories"). + Name(inventory.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(inventory). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *inventories) UpdateStatus(ctx context.Context, inventory *v1alpha4.Inventory, opts v1.UpdateOptions) (result *v1alpha4.Inventory, err error) { + result = &v1alpha4.Inventory{} + err = c.client.Put(). + Namespace(c.ns). + Resource("inventories"). + Name(inventory.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(inventory). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the inventory and deletes it. Returns an error if one occurs. +func (c *inventories) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("inventories"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *inventories) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("inventories"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched inventory. +func (c *inventories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Inventory, err error) { + result = &v1alpha4.Inventory{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("inventories"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied inventory. +func (c *inventories) Apply(ctx context.Context, inventory *metalv1alpha4.InventoryApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Inventory, err error) { + if inventory == nil { + return nil, fmt.Errorf("inventory provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(inventory) + if err != nil { + return nil, err + } + name := inventory.Name + if name == nil { + return nil, fmt.Errorf("inventory.Name must be provided to Apply") + } + result = &v1alpha4.Inventory{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("inventories"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *inventories) ApplyStatus(ctx context.Context, inventory *metalv1alpha4.InventoryApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Inventory, err error) { + if inventory == nil { + return nil, fmt.Errorf("inventory provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(inventory) + if err != nil { + return nil, err + } + + name := inventory.Name + if name == nil { + return nil, fmt.Errorf("inventory.Name must be provided to Apply") + } + + result = &v1alpha4.Inventory{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("inventories"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/metal/typed/metal/v1alpha4/machine.go b/client/metal/typed/metal/v1alpha4/machine.go new file mode 100644 index 00000000..47d5e988 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/machine.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + scheme "github.com/ironcore-dev/metal/client/metal/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MachinesGetter has a method to return a MachineInterface. +// A group's client should implement this interface. +type MachinesGetter interface { + Machines(namespace string) MachineInterface +} + +// MachineInterface has methods to work with Machine resources. +type MachineInterface interface { + Create(ctx context.Context, machine *v1alpha4.Machine, opts v1.CreateOptions) (*v1alpha4.Machine, error) + Update(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (*v1alpha4.Machine, error) + UpdateStatus(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (*v1alpha4.Machine, 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) (*v1alpha4.Machine, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.MachineList, 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 *v1alpha4.Machine, err error) + Apply(ctx context.Context, machine *metalv1alpha4.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Machine, err error) + ApplyStatus(ctx context.Context, machine *metalv1alpha4.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Machine, err error) + MachineExpansion +} + +// machines implements MachineInterface +type machines struct { + client rest.Interface + ns string +} + +// newMachines returns a Machines +func newMachines(c *MetalV1alpha4Client, namespace string) *machines { + return &machines{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. +func (c *machines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *machines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.MachineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.MachineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machines. +func (c *machines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Create(ctx context.Context, machine *v1alpha4.Machine, opts v1.CreateOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Update(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *machines) UpdateStatus(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *machines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machine. +func (c *machines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machines"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied machine. +func (c *machines) Apply(ctx context.Context, machine *metalv1alpha4.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Machine, err error) { + if machine == nil { + return nil, fmt.Errorf("machine provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machine) + if err != nil { + return nil, err + } + name := machine.Name + if name == nil { + return nil, fmt.Errorf("machine.Name must be provided to Apply") + } + result = &v1alpha4.Machine{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machines"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *machines) ApplyStatus(ctx context.Context, machine *metalv1alpha4.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Machine, err error) { + if machine == nil { + return nil, fmt.Errorf("machine provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machine) + if err != nil { + return nil, err + } + + name := machine.Name + if name == nil { + return nil, fmt.Errorf("machine.Name must be provided to Apply") + } + + result = &v1alpha4.Machine{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machines"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/metal/typed/metal/v1alpha4/metal_client.go b/client/metal/typed/metal/v1alpha4/metal_client.go new file mode 100644 index 00000000..55b2e2d9 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/metal_client.go @@ -0,0 +1,124 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "net/http" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + "github.com/ironcore-dev/metal/client/metal/scheme" + rest "k8s.io/client-go/rest" +) + +type MetalV1alpha4Interface interface { + RESTClient() rest.Interface + AggregatesGetter + BenchmarksGetter + InventoriesGetter + MachinesGetter + NetworkSwitchesGetter + SizesGetter + SwitchConfigsGetter +} + +// MetalV1alpha4Client is used to interact with features provided by the metal.ironcore.dev group. +type MetalV1alpha4Client struct { + restClient rest.Interface +} + +func (c *MetalV1alpha4Client) Aggregates(namespace string) AggregateInterface { + return newAggregates(c, namespace) +} + +func (c *MetalV1alpha4Client) Benchmarks(namespace string) BenchmarkInterface { + return newBenchmarks(c, namespace) +} + +func (c *MetalV1alpha4Client) Inventories(namespace string) InventoryInterface { + return newInventories(c, namespace) +} + +func (c *MetalV1alpha4Client) Machines(namespace string) MachineInterface { + return newMachines(c, namespace) +} + +func (c *MetalV1alpha4Client) NetworkSwitches(namespace string) NetworkSwitchInterface { + return newNetworkSwitches(c, namespace) +} + +func (c *MetalV1alpha4Client) Sizes(namespace string) SizeInterface { + return newSizes(c, namespace) +} + +func (c *MetalV1alpha4Client) SwitchConfigs(namespace string) SwitchConfigInterface { + return newSwitchConfigs(c, namespace) +} + +// NewForConfig creates a new MetalV1alpha4Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*MetalV1alpha4Client, 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 MetalV1alpha4Client 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) (*MetalV1alpha4Client, 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 &MetalV1alpha4Client{client}, nil +} + +// NewForConfigOrDie creates a new MetalV1alpha4Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MetalV1alpha4Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MetalV1alpha4Client for the given RESTClient. +func New(c rest.Interface) *MetalV1alpha4Client { + return &MetalV1alpha4Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha4.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = 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 *MetalV1alpha4Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/client/metal/typed/metal/v1alpha4/networkswitch.go b/client/metal/typed/metal/v1alpha4/networkswitch.go new file mode 100644 index 00000000..06378776 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/networkswitch.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + scheme "github.com/ironcore-dev/metal/client/metal/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// NetworkSwitchesGetter has a method to return a NetworkSwitchInterface. +// A group's client should implement this interface. +type NetworkSwitchesGetter interface { + NetworkSwitches(namespace string) NetworkSwitchInterface +} + +// NetworkSwitchInterface has methods to work with NetworkSwitch resources. +type NetworkSwitchInterface interface { + Create(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.CreateOptions) (*v1alpha4.NetworkSwitch, error) + Update(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.UpdateOptions) (*v1alpha4.NetworkSwitch, error) + UpdateStatus(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.UpdateOptions) (*v1alpha4.NetworkSwitch, 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) (*v1alpha4.NetworkSwitch, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.NetworkSwitchList, 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 *v1alpha4.NetworkSwitch, err error) + Apply(ctx context.Context, networkSwitch *metalv1alpha4.NetworkSwitchApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.NetworkSwitch, err error) + ApplyStatus(ctx context.Context, networkSwitch *metalv1alpha4.NetworkSwitchApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.NetworkSwitch, err error) + NetworkSwitchExpansion +} + +// networkSwitches implements NetworkSwitchInterface +type networkSwitches struct { + client rest.Interface + ns string +} + +// newNetworkSwitches returns a NetworkSwitches +func newNetworkSwitches(c *MetalV1alpha4Client, namespace string) *networkSwitches { + return &networkSwitches{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the networkSwitch, and returns the corresponding networkSwitch object, and an error if there is any. +func (c *networkSwitches) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.NetworkSwitch, err error) { + result = &v1alpha4.NetworkSwitch{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkswitches"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NetworkSwitches that match those selectors. +func (c *networkSwitches) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.NetworkSwitchList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.NetworkSwitchList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkswitches"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networkSwitches. +func (c *networkSwitches) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("networkswitches"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a networkSwitch and creates it. Returns the server's representation of the networkSwitch, and an error, if there is any. +func (c *networkSwitches) Create(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.CreateOptions) (result *v1alpha4.NetworkSwitch, err error) { + result = &v1alpha4.NetworkSwitch{} + err = c.client.Post(). + Namespace(c.ns). + Resource("networkswitches"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkSwitch). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a networkSwitch and updates it. Returns the server's representation of the networkSwitch, and an error, if there is any. +func (c *networkSwitches) Update(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.UpdateOptions) (result *v1alpha4.NetworkSwitch, err error) { + result = &v1alpha4.NetworkSwitch{} + err = c.client.Put(). + Namespace(c.ns). + Resource("networkswitches"). + Name(networkSwitch.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkSwitch). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *networkSwitches) UpdateStatus(ctx context.Context, networkSwitch *v1alpha4.NetworkSwitch, opts v1.UpdateOptions) (result *v1alpha4.NetworkSwitch, err error) { + result = &v1alpha4.NetworkSwitch{} + err = c.client.Put(). + Namespace(c.ns). + Resource("networkswitches"). + Name(networkSwitch.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkSwitch). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the networkSwitch and deletes it. Returns an error if one occurs. +func (c *networkSwitches) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("networkswitches"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networkSwitches) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("networkswitches"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched networkSwitch. +func (c *networkSwitches) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.NetworkSwitch, err error) { + result = &v1alpha4.NetworkSwitch{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("networkswitches"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied networkSwitch. +func (c *networkSwitches) Apply(ctx context.Context, networkSwitch *metalv1alpha4.NetworkSwitchApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.NetworkSwitch, err error) { + if networkSwitch == nil { + return nil, fmt.Errorf("networkSwitch provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(networkSwitch) + if err != nil { + return nil, err + } + name := networkSwitch.Name + if name == nil { + return nil, fmt.Errorf("networkSwitch.Name must be provided to Apply") + } + result = &v1alpha4.NetworkSwitch{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("networkswitches"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *networkSwitches) ApplyStatus(ctx context.Context, networkSwitch *metalv1alpha4.NetworkSwitchApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.NetworkSwitch, err error) { + if networkSwitch == nil { + return nil, fmt.Errorf("networkSwitch provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(networkSwitch) + if err != nil { + return nil, err + } + + name := networkSwitch.Name + if name == nil { + return nil, fmt.Errorf("networkSwitch.Name must be provided to Apply") + } + + result = &v1alpha4.NetworkSwitch{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("networkswitches"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/metal/typed/metal/v1alpha4/size.go b/client/metal/typed/metal/v1alpha4/size.go new file mode 100644 index 00000000..6b0bfdf6 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/size.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + scheme "github.com/ironcore-dev/metal/client/metal/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SizesGetter has a method to return a SizeInterface. +// A group's client should implement this interface. +type SizesGetter interface { + Sizes(namespace string) SizeInterface +} + +// SizeInterface has methods to work with Size resources. +type SizeInterface interface { + Create(ctx context.Context, size *v1alpha4.Size, opts v1.CreateOptions) (*v1alpha4.Size, error) + Update(ctx context.Context, size *v1alpha4.Size, opts v1.UpdateOptions) (*v1alpha4.Size, error) + UpdateStatus(ctx context.Context, size *v1alpha4.Size, opts v1.UpdateOptions) (*v1alpha4.Size, 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) (*v1alpha4.Size, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.SizeList, 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 *v1alpha4.Size, err error) + Apply(ctx context.Context, size *metalv1alpha4.SizeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Size, err error) + ApplyStatus(ctx context.Context, size *metalv1alpha4.SizeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Size, err error) + SizeExpansion +} + +// sizes implements SizeInterface +type sizes struct { + client rest.Interface + ns string +} + +// newSizes returns a Sizes +func newSizes(c *MetalV1alpha4Client, namespace string) *sizes { + return &sizes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the size, and returns the corresponding size object, and an error if there is any. +func (c *sizes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Size, err error) { + result = &v1alpha4.Size{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sizes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Sizes that match those selectors. +func (c *sizes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.SizeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.SizeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sizes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sizes. +func (c *sizes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sizes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a size and creates it. Returns the server's representation of the size, and an error, if there is any. +func (c *sizes) Create(ctx context.Context, size *v1alpha4.Size, opts v1.CreateOptions) (result *v1alpha4.Size, err error) { + result = &v1alpha4.Size{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sizes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(size). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a size and updates it. Returns the server's representation of the size, and an error, if there is any. +func (c *sizes) Update(ctx context.Context, size *v1alpha4.Size, opts v1.UpdateOptions) (result *v1alpha4.Size, err error) { + result = &v1alpha4.Size{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sizes"). + Name(size.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(size). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *sizes) UpdateStatus(ctx context.Context, size *v1alpha4.Size, opts v1.UpdateOptions) (result *v1alpha4.Size, err error) { + result = &v1alpha4.Size{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sizes"). + Name(size.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(size). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the size and deletes it. Returns an error if one occurs. +func (c *sizes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sizes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sizes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("sizes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched size. +func (c *sizes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Size, err error) { + result = &v1alpha4.Size{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sizes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied size. +func (c *sizes) Apply(ctx context.Context, size *metalv1alpha4.SizeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Size, err error) { + if size == nil { + return nil, fmt.Errorf("size provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(size) + if err != nil { + return nil, err + } + name := size.Name + if name == nil { + return nil, fmt.Errorf("size.Name must be provided to Apply") + } + result = &v1alpha4.Size{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("sizes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *sizes) ApplyStatus(ctx context.Context, size *metalv1alpha4.SizeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.Size, err error) { + if size == nil { + return nil, fmt.Errorf("size provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(size) + if err != nil { + return nil, err + } + + name := size.Name + if name == nil { + return nil, fmt.Errorf("size.Name must be provided to Apply") + } + + result = &v1alpha4.Size{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("sizes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/metal/typed/metal/v1alpha4/switchconfig.go b/client/metal/typed/metal/v1alpha4/switchconfig.go new file mode 100644 index 00000000..f3556c41 --- /dev/null +++ b/client/metal/typed/metal/v1alpha4/switchconfig.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" + metalv1alpha4 "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" + scheme "github.com/ironcore-dev/metal/client/metal/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SwitchConfigsGetter has a method to return a SwitchConfigInterface. +// A group's client should implement this interface. +type SwitchConfigsGetter interface { + SwitchConfigs(namespace string) SwitchConfigInterface +} + +// SwitchConfigInterface has methods to work with SwitchConfig resources. +type SwitchConfigInterface interface { + Create(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.CreateOptions) (*v1alpha4.SwitchConfig, error) + Update(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.UpdateOptions) (*v1alpha4.SwitchConfig, error) + UpdateStatus(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.UpdateOptions) (*v1alpha4.SwitchConfig, 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) (*v1alpha4.SwitchConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.SwitchConfigList, 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 *v1alpha4.SwitchConfig, err error) + Apply(ctx context.Context, switchConfig *metalv1alpha4.SwitchConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.SwitchConfig, err error) + ApplyStatus(ctx context.Context, switchConfig *metalv1alpha4.SwitchConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.SwitchConfig, err error) + SwitchConfigExpansion +} + +// switchConfigs implements SwitchConfigInterface +type switchConfigs struct { + client rest.Interface + ns string +} + +// newSwitchConfigs returns a SwitchConfigs +func newSwitchConfigs(c *MetalV1alpha4Client, namespace string) *switchConfigs { + return &switchConfigs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the switchConfig, and returns the corresponding switchConfig object, and an error if there is any. +func (c *switchConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.SwitchConfig, err error) { + result = &v1alpha4.SwitchConfig{} + err = c.client.Get(). + Namespace(c.ns). + Resource("switchconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SwitchConfigs that match those selectors. +func (c *switchConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.SwitchConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.SwitchConfigList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("switchconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested switchConfigs. +func (c *switchConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("switchconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a switchConfig and creates it. Returns the server's representation of the switchConfig, and an error, if there is any. +func (c *switchConfigs) Create(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.CreateOptions) (result *v1alpha4.SwitchConfig, err error) { + result = &v1alpha4.SwitchConfig{} + err = c.client.Post(). + Namespace(c.ns). + Resource("switchconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(switchConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a switchConfig and updates it. Returns the server's representation of the switchConfig, and an error, if there is any. +func (c *switchConfigs) Update(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.UpdateOptions) (result *v1alpha4.SwitchConfig, err error) { + result = &v1alpha4.SwitchConfig{} + err = c.client.Put(). + Namespace(c.ns). + Resource("switchconfigs"). + Name(switchConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(switchConfig). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *switchConfigs) UpdateStatus(ctx context.Context, switchConfig *v1alpha4.SwitchConfig, opts v1.UpdateOptions) (result *v1alpha4.SwitchConfig, err error) { + result = &v1alpha4.SwitchConfig{} + err = c.client.Put(). + Namespace(c.ns). + Resource("switchconfigs"). + Name(switchConfig.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(switchConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the switchConfig and deletes it. Returns an error if one occurs. +func (c *switchConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("switchconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *switchConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("switchconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched switchConfig. +func (c *switchConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.SwitchConfig, err error) { + result = &v1alpha4.SwitchConfig{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("switchconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied switchConfig. +func (c *switchConfigs) Apply(ctx context.Context, switchConfig *metalv1alpha4.SwitchConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.SwitchConfig, err error) { + if switchConfig == nil { + return nil, fmt.Errorf("switchConfig provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(switchConfig) + if err != nil { + return nil, err + } + name := switchConfig.Name + if name == nil { + return nil, fmt.Errorf("switchConfig.Name must be provided to Apply") + } + result = &v1alpha4.SwitchConfig{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("switchconfigs"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *switchConfigs) ApplyStatus(ctx context.Context, switchConfig *metalv1alpha4.SwitchConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha4.SwitchConfig, err error) { + if switchConfig == nil { + return nil, fmt.Errorf("switchConfig provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(switchConfig) + if err != nil { + return nil, err + } + + name := switchConfig.Name + if name == nil { + return nil, fmt.Errorf("switchConfig.Name must be provided to Apply") + } + + result = &v1alpha4.SwitchConfig{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("switchconfigs"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/openapi/api_violations.report b/client/openapi/api_violations.report similarity index 98% rename from openapi/api_violations.report rename to client/openapi/api_violations.report index fbb7c77b..04407238 100644 --- a/openapi/api_violations.report +++ b/client/openapi/api_violations.report @@ -147,6 +147,8 @@ API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,Table API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,TableRow,Cells API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,TableRow,Conditions API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,UpdateOptions,DryRun +API rule violation: list_type_missing,k8s.io/apimachinery/pkg/runtime,RawExtension,Raw +API rule violation: list_type_missing,k8s.io/apimachinery/pkg/runtime,Unknown,Raw API rule violation: names_match,github.com/ironcore-dev/metal/apis/metal/v1alpha4,AddressFamiliesMap,IPv4 API rule violation: names_match,github.com/ironcore-dev/metal/apis/metal/v1alpha4,AddressFamiliesMap,IPv6 API rule violation: names_match,github.com/ironcore-dev/metal/apis/metal/v1alpha4,Addresses,IPv4 @@ -232,3 +234,5 @@ API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEve API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,MicroTime,Time API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,StatusCause,Type API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentEncoding +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentType diff --git a/openapi/zz_generated.openapi.go b/client/openapi/zz_generated.openapi.go similarity index 99% rename from openapi/zz_generated.openapi.go rename to client/openapi/zz_generated.openapi.go index a2e00db8..1c4c6568 100644 --- a/openapi/zz_generated.openapi.go +++ b/client/openapi/zz_generated.openapi.go @@ -1,21 +1,8 @@ //go:build !ignore_autogenerated // +build !ignore_autogenerated -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // Code generated by openapi-gen. DO NOT EDIT. @@ -383,6 +370,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), + "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), + "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), + "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), + "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), } } @@ -18840,3 +18831,158 @@ func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.Ope "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } + +func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", + Type: []string{"object"}, + }, + }, + } +} + +func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\",inline\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Unknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. metadata and field mutatation.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "ContentEncoding": { + SchemaProps: spec.SchemaProps{ + Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "ContentType": { + SchemaProps: spec.SchemaProps{ + Description: "ContentType is serialization method used to serialize 'Raw'. Unspecified means ContentTypeJSON.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"ContentEncoding", "ContentType"}, + }, + }, + } +} + +func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Info contains versioning information. how we'll want to distribute that information.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "major": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "minor": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "gitVersion": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "gitCommit": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "gitTreeState": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "buildDate": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "goVersion": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "compiler": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "platform": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState", "buildDate", "goVersion", "compiler", "platform"}, + }, + }, + } +} diff --git a/clientset/inventory/clientset.go b/clientset/inventory/clientset.go deleted file mode 100644 index 4e8c3385..00000000 --- a/clientset/inventory/clientset.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clientset - -import ( - "fmt" - - "k8s.io/client-go/rest" - "k8s.io/client-go/util/flowcontrol" - - "github.com/ironcore-dev/metal/clientset/inventory/v1alpha1" -) - -type Clientset interface { - MachineV1Alpha1() v1alpha1.V1Alpha1Interface -} - -type clientset struct { - v1alpha1 v1alpha1.V1Alpha1Interface -} - -func (c *clientset) MachineV1Alpha1() v1alpha1.V1Alpha1Interface { - return c.v1alpha1 -} - -func NewForConfig(c *rest.Config) (Clientset, error) { - cc := *c - if cc.RateLimiter == nil && cc.QPS > 0 { - if cc.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") - } - cc.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(cc.QPS, cc.Burst) - } - var cs clientset - var err error - cs.v1alpha1, err = v1alpha1.NewForConfig(&cc) - if err != nil { - return nil, err - } - - return &cs, nil -} diff --git a/clientset/inventory/v1alpha1/aggregate.go b/clientset/inventory/v1alpha1/aggregate.go deleted file mode 100644 index b944b654..00000000 --- a/clientset/inventory/v1alpha1/aggregate.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -const ( - CAggregatesResourceType = "aggregates" -) - -type AggregateInterface interface { - Get(ctx context.Context, name string, opts metav1.GetOptions) (*metalv1alpha4.Aggregate, error) - List(ctx context.Context, opts metav1.ListOptions) (*metalv1alpha4.AggregateList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Create(ctx context.Context, aggregate *metalv1alpha4.Aggregate, opts metav1.CreateOptions) (*metalv1alpha4.Aggregate, error) - Update(ctx context.Context, aggregate *metalv1alpha4.Aggregate, opts metav1.UpdateOptions) (*metalv1alpha4.Aggregate, error) - UpdateStatus(ctx context.Context, aggregate *metalv1alpha4.Aggregate, opts metav1.UpdateOptions) (*metalv1alpha4.Aggregate, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metalv1alpha4.Aggregate, error) -} - -type aggregateClient struct { - restClient rest.Interface - ns string -} - -func (c *aggregateClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*metalv1alpha4.Aggregate, error) { - result := &metalv1alpha4.Aggregate{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - Name(name). - VersionedParams(&opts, scheme.ParameterCodec). - Do(ctx). - Into(result) - - return result, err -} - -func (c *aggregateClient) List(ctx context.Context, opts metav1.ListOptions) (*metalv1alpha4.AggregateList, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result := &metalv1alpha4.AggregateList{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - - return result, err -} - -func (c *aggregateClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - watcher, err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) - - return watcher, err -} - -func (c *aggregateClient) Create(ctx context.Context, aggregate *metalv1alpha4.Aggregate, opts metav1.CreateOptions) (*metalv1alpha4.Aggregate, error) { - result := &metalv1alpha4.Aggregate{} - err := c.restClient. - Post(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aggregate). - Do(ctx). - Into(result) - - return result, err -} - -func (c *aggregateClient) Update(ctx context.Context, aggregate *metalv1alpha4.Aggregate, opts metav1.UpdateOptions) (*metalv1alpha4.Aggregate, error) { - result := &metalv1alpha4.Aggregate{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - Name(aggregate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aggregate). - Do(ctx). - Into(result) - - return result, err -} - -func (c *aggregateClient) UpdateStatus(ctx context.Context, aggregate *metalv1alpha4.Aggregate, opts metav1.UpdateOptions) (*metalv1alpha4.Aggregate, error) { - result := &metalv1alpha4.Aggregate{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - Name(aggregate.Name). - SubResource(CStatusSubresource). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aggregate). - Do(ctx). - Into(result) - - return result, err -} - -func (c *aggregateClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -func (c *aggregateClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CAggregatesResourceType). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -func (c *aggregateClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metalv1alpha4.Aggregate, error) { - result := &metalv1alpha4.Aggregate{} - err := c.restClient.Patch(pt). - Namespace(c.ns). - Resource(CAggregatesResourceType). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - - return result, err -} diff --git a/clientset/inventory/v1alpha1/aggregate_client_test.go b/clientset/inventory/v1alpha1/aggregate_client_test.go deleted file mode 100644 index 2dc87037..00000000 --- a/clientset/inventory/v1alpha1/aggregate_client_test.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "time" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/json" - "k8s.io/apimachinery/pkg/watch" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -// nolint:forcetypeassert -var _ = PDescribe("Aggregate client", func() { - const ( - AggregateName = "test-aggregate" - AggregateToDeleteName = "test-aggregate-to-delete" - DeleteLabel = "delete-label" - AggregateNamespace = "default" - - timeout = time.Second * 10 - interval = time.Millisecond * 250 - ) - - Context("When Aggregate CR is installed", func() { - It("Should check that Aggregate CR is operational with client", func() { - By("Creating client") - finished := make(chan bool) - ctx := context.Background() - - clientset, err := NewForConfig(cfg) - Expect(err).NotTo(HaveOccurred()) - - client := clientset.Aggregates(AggregateNamespace) - - aggregate := &metalv1alpha4.Aggregate{ - ObjectMeta: v1.ObjectMeta{ - Name: AggregateName, - Namespace: AggregateNamespace, - }, - Spec: metalv1alpha4.AggregateSpec{ - Aggregates: []metalv1alpha4.AggregateItem{ - { - SourcePath: *metalv1alpha4.JSONPathFromString("spec.cpus"), - TargetPath: *metalv1alpha4.JSONPathFromString("status.computed.cpus.cpuCount"), - Aggregate: metalv1alpha4.CCountAggregateType, - }, - }, - }, - } - - By("Creating watcher") - watcher, err := client.Watch(ctx, v1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - events := watcher.ResultChan() - - By("Creating Aggregate") - createdAggregate := &metalv1alpha4.Aggregate{} - go func() { - defer GinkgoRecover() - createdAggregate, err = client.Create(ctx, aggregate, v1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(createdAggregate.Spec).Should(Equal(aggregate.Spec)) - finished <- true - }() - - event := &watch.Event{} - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Added)) - eventAggregate := event.Object.(*metalv1alpha4.Aggregate) - Expect(eventAggregate).NotTo(BeNil()) - Expect(eventAggregate.Spec).Should(Equal(aggregate.Spec)) - - <-finished - - By("Updating Aggregate") - createdAggregate.Spec.Aggregates[0].SourcePath = *metalv1alpha4.JSONPathFromString("spec.nets") - go func() { - defer GinkgoRecover() - updatedAggregate, err := client.Update(ctx, createdAggregate, v1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(updatedAggregate.Spec).Should(Equal(createdAggregate.Spec)) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventAggregate = event.Object.(*metalv1alpha4.Aggregate) - Expect(eventAggregate).NotTo(BeNil()) - Expect(eventAggregate.Spec).Should(Equal(createdAggregate.Spec)) - - <-finished - - By("Patching Aggregate") - patch := []struct { - Op string `json:"op"` - Path string `json:"path"` - Value string `json:"value"` - }{{ - Op: "replace", - Path: "/spec/aggregates/0/targetPath", - Value: "status.computed.nets.netCount", - }} - - patchData, err := json.Marshal(patch) - Expect(err).NotTo(HaveOccurred()) - - go func() { - defer GinkgoRecover() - patchedAggregate, err := client.Patch(ctx, AggregateName, types.JSONPatchType, patchData, v1.PatchOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(patchedAggregate.Spec.Aggregates[0].TargetPath).Should(BeEquivalentTo(*metalv1alpha4.JSONPathFromString(patch[0].Value))) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventAggregate = event.Object.(*metalv1alpha4.Aggregate) - Expect(eventAggregate).NotTo(BeNil()) - Expect(eventAggregate.Spec.Aggregates[0].TargetPath).Should(Equal(*metalv1alpha4.JSONPathFromString(patch[0].Value))) - - <-finished - - // We do not handle status for Aggregate atm, - // so just a placeholder for now - By("Updating Aggregate status") - _, err = client.UpdateStatus(ctx, eventAggregate, v1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Eventually(events).Should(Receive()) - - aggregateToDelete := &metalv1alpha4.Aggregate{ - ObjectMeta: v1.ObjectMeta{ - Name: AggregateToDeleteName, - Namespace: AggregateNamespace, - Labels: map[string]string{ - DeleteLabel: "", - }, - }, - Spec: metalv1alpha4.AggregateSpec{ - Aggregates: []metalv1alpha4.AggregateItem{ - { - SourcePath: *metalv1alpha4.JSONPathFromString("a.b.c"), - TargetPath: *metalv1alpha4.JSONPathFromString("q.w.e"), - Aggregate: metalv1alpha4.CSumAggregateType, - }, - }, - }, - } - - By("Creating Aggregate collection") - _, err = client.Create(ctx, aggregateToDelete, v1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Eventually(events).Should(Receive()) - - By("Listing Aggregates") - aggregateList, err := client.List(ctx, v1.ListOptions{}) - Expect(aggregateList).NotTo(BeNil()) - Expect(aggregateList.Items).To(HaveLen(2)) - - By("Bulk deleting Aggregate") - Expect(client.DeleteCollection(ctx, v1.DeleteOptions{}, v1.ListOptions{LabelSelector: DeleteLabel})).To(Succeed()) - - By("Requesting created Aggregate") - Eventually(func() bool { - _, err = client.Get(ctx, AggregateName, v1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeTrue()) - Eventually(func() bool { - _, err = client.Get(ctx, AggregateToDeleteName, v1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeFalse()) - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventAggregate = event.Object.(*metalv1alpha4.Aggregate) - Expect(eventAggregate).NotTo(BeNil()) - Expect(eventAggregate.Name).To(Equal(AggregateToDeleteName)) - - By("Deleting Aggregate") - go func() { - defer GinkgoRecover() - err := client.Delete(ctx, AggregateName, v1.DeleteOptions{}) - Expect(err).NotTo(HaveOccurred()) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventAggregate = event.Object.(*metalv1alpha4.Aggregate) - Expect(eventAggregate).NotTo(BeNil()) - Expect(eventAggregate.Name).To(Equal(AggregateName)) - - <-finished - - watcher.Stop() - Eventually(events).Should(BeClosed()) - }) - }) -}) diff --git a/clientset/inventory/v1alpha1/api.go b/clientset/inventory/v1alpha1/api.go deleted file mode 100644 index 5a85316f..00000000 --- a/clientset/inventory/v1alpha1/api.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -const ( - CStatusSubresource = "status" -) - -type V1Alpha1Interface interface { //nolint:revive - Sizes(namespace string) SizeInterface - Inventories(namespace string) InventoryInterface - Aggregates(namespace string) AggregateInterface -} - -type v1Alpha1Client struct { - restClient rest.Interface -} - -func NewForConfig(c *rest.Config) (V1Alpha1Interface, error) { - config := *c - config.ContentConfig.GroupVersion = &metalv1alpha4.SchemeGroupVersion - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - config.UserAgent = rest.DefaultKubernetesUserAgent() - - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - - return &v1Alpha1Client{restClient: client}, nil -} - -func (c *v1Alpha1Client) Sizes(namespace string) SizeInterface { - return &sizeClient{ - restClient: c.restClient, - ns: namespace, - } -} - -func (c *v1Alpha1Client) Inventories(namespace string) InventoryInterface { - return &inventoryClient{ - restClient: c.restClient, - ns: namespace, - } -} - -func (c *v1Alpha1Client) Aggregates(namespace string) AggregateInterface { - return &aggregateClient{ - restClient: c.restClient, - ns: namespace, - } -} diff --git a/clientset/inventory/v1alpha1/client_suite_test.go b/clientset/inventory/v1alpha1/client_suite_test.go deleted file mode 100644 index b2d8d55d..00000000 --- a/clientset/inventory/v1alpha1/client_suite_test.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/envtest" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -var cfg *rest.Config -var testEnv *envtest.Environment - -// nolint -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecs(t, "Inventory Clientset Suite") -} - -var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - - By("bootstrapping test environment") - crdPath := filepath.Join("..", "..", "..", "config", "crd", "bases") - - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{crdPath}, - } - - var err error - cfg, err = testEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(cfg).NotTo(BeNil()) - - err = metalv1alpha4.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - // +kubebuilder:scaffold:scheme -}) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).NotTo(HaveOccurred()) -}) diff --git a/clientset/inventory/v1alpha1/inventory.go b/clientset/inventory/v1alpha1/inventory.go deleted file mode 100644 index 0a8bf0c0..00000000 --- a/clientset/inventory/v1alpha1/inventory.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -const ( - CInventoriesResourceType = "inventories" -) - -type InventoryInterface interface { - Get(ctx context.Context, name string, opts metav1.GetOptions) (*metalv1alpha4.Inventory, error) - List(ctx context.Context, opts metav1.ListOptions) (*metalv1alpha4.InventoryList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Create(ctx context.Context, inventory *metalv1alpha4.Inventory, opts metav1.CreateOptions) (*metalv1alpha4.Inventory, error) - Update(ctx context.Context, inventory *metalv1alpha4.Inventory, opts metav1.UpdateOptions) (*metalv1alpha4.Inventory, error) - UpdateStatus(ctx context.Context, inventory *metalv1alpha4.Inventory, opts metav1.UpdateOptions) (*metalv1alpha4.Inventory, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metalv1alpha4.Inventory, error) -} - -type inventoryClient struct { - restClient rest.Interface - ns string -} - -func (c *inventoryClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*metalv1alpha4.Inventory, error) { - result := &metalv1alpha4.Inventory{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - Name(name). - VersionedParams(&opts, scheme.ParameterCodec). - Do(ctx). - Into(result) - - return result, err -} - -func (c *inventoryClient) List(ctx context.Context, opts metav1.ListOptions) (*metalv1alpha4.InventoryList, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result := &metalv1alpha4.InventoryList{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - - return result, err -} - -func (c *inventoryClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - watcher, err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) - - return watcher, err -} - -func (c *inventoryClient) Create(ctx context.Context, inventory *metalv1alpha4.Inventory, opts metav1.CreateOptions) (*metalv1alpha4.Inventory, error) { - result := &metalv1alpha4.Inventory{} - err := c.restClient. - Post(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Body(inventory). - Do(ctx). - Into(result) - - return result, err -} - -func (c *inventoryClient) Update(ctx context.Context, inventory *metalv1alpha4.Inventory, opts metav1.UpdateOptions) (*metalv1alpha4.Inventory, error) { - result := &metalv1alpha4.Inventory{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - Name(inventory.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(inventory). - Do(ctx). - Into(result) - - return result, err -} - -func (c *inventoryClient) UpdateStatus(ctx context.Context, inventory *metalv1alpha4.Inventory, opts metav1.UpdateOptions) (*metalv1alpha4.Inventory, error) { - result := &metalv1alpha4.Inventory{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - Name(inventory.Name). - SubResource(CStatusSubresource). - VersionedParams(&opts, scheme.ParameterCodec). - Body(inventory). - Do(ctx). - Into(result) - - return result, err -} - -func (c *inventoryClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -func (c *inventoryClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CInventoriesResourceType). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -func (c *inventoryClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metalv1alpha4.Inventory, error) { - result := &metalv1alpha4.Inventory{} - err := c.restClient.Patch(pt). - Namespace(c.ns). - Resource(CInventoriesResourceType). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - - return result, err -} diff --git a/clientset/inventory/v1alpha1/inventory_client_test.go b/clientset/inventory/v1alpha1/inventory_client_test.go deleted file mode 100644 index 104a221b..00000000 --- a/clientset/inventory/v1alpha1/inventory_client_test.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "time" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/json" - "k8s.io/apimachinery/pkg/watch" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -// nolint:forcetypeassert -var _ = PDescribe("Inventory client", func() { - const ( - InventoryName = "test-inventory" - InventoryToDeleteName = "test-inventory-to-delete" - DeleteLabel = "delete-label" - InventoryNamespace = "default" - - timeout = time.Second * 10 - interval = time.Millisecond * 250 - ) - - Context("When Inventory CR is installed", func() { - It("Should check that Inventory CR is operational with client", func() { - By("Creating client") - finished := make(chan bool) - ctx := context.Background() - - clientset, err := NewForConfig(cfg) - Expect(err).NotTo(HaveOccurred()) - - client := clientset.Inventories(InventoryNamespace) - - inventory := &metalv1alpha4.Inventory{ - ObjectMeta: v1.ObjectMeta{ - Name: InventoryName, - Namespace: InventoryNamespace, - }, - Spec: metalv1alpha4.InventorySpec{ - System: &metalv1alpha4.SystemSpec{ - ID: "a967954c-3475-11b2-a85c-84d8b4f8cd2d", - Manufacturer: "LENOVO", - ProductSKU: "LENOVO_MT_20JX_BU_Think_FM_ThinkPad T570 W10DG", - SerialNumber: "R90QR6J0", - }, - Blocks: []metalv1alpha4.BlockSpec{ - { - Name: "JustDisk", - Type: "SCSI", - Rotational: true, - Model: "greatModel", - Size: 1000, - }, - }, - Memory: &metalv1alpha4.MemorySpec{ - Total: 1024000, - }, - CPUs: []metalv1alpha4.CPUSpec{ - { - PhysicalID: 0, - LogicalIDs: []uint64{0, 1, 2, 3}, - Cores: 2, - Siblings: 4, - VendorID: "GenuineIntel", - Model: "78", - ModelName: "Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz", - // These two values should be set through parse method - // in order to avoid failure on deep equality. - // On deserialization, Quantity sets internal string representation - // to the string value coming from JSON. - // If left empty or constructed from int64, string representation - // will not be set, and DeepEqual method will return false in result. - MHz: resource.MustParse("0"), - BogoMIPS: resource.MustParse("0"), - }, - }, - NICs: []metalv1alpha4.NICSpec{ - { - Name: "enp0s31f6", - PCIAddress: "0000:00:1f.6", - MACAddress: "48:2a:e3:02:d9:e8", - MTU: 1400, - Speed: 1000, - }, - }, - Host: &metalv1alpha4.HostSpec{ - Name: "dummy.localdomain", - }, - }, - } - - By("Creating watcher") - watcher, err := client.Watch(ctx, v1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - events := watcher.ResultChan() - - By("Creating Inventory") - createdInventory := &metalv1alpha4.Inventory{} - go func() { - defer GinkgoRecover() - createdInventory, err = client.Create(ctx, inventory, v1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(createdInventory.Spec).Should(Equal(inventory.Spec)) - finished <- true - }() - - event := &watch.Event{} - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Added)) - eventInventory := event.Object.(*metalv1alpha4.Inventory) - Expect(eventInventory).NotTo(BeNil()) - Expect(eventInventory.Spec).Should(Equal(inventory.Spec)) - - <-finished - - By("Updating Inventory") - createdInventory.Spec.Host.Name = "updateddummy.localdomain" - go func() { - defer GinkgoRecover() - updatedInventory, err := client.Update(ctx, createdInventory, v1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(updatedInventory.Spec).Should(Equal(createdInventory.Spec)) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventInventory = event.Object.(*metalv1alpha4.Inventory) - Expect(eventInventory).NotTo(BeNil()) - Expect(eventInventory.Spec).Should(Equal(createdInventory.Spec)) - - <-finished - - By("Patching Inventory") - patch := []struct { - Op string `json:"op"` - Path string `json:"path"` - Value string `json:"value"` - }{{ - Op: "replace", - Path: "/spec/host/name", - Value: "patcheddummy.localdomain", - }} - - patchData, err := json.Marshal(patch) - Expect(err).NotTo(HaveOccurred()) - - go func() { - defer GinkgoRecover() - patchedInventory, err := client.Patch(ctx, InventoryName, types.JSONPatchType, patchData, v1.PatchOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(patchedInventory.Spec.Host.Name).Should(Equal(patch[0].Value)) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventInventory = event.Object.(*metalv1alpha4.Inventory) - Expect(eventInventory).NotTo(BeNil()) - Expect(eventInventory.Spec.Host.Name).Should(Equal(patch[0].Value)) - - <-finished - - // We do not handle status for Inventory atm, - // so just a placeholder for now - By("Updating Inventory status") - _, err = client.UpdateStatus(ctx, eventInventory, v1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Eventually(events).Should(Receive()) - - inventoryToDelete := inventory.DeepCopy() - inventoryToDelete.Name = InventoryToDeleteName - inventoryToDelete.Labels = map[string]string{ - DeleteLabel: "", - } - - By("Creating Inventory collection") - _, err = client.Create(ctx, inventoryToDelete, v1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Eventually(events).Should(Receive()) - - By("Listing Inventories") - inventoryList, err := client.List(ctx, v1.ListOptions{}) - Expect(inventoryList).NotTo(BeNil()) - Expect(inventoryList.Items).To(HaveLen(2)) - - By("Bulk deleting Inventory") - Expect(client.DeleteCollection(ctx, v1.DeleteOptions{}, v1.ListOptions{LabelSelector: DeleteLabel})).To(Succeed()) - - By("Requesting created Inventory") - Eventually(func() bool { - _, err = client.Get(ctx, InventoryName, v1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeTrue()) - Eventually(func() bool { - _, err = client.Get(ctx, InventoryToDeleteName, v1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeFalse()) - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventInventory = event.Object.(*metalv1alpha4.Inventory) - Expect(eventInventory).NotTo(BeNil()) - Expect(eventInventory.Name).To(Equal(InventoryToDeleteName)) - - By("Deleting Inventory") - go func() { - defer GinkgoRecover() - err := client.Delete(ctx, InventoryName, v1.DeleteOptions{}) - Expect(err).NotTo(HaveOccurred()) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventInventory = event.Object.(*metalv1alpha4.Inventory) - Expect(eventInventory).NotTo(BeNil()) - Expect(eventInventory.Name).To(Equal(InventoryName)) - - <-finished - - watcher.Stop() - Eventually(events).Should(BeClosed()) - }) - }) -}) diff --git a/clientset/inventory/v1alpha1/size.go b/clientset/inventory/v1alpha1/size.go deleted file mode 100644 index d56d41c9..00000000 --- a/clientset/inventory/v1alpha1/size.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -const ( - CSizesResourceType = "sizes" -) - -type SizeInterface interface { - Get(ctx context.Context, name string, opts metav1.GetOptions) (*metalv1alpha4.Size, error) - List(ctx context.Context, opts metav1.ListOptions) (*metalv1alpha4.SizeList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Create(ctx context.Context, size *metalv1alpha4.Size, opts metav1.CreateOptions) (*metalv1alpha4.Size, error) - Update(ctx context.Context, size *metalv1alpha4.Size, opts metav1.UpdateOptions) (*metalv1alpha4.Size, error) - UpdateStatus(ctx context.Context, size *metalv1alpha4.Size, opts metav1.UpdateOptions) (*metalv1alpha4.Size, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metalv1alpha4.Size, error) -} - -type sizeClient struct { - restClient rest.Interface - ns string -} - -func (c *sizeClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*metalv1alpha4.Size, error) { - result := &metalv1alpha4.Size{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CSizesResourceType). - Name(name). - VersionedParams(&opts, scheme.ParameterCodec). - Do(ctx). - Into(result) - - return result, err -} - -func (c *sizeClient) List(ctx context.Context, opts metav1.ListOptions) (*metalv1alpha4.SizeList, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result := &metalv1alpha4.SizeList{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CSizesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - - return result, err -} - -func (c *sizeClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - watcher, err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CSizesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) - - return watcher, err -} - -func (c *sizeClient) Create(ctx context.Context, size *metalv1alpha4.Size, opts metav1.CreateOptions) (*metalv1alpha4.Size, error) { - result := &metalv1alpha4.Size{} - err := c.restClient. - Post(). - Namespace(c.ns). - Resource(CSizesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Body(size). - Do(ctx). - Into(result) - - return result, err -} - -func (c *sizeClient) Update(ctx context.Context, size *metalv1alpha4.Size, opts metav1.UpdateOptions) (*metalv1alpha4.Size, error) { - result := &metalv1alpha4.Size{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CSizesResourceType). - Name(size.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(size). - Do(ctx). - Into(result) - - return result, err -} - -func (c *sizeClient) UpdateStatus(ctx context.Context, size *metalv1alpha4.Size, opts metav1.UpdateOptions) (*metalv1alpha4.Size, error) { - result := &metalv1alpha4.Size{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CSizesResourceType). - Name(size.Name). - SubResource(CStatusSubresource). - VersionedParams(&opts, scheme.ParameterCodec). - Body(size). - Do(ctx). - Into(result) - - return result, err -} - -func (c *sizeClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CSizesResourceType). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -func (c *sizeClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CSizesResourceType). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -func (c *sizeClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metalv1alpha4.Size, error) { - result := &metalv1alpha4.Size{} - err := c.restClient.Patch(pt). - Namespace(c.ns). - Resource(CSizesResourceType). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - - return result, err -} diff --git a/clientset/inventory/v1alpha1/size_client_test.go b/clientset/inventory/v1alpha1/size_client_test.go deleted file mode 100644 index 8208e9e9..00000000 --- a/clientset/inventory/v1alpha1/size_client_test.go +++ /dev/null @@ -1,212 +0,0 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "time" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/json" - "k8s.io/apimachinery/pkg/watch" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -// nolint:forcetypeassert -var _ = PDescribe("Size client", func() { - const ( - SizeName = "test-size" - SizeToDeleteName = "test-size-to-delete" - DeleteLabel = "delete-label" - SizeNamespace = "default" - - timeout = time.Second * 10 - interval = time.Millisecond * 250 - ) - - Context("When Size CR is installed", func() { - It("Should check that Size CR is operational with client", func() { - By("Creating client") - finished := make(chan bool) - ctx := context.Background() - - clientset, err := NewForConfig(cfg) - Expect(err).NotTo(HaveOccurred()) - - client := clientset.Sizes(SizeNamespace) - - qty := resource.MustParse("12Gi") - size := &metalv1alpha4.Size{ - ObjectMeta: v1.ObjectMeta{ - Name: SizeName, - Namespace: SizeNamespace, - }, - Spec: metalv1alpha4.SizeSpec{ - Constraints: []metalv1alpha4.ConstraintSpec{ - { - Path: *metalv1alpha4.JSONPathFromString("a.b.c"), - GreaterThan: &qty, - }, - }, - }, - } - - By("Creating watcher") - watcher, err := client.Watch(ctx, v1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - events := watcher.ResultChan() - - By("Creating Size") - createdSize := &metalv1alpha4.Size{} - go func() { - defer GinkgoRecover() - createdSize, err = client.Create(ctx, size, v1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(createdSize.Spec).Should(Equal(size.Spec)) - finished <- true - }() - - event := &watch.Event{} - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Added)) - eventSize := event.Object.(*metalv1alpha4.Size) - Expect(eventSize).NotTo(BeNil()) - Expect(eventSize.Spec).Should(Equal(size.Spec)) - - <-finished - - By("Updating Size") - createdSize.Spec.Constraints[0].Path = *metalv1alpha4.JSONPathFromString("d.e.f") - go func() { - defer GinkgoRecover() - updatedSize, err := client.Update(ctx, createdSize, v1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(updatedSize.Spec).Should(Equal(createdSize.Spec)) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventSize = event.Object.(*metalv1alpha4.Size) - Expect(eventSize).NotTo(BeNil()) - Expect(eventSize.Spec).Should(Equal(createdSize.Spec)) - - <-finished - - By("Patching Size") - patch := []struct { - Op string `json:"op"` - Path string `json:"path"` - Value string `json:"value"` - }{{ - Op: "replace", - Path: "/spec/constraints/0/path", - Value: "g.h.i", - }} - - patchData, err := json.Marshal(patch) - Expect(err).NotTo(HaveOccurred()) - - go func() { - defer GinkgoRecover() - patchedSize, err := client.Patch(ctx, SizeName, types.JSONPatchType, patchData, v1.PatchOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(patchedSize.Spec.Constraints[0].Path.String()).Should(Equal(metalv1alpha4.JSONPathFromString(patch[0].Value).String())) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventSize = event.Object.(*metalv1alpha4.Size) - Expect(eventSize).NotTo(BeNil()) - Expect(eventSize.Spec.Constraints[0].Path.String()).Should(Equal(metalv1alpha4.JSONPathFromString(patch[0].Value).String())) - - <-finished - - // We do not handle status for Size atm, - // so just a placeholder for now - By("Updating Size status") - _, err = client.UpdateStatus(ctx, eventSize, v1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Eventually(events).Should(Receive()) - - sizeToDelete := &metalv1alpha4.Size{ - ObjectMeta: v1.ObjectMeta{ - Name: SizeToDeleteName, - Namespace: SizeNamespace, - Labels: map[string]string{ - DeleteLabel: "", - }, - }, - Spec: metalv1alpha4.SizeSpec{}, - } - - By("Creating Size collection") - _, err = client.Create(ctx, sizeToDelete, v1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Eventually(events).Should(Receive()) - - By("Listing Sizes") - sizeList, err := client.List(ctx, v1.ListOptions{}) - Expect(sizeList).NotTo(BeNil()) - Expect(sizeList.Items).To(HaveLen(2)) - - By("Bulk deleting Size") - Expect(client.DeleteCollection(ctx, v1.DeleteOptions{}, v1.ListOptions{LabelSelector: DeleteLabel})).To(Succeed()) - - By("Requesting created Size") - Eventually(func() bool { - _, err = client.Get(ctx, SizeName, v1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeTrue()) - Eventually(func() bool { - _, err = client.Get(ctx, SizeToDeleteName, v1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeFalse()) - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventSize = event.Object.(*metalv1alpha4.Size) - Expect(eventSize).NotTo(BeNil()) - Expect(eventSize.Name).To(Equal(SizeToDeleteName)) - - By("Deleting Size") - go func() { - defer GinkgoRecover() - err := client.Delete(ctx, SizeName, v1.DeleteOptions{}) - Expect(err).NotTo(HaveOccurred()) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventSize = event.Object.(*metalv1alpha4.Size) - Expect(eventSize).NotTo(BeNil()) - Expect(eventSize.Name).To(Equal(SizeName)) - - <-finished - - watcher.Stop() - Eventually(events).Should(BeClosed()) - }) - }) -}) diff --git a/clientset/switch/v1beta1/client.go b/clientset/switch/v1beta1/client.go deleted file mode 100644 index 3d328ad9..00000000 --- a/clientset/switch/v1beta1/client.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -type SwitchV1Alpha1Interface interface { - Projects(namespace string) SwitchInterface -} - -type SwitchV1Alpha1Client struct { - restClient rest.Interface -} - -func NewForConfig(c *rest.Config) (*SwitchV1Alpha1Client, error) { - config := *c - config.ContentConfig.GroupVersion = &metalv1alpha4.SchemeGroupVersion - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - config.UserAgent = rest.DefaultKubernetesUserAgent() - - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - - return &SwitchV1Alpha1Client{restClient: client}, nil -} - -func (c *SwitchV1Alpha1Client) Switches(namespace string) SwitchInterface { - return &switchClient{ - restClient: c.restClient, - ns: namespace, - } -} diff --git a/clientset/switch/v1beta1/client_test.go b/clientset/switch/v1beta1/client_test.go deleted file mode 100644 index eb39244b..00000000 --- a/clientset/switch/v1beta1/client_test.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Copyright 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "time" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/json" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/utils/ptr" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - "github.com/ironcore-dev/metal/pkg/constants" -) - -var _ = PDescribe("NetworkSwitch client", func() { - const ( - SwitchName = "test-switch" - SwitchToDeleteName = "test-switch-to-delete" - DeleteLabel = "delete-label" - SwitchesNamespace = "default" - - timeout = time.Second * 10 - interval = time.Millisecond * 250 - ) - - Context("When NetworkSwitch CR is installed", func() { - It("Should check that NetworkSwitch CR is operational with client", func() { - By("Creating client") - finished := make(chan bool) - ctx := context.Background() - - clientset, err := NewForConfig(cfg) - Expect(err).NotTo(HaveOccurred()) - - client := clientset.Switches(SwitchesNamespace) - - res := &metalv1alpha4.NetworkSwitch{ - ObjectMeta: metav1.ObjectMeta{ - Name: SwitchName, - Namespace: SwitchesNamespace, - }, - Spec: metalv1alpha4.NetworkSwitchSpec{ - InventoryRef: &v1.LocalObjectReference{Name: "a177382d-a3b4-3ecd-97a4-01cc15e749e4"}, - TopSpine: ptr.To(false), - Managed: ptr.To(true), - Cordon: ptr.To(false), - ScanPorts: ptr.To(true), - }, - } - - By("Creating watcher") - watcher, err := client.Watch(ctx, metav1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - events := watcher.ResultChan() - - By("Creating NetworkSwitch") - createdSwitch := &metalv1alpha4.NetworkSwitch{} - go func() { - defer GinkgoRecover() - createdSwitch, err = client.Create(ctx, res, metav1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(createdSwitch.Spec).Should(Equal(res.Spec)) - finished <- true - }() - - event := &watch.Event{} - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Added)) - eventSwitch, ok := event.Object.(*metalv1alpha4.NetworkSwitch) - Expect(ok).To(BeTrue()) - Expect(eventSwitch).NotTo(BeNil()) - Expect(eventSwitch.Spec).Should(Equal(res.Spec)) - - <-finished - - By("Updating NetworkSwitch") - createdSwitch, err = client.Get(ctx, SwitchName, metav1.GetOptions{}) - Expect(err).NotTo(HaveOccurred()) - createdSwitch.SetCordon(true) - go func() { - defer GinkgoRecover() - var updatedSwitch *metalv1alpha4.NetworkSwitch - updatedSwitch, err = client.Update(ctx, createdSwitch, metav1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(updatedSwitch.Spec).Should(Equal(createdSwitch.Spec)) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventSwitch, ok = event.Object.(*metalv1alpha4.NetworkSwitch) - Expect(ok).To(BeTrue()) - Expect(eventSwitch).NotTo(BeNil()) - Expect(eventSwitch.Spec).Should(Equal(createdSwitch.Spec)) - - <-finished - - By("Patching NetworkSwitch") - patch := []struct { - Op string `json:"op"` - Path string `json:"path"` - Value bool `json:"value"` - }{{ - Op: "replace", - Path: "/spec/managed", - Value: false, - }} - - patchData, err := json.Marshal(patch) - Expect(err).NotTo(HaveOccurred()) - - go func() { - defer GinkgoRecover() - var patchedSwitch *metalv1alpha4.NetworkSwitch - patchedSwitch, err = client.Patch(ctx, SwitchName, types.JSONPatchType, patchData, metav1.PatchOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(patchedSwitch.Managed()).Should(BeFalse()) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventSwitch, ok = event.Object.(*metalv1alpha4.NetworkSwitch) - Expect(ok).To(BeTrue()) - Expect(eventSwitch).NotTo(BeNil()) - Expect(eventSwitch.Managed()).Should(BeFalse()) - - <-finished - - By("Updating NetworkSwitch status") - createdSwitch, err = client.Get(ctx, SwitchName, metav1.GetOptions{}) - Expect(err).NotTo(HaveOccurred()) - createdSwitch.Status = metalv1alpha4.NetworkSwitchStatus{ - TotalPorts: 1, - SwitchPorts: 1, - Role: "spine", - Layer: 0, - Interfaces: map[string]*metalv1alpha4.InterfaceSpec{"Ethernet0": { - MACAddress: ptr.To("00:00:00:00:00:01"), - Direction: ptr.To(constants.DirectionSouth), - Speed: ptr.To(uint32(100000)), - PortParametersSpec: &metalv1alpha4.PortParametersSpec{ - FEC: ptr.To(constants.FECNone), - MTU: ptr.To(uint32(9100)), - Lanes: ptr.To(uint32(4)), - State: ptr.To(constants.NICUp), - }, - }}, - State: ptr.To("Initial"), - } - go func() { - defer GinkgoRecover() - var updatedSwitch *metalv1alpha4.NetworkSwitch - updatedSwitch, err = client.UpdateStatus(ctx, createdSwitch, metav1.UpdateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Expect(updatedSwitch.Status).Should(Equal(createdSwitch.Status)) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Modified)) - eventSwitch, ok = event.Object.(*metalv1alpha4.NetworkSwitch) - Expect(ok).To(BeTrue()) - Expect(eventSwitch).NotTo(BeNil()) - Expect(eventSwitch.Status).Should(Equal(createdSwitch.Status)) - - switchToDelete := res.DeepCopy() - switchToDelete.Name = SwitchToDeleteName - switchToDelete.Labels = map[string]string{ - DeleteLabel: "", - } - - By("Creating NetworkSwitch collection") - _, err = client.Create(ctx, switchToDelete, metav1.CreateOptions{}) - Expect(err).NotTo(HaveOccurred()) - Eventually(events).Should(Receive()) - - By("Listing Switches") - switchesList, err := client.List(ctx, metav1.ListOptions{}) - Expect(switchesList).NotTo(BeNil()) - Expect(switchesList.Items).To(HaveLen(2)) - - By("Bulk deleting Switches") - Expect(client.DeleteCollection( - ctx, metav1.DeleteOptions{}, - metav1.ListOptions{LabelSelector: DeleteLabel})).To(Succeed()) - - By("Requesting created NetworkSwitch") - Eventually(func() bool { - _, err = client.Get(ctx, SwitchName, metav1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeTrue()) - Eventually(func() bool { - _, err = client.Get(ctx, SwitchToDeleteName, metav1.GetOptions{}) - return err == nil - }, timeout, interval).Should(BeFalse()) - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventSwitch, ok = event.Object.(*metalv1alpha4.NetworkSwitch) - Expect(ok).To(BeTrue()) - Expect(eventSwitch).NotTo(BeNil()) - Expect(eventSwitch.Name).To(Equal(SwitchToDeleteName)) - - By("Deleting NetworkSwitch") - go func() { - defer GinkgoRecover() - err := client.Delete(ctx, SwitchName, metav1.DeleteOptions{}) - Expect(err).NotTo(HaveOccurred()) - finished <- true - }() - - Eventually(events).Should(Receive(event)) - Expect(event.Type).To(Equal(watch.Deleted)) - eventSwitch, ok = event.Object.(*metalv1alpha4.NetworkSwitch) - Expect(ok).To(BeTrue()) - Expect(eventSwitch).NotTo(BeNil()) - Expect(eventSwitch.Name).To(Equal(SwitchName)) - - <-finished - - watcher.Stop() - Eventually(events).Should(BeClosed()) - }) - }) -}) diff --git a/clientset/switch/v1beta1/suite_test.go b/clientset/switch/v1beta1/suite_test.go deleted file mode 100644 index 96a11c73..00000000 --- a/clientset/switch/v1beta1/suite_test.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/envtest" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -var cfg *rest.Config -var testEnv *envtest.Environment - -//nolint:paralleltest -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecs(t, "NetworkSwitch Controller Suite") -} - -var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - - By("bootstrapping test environment") - crdPath := filepath.Join("..", "..", "..", "config", "crd", "bases") - - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{crdPath}, - } - - var err error - cfg, err = testEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(cfg).NotTo(BeNil()) - - err = metalv1alpha4.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - // +kubebuilder:scaffold:scheme -}) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).NotTo(HaveOccurred()) -}) diff --git a/clientset/switch/v1beta1/switch.go b/clientset/switch/v1beta1/switch.go deleted file mode 100644 index 4f5fd4dc..00000000 --- a/clientset/switch/v1beta1/switch.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" -) - -const ( - CSwitchesResourceType = "switches" - CStatusSubresource = "status" -) - -type SwitchInterface interface { - Get(context.Context, string, metav1.GetOptions) (*metalv1alpha4.NetworkSwitch, error) - List(context.Context, metav1.ListOptions) (*metalv1alpha4.NetworkSwitchList, error) - Watch(context.Context, metav1.ListOptions) (watch.Interface, error) - Create(context.Context, *metalv1alpha4.NetworkSwitch, metav1.CreateOptions) (*metalv1alpha4.NetworkSwitch, error) - Update(context.Context, *metalv1alpha4.NetworkSwitch, metav1.UpdateOptions) (*metalv1alpha4.NetworkSwitch, error) - UpdateStatus(context.Context, *metalv1alpha4.NetworkSwitch, metav1.UpdateOptions) (*metalv1alpha4.NetworkSwitch, error) - Delete(context.Context, string, metav1.DeleteOptions) error - DeleteCollection(context.Context, metav1.DeleteOptions, metav1.ListOptions) error - Patch(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) (*metalv1alpha4.NetworkSwitch, error) -} - -type switchClient struct { - restClient rest.Interface - ns string -} - -func (c *switchClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*metalv1alpha4.NetworkSwitch, error) { - result := &metalv1alpha4.NetworkSwitch{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - Name(name). - VersionedParams(&opts, scheme.ParameterCodec). - Do(ctx). - Into(result) - - return result, err -} - -func (c *switchClient) List(ctx context.Context, opts metav1.ListOptions) (*metalv1alpha4.NetworkSwitchList, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result := &metalv1alpha4.NetworkSwitchList{} - err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - - return result, err -} - -func (c *switchClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - watcher, err := c.restClient. - Get(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) - - return watcher, err -} - -func (c *switchClient) Create(ctx context.Context, obj *metalv1alpha4.NetworkSwitch, opts metav1.CreateOptions) (*metalv1alpha4.NetworkSwitch, error) { - result := &metalv1alpha4.NetworkSwitch{} - err := c.restClient. - Post(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - VersionedParams(&opts, scheme.ParameterCodec). - Body(obj). - Do(ctx). - Into(result) - - return result, err -} - -func (c *switchClient) Update(ctx context.Context, obj *metalv1alpha4.NetworkSwitch, opts metav1.UpdateOptions) (*metalv1alpha4.NetworkSwitch, error) { - result := &metalv1alpha4.NetworkSwitch{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - Name(obj.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(obj). - Do(ctx). - Into(result) - - return result, err -} - -func (c *switchClient) UpdateStatus(ctx context.Context, obj *metalv1alpha4.NetworkSwitch, opts metav1.UpdateOptions) (*metalv1alpha4.NetworkSwitch, error) { - result := &metalv1alpha4.NetworkSwitch{} - err := c.restClient.Put(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - Name(obj.Name). - SubResource(CStatusSubresource). - VersionedParams(&opts, scheme.ParameterCodec). - Body(obj). - Do(ctx). - Into(result) - - return result, err -} - -func (c *switchClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -func (c *switchClient) DeleteCollection(ctx context.Context, - opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - - return c.restClient.Delete(). - Namespace(c.ns). - Resource(CSwitchesResourceType). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -func (c *switchClient) Patch( - ctx context.Context, - name string, - pt types.PatchType, - data []byte, - opts metav1.PatchOptions, - subresources ...string) (*metalv1alpha4.NetworkSwitch, error) { - result := &metalv1alpha4.NetworkSwitch{} - err := c.restClient.Patch(pt). - Namespace(c.ns). - Resource(CSwitchesResourceType). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - - return result, err -} diff --git a/common/types/base/domainEntity.go b/common/types/base/domainEntity.go index 9792fc3b..75a5d155 100644 --- a/common/types/base/domainEntity.go +++ b/common/types/base/domainEntity.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package base diff --git a/common/types/base/domainEvent.go b/common/types/base/domainEvent.go index 84fedf7c..386a33a4 100644 --- a/common/types/base/domainEvent.go +++ b/common/types/base/domainEvent.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package base diff --git a/common/types/errors/businessError.go b/common/types/errors/businessError.go index 44e0bd58..ba255f11 100644 --- a/common/types/errors/businessError.go +++ b/common/types/errors/businessError.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package errors diff --git a/common/types/events/domainEventListener.go b/common/types/events/domainEventListener.go index dbf0030c..6fca5c47 100644 --- a/common/types/events/domainEventListener.go +++ b/common/types/events/domainEventListener.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package events diff --git a/common/types/events/domainEventPublisher.go b/common/types/events/domainEventPublisher.go index 958b1607..b90b95b6 100644 --- a/common/types/events/domainEventPublisher.go +++ b/common/types/events/domainEventPublisher.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package events diff --git a/controllers/benchmark/benchmark_controller.go b/controllers/benchmark/benchmark_controller.go index 462e6e69..55eb5794 100644 --- a/controllers/benchmark/benchmark_controller.go +++ b/controllers/benchmark/benchmark_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/benchmark/onboarding_controller.go b/controllers/benchmark/onboarding_controller.go index 30f93cd3..ec354f42 100644 --- a/controllers/benchmark/onboarding_controller.go +++ b/controllers/benchmark/onboarding_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/benchmark/onboarding_controller_test.go b/controllers/benchmark/onboarding_controller_test.go index 8050882c..a347fbac 100644 --- a/controllers/benchmark/onboarding_controller_test.go +++ b/controllers/benchmark/onboarding_controller_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/benchmark/suite_test.go b/controllers/benchmark/suite_test.go index ee6e39f2..89eef6f4 100644 --- a/controllers/benchmark/suite_test.go +++ b/controllers/benchmark/suite_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/inventory/access_controller.go b/controllers/inventory/access_controller.go index 662fb651..30113637 100644 --- a/controllers/inventory/access_controller.go +++ b/controllers/inventory/access_controller.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers @@ -448,7 +435,7 @@ func (r *AccessReconciler) kubernetesClientConfig( } func (r *AccessReconciler) ClusterName() string { - return "onmetal" + return "ironcore" } func (r *AccessReconciler) InventoryRoleBinding( diff --git a/controllers/inventory/access_controller_test.go b/controllers/inventory/access_controller_test.go index 1bfbabe4..4620c81b 100644 --- a/controllers/inventory/access_controller_test.go +++ b/controllers/inventory/access_controller_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers_test diff --git a/controllers/inventory/aggregate_controller.go b/controllers/inventory/aggregate_controller.go index 3bfce229..eb8fa351 100644 --- a/controllers/inventory/aggregate_controller.go +++ b/controllers/inventory/aggregate_controller.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/inventory/aggregate_controller_test.go b/controllers/inventory/aggregate_controller_test.go index 2ccbaa60..5a468c82 100644 --- a/controllers/inventory/aggregate_controller_test.go +++ b/controllers/inventory/aggregate_controller_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/inventory/errors.go b/controllers/inventory/errors.go index 4fd1a5d9..b0251714 100644 --- a/controllers/inventory/errors.go +++ b/controllers/inventory/errors.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/inventory/fake/client.go b/controllers/inventory/fake/client.go index 0b1fe7e0..5a068d4d 100644 --- a/controllers/inventory/fake/client.go +++ b/controllers/inventory/fake/client.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package fake diff --git a/controllers/inventory/inventory_controller.go b/controllers/inventory/inventory_controller.go index 2cf46a14..4af6a448 100644 --- a/controllers/inventory/inventory_controller.go +++ b/controllers/inventory/inventory_controller.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers @@ -50,6 +37,8 @@ type InventoryReconciler struct { // +kubebuilder:rbac:groups=metal.ironcore.dev,resources=metalv1alpha4/status,verbs=get;update;patch // +kubebuilder:rbac:groups=metal.ironcore.dev,resources=metalv1alpha4/finalizers,verbs=update +// todo: refactor Reconcile function +// nolint:gocyclo func (r *InventoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { log := r.Log.WithValues("inventory", req.NamespacedName) diff --git a/controllers/inventory/inventory_controller_test.go b/controllers/inventory/inventory_controller_test.go index 419058ea..d5d8a250 100644 --- a/controllers/inventory/inventory_controller_test.go +++ b/controllers/inventory/inventory_controller_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/inventory/size_controller.go b/controllers/inventory/size_controller.go index 28bfa41f..b5513cd6 100644 --- a/controllers/inventory/size_controller.go +++ b/controllers/inventory/size_controller.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/inventory/size_controller_test.go b/controllers/inventory/size_controller_test.go index 754b517f..8fe5c938 100644 --- a/controllers/inventory/size_controller_test.go +++ b/controllers/inventory/size_controller_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/inventory/suite_test.go b/controllers/inventory/suite_test.go index e48b1354..8ac2200a 100644 --- a/controllers/inventory/suite_test.go +++ b/controllers/inventory/suite_test.go @@ -1,18 +1,5 @@ -/* -Copyright 2021. - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/ipxe_controller.go b/controllers/machine/ipxe_controller.go index ab546657..d7d6b1dd 100644 --- a/controllers/machine/ipxe_controller.go +++ b/controllers/machine/ipxe_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers @@ -30,7 +17,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "github.com/go-logr/logr" - onmetalimage "github.com/ironcore-dev/ironcore-image" + ironcoreimage "github.com/ironcore-dev/ironcore-image" "github.com/ironcore-dev/ironcore-image/oci/remote" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -112,7 +99,7 @@ func (r *IpxeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. } if computeMachine.Spec.Image == "" { - log.Info("unable to handle ipxe CM, onmetal image url is empty") + log.Info("unable to handle ipxe CM, ironcore image url is empty") return ctrl.Result{}, nil } @@ -208,58 +195,58 @@ type ImageDescription struct { CommandLine string } -type OnmetalImageParser struct { +type IroncoreImageParser struct { Log logr.Logger Registry *remote.Registry } -func (p *OnmetalImageParser) GetDescription(url string) (ImageDescription, error) { +func (p *IroncoreImageParser) GetDescription(url string) (ImageDescription, error) { var imageDescription ImageDescription - onmetalImage, err := p.getOnmetalImage(url) + ironcoreImage, err := p.getIroncoreImage(url) if err != nil { - p.Log.Error(err, "could not get onmetal image") + p.Log.Error(err, "could not get ironcore image") return imageDescription, err } - p.describeImage(&imageDescription, onmetalImage) + p.describeImage(&imageDescription, ironcoreImage) return imageDescription, nil } -func (p *OnmetalImageParser) describeImage(imageDescription *ImageDescription, onmetalImage *onmetalimage.Image) { - if onmetalImage.Kernel != nil { - imageDescription.KernelDigest = p.formatDigest(string(onmetalImage.Kernel.Descriptor().Digest)) +func (p *IroncoreImageParser) describeImage(imageDescription *ImageDescription, ironcoreImage *ironcoreimage.Image) { + if ironcoreImage.Kernel != nil { + imageDescription.KernelDigest = p.formatDigest(string(ironcoreImage.Kernel.Descriptor().Digest)) } - if onmetalImage.InitRAMFs != nil { - imageDescription.InitRAMFsDigest = p.formatDigest(string(onmetalImage.InitRAMFs.Descriptor().Digest)) + if ironcoreImage.InitRAMFs != nil { + imageDescription.InitRAMFsDigest = p.formatDigest(string(ironcoreImage.InitRAMFs.Descriptor().Digest)) } - if onmetalImage.RootFS != nil { - imageDescription.RootFSDigest = p.formatDigest(string(onmetalImage.RootFS.Descriptor().Digest)) + if ironcoreImage.RootFS != nil { + imageDescription.RootFSDigest = p.formatDigest(string(ironcoreImage.RootFS.Descriptor().Digest)) } - imageDescription.CommandLine = onmetalImage.Config.CommandLine + imageDescription.CommandLine = ironcoreImage.Config.CommandLine } -func (p *OnmetalImageParser) getOnmetalImage(url string) (*onmetalimage.Image, error) { +func (p *IroncoreImageParser) getIroncoreImage(url string) (*ironcoreimage.Image, error) { ociImage, err := p.Registry.Resolve(context.Background(), url) if err != nil { p.Log.Error(err, "registry resolving failed") return nil, err } - onmetalImage, err := onmetalimage.ResolveImage(context.Background(), ociImage) + ironcoreImage, err := ironcoreimage.ResolveImage(context.Background(), ociImage) if err != nil { p.Log.Error(err, "image resolving failed") return nil, err } - return onmetalImage, nil + return ironcoreImage, nil } // remove sha256 prefix. -func (p *OnmetalImageParser) formatDigest(digest string) string { +func (p *IroncoreImageParser) formatDigest(digest string) string { separatedStrings := strings.Split(digest, ":") if len(separatedStrings) > 1 { diff --git a/controllers/machine/machine_pool_controller.go b/controllers/machine/machine_pool_controller.go index e39278b4..8c100353 100644 --- a/controllers/machine/machine_pool_controller.go +++ b/controllers/machine/machine_pool_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/machine_power_controller.go b/controllers/machine/machine_power_controller.go index f2abe79f..226b0343 100644 --- a/controllers/machine/machine_power_controller.go +++ b/controllers/machine/machine_power_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/machine_reservation_controller.go b/controllers/machine/machine_reservation_controller.go index 1f0e7f34..8854eadd 100644 --- a/controllers/machine/machine_reservation_controller.go +++ b/controllers/machine/machine_reservation_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/metal_api_test/machine_power_controller_test.go b/controllers/machine/metal_api_test/machine_power_controller_test.go index 585e01eb..2886391f 100644 --- a/controllers/machine/metal_api_test/machine_power_controller_test.go +++ b/controllers/machine/metal_api_test/machine_power_controller_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/metal_api_test/suite_test.go b/controllers/machine/metal_api_test/suite_test.go index 20d293f8..583779d4 100644 --- a/controllers/machine/metal_api_test/suite_test.go +++ b/controllers/machine/metal_api_test/suite_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/onmetal_api_integration_test/ipxe_controller_test.go b/controllers/machine/onmetal_api_integration_test/ipxe_controller_test.go index 73a6d418..07cebe4f 100644 --- a/controllers/machine/onmetal_api_integration_test/ipxe_controller_test.go +++ b/controllers/machine/onmetal_api_integration_test/ipxe_controller_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/onmetal_api_integration_test/machine_pool_controller_test.go b/controllers/machine/onmetal_api_integration_test/machine_pool_controller_test.go index be4d825b..f5d1c60d 100644 --- a/controllers/machine/onmetal_api_integration_test/machine_pool_controller_test.go +++ b/controllers/machine/onmetal_api_integration_test/machine_pool_controller_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/onmetal_api_integration_test/machine_reservation_controller_test.go b/controllers/machine/onmetal_api_integration_test/machine_reservation_controller_test.go index 46d8ebef..f2a39212 100644 --- a/controllers/machine/onmetal_api_integration_test/machine_reservation_controller_test.go +++ b/controllers/machine/onmetal_api_integration_test/machine_reservation_controller_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/machine/onmetal_api_integration_test/suite_test.go b/controllers/machine/onmetal_api_integration_test/suite_test.go index 9f761c02..4345ffae 100644 --- a/controllers/machine/onmetal_api_integration_test/suite_test.go +++ b/controllers/machine/onmetal_api_integration_test/suite_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/onboarding/indexName.go b/controllers/onboarding/indexName.go index b1044046..65fe9240 100644 --- a/controllers/onboarding/indexName.go +++ b/controllers/onboarding/indexName.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + package controllers import ( diff --git a/controllers/onboarding/inventory.go b/controllers/onboarding/inventory.go index 4bb7471e..47662568 100644 --- a/controllers/onboarding/inventory.go +++ b/controllers/onboarding/inventory.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/onboarding/machine.go b/controllers/onboarding/machine.go index 5cbb238a..9d5c063b 100644 --- a/controllers/onboarding/machine.go +++ b/controllers/onboarding/machine.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package controllers diff --git a/controllers/switch/controllers_test.go b/controllers/switch/controllers_test.go index 0af0f30d..fb950c88 100644 --- a/controllers/switch/controllers_test.go +++ b/controllers/switch/controllers_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1beta1 diff --git a/controllers/switch/ipam_controller.go b/controllers/switch/ipam_controller.go index 00be503e..e4d71f08 100644 --- a/controllers/switch/ipam_controller.go +++ b/controllers/switch/ipam_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1beta1 @@ -566,6 +553,7 @@ func buildSwitchPortSubnet( return subnet } +// nolint:dupl func cleanupFailedLoopbackIPs( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, @@ -605,6 +593,7 @@ func cleanupFailedLoopbackIPs( return nil } +// nolint:dupl func cleanupFailedSwitchPortSubnets( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, @@ -638,6 +627,7 @@ func cleanupFailedSwitchPortSubnets( return nil } +// nolint:dupl func cleanupFailedSouthSubnets( ctx context.Context, obj *metalv1alpha4.NetworkSwitch, diff --git a/controllers/switch/iptrack_controller.go b/controllers/switch/iptrack_controller.go index 7aef5569..58b3d8fd 100644 --- a/controllers/switch/iptrack_controller.go +++ b/controllers/switch/iptrack_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2024 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1beta1 diff --git a/controllers/switch/onboarding_controller.go b/controllers/switch/onboarding_controller.go index e7ca10ed..1beccb9e 100644 --- a/controllers/switch/onboarding_controller.go +++ b/controllers/switch/onboarding_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1beta1 diff --git a/controllers/switch/subnettrack_controller.go b/controllers/switch/subnettrack_controller.go index 8581a836..7647ae90 100644 --- a/controllers/switch/subnettrack_controller.go +++ b/controllers/switch/subnettrack_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2024 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1beta1 diff --git a/controllers/switch/suite_test.go b/controllers/switch/suite_test.go index 46521c54..3da4f714 100644 --- a/controllers/switch/suite_test.go +++ b/controllers/switch/suite_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1beta1 diff --git a/controllers/switch/switch_controller.go b/controllers/switch/switch_controller.go index da539cd8..b31b8c85 100644 --- a/controllers/switch/switch_controller.go +++ b/controllers/switch/switch_controller.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package v1beta1 diff --git a/docs/README.md b/docs/README.md index c7d6aaad..7e099b14 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,10 +20,7 @@ ## [API Reference](api-reference/README.md) -* [`benchmark.onemtal.de` API Group](api-reference/benchmark.md) -* [`inventory.ironcore.dev` API Group](api-reference/inventory.md) -* [`switch.ironcore.dev` API Group](api-reference/switch.md) -* [`machine.ironcore.dev` API Group](api-reference/machine.md) +* [`metal.ironcore.dev` API Group](api-reference/metal.md) ## Proposals diff --git a/docs/api-reference/benchmark.md b/docs/api-reference/benchmark.md deleted file mode 100644 index 54cad943..00000000 --- a/docs/api-reference/benchmark.md +++ /dev/null @@ -1,252 +0,0 @@ -

Packages:

- -

metal.ironcore.dev/v1alpha3

-Resource Types: - -

MachineBenchmark -

-
-

MachineBenchmark is the Schema for the machines API.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -metal.ironcore.dev/v1alpha3 - -
-kind
-string -
MachineBenchmark
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -MachineSpec - - -
-
-
- - - - - -
-benchmarks
- - -map[string]..Benchmarks - - -
-

Benchmarks is the collection of benchmarks.

-
-
-status
- - -MachineStatus - - -
-
-

Benchmark -

-
-
- - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name is the specific benchmark name. e.g. fio-1k.

-
-value
- -uint64 - -
-

Value is the exact result of specific benchmark.

-
-

BenchmarkDeviation -

-
-

BenchmarkDeviation is a deviation between old value and the new one.

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name is the specific benchmark name. e.g. fio-1k.

-
-value
- -string - -
-

Value is the exact result of specific benchmark.

-
-

BenchmarkDeviations -([]..BenchmarkDeviation alias)

-

-(Appears on:MachineStatus) -

-
-
-

Benchmarks -([]..Benchmark alias)

-

-(Appears on:MachineSpec) -

-
-
-

MachineSpec -

-

-(Appears on:MachineBenchmark) -

-
-

MachineSpec contains machine benchmark results.

-
- - - - - - - - - - - - - -
FieldDescription
-benchmarks
- - -map[string]..Benchmarks - - -
-

Benchmarks is the collection of benchmarks.

-
-

MachineStatus -

-

-(Appears on:MachineBenchmark) -

-
-

MachineStatus contains machine benchmarks deviations.

-
- - - - - - - - - - - - - -
FieldDescription
-machine_deviation
- - -map[string]..BenchmarkDeviations - - -
-

MachineDeviation shows the difference between last and current benchmark results.

-
-
-

-Generated with gen-crd-api-reference-docs -on git commit 95c3af5. -

diff --git a/docs/api-reference/inventory.md b/docs/api-reference/inventory.md deleted file mode 100644 index 0697e264..00000000 --- a/docs/api-reference/inventory.md +++ /dev/null @@ -1,2450 +0,0 @@ -

Packages:

- -

metal.ironcore.dev/v1alpha4

-Resource Types: - -

Aggregate -

-
-

Aggregate is the Schema for the aggregates API.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -metal.ironcore.dev/v1alpha4 - -
-kind
-string -
Aggregate
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -AggregateSpec - - -
-
-
- - - - - -
-aggregates
- - -[]AggregateItem - - -
-

Aggregates is a list of aggregates required to be computed

-
-
-status
- - -AggregateStatus - - -
-
-

Inventory -

-
-

Inventory is the Schema for the inventories API.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -metal.ironcore.dev/v1alpha4 - -
-kind
-string -
Inventory
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -InventorySpec - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-system
- - -SystemSpec - - -
-

System contains DMI system information

-
-ipmis
- - -[]IPMISpec - - -
-

IPMIs contains info about IPMI interfaces on the host

-
-blocks
- - -[]BlockSpec - - -
-

Blocks contains info about block devices on the host

-
-memory
- - -MemorySpec - - -
-

Memory contains info block devices on the host

-
-cpus
- - -[]CPUSpec - - -
-

CPUs contains info about cpus, cores and threads

-
-numa
- - -[]NumaSpec - - -
-

NUMA contains info about cpu/memory topology

-
-pciDevices
- - -[]PCIDeviceSpec - - -
-

PCIDevices contains info about devices accessible through

-
-nics
- - -[]NICSpec - - -
-

NICs contains info about network interfaces and network discovery

-
-virt
- - -VirtSpec - - -
-

Virt is a virtualization detected on host

-
-host
- - -HostSpec - - -
-

Host contains info about inventorying object

-
-distro
- - -DistroSpec - - -
-

Distro contains info about OS distro

-
-
-status
- - -InventoryStatus - - -
-
-

AggregateItem -

-

-(Appears on:AggregateSpec) -

-
-
- - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-sourcePath
- - -JSONPath - - -
-

SourcePath is a path in Inventory spec aggregate will be applied to

-
-targetPath
- - -JSONPath - - -
-

TargetPath is a path in Inventory status computed field

-
-aggregate
- - -AggregateType - - -
-

Aggregate defines whether collection values should be aggregated -for constraint checks, in case if path defines selector for collection

-
-

AggregateSpec -

-

-(Appears on:Aggregate) -

-
-

AggregateSpec defines the desired state of Aggregate.

-
- - - - - - - - - - - - - -
FieldDescription
-aggregates
- - -[]AggregateItem - - -
-

Aggregates is a list of aggregates required to be computed

-
-

AggregateStatus -

-

-(Appears on:Aggregate) -

-
-

AggregateStatus defines the observed state of Aggregate.

-
-

AggregateType -(string alias)

-

-(Appears on:AggregateItem, ConstraintSpec) -

-
-
- - - - - - - - - - - - - - - - - - -
ValueDescription

"avg"

"count"

"max"

"min"

"sum"

-

AggregationResults -

-

-(Appears on:InventoryStatus) -

-
-
- - - - - - - - - - - - - -
FieldDescription
--
- -map[string]interface{} - -
-
-

BlockSpec -

-

-(Appears on:InventorySpec) -

-
-

BlockSpec contains info about block device

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name is a name of the device registered by Linux Kernel

-
-type
- -string - -
-

Type refers to data carrier form-factor

-
-rotational
- -bool - -
-

Rotational shows whether disk is solid state or not

-
-system
- -string - -
-

Bus is a type of hardware interface used to connect the disk to the system

-
-model
- -string - -
-

Model is a unique hardware part identifier

-
-size
- -uint64 - -
-

Size is a disk space available in bytes

-
-partitionTable
- - -PartitionTableSpec - - -
-

PartitionTable is a partition table currently written to the disk

-
-

CPUSpec -

-

-(Appears on:InventorySpec) -

-
-

CPUSpec contains info about CPUs on hsot machine

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-physicalId
- -uint64 - -
-

PhysicalID is an ID of physical CPU

-
-logicalIds
- -[]uint64 - -
-

LogicalIDs is a collection of logical CPU nums related to the physical CPU (required for NUMA)

-
-cores
- -uint64 - -
-

Cores is a number of physical cores

-
-siblings
- -uint64 - -
-

Siblings is a number of logical CPUs/threads

-
-vendorId
- -string - -
-

VendorID is a manufacturer identifire

-
-family
- -string - -
-

Family refers to processor type

-
-model
- -string - -
-

Model is a reference id of the model

-
-modelName
- -string - -
-

ModelName is a common name of the processor

-
-stepping
- -string - -
-

Stepping is an iteration of the architecture

-
-microcode
- -string - -
-

Microcode is a firmware reference

-
-mhz
- - -k8s.io/apimachinery/pkg/api/resource.Quantity - - -
-

MHz is a logical core frequency

-
-cacheSize
- -string - -
-

CacheSize is an L2 cache size

-
-fpu
- -bool - -
-

FPU defines if CPU has a Floating Point Unit

-
-fpuException
- -bool - -
-

FPUException

-
-cpuIdLevel
- -uint64 - -
-

CPUIDLevel

-
-wp
- -bool - -
-

WP tells if WP bit is present

-
-flags
- -[]string - -
-

Flags defines a list of low-level computing capabilities

-
-vmxFlags
- -[]string - -
-

VMXFlags defines a list of virtualization capabilities

-
-bugs
- -[]string - -
-

Bugs contains a list of known hardware bugs

-
-bogoMips
- - -k8s.io/apimachinery/pkg/api/resource.Quantity - - -
-

BogoMIPS is a synthetic performance metric

-
-clFlushSize
- -uint64 - -
-

CLFlushSize size for cache line flushing feature

-
-cacheAlignment
- -uint64 - -
-

CacheAlignment is a cache size

-
-addressSizes
- -string - -
-

AddressSizes is an info about address transition system

-
-powerManagement
- -string - -
-

PowerManagement

-
-

ConstraintSpec -

-

-(Appears on:SizeSpec) -

-
-

ConstraintSpec contains conditions of contraint that should be applied on resource.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-path
- - -JSONPath - - -
-

Path is a path to the struct field constraint will be applied to

-
-agg
- - -AggregateType - - -
-

Aggregate defines whether collection values should be aggregated -for constraint checks, in case if path defines selector for collection

-
-eq
- - -ConstraintValSpec - - -
-

Equal contains an exact expected value

-
-neq
- - -ConstraintValSpec - - -
-

NotEqual contains an exact not expected value

-
-lt
- - -k8s.io/apimachinery/pkg/api/resource.Quantity - - -
-

LessThan contains an highest expected value, exclusive

-
-lte
- - -k8s.io/apimachinery/pkg/api/resource.Quantity - - -
-

LessThan contains an highest expected value, inclusive

-
-gt
- - -k8s.io/apimachinery/pkg/api/resource.Quantity - - -
-

LessThan contains an lowest expected value, exclusive

-
-gte
- - -k8s.io/apimachinery/pkg/api/resource.Quantity - - -
-

GreaterThanOrEqual contains an lowest expected value, inclusive

-
-

ConstraintValSpec -

-

-(Appears on:ConstraintSpec) -

-
-

ConstraintValSpec is a wrapper around value for constraint. -Since it is not possilble to set oneOf/anyOf through kubebuilder -markers, type is set to number here, and patched with kustomize -See https://github.com/kubernetes-sigs/kubebuilder/issues/301

-
- - - - - - - - - - - - - - - - - -
FieldDescription
--
- -string - -
-
--
- - -k8s.io/apimachinery/pkg/api/resource.Quantity - - -
-
-

DistroSpec -

-

-(Appears on:InventorySpec) -

-
-

DistroSpec contains info about distro

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-buildVersion
- -string - -
-
-debianVersion
- -string - -
-
-kernelVersion
- -string - -
-
-asicType
- -string - -
-
-commitID
- -string - -
-
-buildDate
- -string - -
-
-buildNumber
- -uint32 - -
-
-buildBy
- -string - -
-
-

HostSpec -

-

-(Appears on:InventorySpec) -

-
-

HostSpec contains type of inventorying object and in case it is a switch - SONiC version

-
- - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Hostname contains hostname

-
-

IPMISpec -

-

-(Appears on:InventorySpec) -

-
-

IPMISpec contains info about IPMI module

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-ipAddress
- -string - -
-

IPAddress is an IP address assigned to IPMI network interface

-
-macAddress
- -string - -
-

MACAddress is a MAC address of IPMI’s network interface

-
-

InventorySpec -

-

-(Appears on:Inventory, ValidationInventory) -

-
-

InventorySpec contains result of inventorization process on the host

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-system
- - -SystemSpec - - -
-

System contains DMI system information

-
-ipmis
- - -[]IPMISpec - - -
-

IPMIs contains info about IPMI interfaces on the host

-
-blocks
- - -[]BlockSpec - - -
-

Blocks contains info about block devices on the host

-
-memory
- - -MemorySpec - - -
-

Memory contains info block devices on the host

-
-cpus
- - -[]CPUSpec - - -
-

CPUs contains info about cpus, cores and threads

-
-numa
- - -[]NumaSpec - - -
-

NUMA contains info about cpu/memory topology

-
-pciDevices
- - -[]PCIDeviceSpec - - -
-

PCIDevices contains info about devices accessible through

-
-nics
- - -[]NICSpec - - -
-

NICs contains info about network interfaces and network discovery

-
-virt
- - -VirtSpec - - -
-

Virt is a virtualization detected on host

-
-host
- - -HostSpec - - -
-

Host contains info about inventorying object

-
-distro
- - -DistroSpec - - -
-

Distro contains info about OS distro

-
-

InventoryStatus -

-

-(Appears on:Inventory) -

-
-

InventoryStatus defines the observed state of Inventory

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-computed
- - -AggregationResults - - -
-
-inventoryStatuses
- - -InventoryStatuses - - -
-
-

InventoryStatuses -

-

-(Appears on:InventoryStatus) -

-
-
- - - - - - - - - - - - - - - - - -
FieldDescription
-ready
- -bool - -
-
-requestsCount
- -int - -
-
-

JSONPath -

-

-(Appears on:AggregateItem, ConstraintSpec) -

-
-
- - - - - - - - - - - - - -
FieldDescription
--
- -string - -
-
-

LLDPCapabilities -(string alias)

-

-(Appears on:LLDPSpec) -

-
-

LLDPCapabilities

-
-

LLDPSpec -

-

-(Appears on:NICSpec) -

-
-

LLDPSpec is an entry received by network interface by Link Layer Discovery Protocol

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-chassisId
- -string - -
-

ChassisID is a neighbour box identifier

-
-systemName
- -string - -
-

SystemName is given name to the neighbour box

-
-systemDescription
- -string - -
-

SystemDescription is a short description of the neighbour box

-
-portId
- -string - -
-

PortID is a hardware identifier of the link port

-
-portDescription
- -string - -
-

PortDescription is a short description of the link port

-
-capabilities
- - -[]LLDPCapabilities - - -
-

Capabilities is a list of LLDP capabilities advertised by neighbor

-
-

MemorySpec -

-

-(Appears on:InventorySpec, NumaSpec) -

-
-

MemorySpec contains info about RAM on host

-
- - - - - - - - - - - - - -
FieldDescription
-total
- -uint64 - -
-

Total is a total amount of RAM on host

-
-

NDPSpec -

-

-(Appears on:NICSpec) -

-
-

NDPSpec is an entry received by IPv6 Neighbour Discovery Protocol

-
- - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-ipAddress
- -string - -
-

IPAddress is an IPv6 address of a neighbour

-
-macAddress
- -string - -
-

MACAddress is an MAC address of a neighbour

-
-state
- -string - -
-

State is a state of discovery

-
-

NICSpec -

-

-(Appears on:InventorySpec) -

-
-

NICSpec contains info about network interfaces

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name is a name of the device registered by Linux Kernel

-
-pciAddress
- -string - -
-

PCIAddress is the PCI bus address network interface is connected to

-
-macAddress
- -string - -
-

MACAddress is the MAC address of network interface

-
-mtu
- -uint16 - -
-

MTU is refers to Maximum Transmission Unit

-
-speed
- -uint32 - -
-

Speed is a speed of network interface in Mbits/s

-
-lanes
- -byte - -
-

Lanes is a number of used lanes (if supported)

-
-activeFEC
- -string - -
-

ActiveFEC is an active error correction mode

-
-lldps
- - -[]LLDPSpec - - -
-

LLDP is a collection of LLDP messages received by the network interface

-
-ndps
- - -[]NDPSpec - - -
-

NDP is a collection of NDP messages received by the network interface

-
-

NumaSpec -

-

-(Appears on:InventorySpec) -

-
-

NumaSpec describes NUMA node

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-id
- -int - -
-

ID is NUMA node ID.

-
-cpus
- -[]int - -
-

CPUs is a list of CPU logical IDs in current numa node.

-
-distances
- -[]int - -
-

Distances contains distances to other nodes. Element index corresponds to NUMA node ID.

-
-memory
- - -MemorySpec - - -
-

Memory contains info about NUMA node memory setup.

-
-

PCIDeviceDescriptionSpec -

-

-(Appears on:PCIDeviceSpec) -

-
-

PCIDeviceDescriptionSpec contains one of the options that is describing the PCI device

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-id
- -string - -
-

ID is a hexadecimal identifier of device property , that corresponds to the value from PCIIDs database

-
-name
- -string - -
-

Name is a string value of property extracted from PCIID DB

-
-

PCIDeviceSpec -

-

-(Appears on:InventorySpec) -

-
-

PCIDeviceSpec contains description of PCI device

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-busId
- -string - -
-

BusID is an ID of PCI bus on the board device is attached to.

-
-address
- -string - -
-

Address is an ID of device on PCI bus.

-
-vendor
- - -PCIDeviceDescriptionSpec - - -
-

Vendor refers to manufacturer ore device trademark.

-
-subvendor
- - -PCIDeviceDescriptionSpec - - -
-

Subvendor usually refers to the platform or co-manufacturer. E.g. Lenovo board manufactured for Intel platform (by Intel spec).

-
-type
- - -PCIDeviceDescriptionSpec - - -
-

Type shows device’s designation.

-
-subtype
- - -PCIDeviceDescriptionSpec - - -
-

Subtype shows device’s subsystem.

-
-class
- - -PCIDeviceDescriptionSpec - - -
-

Class refers to generic device designation.

-
-subclass
- - -PCIDeviceDescriptionSpec - - -
-

Subclass narrows the designation scope.

-
-interface
- - -PCIDeviceDescriptionSpec - - -
-

ProgrammingInterface specifies communication protocols.

-
-

PartitionSpec -

-

-(Appears on:PartitionTableSpec) -

-
-

PartitionSpec contains info about partition

-
- - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-id
- -string - -
-

ID is a GUID of GPT partition or number for MBR partition

-
-name
- -string - -
-

Name is a human readable name given to the partition

-
-size
- -uint64 - -
-

Size is a size of partition in bytes

-
-

PartitionTableSpec -

-

-(Appears on:BlockSpec) -

-
-

PartitionTableSpec contains info about partition table on block device

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-type
- -string - -
-

Type is a format of partition table

-
-partitions
- - -[]PartitionSpec - - -
-

Partitions are active partition records on disk

-
-

Size -

-
-

Size is the Schema for the sizes API.

-
- - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -SizeSpec - - -
-
-
- - - - - -
-constraints
- - -[]ConstraintSpec - - -
-

Constraints is a list of selectors based on machine properties.

-
-
-status
- - -SizeStatus - - -
-
-

SizeSpec -

-

-(Appears on:Size) -

-
-

SizeSpec defines the desired state of Size.

-
- - - - - - - - - - - - - -
FieldDescription
-constraints
- - -[]ConstraintSpec - - -
-

Constraints is a list of selectors based on machine properties.

-
-

SizeStatus -

-

-(Appears on:Size) -

-
-

SizeStatus defines the observed state of Size.

-
-

SystemSpec -

-

-(Appears on:InventorySpec) -

-
-

SystemSpec contains DMI system information

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-id
- -string - -
-

ID is a UUID of a system board

-
-manufacturer
- -string - -
-

Manufacturer refers to the company that produced the product

-
-productSku
- -string - -
-

ProductSKU is a product’s Stock Keeping Unit

-
-serialNumber
- -string - -
-

SerialNumber contains serial number of a system

-
-

ValidationInventory -

-
-
- - - - - - - - - - - - - -
FieldDescription
-spec
- - -InventorySpec - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-system
- - -SystemSpec - - -
-

System contains DMI system information

-
-ipmis
- - -[]IPMISpec - - -
-

IPMIs contains info about IPMI interfaces on the host

-
-blocks
- - -[]BlockSpec - - -
-

Blocks contains info about block devices on the host

-
-memory
- - -MemorySpec - - -
-

Memory contains info block devices on the host

-
-cpus
- - -[]CPUSpec - - -
-

CPUs contains info about cpus, cores and threads

-
-numa
- - -[]NumaSpec - - -
-

NUMA contains info about cpu/memory topology

-
-pciDevices
- - -[]PCIDeviceSpec - - -
-

PCIDevices contains info about devices accessible through

-
-nics
- - -[]NICSpec - - -
-

NICs contains info about network interfaces and network discovery

-
-virt
- - -VirtSpec - - -
-

Virt is a virtualization detected on host

-
-host
- - -HostSpec - - -
-

Host contains info about inventorying object

-
-distro
- - -DistroSpec - - -
-

Distro contains info about OS distro

-
-
-

VirtSpec -

-

-(Appears on:InventorySpec) -

-
-

VirtSpec contains info about detected host virtualization

-
- - - - - - - - - - - - - -
FieldDescription
-vmType
- -string - -
-

VMType is a type of virtual machine engine

-
-
-

-Generated with gen-crd-api-reference-docs -on git commit 95c3af5. -

diff --git a/docs/api-reference/machine.md b/docs/api-reference/machine.md deleted file mode 100644 index 5caecfce..00000000 --- a/docs/api-reference/machine.md +++ /dev/null @@ -1,927 +0,0 @@ -

Packages:

- -

metal.ironcore.dev/v1alpha3

-Resource Types: - -

Machine -

-
-

Machine - is the data structure for a Machine resource. -It contains an aggregated information from Inventory and OOB resources.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -metal.ironcore.dev/v1alpha3 - -
-kind
-string -
Machine
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -MachineSpec - - -
-
-
- - - - - - - - - - - - - - - - - -
-hostname
- -string - -
-(Optional) -

Hostname - defines machine domain name

-
-description
- -string - -
-(Optional) -

Description - summary info about machine

-
-identity
- - -Identity - - -
-(Optional) -

Identity - defines machine hardware info

-
-inventory_requested
- -bool - -
-

InventoryRequested - defines if inventory requested or not

-
-
-status
- - -MachineStatus - - -
-
-

Addresses -

-

-(Appears on:Interface) -

-
-
- - - - - - - - - - - - - - - - - -
FieldDescription
-ipv4
- - -[]IPAddressSpec - - -
-
-ipv6
- - -[]IPAddressSpec - - -
-
-

IPAddressSpec -

-

-(Appears on:Addresses, LoopbackAddresses) -

-
-

IPAddressSpec defines interface’s ip address info.

-
- - - - - - - - - - - - - -
FieldDescription
--
- -net/netip.Prefix - -
-

Address refers to the ip address value

-
-

Identity -

-

-(Appears on:MachineSpec) -

-
-

Identity - defines hardware information about machine.

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-sku
- -string - -
-(Optional) -

SKU - stock keeping unit. The label allows vendors automatically track the movement of inventory

-
-serial_number
- -string - -
-(Optional) -

SerialNumber - unique machine number

-
-asset
- -string - -
-(Optional) -
-internal
- - -[]Internal - - -
-

Deprecated

-
-

Interface -

-

-(Appears on:Network) -

-
-

Interface - defines information about machine interfaces.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-(Optional) -

Name - machine interface name

-
-switch_reference
- - -ResourceReference - - -
-(Optional) -

SwitchReference - defines unique switch identification

-
-addresses
- - -Addresses - - -
-(Optional) -

IPv4 - defines machine IPv4 address

-
-peer
- - -Peer - - -
-(Optional) -

Peer - defines lldp peer info.

-
-lanes
- -uint32 - -
-(Optional) -

Lane - defines number of lines per interface

-
-moved
- -bool - -
-(Optional) -

Moved - defines if interface was reconnected to another switch or not

-
-unknown
- -bool - -
-(Optional) -

Unknown - defines information availability about interface

-
-

Internal -

-

-(Appears on:Identity) -

-
-
- - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-
-value
- -string - -
-
-

LoopbackAddresses -

-

-(Appears on:Network) -

-
-
- - - - - - - - - - - - - - - - - -
FieldDescription
-ipv4
- - -IPAddressSpec - - -
-
-ipv6
- - -IPAddressSpec - - -
-
-

MachineSpec -

-

-(Appears on:Machine) -

-
-

MachineSpec - defines the desired spec of Machine.

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-hostname
- -string - -
-(Optional) -

Hostname - defines machine domain name

-
-description
- -string - -
-(Optional) -

Description - summary info about machine

-
-identity
- - -Identity - - -
-(Optional) -

Identity - defines machine hardware info

-
-inventory_requested
- -bool - -
-

InventoryRequested - defines if inventory requested or not

-
-

MachineState -(string alias)

-

-(Appears on:MachineStatus) -

-
-
- - - - - - - - - - - - -
ValueDescription

"Healthy"

MachineStateHealthy - When State is Healthy Machine` is allowed to be booked.

-

"Unhealthy"

MachineStateUnhealthy - When State is Unhealthy` Machine isn’t allowed to be booked.

-
-

MachineStatus -

-

-(Appears on:Machine) -

-
-

MachineStatus - defines machine aggregated info.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-reboot
- -string - -
-(Optional) -

Reboot - defines machine reboot status

-
-health
- - -MachineState - - -
-(Optional) -

Health - defines machine condition. -“healthy” if both OOB and Inventory are presented and “unhealthy” if one of them isn’t

-
-network
- - -Network - - -
-(Optional) -

Network - defines machine network status

-
-reservation
- - -Reservation - - -
-(Optional) -

Reservation - defines machine reservation state and reference object.

-
-orphaned
- -bool - -
-(Optional) -

Orphaned - defines machine condition whether OOB or Inventory is missing or not

-
-

Network -

-

-(Appears on:MachineStatus) -

-
-

Network - defines machine network status.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-asn
- -uint32 - -
-

ASN - defines calculated Autonomous system Number.

-
-redundancy
- -string - -
-

Redundancy - defines machine redundancy status. -Available values: “Single”, “HighAvailability” or “None”

-
-ports
- -int - -
-

Ports - defines number of machine ports

-
-unknown_ports
- -int - -
-

UnknownPorts - defines number of machine interface without info

-
-interfaces
- - -[]Interface - - -
-

Interfaces - defines machine interfaces info

-
-loopback_addresses
- - -LoopbackAddresses - - -
-

Loopbacks refers to the switch’s loopback addresses

-
-

Peer -

-

-(Appears on:Interface) -

-
-

Peer - contains machine neighbor information collected from LLDP.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-lldp_system_name
- -string - -
-(Optional) -

LLDPSystemName - defines switch name obtained from Link Layer Discovery Protocol -layer 2 neighbor discovery protocol

-
-lldp_chassis_id
- -string - -
-(Optional) -

LLDPChassisID - defines switch ID for chassis obtained from Link Layer Discovery Protocol

-
-lldp_port_id
- -string - -
-(Optional) -

LLDPPortID - defines switch port ID obtained from Link Layer Discovery Protocol

-
-lldp_port_description
- -string - -
-(Optional) -

LLDPPortDescription - defines switch definition obtained from Link Layer Discovery Protocol

-
-resource_reference
- - -ResourceReference - - -
-(Optional) -

ResourceReference refers to the related resource definition

-
-

Reservation -

-

-(Appears on:MachineStatus) -

-
-
- - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-status
- -string - -
-(Optional) -

Status - defines Machine Order state provided by OOB Machine Resources

-
-class
- -string - -
-(Optional) -

Class - defines what class the mahchine was reserved under

-
-reference
- - -ResourceReference - - -
-(Optional) -

Reference - defines underlying referenced object.

-
-

ResourceReference -

-

-(Appears on:Interface, Peer, Reservation) -

-
-

ResourceReference defines related resource info.

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
- -string - -
-(Optional) -

APIVersion refers to the resource API version

-
-kind
- -string - -
-(Optional) -

Kind refers to the resource kind

-
-name
- -string - -
-(Optional) -

Name refers to the resource name

-
-namespace
- -string - -
-(Optional) -

Namespace refers to the resource namespace

-
-
-

-Generated with gen-crd-api-reference-docs -on git commit 95c3af5. -

diff --git a/docs/api-reference/metal.md b/docs/api-reference/metal.md new file mode 100644 index 00000000..affb1099 --- /dev/null +++ b/docs/api-reference/metal.md @@ -0,0 +1,5303 @@ +

Packages:

+ +

metal.ironcore.dev/v1alpha4

+Resource Types: + +

Aggregate +

+
+

Aggregate is the Schema for the aggregates API.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +metal.ironcore.dev/v1alpha4 + +
+kind
+string +
Aggregate
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +AggregateSpec + + +
+
+
+ + + + + +
+aggregates
+ + +[]AggregateItem + + +
+

Aggregates is a list of aggregates required to be computed

+
+
+status
+ + +AggregateStatus + + +
+
+

Benchmark +

+
+

Benchmark is the Schema for the machines API.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +metal.ironcore.dev/v1alpha4 + +
+kind
+string +
Benchmark
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +BenchmarkSpec + + +
+
+
+ + + + + +
+benchmarks
+ + +map[string]./apis/metal/v1alpha4.Benchmarks + + +
+

Benchmarks is the collection of benchmarks.

+
+
+status
+ + +BenchmarkStatus + + +
+
+

Inventory +

+
+

Inventory is the Schema for the inventories API.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +metal.ironcore.dev/v1alpha4 + +
+kind
+string +
Inventory
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +InventorySpec + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+system
+ + +SystemSpec + + +
+

System contains DMI system information

+
+ipmis
+ + +[]IPMISpec + + +
+

IPMIs contains info about IPMI interfaces on the host

+
+blocks
+ + +[]BlockSpec + + +
+

Blocks contains info about block devices on the host

+
+memory
+ + +MemorySpec + + +
+

Memory contains info block devices on the host

+
+cpus
+ + +[]CPUSpec + + +
+

CPUs contains info about cpus, cores and threads

+
+numa
+ + +[]NumaSpec + + +
+

NUMA contains info about cpu/memory topology

+
+pciDevices
+ + +[]PCIDeviceSpec + + +
+

PCIDevices contains info about devices accessible through

+
+nics
+ + +[]NICSpec + + +
+

NICs contains info about network interfaces and network discovery

+
+virt
+ + +VirtSpec + + +
+

Virt is a virtualization detected on host

+
+host
+ + +HostSpec + + +
+

Host contains info about inventorying object

+
+distro
+ + +DistroSpec + + +
+

Distro contains info about OS distro

+
+
+status
+ + +InventoryStatus + + +
+
+

Machine +

+
+

Machine - is the data structure for a Machine resource. +It contains an aggregated information from Inventory and OOB resources.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +metal.ironcore.dev/v1alpha4 + +
+kind
+string +
Machine
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +MachineSpec + + +
+
+
+ + + + + + + + + + + + + + + + + +
+hostname
+ +string + +
+(Optional) +

Hostname - defines machine domain name

+
+description
+ +string + +
+(Optional) +

Description - summary info about machine

+
+identity
+ + +Identity + + +
+(Optional) +

Identity - defines machine hardware info

+
+inventory_requested
+ +bool + +
+

InventoryRequested - defines if inventory requested or not

+
+
+status
+ + +MachineStatus + + +
+
+

NetworkSwitch +

+
+

NetworkSwitch is the Schema for switches API.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +metal.ironcore.dev/v1alpha4 + +
+kind
+string +
NetworkSwitch
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +NetworkSwitchSpec + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+inventoryRef
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

InventoryRef contains reference to corresponding inventory object +Empty InventoryRef means that there is no corresponding Inventory object

+
+configSelector
+ + +Kubernetes meta/v1.LabelSelector + + +
+

ConfigSelector contains selector to filter out corresponding SwitchConfig. +If the selector is not defined, it will be populated by defaulting webhook +with MatchLabels item, containing ‘metal.ironcore.dev/layer’ key with value +equals to object’s .status.layer.

+
+managed
+ +bool + +
+

Managed is a flag defining whether NetworkSwitch object would be processed during reconciliation

+
+cordon
+ +bool + +
+

Cordon is a flag defining whether NetworkSwitch object is taken offline

+
+topSpine
+ +bool + +
+

TopSpine is a flag defining whether NetworkSwitch is a top-level spine switch

+
+scanPorts
+ +bool + +
+

ScanPorts is a flag defining whether to run periodical scanning on switch ports

+
+ipam
+ + +IPAMSpec + + +
+

IPAM refers to selectors for subnets which will be used for NetworkSwitch object

+
+interfaces
+ + +InterfacesSpec + + +
+

Interfaces contains general configuration for all switch ports

+
+
+status
+ + +NetworkSwitchStatus + + +
+
+

Size +

+
+

Size is the Schema for the sizes API.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +metal.ironcore.dev/v1alpha4 + +
+kind
+string +
Size
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +SizeSpec + + +
+
+
+ + + + + +
+constraints
+ + +[]ConstraintSpec + + +
+

Constraints is a list of selectors based on machine properties.

+
+
+status
+ + +SizeStatus + + +
+
+

SwitchConfig +

+
+

SwitchConfig is the Schema for switch config API.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +metal.ironcore.dev/v1alpha4 + +
+kind
+string +
SwitchConfig
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +SwitchConfigSpec + + +
+
+
+ + + + + + + + + + + + + + + + + +
+switches
+ + +Kubernetes meta/v1.LabelSelector + + +
+

Switches contains label selector to pick up NetworkSwitch objects

+
+portsDefaults
+ + +PortParametersSpec + + +
+

PortsDefaults contains switch port parameters which will be applied to all ports of the switches +which fit selector conditions

+
+ipam
+ + +GeneralIPAMSpec + + +
+

IPAM refers to selectors for subnets which will be used for NetworkSwitch object

+
+routingConfigTemplate
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

RoutingConfigTemplate contains the reference to the ConfigMap object which contains go-template for FRR config

+
+
+status
+ + +SwitchConfigStatus + + +
+
+

AdditionalIPSpec +

+
+

AdditionalIPSpec defines IP address and selector for subnet where address should be reserved.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+address
+ +string + +
+

Address contains additional IP address that should be assigned to the interface

+
+parentSubnet
+ + +Kubernetes meta/v1.LabelSelector + + +
+

ParentSubnet contains label selector to pick up IPAM objects

+
+

AddressFamiliesMap +

+

+(Appears on:GeneralIPAMSpec) +

+
+

AddressFamiliesMap contains flags regarding what IP address families should be used.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+ipv4
+ +bool + +
+

IPv4 is a flag defining whether IPv4 is used or not

+
+ipv6
+ +bool + +
+

IPv6 is a flag defining whether IPv6 is used or not

+
+

Addresses +

+

+(Appears on:Interface) +

+
+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+ipv4
+ + +[]IPAddrSpec + + +
+
+ipv6
+ + +[]IPAddrSpec + + +
+
+

AggregateItem +

+

+(Appears on:AggregateSpec) +

+
+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+sourcePath
+ + +JSONPath + + +
+

SourcePath is a path in Inventory spec aggregate will be applied to

+
+targetPath
+ + +JSONPath + + +
+

TargetPath is a path in Inventory status computed field

+
+aggregate
+ + +AggregateType + + +
+

Aggregate defines whether collection values should be aggregated +for constraint checks, in case if path defines selector for collection

+
+

AggregateSpec +

+

+(Appears on:Aggregate) +

+
+

AggregateSpec defines the desired state of Aggregate.

+
+ + + + + + + + + + + + + +
FieldDescription
+aggregates
+ + +[]AggregateItem + + +
+

Aggregates is a list of aggregates required to be computed

+
+

AggregateStatus +

+

+(Appears on:Aggregate) +

+
+

AggregateStatus defines the observed state of Aggregate.

+
+

AggregateType +(string alias)

+

+(Appears on:AggregateItem, ConstraintSpec) +

+
+
+ + + + + + + + + + + + + + + + + + +
ValueDescription

"avg"

"count"

"max"

"min"

"sum"

+

AggregationResults +

+

+(Appears on:InventoryStatus) +

+
+
+ + + + + + + + + + + + + +
FieldDescription
+-
+ +map[string]interface{} + +
+
+

BenchmarkDeviation +

+
+

BenchmarkDeviation is a deviation between old value and the new one.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name is the specific benchmark name. e.g. fio-1k.

+
+value
+ +string + +
+

Value is the exact result of specific benchmark.

+
+

BenchmarkDeviations +([]./apis/metal/v1alpha4.BenchmarkDeviation alias)

+

+(Appears on:BenchmarkStatus) +

+
+
+

BenchmarkResult +

+
+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name is the specific benchmark name. e.g. fio-1k.

+
+value
+ +uint64 + +
+

Value is the exact result of specific benchmark.

+
+

BenchmarkSpec +

+

+(Appears on:Benchmark) +

+
+

BenchmarkSpec contains machine benchmark results.

+
+ + + + + + + + + + + + + +
FieldDescription
+benchmarks
+ + +map[string]./apis/metal/v1alpha4.Benchmarks + + +
+

Benchmarks is the collection of benchmarks.

+
+

BenchmarkStatus +

+

+(Appears on:Benchmark) +

+
+

BenchmarkStatus contains machine benchmarks deviations.

+
+ + + + + + + + + + + + + +
FieldDescription
+machine_deviation
+ + +map[string]./apis/metal/v1alpha4.BenchmarkDeviations + + +
+

BenchmarkDeviations shows the difference between last and current benchmark results.

+
+

Benchmarks +([]./apis/metal/v1alpha4.BenchmarkResult alias)

+

+(Appears on:BenchmarkSpec) +

+
+
+

BlockSpec +

+

+(Appears on:InventorySpec) +

+
+

BlockSpec contains info about block device.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name is a name of the device registered by Linux Kernel

+
+type
+ +string + +
+

Type refers to data carrier form-factor

+
+rotational
+ +bool + +
+

Rotational shows whether disk is solid state or not

+
+system
+ +string + +
+

Bus is a type of hardware interface used to connect the disk to the system

+
+model
+ +string + +
+

Model is a unique hardware part identifier

+
+size
+ +uint64 + +
+

Size is a disk space available in bytes

+
+partitionTable
+ + +PartitionTableSpec + + +
+

PartitionTable is a partition table currently written to the disk

+
+

CPUSpec +

+

+(Appears on:InventorySpec) +

+
+

CPUSpec contains info about CPUs on hsot machine.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+physicalId
+ +uint64 + +
+

PhysicalID is an ID of physical CPU

+
+logicalIds
+ +[]uint64 + +
+

LogicalIDs is a collection of logical CPU nums related to the physical CPU (required for NUMA)

+
+cores
+ +uint64 + +
+

Cores is a number of physical cores

+
+siblings
+ +uint64 + +
+

Siblings is a number of logical CPUs/threads

+
+vendorId
+ +string + +
+

VendorID is a manufacturer identifire

+
+family
+ +string + +
+

Family refers to processor type

+
+model
+ +string + +
+

Model is a reference id of the model

+
+modelName
+ +string + +
+

ModelName is a common name of the processor

+
+stepping
+ +string + +
+

Stepping is an iteration of the architecture

+
+microcode
+ +string + +
+

Microcode is a firmware reference

+
+mhz
+ + +k8s.io/apimachinery/pkg/api/resource.Quantity + + +
+

MHz is a logical core frequency

+
+cacheSize
+ +string + +
+

CacheSize is an L2 cache size

+
+fpu
+ +bool + +
+

FPU defines if CPU has a Floating Point Unit

+
+fpuException
+ +bool + +
+

FPUException

+
+cpuIdLevel
+ +uint64 + +
+

CPUIDLevel

+
+wp
+ +bool + +
+

WP tells if WP bit is present

+
+flags
+ +[]string + +
+

Flags defines a list of low-level computing capabilities

+
+vmxFlags
+ +[]string + +
+

VMXFlags defines a list of virtualization capabilities

+
+bugs
+ +[]string + +
+

Bugs contains a list of known hardware bugs

+
+bogoMips
+ + +k8s.io/apimachinery/pkg/api/resource.Quantity + + +
+

BogoMIPS is a synthetic performance metric

+
+clFlushSize
+ +uint64 + +
+

CLFlushSize size for cache line flushing feature

+
+cacheAlignment
+ +uint64 + +
+

CacheAlignment is a cache size

+
+addressSizes
+ +string + +
+

AddressSizes is an info about address transition system

+
+powerManagement
+ +string + +
+

PowerManagement

+
+

ConditionSpec +

+
+

ConditionSpec contains current condition of port parameters.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name reflects the name of the condition

+
+state
+ +bool + +
+

State reflects the state of the condition

+
+lastUpdateTimestamp
+ +string + +
+

LastUpdateTimestamp reflects the last timestamp when condition was updated

+
+lastTransitionTimestamp
+ +string + +
+

LastTransitionTimestamp reflects the last timestamp when condition changed state from one to another

+
+reason
+ +string + +
+

Reason reflects the reason of condition state

+
+message
+ +string + +
+

Message reflects the verbose message about the reason

+
+

ConnectionsMap +(map[uint8]*./apis/metal/v1alpha4.NetworkSwitchList alias)

+
+
+

ConstraintSpec +

+

+(Appears on:SizeSpec) +

+
+

ConstraintSpec contains conditions of contraint that should be applied on resource.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+path
+ + +JSONPath + + +
+

Path is a path to the struct field constraint will be applied to

+
+agg
+ + +AggregateType + + +
+

Aggregate defines whether collection values should be aggregated +for constraint checks, in case if path defines selector for collection

+
+eq
+ + +ConstraintValSpec + + +
+

Equal contains an exact expected value

+
+neq
+ + +ConstraintValSpec + + +
+

NotEqual contains an exact not expected value

+
+lt
+ + +k8s.io/apimachinery/pkg/api/resource.Quantity + + +
+

LessThan contains an highest expected value, exclusive

+
+lte
+ + +k8s.io/apimachinery/pkg/api/resource.Quantity + + +
+

LessThan contains an highest expected value, inclusive

+
+gt
+ + +k8s.io/apimachinery/pkg/api/resource.Quantity + + +
+

LessThan contains an lowest expected value, exclusive

+
+gte
+ + +k8s.io/apimachinery/pkg/api/resource.Quantity + + +
+

GreaterThanOrEqual contains an lowest expected value, inclusive

+
+

ConstraintValSpec +

+

+(Appears on:ConstraintSpec) +

+
+

ConstraintValSpec is a wrapper around value for constraint. +Since it is not possilble to set oneOf/anyOf through kubebuilder +markers, type is set to number here, and patched with kustomize +See https://github.com/kubernetes-sigs/kubebuilder/issues/301

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+-
+ +string + +
+
+-
+ + +k8s.io/apimachinery/pkg/api/resource.Quantity + + +
+
+

DistroSpec +

+

+(Appears on:InventorySpec) +

+
+

DistroSpec contains info about distro.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+buildVersion
+ +string + +
+
+debianVersion
+ +string + +
+
+kernelVersion
+ +string + +
+
+asicType
+ +string + +
+
+commitID
+ +string + +
+
+buildDate
+ +string + +
+
+buildNumber
+ +uint32 + +
+
+buildBy
+ +string + +
+
+

FieldSelectorSpec +

+

+(Appears on:IPAMSelectionSpec) +

+
+

FieldSelectorSpec contains label key and field path where to get label value for search.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+labelKey
+ +string + +
+

LabelKey contains label key

+
+fieldRef
+ + +Kubernetes core/v1.ObjectFieldSelector + + +
+

FieldRef contains reference to the field of resource where to get label’s value

+
+

GeneralIPAMSpec +

+

+(Appears on:SwitchConfigSpec) +

+
+

GeneralIPAMSpec contains definition of selectors, used to filter +required IPAM objects.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+addressFamily
+ + +AddressFamiliesMap + + +
+

AddressFamily contains flags to define which address families are used for switch subnets

+
+carrierSubnets
+ + +IPAMSelectionSpec + + +
+

CarrierSubnets contains label selector for Subnet object where switch’s south subnet +should be reserved

+
+loopbackSubnets
+ + +IPAMSelectionSpec + + +
+

LoopbackSubnets contains label selector for Subnet object where switch’s loopback +IP addresses should be reserved

+
+southSubnets
+ + +IPAMSelectionSpec + + +
+

SouthSubnets defines selector for subnets object which will be assigned to switch

+
+loopbackAddresses
+ + +IPAMSelectionSpec + + +
+

LoopbackAddresses defines selector for IP objects which should be referenced as switch’s loopback addresses

+
+

HostSpec +

+

+(Appears on:InventorySpec) +

+
+

HostSpec contains type of inventorying object and in case it is a switch - SONiC version.

+
+ + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Hostname contains hostname

+
+

IPAMSelectionSpec +

+

+(Appears on:GeneralIPAMSpec, IPAMSpec) +

+
+

IPAMSelectionSpec contains label selector and address family.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+labelSelector
+ + +Kubernetes meta/v1.LabelSelector + + +
+

LabelSelector contains label selector to pick up IPAM objects

+
+fieldSelector
+ + +FieldSelectorSpec + + +
+

FieldSelector contains label key and field path where to get label value for search. +If FieldSelector is used as part of IPAM configuration in SwitchConfig object it will +reference to the field path in related NetworkSwitch object. If FieldSelector is used as part of IPAM +configuration in NetworkSwitch object, it will reference to the field path in the same object

+
+

IPAMSpec +

+

+(Appears on:NetworkSwitchSpec) +

+
+

IPAMSpec contains selectors for subnets and loopback IPs and +definition of address families which should be claimed.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+southSubnets
+ + +IPAMSelectionSpec + + +
+

SouthSubnets defines selector for subnet object which will be assigned to switch

+
+loopbackAddresses
+ + +IPAMSelectionSpec + + +
+

LoopbackAddresses defines selector for IP object which will be assigned to switch’s loopback interface

+
+

IPAddrSpec +

+

+(Appears on:Addresses, LoopbackAddresses) +

+
+

IPAddrSpec defines interface’s ip address info.

+
+ + + + + + + + + + + + + +
FieldDescription
+-
+ + +net/netip.Prefix + + +
+

Address refers to the ip address value

+
+

IPAddressSpec +

+
+

IPAddressSpec defines interface’s ip address info.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+ObjectReference
+ + +ObjectReference + + +
+

+(Members of ObjectReference are embedded into this type.) +

+

Contains information to locate the referenced object

+
+address
+ +string + +
+

Address refers to the ip address value

+
+extraAddress
+ +bool + +
+

ExtraAddress is a flag defining whether address was added as additional by user

+
+addressFamily
+ +string + +
+

AddressFamily refers to the AF of IP address

+
+

IPMISpec +

+

+(Appears on:InventorySpec) +

+
+

IPMISpec contains info about IPMI module.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+ipAddress
+ +string + +
+

IPAddress is an IP address assigned to IPMI network interface

+
+macAddress
+ +string + +
+

MACAddress is a MAC address of IPMI’s network interface

+
+

Identity +

+

+(Appears on:MachineSpec) +

+
+

Identity - defines hardware information about machine.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+sku
+ +string + +
+(Optional) +

SKU - stock keeping unit. The label allows vendors automatically track the movement of inventory

+
+serial_number
+ +string + +
+(Optional) +

SerialNumber - unique machine number

+
+asset
+ +string + +
+(Optional) +
+internal
+ + +[]Internal + + +
+

Deprecated

+
+

Interface +

+

+(Appears on:Network) +

+
+

Interface - defines information about machine interfaces.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+(Optional) +

Name - machine interface name

+
+switch_reference
+ + +ResourceReference + + +
+(Optional) +

SwitchReference - defines unique switch identification

+
+addresses
+ + +Addresses + + +
+(Optional) +

IPv4 - defines machine IPv4 address

+
+peer
+ + +Peer + + +
+(Optional) +

Peer - defines lldp peer info.

+
+lanes
+ +uint32 + +
+(Optional) +

Lane - defines number of lines per interface

+
+moved
+ +bool + +
+(Optional) +

Moved - defines if interface was reconnected to another switch or not

+
+unknown
+ +bool + +
+(Optional) +

Unknown - defines information availability about interface

+
+

InterfaceOverridesSpec +

+
+

InterfaceOverridesSpec contains overridden parameters for certain switch port.

+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+PortParametersSpec
+ + +PortParametersSpec + + +
+

+(Members of PortParametersSpec are embedded into this type.) +

+

Contains port parameters overrides

+
+name
+ +string + +
+

Name refers to switch port name

+
+ip
+ + +[]*./apis/metal/v1alpha4.AdditionalIPSpec + + +
+

IP contains a list of additional IP addresses for interface

+
+

InterfaceSpec +

+
+

InterfaceSpec defines the state of switch’s interface.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+PortParametersSpec
+ + +PortParametersSpec + + +
+

+(Members of PortParametersSpec are embedded into this type.) +

+

Contains port parameters

+
+macAddress
+ +string + +
+

MACAddress refers to the interface’s hardware address +validation pattern

+
+speed
+ +uint32 + +
+

Speed refers to interface’s speed

+
+ip
+ + +[]*./apis/metal/v1alpha4.IPAddressSpec + + +
+

IP contains a list of IP addresses that are assigned to interface

+
+direction
+ +string + +
+

Direction refers to the interface’s connection ‘direction’

+
+peer
+ + +PeerSpec + + +
+

Peer refers to the info about device connected to current switch port

+
+

InterfacesSpec +

+

+(Appears on:NetworkSwitchSpec) +

+
+

InterfacesSpec contains definitions for general switch ports’ configuration.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+defaults
+ + +PortParametersSpec + + +
+

Defaults contains switch port parameters which will be applied to all ports of the switches

+
+overrides
+ + +[]*./apis/metal/v1alpha4.InterfaceOverridesSpec + + +
+

Overrides contains set of parameters which should be overridden for listed switch ports

+
+

Internal +

+

+(Appears on:Identity) +

+
+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+
+value
+ +string + +
+
+

InventorySpec +

+

+(Appears on:Inventory, ValidationInventory) +

+
+

InventorySpec contains result of inventorization process on the host.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+system
+ + +SystemSpec + + +
+

System contains DMI system information

+
+ipmis
+ + +[]IPMISpec + + +
+

IPMIs contains info about IPMI interfaces on the host

+
+blocks
+ + +[]BlockSpec + + +
+

Blocks contains info about block devices on the host

+
+memory
+ + +MemorySpec + + +
+

Memory contains info block devices on the host

+
+cpus
+ + +[]CPUSpec + + +
+

CPUs contains info about cpus, cores and threads

+
+numa
+ + +[]NumaSpec + + +
+

NUMA contains info about cpu/memory topology

+
+pciDevices
+ + +[]PCIDeviceSpec + + +
+

PCIDevices contains info about devices accessible through

+
+nics
+ + +[]NICSpec + + +
+

NICs contains info about network interfaces and network discovery

+
+virt
+ + +VirtSpec + + +
+

Virt is a virtualization detected on host

+
+host
+ + +HostSpec + + +
+

Host contains info about inventorying object

+
+distro
+ + +DistroSpec + + +
+

Distro contains info about OS distro

+
+

InventoryStatus +

+

+(Appears on:Inventory) +

+
+

InventoryStatus defines the observed state of Inventory.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+computed
+ + +AggregationResults + + +
+
+inventoryStatuses
+ + +InventoryStatuses + + +
+
+

InventoryStatuses +

+

+(Appears on:InventoryStatus) +

+
+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+ready
+ +bool + +
+
+requestsCount
+ +int + +
+
+

JSONPath +

+

+(Appears on:AggregateItem, ConstraintSpec) +

+
+
+ + + + + + + + + + + + + +
FieldDescription
+-
+ +string + +
+
+

LLDPCapabilities +(string alias)

+

+(Appears on:LLDPSpec) +

+
+

LLDPCapabilities

+
+

LLDPSpec +

+

+(Appears on:NICSpec) +

+
+

LLDPSpec is an entry received by network interface by Link Layer Discovery Protocol.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+chassisId
+ +string + +
+

ChassisID is a neighbour box identifier

+
+systemName
+ +string + +
+

SystemName is given name to the neighbour box

+
+systemDescription
+ +string + +
+

SystemDescription is a short description of the neighbour box

+
+portId
+ +string + +
+

PortID is a hardware identifier of the link port

+
+portDescription
+ +string + +
+

PortDescription is a short description of the link port

+
+capabilities
+ + +[]LLDPCapabilities + + +
+

Capabilities is a list of LLDP capabilities advertised by neighbor

+
+

LoopbackAddresses +

+

+(Appears on:Network) +

+
+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+ipv4
+ + +IPAddrSpec + + +
+
+ipv6
+ + +IPAddrSpec + + +
+
+

MachineSpec +

+

+(Appears on:Machine) +

+
+

MachineSpec - defines the desired spec of Machine.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+hostname
+ +string + +
+(Optional) +

Hostname - defines machine domain name

+
+description
+ +string + +
+(Optional) +

Description - summary info about machine

+
+identity
+ + +Identity + + +
+(Optional) +

Identity - defines machine hardware info

+
+inventory_requested
+ +bool + +
+

InventoryRequested - defines if inventory requested or not

+
+

MachineState +(string alias)

+

+(Appears on:MachineStatus) +

+
+
+ + + + + + + + + + + + +
ValueDescription

"Healthy"

MachineStateHealthy - When State is Healthy Machine` is allowed to be booked.

+

"Unhealthy"

MachineStateUnhealthy - When State is Unhealthy` Machine isn’t allowed to be booked.

+
+

MachineStatus +

+

+(Appears on:Machine) +

+
+

MachineStatus - defines machine aggregated info.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+reboot
+ +string + +
+(Optional) +

Reboot - defines machine reboot status

+
+health
+ + +MachineState + + +
+(Optional) +

Health - defines machine condition. +“healthy” if both OOB and Inventory are presented and “unhealthy” if one of them isn’t

+
+network
+ + +Network + + +
+(Optional) +

Network - defines machine network status

+
+reservation
+ + +Reservation + + +
+(Optional) +

Reservation - defines machine reservation state and reference object.

+
+orphaned
+ +bool + +
+(Optional) +

Orphaned - defines machine condition whether OOB or Inventory is missing or not

+
+

MemorySpec +

+

+(Appears on:InventorySpec, NumaSpec) +

+
+

MemorySpec contains info about RAM on host.

+
+ + + + + + + + + + + + + +
FieldDescription
+total
+ +uint64 + +
+

Total is a total amount of RAM on host

+
+

NDPSpec +

+

+(Appears on:NICSpec) +

+
+

NDPSpec is an entry received by IPv6 Neighbour Discovery Protocol.

+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+ipAddress
+ +string + +
+

IPAddress is an IPv6 address of a neighbour

+
+macAddress
+ +string + +
+

MACAddress is an MAC address of a neighbour

+
+state
+ +string + +
+

State is a state of discovery

+
+

NICSpec +

+

+(Appears on:InventorySpec) +

+
+

NICSpec contains info about network interfaces.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name is a name of the device registered by Linux Kernel

+
+pciAddress
+ +string + +
+

PCIAddress is the PCI bus address network interface is connected to

+
+macAddress
+ +string + +
+

MACAddress is the MAC address of network interface

+
+mtu
+ +uint16 + +
+

MTU is refers to Maximum Transmission Unit

+
+speed
+ +uint32 + +
+

Speed is a speed of network interface in Mbits/s

+
+lanes
+ +byte + +
+

Lanes is a number of used lanes (if supported)

+
+activeFEC
+ +string + +
+

ActiveFEC is an active error correction mode

+
+lldps
+ + +[]LLDPSpec + + +
+

LLDP is a collection of LLDP messages received by the network interface

+
+ndps
+ + +[]NDPSpec + + +
+

NDP is a collection of NDP messages received by the network interface

+
+

Network +

+

+(Appears on:MachineStatus) +

+
+

Network - defines machine network status.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+asn
+ +uint32 + +
+

ASN - defines calculated Autonomous system Number.

+
+redundancy
+ +string + +
+

Redundancy - defines machine redundancy status. +Available values: “Single”, “HighAvailability” or “None”

+
+ports
+ +int + +
+

Ports - defines number of machine ports

+
+unknown_ports
+ +int + +
+

UnknownPorts - defines number of machine interface without info

+
+interfaces
+ + +[]Interface + + +
+

Interfaces - defines machine interfaces info

+
+loopback_addresses
+ + +LoopbackAddresses + + +
+

Loopbacks refers to the switch’s loopback addresses

+
+

NetworkSwitchSpec +

+

+(Appears on:NetworkSwitch) +

+
+

NetworkSwitchSpec contains desired state of resulting NetworkSwitch configuration.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+inventoryRef
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

InventoryRef contains reference to corresponding inventory object +Empty InventoryRef means that there is no corresponding Inventory object

+
+configSelector
+ + +Kubernetes meta/v1.LabelSelector + + +
+

ConfigSelector contains selector to filter out corresponding SwitchConfig. +If the selector is not defined, it will be populated by defaulting webhook +with MatchLabels item, containing ‘metal.ironcore.dev/layer’ key with value +equals to object’s .status.layer.

+
+managed
+ +bool + +
+

Managed is a flag defining whether NetworkSwitch object would be processed during reconciliation

+
+cordon
+ +bool + +
+

Cordon is a flag defining whether NetworkSwitch object is taken offline

+
+topSpine
+ +bool + +
+

TopSpine is a flag defining whether NetworkSwitch is a top-level spine switch

+
+scanPorts
+ +bool + +
+

ScanPorts is a flag defining whether to run periodical scanning on switch ports

+
+ipam
+ + +IPAMSpec + + +
+

IPAM refers to selectors for subnets which will be used for NetworkSwitch object

+
+interfaces
+ + +InterfacesSpec + + +
+

Interfaces contains general configuration for all switch ports

+
+

NetworkSwitchStatus +

+

+(Appears on:NetworkSwitch) +

+
+

NetworkSwitchStatus contains observed state of NetworkSwitch.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+configRef
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

ConfigRef contains reference to corresponding SwitchConfig object +Empty ConfigRef means that there is no corresponding SwitchConfig object

+
+routingConfigTemplate
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

RoutingConfigTemplate contains the reference to the ConfigMap object which contains go-template for FRR config. +This field reflects the corresponding field of the related SwitchConfig object.

+
+asn
+ +uint32 + +
+

ASN contains current autonomous system number defined for switch

+
+totalPorts
+ +uint32 + +
+

TotalPorts refers to total number of ports

+
+switchPorts
+ +uint32 + +
+

SwitchPorts refers to the number of ports excluding management interfaces, loopback etc.

+
+role
+ +string + +
+

Role refers to switch’s role

+
+layer
+ +uint32 + +
+

Layer refers to switch’s current position in connection hierarchy

+
+interfaces
+ + +map[string]*./apis/metal/v1alpha4.InterfaceSpec + + +
+

Interfaces refers to switch’s interfaces configuration

+
+subnets
+ + +[]*./apis/metal/v1alpha4.SubnetSpec + + +
+

Subnets refers to the switch’s south subnets

+
+loopbackAddresses
+ + +[]*./apis/metal/v1alpha4.IPAddressSpec + + +
+

LoopbackAddresses refers to the switch’s loopback addresses

+
+state
+ +string + +
+

State is the current state of corresponding object or process

+
+message
+ +string + +
+

Message contains a brief description of the current state

+
+conditions
+ + +[]*./apis/metal/v1alpha4.ConditionSpec + + +
+

Condition contains state of port parameters

+
+

NumaSpec +

+

+(Appears on:InventorySpec) +

+
+

NumaSpec describes NUMA node.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+id
+ +int + +
+

ID is NUMA node ID.

+
+cpus
+ +[]int + +
+

CPUs is a list of CPU logical IDs in current numa node.

+
+distances
+ +[]int + +
+

Distances contains distances to other nodes. Element index corresponds to NUMA node ID.

+
+memory
+ + +MemorySpec + + +
+

Memory contains info about NUMA node memory setup.

+
+

ObjectReference +

+

+(Appears on:IPAddressSpec, PeerSpec, SubnetSpec) +

+
+

ObjectReference contains enough information to let you locate the +referenced object across namespaces.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name contains name of the referenced object

+
+namespace
+ +string + +
+

Namespace contains namespace of the referenced object

+
+

PCIDeviceDescriptionSpec +

+

+(Appears on:PCIDeviceSpec) +

+
+

PCIDeviceDescriptionSpec contains one of the options that is describing the PCI device.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+id
+ +string + +
+

ID is a hexadecimal identifier of device property , that corresponds to the value from PCIIDs database

+
+name
+ +string + +
+

Name is a string value of property extracted from PCIID DB

+
+

PCIDeviceSpec +

+

+(Appears on:InventorySpec) +

+
+

PCIDeviceSpec contains description of PCI device.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+busId
+ +string + +
+

BusID is an ID of PCI bus on the board device is attached to.

+
+address
+ +string + +
+

Address is an ID of device on PCI bus.

+
+vendor
+ + +PCIDeviceDescriptionSpec + + +
+

Vendor refers to manufacturer ore device trademark.

+
+subvendor
+ + +PCIDeviceDescriptionSpec + + +
+

Subvendor usually refers to the platform or co-manufacturer. E.g. Lenovo board manufactured for Intel platform (by Intel spec).

+
+type
+ + +PCIDeviceDescriptionSpec + + +
+

Type shows device’s designation.

+
+subtype
+ + +PCIDeviceDescriptionSpec + + +
+

Subtype shows device’s subsystem.

+
+class
+ + +PCIDeviceDescriptionSpec + + +
+

Class refers to generic device designation.

+
+subclass
+ + +PCIDeviceDescriptionSpec + + +
+

Subclass narrows the designation scope.

+
+interface
+ + +PCIDeviceDescriptionSpec + + +
+

ProgrammingInterface specifies communication protocols.

+
+

PartitionSpec +

+

+(Appears on:PartitionTableSpec) +

+
+

PartitionSpec contains info about partition.

+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+id
+ +string + +
+

ID is a GUID of GPT partition or number for MBR partition

+
+name
+ +string + +
+

Name is a human readable name given to the partition

+
+size
+ +uint64 + +
+

Size is a size of partition in bytes

+
+

PartitionTableSpec +

+

+(Appears on:BlockSpec) +

+
+

PartitionTableSpec contains info about partition table on block device.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+type
+ +string + +
+

Type is a format of partition table

+
+partitions
+ + +[]PartitionSpec + + +
+

Partitions are active partition records on disk

+
+

Peer +

+

+(Appears on:Interface) +

+
+

Peer - contains machine neighbor information collected from LLDP.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+lldp_system_name
+ +string + +
+(Optional) +

LLDPSystemName - defines switch name obtained from Link Layer Discovery Protocol +layer 2 neighbor discovery protocol

+
+lldp_chassis_id
+ +string + +
+(Optional) +

LLDPChassisID - defines switch ID for chassis obtained from Link Layer Discovery Protocol

+
+lldp_port_id
+ +string + +
+(Optional) +

LLDPPortID - defines switch port ID obtained from Link Layer Discovery Protocol

+
+lldp_port_description
+ +string + +
+(Optional) +

LLDPPortDescription - defines switch definition obtained from Link Layer Discovery Protocol

+
+resource_reference
+ + +ResourceReference + + +
+(Optional) +

ResourceReference refers to the related resource definition

+
+

PeerInfoSpec +

+

+(Appears on:PeerSpec) +

+
+

PeerInfoSpec contains LLDP info about peer.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+chassisId
+ +string + +
+

ChassisID refers to the chassis identificator - either MAC-address or system uuid +validation pattern

+
+systemName
+ +string + +
+

SystemName refers to the advertised peer’s name

+
+portId
+ +string + +
+

PortID refers to the advertised peer’s port ID

+
+portDescription
+ +string + +
+

PortDescription refers to the advertised peer’s port description

+
+type
+ +string + +
+

Type refers to the peer type

+
+

PeerSpec +

+

+(Appears on:InterfaceSpec) +

+
+

PeerSpec defines peer info.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+ObjectReference
+ + +ObjectReference + + +
+

+(Members of ObjectReference are embedded into this type.) +

+

Contains information to locate the referenced object

+
+PeerInfoSpec
+ + +PeerInfoSpec + + +
+

+(Members of PeerInfoSpec are embedded into this type.) +

+

Contains LLDP info about peer

+
+

PortParametersSpec +

+

+(Appears on:InterfaceOverridesSpec, InterfaceSpec, InterfacesSpec, SwitchConfigSpec) +

+
+

PortParametersSpec contains a set of parameters of switch port.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+lanes
+ +uint32 + +
+

Lanes refers to a number of lanes used by switch port

+
+mtu
+ +uint32 + +
+

MTU refers to maximum transmission unit value which should be applied on switch port

+
+ipv4MaskLength
+ +uint32 + +
+

IPv4MaskLength defines prefix of subnet where switch port’s IPv4 address should be reserved

+
+ipv6Prefix
+ +uint32 + +
+

IPv6Prefix defines prefix of subnet where switch port’s IPv6 address should be reserved

+
+fec
+ +string + +
+

FEC refers to forward error correction method which should be applied on switch port

+
+state
+ +string + +
+

State defines default state of switch port

+
+

RegionSpec +

+

+(Appears on:SubnetSpec) +

+
+

RegionSpec defines region info.

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name refers to the switch’s region

+
+availabilityZone
+ +string + +
+

AvailabilityZone refers to the switch’s availability zone

+
+

Reservation +

+

+(Appears on:MachineStatus) +

+
+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+status
+ +string + +
+(Optional) +

Status - defines Machine Order state provided by OOB Machine Resources

+
+class
+ +string + +
+(Optional) +

Class - defines what class the mahchine was reserved under

+
+reference
+ + +ResourceReference + + +
+(Optional) +

Reference - defines underlying referenced object.

+
+

ResourceReference +

+

+(Appears on:Interface, Peer, Reservation) +

+
+

ResourceReference defines related resource info.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+ +string + +
+(Optional) +

APIVersion refers to the resource API version

+
+kind
+ +string + +
+(Optional) +

Kind refers to the resource kind

+
+name
+ +string + +
+(Optional) +

Name refers to the resource name

+
+namespace
+ +string + +
+(Optional) +

Namespace refers to the resource namespace

+
+

SizeSpec +

+

+(Appears on:Size) +

+
+

SizeSpec defines the desired state of Size.

+
+ + + + + + + + + + + + + +
FieldDescription
+constraints
+ + +[]ConstraintSpec + + +
+

Constraints is a list of selectors based on machine properties.

+
+

SizeStatus +

+

+(Appears on:Size) +

+
+

SizeStatus defines the observed state of Size.

+
+

SubnetSpec +

+
+

SubnetSpec defines switch’s subnet info.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+subnet
+ + +ObjectReference + + +
+

Contains information to locate the referenced object

+
+network
+ + +ObjectReference + + +
+

Contains information to locate the referenced object

+
+cidr
+ +string + +
+

CIDR refers to subnet CIDR +validation pattern

+
+region
+ + +RegionSpec + + +
+

Region refers to switch’s region

+
+addressFamily
+ +string + +
+

AddressFamily refers to the AF of subnet

+
+

SwitchConfigSpec +

+

+(Appears on:SwitchConfig) +

+
+

SwitchConfigSpec contains desired configuration for selected switches.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+switches
+ + +Kubernetes meta/v1.LabelSelector + + +
+

Switches contains label selector to pick up NetworkSwitch objects

+
+portsDefaults
+ + +PortParametersSpec + + +
+

PortsDefaults contains switch port parameters which will be applied to all ports of the switches +which fit selector conditions

+
+ipam
+ + +GeneralIPAMSpec + + +
+

IPAM refers to selectors for subnets which will be used for NetworkSwitch object

+
+routingConfigTemplate
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

RoutingConfigTemplate contains the reference to the ConfigMap object which contains go-template for FRR config

+
+

SwitchConfigStatus +

+

+(Appears on:SwitchConfig) +

+
+

SwitchConfigStatus contains observed state of SwitchConfig.

+
+

SystemSpec +

+

+(Appears on:InventorySpec) +

+
+

SystemSpec contains DMI system information.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+id
+ +string + +
+

ID is a UUID of a system board

+
+manufacturer
+ +string + +
+

Manufacturer refers to the company that produced the product

+
+productSku
+ +string + +
+

ProductSKU is a product’s Stock Keeping Unit

+
+serialNumber
+ +string + +
+

SerialNumber contains serial number of a system

+
+

ValidationInventory +

+
+
+ + + + + + + + + + + + + +
FieldDescription
+spec
+ + +InventorySpec + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+system
+ + +SystemSpec + + +
+

System contains DMI system information

+
+ipmis
+ + +[]IPMISpec + + +
+

IPMIs contains info about IPMI interfaces on the host

+
+blocks
+ + +[]BlockSpec + + +
+

Blocks contains info about block devices on the host

+
+memory
+ + +MemorySpec + + +
+

Memory contains info block devices on the host

+
+cpus
+ + +[]CPUSpec + + +
+

CPUs contains info about cpus, cores and threads

+
+numa
+ + +[]NumaSpec + + +
+

NUMA contains info about cpu/memory topology

+
+pciDevices
+ + +[]PCIDeviceSpec + + +
+

PCIDevices contains info about devices accessible through

+
+nics
+ + +[]NICSpec + + +
+

NICs contains info about network interfaces and network discovery

+
+virt
+ + +VirtSpec + + +
+

Virt is a virtualization detected on host

+
+host
+ + +HostSpec + + +
+

Host contains info about inventorying object

+
+distro
+ + +DistroSpec + + +
+

Distro contains info about OS distro

+
+
+

VirtSpec +

+

+(Appears on:InventorySpec) +

+
+

VirtSpec contains info about detected host virtualization.

+
+ + + + + + + + + + + + + +
FieldDescription
+vmType
+ +string + +
+

VMType is a type of virtual machine engine

+
+
+

+Generated with gen-crd-api-reference-docs +on git commit 26e566b. +

diff --git a/docs/api-reference/readme.md b/docs/api-reference/readme.md index 0ef508d9..d4f85665 100644 --- a/docs/api-reference/readme.md +++ b/docs/api-reference/readme.md @@ -1,6 +1,3 @@ # Metal-API Reference -* [`benchmark` API Group](benchmark.md) -* [`inventory` API Group](inventory.md) -* [`switches` API Group](switches.md) -* [`machine` API Group](machine.md) +* [`metal` API Group](metal.md) diff --git a/docs/api-reference/switch.md b/docs/api-reference/switch.md deleted file mode 100644 index 632dc162..00000000 --- a/docs/api-reference/switch.md +++ /dev/null @@ -1,1695 +0,0 @@ -

Packages:

- -

metal.ironcore.dev/v1beta1

-Resource Types: - -

Switch -

-
-

Switch is the Schema for switches API.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -metal.ironcore.dev/v1beta1 - -
-kind
-string -
Switch
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -SwitchSpec - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-inventoryRef
- - -Kubernetes core/v1.LocalObjectReference - - -
-

InventoryRef contains reference to corresponding inventory object -Empty InventoryRef means that there is no corresponding Inventory object

-
-configSelector
- - -Kubernetes meta/v1.LabelSelector - - -
-

ConfigSelector contains selector to filter out corresponding SwitchConfig. -If the selector is not defined, it will be populated by defaulting webhook -with MatchLabels item, containing ‘metal.ironcore.dev/layer’ key with value -equals to object’s .status.layer.

-
-managed
- -bool - -
-

Managed is a flag defining whether Switch object would be processed during reconciliation

-
-cordon
- -bool - -
-

Cordon is a flag defining whether Switch object is taken offline

-
-topSpine
- -bool - -
-

TopSpine is a flag defining whether Switch is a top-level spine switch

-
-scanPorts
- -bool - -
-

ScanPorts is a flag defining whether to run periodical scanning on switch ports

-
-ipam
- - -IPAMSpec - - -
-

IPAM refers to selectors for subnets which will be used for Switch object

-
-interfaces
- - -InterfacesSpec - - -
-

Interfaces contains general configuration for all switch ports

-
-
-status
- - -SwitchStatus - - -
-
-

SwitchConfig -

-
-

SwitchConfig is the Schema for switch config API.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -metal.ironcore.dev/v1beta1 - -
-kind
-string -
SwitchConfig
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -SwitchConfigSpec - - -
-
-
- - - - - - - - - - - - - - - - - -
-switches
- - -Kubernetes meta/v1.LabelSelector - - -
-

Switches contains label selector to pick up Switch objects

-
-portsDefaults
- - -PortParametersSpec - - -
-

PortsDefaults contains switch port parameters which will be applied to all ports of the switches -which fit selector conditions

-
-ipam
- - -GeneralIPAMSpec - - -
-

IPAM refers to selectors for subnets which will be used for Switch object

-
-routingConfigTemplate
- - -Kubernetes core/v1.LocalObjectReference - - -
-

RoutingConfigTemplate contains the reference to the ConfigMap object which contains go-template for FRR config

-
-
-status
- - -SwitchConfigStatus - - -
-
-

AdditionalIPSpec -

-
-

AdditionalIPSpec defines IP address and selector for subnet where address should be reserved

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-address
- -string - -
-

Address contains additional IP address that should be assigned to the interface

-
-parentSubnet
- - -Kubernetes meta/v1.LabelSelector - - -
-

ParentSubnet contains label selector to pick up IPAM objects

-
-

AddressFamiliesMap -

-

-(Appears on:GeneralIPAMSpec) -

-
-

AddressFamiliesMap contains flags regarding what IP address families should be used

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-ipv4
- -bool - -
-

IPv4 is a flag defining whether IPv4 is used or not

-
-ipv6
- -bool - -
-

IPv6 is a flag defining whether IPv6 is used or not

-
-

ConditionSpec -

-
-

ConditionSpec contains current condition of port parameters

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name reflects the name of the condition

-
-state
- -bool - -
-

State reflects the state of the condition

-
-lastUpdateTimestamp
- -string - -
-

LastUpdateTimestamp reflects the last timestamp when condition was updated

-
-lastTransitionTimestamp
- -string - -
-

LastTransitionTimestamp reflects the last timestamp when condition changed state from one to another

-
-reason
- -string - -
-

Reason reflects the reason of condition state

-
-message
- -string - -
-

Message reflects the verbose message about the reason

-
-

ConnectionsMap -(map[uint8]*..SwitchList alias)

-
-
-

FieldSelectorSpec -

-

-(Appears on:IPAMSelectionSpec) -

-
-

FieldSelectorSpec contains label key and field path where to get label value for search

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-labelKey
- -string - -
-

LabelKey contains label key

-
-fieldRef
- - -Kubernetes core/v1.ObjectFieldSelector - - -
-

FieldRef contains reference to the field of resource where to get label’s value

-
-

GeneralIPAMSpec -

-

-(Appears on:SwitchConfigSpec) -

-
-

GeneralIPAMSpec contains definition of selectors, used to filter -required IPAM objects.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-addressFamily
- - -AddressFamiliesMap - - -
-

AddressFamily contains flags to define which address families are used for switch subnets

-
-carrierSubnets
- - -IPAMSelectionSpec - - -
-

CarrierSubnets contains label selector for Subnet object where switch’s south subnet -should be reserved

-
-loopbackSubnets
- - -IPAMSelectionSpec - - -
-

LoopbackSubnets contains label selector for Subnet object where switch’s loopback -IP addresses should be reserved

-
-southSubnets
- - -IPAMSelectionSpec - - -
-

SouthSubnets defines selector for subnets object which will be assigned to switch

-
-loopbackAddresses
- - -IPAMSelectionSpec - - -
-

LoopbackAddresses defines selector for IP objects which should be referenced as switch’s loopback addresses

-
-

IPAMSelectionSpec -

-

-(Appears on:GeneralIPAMSpec, IPAMSpec) -

-
-

IPAMSelectionSpec contains label selector and address family

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-labelSelector
- - -Kubernetes meta/v1.LabelSelector - - -
-

LabelSelector contains label selector to pick up IPAM objects

-
-fieldSelector
- - -FieldSelectorSpec - - -
-

FieldSelector contains label key and field path where to get label value for search. -If FieldSelector is used as part of IPAM configuration in SwitchConfig object it will -reference to the field path in related Switch object. If FieldSelector is used as part of IPAM -configuration in Switch object, it will reference to the field path in the same object

-
-

IPAMSpec -

-

-(Appears on:SwitchSpec) -

-
-

IPAMSpec contains selectors for subnets and loopback IPs and -definition of address families which should be claimed

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-southSubnets
- - -IPAMSelectionSpec - - -
-

SouthSubnets defines selector for subnet object which will be assigned to switch

-
-loopbackAddresses
- - -IPAMSelectionSpec - - -
-

LoopbackAddresses defines selector for IP object which will be assigned to switch’s loopback interface

-
-

IPAddressSpec -

-
-

IPAddressSpec defines interface’s ip address info

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-ObjectReference
- - -ObjectReference - - -
-

-(Members of ObjectReference are embedded into this type.) -

-

Contains information to locate the referenced object

-
-address
- -string - -
-

Address refers to the ip address value

-
-extraAddress
- -bool - -
-

ExtraAddress is a flag defining whether address was added as additional by user

-
-addressFamily
- -string - -
-

AddressFamily refers to the AF of IP address

-
-

InterfaceOverridesSpec -

-
-

InterfaceOverridesSpec contains overridden parameters for certain switch port

-
- - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-PortParametersSpec
- - -PortParametersSpec - - -
-

-(Members of PortParametersSpec are embedded into this type.) -

-

Contains port parameters overrides

-
-name
- -string - -
-

Name refers to switch port name

-
-ip
- - -[]*..AdditionalIPSpec - - -
-

IP contains a list of additional IP addresses for interface

-
-

InterfaceSpec -

-
-

InterfaceSpec defines the state of switch’s interface

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-PortParametersSpec
- - -PortParametersSpec - - -
-

-(Members of PortParametersSpec are embedded into this type.) -

-

Contains port parameters

-
-macAddress
- -string - -
-

MACAddress refers to the interface’s hardware address -validation pattern

-
-speed
- -uint32 - -
-

Speed refers to interface’s speed

-
-ip
- - -[]*..IPAddressSpec - - -
-

IP contains a list of IP addresses that are assigned to interface

-
-direction
- -string - -
-

Direction refers to the interface’s connection ‘direction’

-
-peer
- - -PeerSpec - - -
-

Peer refers to the info about device connected to current switch port

-
-

InterfacesSpec -

-

-(Appears on:SwitchSpec) -

-
-

InterfacesSpec contains definitions for general switch ports’ configuration

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-defaults
- - -PortParametersSpec - - -
-

Defaults contains switch port parameters which will be applied to all ports of the switches

-
-overrides
- - -[]*..InterfaceOverridesSpec - - -
-

Overrides contains set of parameters which should be overridden for listed switch ports

-
-

ObjectReference -

-

-(Appears on:IPAddressSpec, PeerSpec, SubnetSpec) -

-
-

ObjectReference contains enough information to let you locate the -referenced object across namespaces.

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name contains name of the referenced object

-
-namespace
- -string - -
-

Namespace contains namespace of the referenced object

-
-

PeerInfoSpec -

-

-(Appears on:PeerSpec) -

-
-

PeerInfoSpec contains LLDP info about peer

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-chassisId
- -string - -
-

ChassisID refers to the chassis identificator - either MAC-address or system uuid -validation pattern

-
-systemName
- -string - -
-

SystemName refers to the advertised peer’s name

-
-portId
- -string - -
-

PortID refers to the advertised peer’s port ID

-
-portDescription
- -string - -
-

PortDescription refers to the advertised peer’s port description

-
-type
- -string - -
-

Type refers to the peer type

-
-

PeerSpec -

-

-(Appears on:InterfaceSpec) -

-
-

PeerSpec defines peer info

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-ObjectReference
- - -ObjectReference - - -
-

-(Members of ObjectReference are embedded into this type.) -

-

Contains information to locate the referenced object

-
-PeerInfoSpec
- - -PeerInfoSpec - - -
-

-(Members of PeerInfoSpec are embedded into this type.) -

-

Contains LLDP info about peer

-
-

PortParametersSpec -

-

-(Appears on:InterfaceOverridesSpec, InterfaceSpec, InterfacesSpec, SwitchConfigSpec) -

-
-

PortParametersSpec contains a set of parameters of switch port

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-lanes
- -uint32 - -
-

Lanes refers to a number of lanes used by switch port

-
-mtu
- -uint32 - -
-

MTU refers to maximum transmission unit value which should be applied on switch port

-
-ipv4MaskLength
- -uint32 - -
-

IPv4MaskLength defines prefix of subnet where switch port’s IPv4 address should be reserved

-
-ipv6Prefix
- -uint32 - -
-

IPv6Prefix defines prefix of subnet where switch port’s IPv6 address should be reserved

-
-fec
- -string - -
-

FEC refers to forward error correction method which should be applied on switch port

-
-state
- -string - -
-

State defines default state of switch port

-
-

RegionSpec -

-

-(Appears on:SubnetSpec) -

-
-

RegionSpec defines region info

-
- - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name refers to the switch’s region

-
-availabilityZone
- -string - -
-

AvailabilityZone refers to the switch’s availability zone

-
-

SubnetSpec -

-
-

SubnetSpec defines switch’s subnet info

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-subnet
- - -ObjectReference - - -
-

Contains information to locate the referenced object

-
-network
- - -ObjectReference - - -
-

Contains information to locate the referenced object

-
-cidr
- -string - -
-

CIDR refers to subnet CIDR -validation pattern

-
-region
- - -RegionSpec - - -
-

Region refers to switch’s region

-
-addressFamily
- -string - -
-

AddressFamily refers to the AF of subnet

-
-

SwitchConfigSpec -

-

-(Appears on:SwitchConfig) -

-
-

SwitchConfigSpec contains desired configuration for selected switches.

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-switches
- - -Kubernetes meta/v1.LabelSelector - - -
-

Switches contains label selector to pick up Switch objects

-
-portsDefaults
- - -PortParametersSpec - - -
-

PortsDefaults contains switch port parameters which will be applied to all ports of the switches -which fit selector conditions

-
-ipam
- - -GeneralIPAMSpec - - -
-

IPAM refers to selectors for subnets which will be used for Switch object

-
-routingConfigTemplate
- - -Kubernetes core/v1.LocalObjectReference - - -
-

RoutingConfigTemplate contains the reference to the ConfigMap object which contains go-template for FRR config

-
-

SwitchConfigStatus -

-

-(Appears on:SwitchConfig) -

-
-

SwitchConfigStatus contains observed state of SwitchConfig

-
-

SwitchSpec -

-

-(Appears on:Switch) -

-
-

SwitchSpec contains desired state of resulting Switch configuration

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-inventoryRef
- - -Kubernetes core/v1.LocalObjectReference - - -
-

InventoryRef contains reference to corresponding inventory object -Empty InventoryRef means that there is no corresponding Inventory object

-
-configSelector
- - -Kubernetes meta/v1.LabelSelector - - -
-

ConfigSelector contains selector to filter out corresponding SwitchConfig. -If the selector is not defined, it will be populated by defaulting webhook -with MatchLabels item, containing ‘metal.ironcore.dev/layer’ key with value -equals to object’s .status.layer.

-
-managed
- -bool - -
-

Managed is a flag defining whether Switch object would be processed during reconciliation

-
-cordon
- -bool - -
-

Cordon is a flag defining whether Switch object is taken offline

-
-topSpine
- -bool - -
-

TopSpine is a flag defining whether Switch is a top-level spine switch

-
-scanPorts
- -bool - -
-

ScanPorts is a flag defining whether to run periodical scanning on switch ports

-
-ipam
- - -IPAMSpec - - -
-

IPAM refers to selectors for subnets which will be used for Switch object

-
-interfaces
- - -InterfacesSpec - - -
-

Interfaces contains general configuration for all switch ports

-
-

SwitchStatus -

-

-(Appears on:Switch) -

-
-

SwitchStatus contains observed state of Switch

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-configRef
- - -Kubernetes core/v1.LocalObjectReference - - -
-

ConfigRef contains reference to corresponding SwitchConfig object -Empty ConfigRef means that there is no corresponding SwitchConfig object

-
-routingConfigTemplate
- - -Kubernetes core/v1.LocalObjectReference - - -
-

RoutingConfigTemplate contains the reference to the ConfigMap object which contains go-template for FRR config. -This field reflects the corresponding field of the related SwitchConfig object.

-
-asn
- -uint32 - -
-

ASN contains current autonomous system number defined for switch

-
-totalPorts
- -uint32 - -
-

TotalPorts refers to total number of ports

-
-switchPorts
- -uint32 - -
-

SwitchPorts refers to the number of ports excluding management interfaces, loopback etc.

-
-role
- -string - -
-

Role refers to switch’s role

-
-layer
- -uint32 - -
-

Layer refers to switch’s current position in connection hierarchy

-
-interfaces
- - -map[string]*..InterfaceSpec - - -
-

Interfaces refers to switch’s interfaces configuration

-
-subnets
- - -[]*..SubnetSpec - - -
-

Subnets refers to the switch’s south subnets

-
-loopbackAddresses
- - -[]*..IPAddressSpec - - -
-

LoopbackAddresses refers to the switch’s loopback addresses

-
-state
- -string - -
-

State is the current state of corresponding object or process

-
-message
- -string - -
-

Message contains a brief description of the current state

-
-conditions
- - -[]*..ConditionSpec - - -
-

Condition contains state of port parameters

-
-
-

-Generated with gen-crd-api-reference-docs -on git commit 95c3af5. -

diff --git a/domain/address/address.go b/domain/address/address.go index 215cc89a..25fe76f8 100644 --- a/domain/address/address.go +++ b/domain/address/address.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/address/address_test.go b/domain/address/address_test.go index fe0d5bdb..56ef0a61 100644 --- a/domain/address/address_test.go +++ b/domain/address/address_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain_test diff --git a/domain/address/consumer.go b/domain/address/consumer.go index 16bad0a9..c4f2bbed 100644 --- a/domain/address/consumer.go +++ b/domain/address/consumer.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + package domain type Consumer struct { diff --git a/domain/infrastructure/errors.go b/domain/infrastructure/errors.go index b100881d..aefdd138 100644 --- a/domain/infrastructure/errors.go +++ b/domain/infrastructure/errors.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/infrastructure/server.go b/domain/infrastructure/server.go index 7af29776..b1c27294 100644 --- a/domain/infrastructure/server.go +++ b/domain/infrastructure/server.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/infrastructure/server_test.go b/domain/infrastructure/server_test.go index de41d0a7..0efaba49 100644 --- a/domain/infrastructure/server_test.go +++ b/domain/infrastructure/server_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain_test diff --git a/domain/inventory/alreadyExist.go b/domain/inventory/alreadyExist.go index 466fce2f..a4a8f17f 100644 --- a/domain/inventory/alreadyExist.go +++ b/domain/inventory/alreadyExist.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/inventory/errors.go b/domain/inventory/errors.go index b382cd8a..a16b8953 100644 --- a/domain/inventory/errors.go +++ b/domain/inventory/errors.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/inventory/inventory.go b/domain/inventory/inventory.go index 31e81822..475c2e10 100644 --- a/domain/inventory/inventory.go +++ b/domain/inventory/inventory.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/inventory/inventoryEvent.go b/domain/inventory/inventoryEvent.go index e0d7a399..8f97d17a 100644 --- a/domain/inventory/inventoryEvent.go +++ b/domain/inventory/inventoryEvent.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/inventory/inventoryID.go b/domain/inventory/inventoryID.go index 65010810..fa7c633b 100644 --- a/domain/inventory/inventoryID.go +++ b/domain/inventory/inventoryID.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/machine/alreadyExist.go b/domain/machine/alreadyExist.go index ad03a86d..91eadcd7 100644 --- a/domain/machine/alreadyExist.go +++ b/domain/machine/alreadyExist.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/machine/errors.go b/domain/machine/errors.go index b382cd8a..a16b8953 100644 --- a/domain/machine/errors.go +++ b/domain/machine/errors.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/machine/interface.go b/domain/machine/interface.go index b3d11710..258ca79a 100644 --- a/domain/machine/interface.go +++ b/domain/machine/interface.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/machine/interfaceType.go b/domain/machine/interfaceType.go index 78430160..69fd7e41 100644 --- a/domain/machine/interfaceType.go +++ b/domain/machine/interfaceType.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/machine/machine.go b/domain/machine/machine.go index 51f27cba..df9793a9 100644 --- a/domain/machine/machine.go +++ b/domain/machine/machine.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/machine/machineEvent.go b/domain/machine/machineEvent.go index 5a1a59f9..87b7a68b 100644 --- a/domain/machine/machineEvent.go +++ b/domain/machine/machineEvent.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/machine/machineID.go b/domain/machine/machineID.go index a13a6f4b..7ee0f858 100644 --- a/domain/machine/machineID.go +++ b/domain/machine/machineID.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/domain/reservation/reservationType.go b/domain/reservation/reservationType.go index d4c4b61a..e868cbec 100644 --- a/domain/reservation/reservationType.go +++ b/domain/reservation/reservationType.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package domain diff --git a/hack/api-reference/template.json b/hack/api-reference/template.json index 3bfe6b7a..a773aa36 100644 --- a/hack/api-reference/template.json +++ b/hack/api-reference/template.json @@ -8,12 +8,24 @@ ], "externalPackages": [ { - "typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/api/resource\\.Quantity", - "docsURLTemplate": "https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Duration" + "typeMatchPrefix": "^net/netip", + "docsURLTemplate": "https://pkg.go.dev/net/netip#{{.TypeIdentifier}}" + }, + { + "typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/api/resource", + "docsURLTemplate": "https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#{{.TypeIdentifier}}" + }, + { + "typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/types", + "docsURLTemplate": "https://pkg.go.dev/k8s.io/apimachinery/pkg/types#{{.TypeIdentifier}}" }, { "typeMatchPrefix": "^k8s\\.io/(api|apimachinery/pkg/apis)/", - "docsURLTemplate": "https://v1-21.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}" + "docsURLTemplate": "https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}" + }, + { + "typeMatchPrefix": "^github\\.com/ironcore-dev/metal/apis/", + "docsURLTemplate": "../{{arrIndex .PackageSegments -2}}/#{{arrIndex .PackageSegments -2}}.ironcore.dev/{{arrIndex .PackageSegments -1}}.{{.TypeIdentifier}}" } ], "typeDisplayNamePrefixOverrides": { diff --git a/hack/api-reference/template/placeholder.go b/hack/api-reference/template/placeholder.go index 24a39568..407a00f9 100644 --- a/hack/api-reference/template/placeholder.go +++ b/hack/api-reference/template/placeholder.go @@ -1,18 +1,6 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 -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. -*/ // Placeholder file to make Go vendor this directory properly. package template diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index d5ce0e36..aefd7dd6 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,15 +1,3 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 -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. -*/ diff --git a/hack/generate.sh b/hack/generate.sh index afba090e..5978844c 100755 --- a/hack/generate.sh +++ b/hack/generate.sh @@ -1,32 +1,91 @@ -#!/bin/sh -set -eu - -VGOPATH="$(mktemp -d)" -MODELSSCHEMA="$(mktemp)" -trap 'rm -rf "$VGOPATH" "$MODELSSCHEMA"' EXIT -go mod download && bin/vgopath -o "$VGOPATH" -GOROOT="${GOROOT:-"$(go env GOROOT)"}" -export GOROOT -GOPATH="$VGOPATH" -export GOPATH -GO111MODULE=off -export GO111MODULE - -APIS_APPLYCONFIGURATION='github.com/ironcore-dev/metal/apis/metal/v1alpha4' -APIS_OPENAPI="k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/api/core/v1,$APIS_APPLYCONFIGURATION" - -bin/openapi-gen \ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +export TERM="xterm-256color" + +bold="$(tput bold)" +blue="$(tput setaf 4)" +normal="$(tput sgr0)" + +function qualify-gvs() { + APIS_PKG="$1" + GROUPS_WITH_VERSIONS="$2" + join_char="" + res="" + + for GVs in ${GROUPS_WITH_VERSIONS}; do + IFS=: read -r G Vs <<<"${GVs}" + + for V in ${Vs//,/ }; do + res="$res$join_char$APIS_PKG/$G/$V" + join_char="," + done + done + + echo "$res" +} + +VGOPATH="$VGOPATH" +MODELS_SCHEMA="$MODELS_SCHEMA" +CLIENT_GEN="$CLIENT_GEN" +DEEPCOPY_GEN="$DEEPCOPY_GEN" +OPENAPI_GEN="$OPENAPI_GEN" +APPLYCONFIGURATION_GEN="$APPLYCONFIGURATION_GEN" + +VIRTUAL_GOPATH="$(mktemp -d)" +trap 'rm -rf "$VIRTUAL_GOPATH"' EXIT + +# Setup virtual GOPATH so the codegen tools work as expected. +(cd "$SCRIPT_DIR/.."; go mod download && "$VGOPATH" -o "$VIRTUAL_GOPATH") + +export GOROOT="${GOROOT:-"$(go env GOROOT)"}" +export GOPATH="$VIRTUAL_GOPATH" +export GO111MODULE=off + +CLIENT_GROUPS="metal" +CLIENT_VERSION_GROUPS="metal:v1alpha4" +ALL_VERSION_GROUPS="$CLIENT_VERSION_GROUPS" + +echo "Generating ${blue}deepcopy${normal}" +"$DEEPCOPY_GEN" \ --output-base "$GOPATH/src" \ - --go-header-file hack/boilerplate.go.txt \ - --input-dirs "$APIS_OPENAPI" \ - --output-package "github.com/ironcore-dev/metal/openapi" \ + --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ + --input-dirs "$(qualify-gvs "github.com/ironcore-dev/metal/apis" "$ALL_VERSION_GROUPS")" \ + -O zz_generated.deepcopy + +echo "Generating ${blue}openapi${normal}" +"$OPENAPI_GEN" \ + --output-base "$GOPATH/src" \ + --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ + --input-dirs "$(qualify-gvs "github.com/ironcore-dev/metal/apis" "$ALL_VERSION_GROUPS")" \ + --input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version" \ + --input-dirs "k8s.io/api/core/v1" \ + --input-dirs "k8s.io/apimachinery/pkg/api/resource" \ + --output-package "github.com/ironcore-dev/metal/client/openapi" \ -O zz_generated.openapi \ - --report-filename "openapi/api_violations.report" + --report-filename "$SCRIPT_DIR/../client/openapi/api_violations.report" + +echo "Generating ${blue}applyconfiguration${normal}" +applyconfigurationgen_external_apis+=("k8s.io/apimachinery/pkg/apis/meta/v1") +applyconfigurationgen_external_apis+=("$(qualify-gvs "github.com/ironcore-dev/metal/apis" "$ALL_VERSION_GROUPS")") +applyconfigurationgen_external_apis_csv=$(IFS=,; echo "${applyconfigurationgen_external_apis[*]}") +"$APPLYCONFIGURATION_GEN" \ + --output-base "$GOPATH/src" \ + --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ + --input-dirs "${applyconfigurationgen_external_apis_csv}" \ + --openapi-schema <("$MODELS_SCHEMA" --openapi-package "github.com/ironcore-dev/metal/client/openapi" --openapi-title "metal") \ + --output-package "github.com/ironcore-dev/metal/client/applyconfiguration" -bin/models-schema --openapi-package "github.com/ironcore-dev/metal/openapi" --openapi-title "metal-api" > "$MODELSSCHEMA" -bin/applyconfiguration-gen \ +echo "Generating ${blue}client${normal}" +"$CLIENT_GEN" \ --output-base "$GOPATH/src" \ - --go-header-file hack/boilerplate.go.txt \ - --input-dirs "$APIS_APPLYCONFIGURATION" \ - --openapi-schema "$MODELSSCHEMA" \ - --output-package "github.com/ironcore-dev/metal/applyconfiguration" + --go-header-file "$SCRIPT_DIR/boilerplate.go.txt" \ + --input "$(qualify-gvs "github.com/ironcore-dev/metal/apis" "$CLIENT_VERSION_GROUPS")" \ + --output-package "github.com/ironcore-dev/metal/client" \ + --apply-configuration-package "github.com/ironcore-dev/metal/client/applyconfiguration" \ + --clientset-name "metal" \ + --input-base "" diff --git a/hack/license-header.txt b/hack/license-header.txt new file mode 100644 index 00000000..2ba253a6 --- /dev/null +++ b/hack/license-header.txt @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +SPDX-License-Identifier: Apache-2.0 \ No newline at end of file diff --git a/hack/setup-envtest.sh b/hack/setup-envtest.sh deleted file mode 100755 index 6785fc3a..00000000 --- a/hack/setup-envtest.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -# -# 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. -# - -set -o errexit -set -o pipefail - -# Turn colors in this script off by setting the NO_COLOR variable in your -# environment to any value: -# -# $ NO_COLOR=1 test.sh -NO_COLOR=${NO_COLOR:-""} -if [ -z "$NO_COLOR" ]; then - header=$'\e[1;33m' - reset=$'\e[0m' -else - header='' - reset='' -fi - -function header_text { - echo "$header$*$reset" -} - -function setup_envtest_env { - header_text "setting up env vars" - - # Setup env vars - KUBEBUILDER_ASSETS=${KUBEBUILDER_ASSETS:-""} - if [[ -z "${KUBEBUILDER_ASSETS}" ]]; then - export KUBEBUILDER_ASSETS=$(pwd)/testbin/k8s/${VERSION}-$(go env GOOS)-$(go env GOARCH) - header_text "KUBEBUILDER_ASSETS=${KUBEBUILDER_ASSETS}" - fi -} - -function fetch_envtest_tools { - header_text "fetching kubebuilder asset" - - local basepath="$(go env GOPATH)" - if [[ ! -f $basepath/bin/setup-envtest ]]; then - go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest - fi - - $basepath/bin/setup-envtest use --bin-dir $(pwd)/testbin $VERSION -} \ No newline at end of file diff --git a/hack/tools.go b/hack/tools.go index 7f2ddc07..09ee2eb4 100644 --- a/hack/tools.go +++ b/hack/tools.go @@ -1,20 +1,7 @@ //go:build tools -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package hack diff --git a/main.go b/main.go index e7f0c356..d9f34107 100644 --- a/main.go +++ b/main.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package main @@ -296,7 +283,7 @@ func startReconcilers( Client: mgr.GetClient(), Scheme: mgr.GetScheme(), Log: ctrl.Log.WithName("controllers").WithName("Ipxe"), - ImageParser: &machinecontrollers.OnmetalImageParser{ + ImageParser: &machinecontrollers.IroncoreImageParser{ Registry: registry, Log: ctrl.Log.WithName("controllers").WithName("Ipxe").WithName("Image-Parser"), }, diff --git a/metal-provider/Dockerfile b/metal-provider/Dockerfile index 847db82d..59985d35 100644 --- a/metal-provider/Dockerfile +++ b/metal-provider/Dockerfile @@ -11,7 +11,7 @@ RUN --mount=type=ssh --mount=type=secret,id=github_pat GITHUB_PAT_PATH=/run/secr && go mod download COPY apis/ apis/ -COPY applyconfiguration/ applyconfiguration/ +COPY client/applyconfiguration/ client/applyconfiguration/ COPY metal-provider/ metal-provider/ COPY pkg/ pkg/ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} go build -a -o /metal-provider metal-provider/main.go diff --git a/metal-provider/internal/log/log.go b/metal-provider/internal/log/log.go index b65426c0..0c9a092e 100644 --- a/metal-provider/internal/log/log.go +++ b/metal-provider/internal/log/log.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package log diff --git a/metal-provider/internal/patch/patch.go b/metal-provider/internal/patch/patch.go index 4e5c0284..4ffa2848 100644 --- a/metal-provider/internal/patch/patch.go +++ b/metal-provider/internal/patch/patch.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package patch diff --git a/metal-provider/internal/unix/unix.go b/metal-provider/internal/unix/unix.go index 9f89312d..e6b3fc72 100644 --- a/metal-provider/internal/unix/unix.go +++ b/metal-provider/internal/unix/unix.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package unix diff --git a/metal-provider/main.go b/metal-provider/main.go index 0615fc4b..c579c832 100644 --- a/metal-provider/main.go +++ b/metal-provider/main.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package main diff --git a/metal-provider/servers/grpc_server.go b/metal-provider/servers/grpc_server.go index db9f5256..8dce8afe 100644 --- a/metal-provider/servers/grpc_server.go +++ b/metal-provider/servers/grpc_server.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package servers @@ -36,7 +23,7 @@ import ( irimetav1alpha1 "github.com/ironcore-dev/ironcore/iri/apis/meta/v1alpha1" metalv1alpha4 "github.com/ironcore-dev/metal/apis/metal/v1alpha4" - metalv1alpha4apply "github.com/ironcore-dev/metal/applyconfiguration/metal/v1alpha4" + metalv1alpha4apply "github.com/ironcore-dev/metal/client/applyconfiguration/metal/v1alpha4" "github.com/ironcore-dev/metal/metal-provider/internal/log" "github.com/ironcore-dev/metal/metal-provider/internal/patch" "github.com/ironcore-dev/metal/metal-provider/internal/unix" diff --git a/pkg/auxiliary/interfaces.go b/pkg/auxiliary/interfaces.go index 72d6ab7d..f3aad691 100644 --- a/pkg/auxiliary/interfaces.go +++ b/pkg/auxiliary/interfaces.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package auxiliary diff --git a/pkg/benchmark/benchmark.go b/pkg/benchmark/benchmark.go index 59fdd793..700ebc91 100644 --- a/pkg/benchmark/benchmark.go +++ b/pkg/benchmark/benchmark.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package benchmark diff --git a/pkg/constants/switch.go b/pkg/constants/switch.go index 337d7149..c4e2c418 100644 --- a/pkg/constants/switch.go +++ b/pkg/constants/switch.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package constants diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go index 0e1fec4e..63b9c2d7 100644 --- a/pkg/errors/errors.go +++ b/pkg/errors/errors.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package errors diff --git a/pkg/network/bgp/asn.go b/pkg/network/bgp/asn.go index 47c87509..8e48fb35 100644 --- a/pkg/network/bgp/asn.go +++ b/pkg/network/bgp/asn.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package bgp diff --git a/pkg/network/bgp/asn_test.go b/pkg/network/bgp/asn_test.go index 4112b1d6..265e235d 100644 --- a/pkg/network/bgp/asn_test.go +++ b/pkg/network/bgp/asn_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package bgp_test diff --git a/pkg/switches/environment.go b/pkg/switches/environment.go index 97c5b968..048c2ab6 100644 --- a/pkg/switches/environment.go +++ b/pkg/switches/environment.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package switches diff --git a/pkg/switches/helpers.go b/pkg/switches/helpers.go index 19141189..9ad91cd1 100644 --- a/pkg/switches/helpers.go +++ b/pkg/switches/helpers.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package switches diff --git a/pkg/switches/helpers_test.go b/pkg/switches/helpers_test.go index a3deb76e..9d8c5ef1 100644 --- a/pkg/switches/helpers_test.go +++ b/pkg/switches/helpers_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2022 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package switches diff --git a/pkg/switches/state_funcs.go b/pkg/switches/state_funcs.go index af7601fa..c3b8f667 100644 --- a/pkg/switches/state_funcs.go +++ b/pkg/switches/state_funcs.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package switches diff --git a/pkg/switches/state_funcs_test.go b/pkg/switches/state_funcs_test.go index 3a1a8b04..b788b9b4 100644 --- a/pkg/switches/state_funcs_test.go +++ b/pkg/switches/state_funcs_test.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package switches diff --git a/pkg/switches/state_writer.go b/pkg/switches/state_writer.go index 36d3db10..eeb1a0c5 100644 --- a/pkg/switches/state_writer.go +++ b/pkg/switches/state_writer.go @@ -1,18 +1,5 @@ -/* -Copyright (c) 2023 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved - -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. -*/ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package switches diff --git a/providers-kubernetes/onboarding/errors.go b/providers-kubernetes/onboarding/errors.go index 10ab0a7a..f89f055b 100644 --- a/providers-kubernetes/onboarding/errors.go +++ b/providers-kubernetes/onboarding/errors.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/fake/client.go b/providers-kubernetes/onboarding/fake/client.go index 1a6ff2da..1e9f7b5a 100644 --- a/providers-kubernetes/onboarding/fake/client.go +++ b/providers-kubernetes/onboarding/fake/client.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 // nolint package fake diff --git a/providers-kubernetes/onboarding/inventoryIDGenerator.go b/providers-kubernetes/onboarding/inventoryIDGenerator.go index 07496804..901b7172 100644 --- a/providers-kubernetes/onboarding/inventoryIDGenerator.go +++ b/providers-kubernetes/onboarding/inventoryIDGenerator.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/inventoryRepository.go b/providers-kubernetes/onboarding/inventoryRepository.go index f6034d61..2ff9d6e6 100644 --- a/providers-kubernetes/onboarding/inventoryRepository.go +++ b/providers-kubernetes/onboarding/inventoryRepository.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/inventoryRepository_test.go b/providers-kubernetes/onboarding/inventoryRepository_test.go index 290be9b6..d740566e 100644 --- a/providers-kubernetes/onboarding/inventoryRepository_test.go +++ b/providers-kubernetes/onboarding/inventoryRepository_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers_test diff --git a/providers-kubernetes/onboarding/loopbackAddressRepository.go b/providers-kubernetes/onboarding/loopbackAddressRepository.go index 8c14619e..acb00d7b 100644 --- a/providers-kubernetes/onboarding/loopbackAddressRepository.go +++ b/providers-kubernetes/onboarding/loopbackAddressRepository.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/loopbackAddressRepository_test.go b/providers-kubernetes/onboarding/loopbackAddressRepository_test.go index 59068e32..ba34aafc 100644 --- a/providers-kubernetes/onboarding/loopbackAddressRepository_test.go +++ b/providers-kubernetes/onboarding/loopbackAddressRepository_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers_test diff --git a/providers-kubernetes/onboarding/loopbackSubnetRepository.go b/providers-kubernetes/onboarding/loopbackSubnetRepository.go index a073c725..bc701667 100644 --- a/providers-kubernetes/onboarding/loopbackSubnetRepository.go +++ b/providers-kubernetes/onboarding/loopbackSubnetRepository.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/machineIDGenerator.go b/providers-kubernetes/onboarding/machineIDGenerator.go index fe039b93..e224563e 100644 --- a/providers-kubernetes/onboarding/machineIDGenerator.go +++ b/providers-kubernetes/onboarding/machineIDGenerator.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/machineRepository.go b/providers-kubernetes/onboarding/machineRepository.go index c0f71178..7705d369 100644 --- a/providers-kubernetes/onboarding/machineRepository.go +++ b/providers-kubernetes/onboarding/machineRepository.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/serverExecutor.go b/providers-kubernetes/onboarding/serverExecutor.go index 4a827170..4301f5ac 100644 --- a/providers-kubernetes/onboarding/serverExecutor.go +++ b/providers-kubernetes/onboarding/serverExecutor.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/serverRepository.go b/providers-kubernetes/onboarding/serverRepository.go index dfec41fc..ff8a66e4 100644 --- a/providers-kubernetes/onboarding/serverRepository.go +++ b/providers-kubernetes/onboarding/serverRepository.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/switchRepository.go b/providers-kubernetes/onboarding/switchRepository.go index ba341cd3..217b433a 100644 --- a/providers-kubernetes/onboarding/switchRepository.go +++ b/providers-kubernetes/onboarding/switchRepository.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/providers-kubernetes/onboarding/switchRepository_test.go b/providers-kubernetes/onboarding/switchRepository_test.go index 29beb320..c6ba0e9d 100644 --- a/providers-kubernetes/onboarding/switchRepository_test.go +++ b/providers-kubernetes/onboarding/switchRepository_test.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + package providers_test import ( diff --git a/publisher/domainEventPublisher.go b/publisher/domainEventPublisher.go index e20ec4ec..79dc557f 100644 --- a/publisher/domainEventPublisher.go +++ b/publisher/domainEventPublisher.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package publisher diff --git a/publisher/domainEventPublisher_test.go b/publisher/domainEventPublisher_test.go index 9f6eccd6..67d27921 100644 --- a/publisher/domainEventPublisher_test.go +++ b/publisher/domainEventPublisher_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package publisher_test diff --git a/usecase/onboarding/createInventory.go b/usecase/onboarding/createInventory.go index 903f4005..f73d89ee 100644 --- a/usecase/onboarding/createInventory.go +++ b/usecase/onboarding/createInventory.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package usecase diff --git a/usecase/onboarding/createMachine.go b/usecase/onboarding/createMachine.go index ae438a03..fa67ca1f 100644 --- a/usecase/onboarding/createMachine.go +++ b/usecase/onboarding/createMachine.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package usecase diff --git a/usecase/onboarding/dto/inventory.go b/usecase/onboarding/dto/inventory.go index efb21f82..715c91cc 100644 --- a/usecase/onboarding/dto/inventory.go +++ b/usecase/onboarding/dto/inventory.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package dto diff --git a/usecase/onboarding/dto/machine.go b/usecase/onboarding/dto/machine.go index 80c6eb70..85838996 100644 --- a/usecase/onboarding/dto/machine.go +++ b/usecase/onboarding/dto/machine.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package dto diff --git a/usecase/onboarding/dto/machineNetwork.go b/usecase/onboarding/dto/machineNetwork.go index 5b6c0689..649c1bd8 100644 --- a/usecase/onboarding/dto/machineNetwork.go +++ b/usecase/onboarding/dto/machineNetwork.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package dto diff --git a/usecase/onboarding/dto/machineNetwork_test.go b/usecase/onboarding/dto/machineNetwork_test.go index c5c68ec2..23425d95 100644 --- a/usecase/onboarding/dto/machineNetwork_test.go +++ b/usecase/onboarding/dto/machineNetwork_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package dto_test diff --git a/usecase/onboarding/dto/request.go b/usecase/onboarding/dto/request.go index b79c29cf..6e02f910 100644 --- a/usecase/onboarding/dto/request.go +++ b/usecase/onboarding/dto/request.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package dto diff --git a/usecase/onboarding/dto/subnet.go b/usecase/onboarding/dto/subnet.go index 96e8efa1..74cb76e5 100644 --- a/usecase/onboarding/dto/subnet.go +++ b/usecase/onboarding/dto/subnet.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package dto diff --git a/usecase/onboarding/dto/switches.go b/usecase/onboarding/dto/switches.go index d7a124e6..f8b53526 100644 --- a/usecase/onboarding/dto/switches.go +++ b/usecase/onboarding/dto/switches.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package dto diff --git a/usecase/onboarding/errors.go b/usecase/onboarding/errors.go index fbba3a24..8a55970e 100644 --- a/usecase/onboarding/errors.go +++ b/usecase/onboarding/errors.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package usecase diff --git a/usecase/onboarding/getInventory.go b/usecase/onboarding/getInventory.go index 137a59d5..dfb710ad 100644 --- a/usecase/onboarding/getInventory.go +++ b/usecase/onboarding/getInventory.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package usecase diff --git a/usecase/onboarding/getMachine.go b/usecase/onboarding/getMachine.go index 58d83d7e..6182c5d4 100644 --- a/usecase/onboarding/getMachine.go +++ b/usecase/onboarding/getMachine.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package usecase diff --git a/usecase/onboarding/getServer.go b/usecase/onboarding/getServer.go index ba60e50d..a6d97de4 100644 --- a/usecase/onboarding/getServer.go +++ b/usecase/onboarding/getServer.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package usecase diff --git a/usecase/onboarding/invariants/inventoryAlreadyExist.go b/usecase/onboarding/invariants/inventoryAlreadyExist.go index 88c4c437..f738e999 100644 --- a/usecase/onboarding/invariants/inventoryAlreadyExist.go +++ b/usecase/onboarding/invariants/inventoryAlreadyExist.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package invariants diff --git a/usecase/onboarding/invariants/machineAlreadyExist.go b/usecase/onboarding/invariants/machineAlreadyExist.go index 9d433e0e..c20b2afd 100644 --- a/usecase/onboarding/invariants/machineAlreadyExist.go +++ b/usecase/onboarding/invariants/machineAlreadyExist.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package invariants diff --git a/usecase/onboarding/machineOnboarding.go b/usecase/onboarding/machineOnboarding.go index a3ca2727..48deab23 100644 --- a/usecase/onboarding/machineOnboarding.go +++ b/usecase/onboarding/machineOnboarding.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package usecase diff --git a/usecase/onboarding/providers/addressPersister.go b/usecase/onboarding/providers/addressPersister.go index dd31de34..046dbc47 100644 --- a/usecase/onboarding/providers/addressPersister.go +++ b/usecase/onboarding/providers/addressPersister.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/inventoryExtractor.go b/usecase/onboarding/providers/inventoryExtractor.go index 80992d56..68d0d16a 100644 --- a/usecase/onboarding/providers/inventoryExtractor.go +++ b/usecase/onboarding/providers/inventoryExtractor.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/inventoryPersister.go b/usecase/onboarding/providers/inventoryPersister.go index a93ee405..b55e0868 100644 --- a/usecase/onboarding/providers/inventoryPersister.go +++ b/usecase/onboarding/providers/inventoryPersister.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/loopbackAddressExtractor.go b/usecase/onboarding/providers/loopbackAddressExtractor.go index 0ec2522f..e0c1c7c6 100644 --- a/usecase/onboarding/providers/loopbackAddressExtractor.go +++ b/usecase/onboarding/providers/loopbackAddressExtractor.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/loopbackSubnetExtractor.go b/usecase/onboarding/providers/loopbackSubnetExtractor.go index 27409f61..6c63dc0c 100644 --- a/usecase/onboarding/providers/loopbackSubnetExtractor.go +++ b/usecase/onboarding/providers/loopbackSubnetExtractor.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/machineExtractor.go b/usecase/onboarding/providers/machineExtractor.go index bc21c2c3..677af17b 100644 --- a/usecase/onboarding/providers/machineExtractor.go +++ b/usecase/onboarding/providers/machineExtractor.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/machinePersister.go b/usecase/onboarding/providers/machinePersister.go index 8fdd4ce9..62ff65f1 100644 --- a/usecase/onboarding/providers/machinePersister.go +++ b/usecase/onboarding/providers/machinePersister.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/serverExecutor.go b/usecase/onboarding/providers/serverExecutor.go index 9ddc2897..872d6e31 100644 --- a/usecase/onboarding/providers/serverExecutor.go +++ b/usecase/onboarding/providers/serverExecutor.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/serverRepository.go b/usecase/onboarding/providers/serverRepository.go index 5d60ac42..bcaf3e70 100644 --- a/usecase/onboarding/providers/serverRepository.go +++ b/usecase/onboarding/providers/serverRepository.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/subnetPersister.go b/usecase/onboarding/providers/subnetPersister.go index 84256b9b..82acf6a2 100644 --- a/usecase/onboarding/providers/subnetPersister.go +++ b/usecase/onboarding/providers/subnetPersister.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/providers/switchExtractor.go b/usecase/onboarding/providers/switchExtractor.go index 791f7ef3..dc3f0eb3 100644 --- a/usecase/onboarding/providers/switchExtractor.go +++ b/usecase/onboarding/providers/switchExtractor.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package providers diff --git a/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule.go b/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule.go index a2a598ca..8aa7307e 100644 --- a/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule.go +++ b/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package rules diff --git a/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule_test.go b/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule_test.go index 04140b59..b765a7d4 100644 --- a/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule_test.go +++ b/usecase/onboarding/rules/createIPv6SubnetFromParentForInventoryRule_test.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + package rules_test import ( diff --git a/usecase/onboarding/rules/createLoopback4ForMachineRule.go b/usecase/onboarding/rules/createLoopback4ForMachineRule.go index 1cda3ea9..7b8bb280 100644 --- a/usecase/onboarding/rules/createLoopback4ForMachineRule.go +++ b/usecase/onboarding/rules/createLoopback4ForMachineRule.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package rules diff --git a/usecase/onboarding/rules/createLoopback4ForMachineRule_test.go b/usecase/onboarding/rules/createLoopback4ForMachineRule_test.go index 04942887..a3686d65 100644 --- a/usecase/onboarding/rules/createLoopback4ForMachineRule_test.go +++ b/usecase/onboarding/rules/createLoopback4ForMachineRule_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package rules_test diff --git a/usecase/onboarding/rules/createLoopback6ForMachineRule.go b/usecase/onboarding/rules/createLoopback6ForMachineRule.go index c21d3ee7..4cb0ae35 100644 --- a/usecase/onboarding/rules/createLoopback6ForMachineRule.go +++ b/usecase/onboarding/rules/createLoopback6ForMachineRule.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package rules diff --git a/usecase/onboarding/rules/createLoopback6ForMachineRule_test.go b/usecase/onboarding/rules/createLoopback6ForMachineRule_test.go index 79a2c7e1..0d3337e2 100644 --- a/usecase/onboarding/rules/createLoopback6ForMachineRule_test.go +++ b/usecase/onboarding/rules/createLoopback6ForMachineRule_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package rules_test diff --git a/usecase/onboarding/rules/serverMustBeEnabledOnFirstTime.go b/usecase/onboarding/rules/serverMustBeEnabledOnFirstTime.go index edea0283..90c8adc1 100644 --- a/usecase/onboarding/rules/serverMustBeEnabledOnFirstTime.go +++ b/usecase/onboarding/rules/serverMustBeEnabledOnFirstTime.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package rules diff --git a/usecase/onboarding/scenarios/createInventory.go b/usecase/onboarding/scenarios/createInventory.go index 5e6a0a6b..dd67262f 100644 --- a/usecase/onboarding/scenarios/createInventory.go +++ b/usecase/onboarding/scenarios/createInventory.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios diff --git a/usecase/onboarding/scenarios/createInventory_test.go b/usecase/onboarding/scenarios/createInventory_test.go index 0c3d3101..fbca58cc 100644 --- a/usecase/onboarding/scenarios/createInventory_test.go +++ b/usecase/onboarding/scenarios/createInventory_test.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios_test diff --git a/usecase/onboarding/scenarios/createMachine.go b/usecase/onboarding/scenarios/createMachine.go index ce23453c..42fb72f2 100644 --- a/usecase/onboarding/scenarios/createMachine.go +++ b/usecase/onboarding/scenarios/createMachine.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios diff --git a/usecase/onboarding/scenarios/createMachine_test.go b/usecase/onboarding/scenarios/createMachine_test.go index 051e0112..4f1aa051 100644 --- a/usecase/onboarding/scenarios/createMachine_test.go +++ b/usecase/onboarding/scenarios/createMachine_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios_test diff --git a/usecase/onboarding/scenarios/getInventory.go b/usecase/onboarding/scenarios/getInventory.go index fd8a7e4b..f15838c7 100644 --- a/usecase/onboarding/scenarios/getInventory.go +++ b/usecase/onboarding/scenarios/getInventory.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios diff --git a/usecase/onboarding/scenarios/getMachine.go b/usecase/onboarding/scenarios/getMachine.go index c14bf0bf..0b27222e 100644 --- a/usecase/onboarding/scenarios/getMachine.go +++ b/usecase/onboarding/scenarios/getMachine.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios diff --git a/usecase/onboarding/scenarios/getServer.go b/usecase/onboarding/scenarios/getServer.go index b4abb01e..876178c1 100644 --- a/usecase/onboarding/scenarios/getServer.go +++ b/usecase/onboarding/scenarios/getServer.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios diff --git a/usecase/onboarding/scenarios/machineOnboarding.go b/usecase/onboarding/scenarios/machineOnboarding.go index 23a3cf5f..330c657f 100644 --- a/usecase/onboarding/scenarios/machineOnboarding.go +++ b/usecase/onboarding/scenarios/machineOnboarding.go @@ -1,18 +1,5 @@ -// /* -// Copyright (c) 2021 T-Systems International GmbH, SAP SE or an SAP affiliate company. All right reserved -// -// 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. -// */ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios diff --git a/usecase/onboarding/scenarios/machineOnboarding_test.go b/usecase/onboarding/scenarios/machineOnboarding_test.go index 40a10e41..d14a07a4 100644 --- a/usecase/onboarding/scenarios/machineOnboarding_test.go +++ b/usecase/onboarding/scenarios/machineOnboarding_test.go @@ -1,16 +1,5 @@ -// Copyright 2023 OnMetal authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 package scenarios_test