diff --git a/.devcontainer/contributor/devcontainer.json b/.devcontainer/contributor/devcontainer.json index 1603e805c6..ec47253098 100644 --- a/.devcontainer/contributor/devcontainer.json +++ b/.devcontainer/contributor/devcontainer.json @@ -43,7 +43,7 @@ }, // Prerequisite for Code Generation, see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites#code-generation // Adding workspace as safe directory to avoid permission issues - "postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.1 && go install github.com/golang/mock/mockgen@v1.5.0", + "postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 && go install github.com/golang/mock/mockgen@v1.5.0", "hostRequirements": { "memory": "8gb" }, diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b68f1019a9..4cd60b70d6 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -59,7 +59,7 @@ jobs: - name: Install mockgen run: go install github.com/golang/mock/mockgen@v1.5.0 - name: Install controller-gen - run: go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.1 + run: go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 - name: Install helm uses: azure/setup-helm@v4 with: diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index bf9bfc45a5..b343681df1 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -72,7 +72,7 @@ jobs: - name: Install controller-gen run: | cd radius - go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.1 + go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 # Generate Bicep docs - name: Generate Bicep docs run: | diff --git a/build/generate.mk b/build/generate.mk index 3a509e8277..31e7c856d9 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -56,19 +56,19 @@ generate-autorest-installed: .PHONY: generate-controller-gen-installed generate-controller-gen-installed: @echo "$(ARROW) Detecting controller-gen..." - @which controller-gen > /dev/null || { echo "run 'go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.1'"; exit 1; } + @which controller-gen > /dev/null || { echo "run 'go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0'"; exit 1; } @echo "$(ARROW) OK" .PHONY: generate-ucp-crd generate-ucp-crd: generate-controller-gen-installed ## Generates the CRDs for UCP APIServer store. @echo "$(ARROW) Generating CRDs for ucp.dev..." - controller-gen object paths=./pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/... object:headerFile=./boilerplate.go.txt + controller-gen object:headerFile=./boilerplate.go.txt paths=./pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/... controller-gen crd paths=./pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/... output:crd:dir=./deploy/Chart/crds/ucpd .PHONY: generate-controller generate-controller: generate-controller-gen-installed ## Generates the CRDs for the Radius controller. @echo "$(ARROW) Generating CRDs for radapp.io..." - controller-gen object paths=./pkg/controller/api/... object:headerFile=./boilerplate.go.txt + controller-gen object:headerFile=./boilerplate.go.txt paths=./pkg/controller/api/... controller-gen crd paths=./pkg/controller/api/... output:crd:dir=./deploy/Chart/crds/radius .PHONY: generate-genericcliclient diff --git a/deploy/Chart/crds/radius/radapp.io_recipes.yaml b/deploy/Chart/crds/radius/radapp.io_recipes.yaml index d18c847ba6..f271618bc9 100644 --- a/deploy/Chart/crds/radius/radapp.io_recipes.yaml +++ b/deploy/Chart/crds/radius/radapp.io_recipes.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: recipes.radapp.io spec: group: radapp.io @@ -37,14 +36,19 @@ spec: description: Recipe is the Schema for the recipes API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -52,14 +56,14 @@ spec: description: RecipeSpec defines the desired state of Recipe properties: application: - description: Application is the name of the Radius application to - use. If unset the namespace of the Recipe will be used as the application - name. + description: |- + Application is the name of the Radius application to use. If unset the namespace of the + Recipe will be used as the application name. type: string environment: - description: Environment is the name of the Radius environment to - use. If unset the value 'default' will be used as the environment - name. + description: |- + Environment is the name of the Radius environment to use. If unset the value 'default' will be + used as the environment name. type: string secretName: description: SecretName is the name of a Kubernetes secret to create @@ -79,9 +83,9 @@ spec: description: Environment is the resource ID of the environment. type: string observedGeneration: - description: ObservedGeneration is the most recent generation observed - for this Recipe. It corresponds to the Recipe's generation, which - is updated on mutation by the API Server. + description: |- + ObservedGeneration is the most recent generation observed for this Recipe. It corresponds to the + Recipe's generation, which is updated on mutation by the API Server. format: int64 type: integer operation: @@ -114,33 +118,40 @@ spec: description: API version of the referent. type: string fieldPath: - description: 'If referring to a piece of an object instead of - an entire object, this string should contain a valid JSON/Go - field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within - a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" - (container with index 2 in this pod). This syntax is chosen - only to have some well-defined way of referencing a part of - an object. TODO: this design is not final and this field is - subject to change in the future.' + description: |- + If referring to a piece of an object instead of an entire object, this string + should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within a pod, this would take on a value like: + "spec.containers{name}" (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only to have some well-defined way of + referencing a part of an object. + TODO: this design is not final and this field is subject to change in the future. type: string kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind of the referent. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ type: string resourceVersion: - description: 'Specific resourceVersion to which this reference - is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + description: |- + Specific resourceVersion to which this reference is made, if any. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency type: string uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids type: string type: object x-kubernetes-map-type: atomic diff --git a/deploy/Chart/crds/ucpd/ucp.dev_queuemessages.yaml b/deploy/Chart/crds/ucpd/ucp.dev_queuemessages.yaml index de8cc13d05..9d48ce89d5 100644 --- a/deploy/Chart/crds/ucpd/ucp.dev_queuemessages.yaml +++ b/deploy/Chart/crds/ucpd/ucp.dev_queuemessages.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: queuemessages.ucp.dev spec: group: ucp.dev @@ -21,14 +20,19 @@ spec: description: QueueMessage is the Schema for QueueMessage API. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/deploy/Chart/crds/ucpd/ucp.dev_resources.yaml b/deploy/Chart/crds/ucpd/ucp.dev_resources.yaml index b313b359f3..405eb4041d 100644 --- a/deploy/Chart/crds/ucpd/ucp.dev_resources.yaml +++ b/deploy/Chart/crds/ucpd/ucp.dev_resources.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.15.0 name: resources.ucp.dev spec: group: ucp.dev @@ -21,9 +20,11 @@ spec: description: Resource is the Schema for the resources API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string entries: items: @@ -47,9 +48,12 @@ spec: type: object type: array kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md index f9e0abbe30..e2d573d5fa 100644 --- a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md +++ b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md @@ -182,6 +182,6 @@ Enter the following commands to install all of the required tools. cd typespec && npm ci npm install -g autorest npm install -g oav -go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.1 +go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 go install github.com/golang/mock/mockgen@v1.5.0 ``` diff --git a/pkg/controller/api/radapp.io/v1alpha3/zz_generated.deepcopy.go b/pkg/controller/api/radapp.io/v1alpha3/zz_generated.deepcopy.go index 9da58abdb9..90116af1dc 100644 --- a/pkg/controller/api/radapp.io/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/controller/api/radapp.io/v1alpha3/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2023 The Radius Authors. diff --git a/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/zz_generated.deepcopy.go b/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/zz_generated.deepcopy.go index 3d84dd4201..92f315566c 100644 --- a/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2023 The Radius Authors. diff --git a/test/magpiego/Dockerfile b/test/magpiego/Dockerfile index 17a2b0dd40..7e90c863c0 100644 --- a/test/magpiego/Dockerfile +++ b/test/magpiego/Dockerfile @@ -1,6 +1,6 @@ # Issues on M1 mac: https://github.com/docker/for-mac/issues/5831 # it is a multistage docker creation for small magpie image -FROM amd64/golang:1.20-alpine +FROM amd64/golang:1.21-alpine WORKDIR /usr/src/tmpapp # Download necessary Go modules diff --git a/test/magpiego/go.mod b/test/magpiego/go.mod index 81a0f5488c..e0398d5232 100644 --- a/test/magpiego/go.mod +++ b/test/magpiego/go.mod @@ -1,6 +1,6 @@ module github.com/radius-project/radius/test/magpiego -go 1.20 +go 1.21 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 diff --git a/test/testrp/Dockerfile b/test/testrp/Dockerfile index 665bfdcaf8..f766a4b359 100644 --- a/test/testrp/Dockerfile +++ b/test/testrp/Dockerfile @@ -1,6 +1,6 @@ # Issues on M1 mac: https://github.com/docker/for-mac/issues/5831 # it is a multistage docker creation for small magpie image -FROM amd64/golang:1.20-alpine3.16 +FROM amd64/golang:1.21-alpine WORKDIR /usr/src/tmpapp # Download necessary Go modules @@ -10,7 +10,7 @@ COPY *.go ./ # create the go binary RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o testrp . -FROM amd64/alpine:3.16 +FROM amd64/alpine:3 WORKDIR /usr/src/app COPY --from=0 /usr/src/tmpapp/testrp ./ EXPOSE 3000