Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1.22 compatibility #267

Merged
merged 6 commits into from
Mar 17, 2022
Merged

Fix 1.22 compatibility #267

merged 6 commits into from
Mar 17, 2022

Conversation

JohnStarich
Copy link
Member

Fixes #258

greglanthier and others added 6 commits March 7, 2022 15:43
Also:
- ignore some linter warnings re: the deprefacted controller-runtime/pkg/client/fake class
- tweak some OLM-related generation tools
- ignore gosec G304 warning (appears to be same category as G307).

Signed-off-by: Greg Lanthier <greg.lanthier@ca.ibm.com>
I reviewed the internal tool `fixcrd`.

A [branch in `fixcrd`](https://github.com/IBM/cloud-operators/blob/9e16ddee216c7f1ab105b315be2e4c4c08cd3305/internal/cmd/fixcrd/main.go#L90-L96) removed the OpenAPI data type `type:` field from the `binding.spec.parameters.value` and `services.spec.parameters.value` fields in the CRD.  This caused the `CustomResourceDefinition.apiextensions.k8s.io "..." is invalid` errors.

These changes to the PR modify the `fixcrd` tool so that it retains the OpenAPI `type: object` data type for the `value:` field in the CRD and incorporates the changes described in @JohnStarich's feedback.

I verified that the CRDs install properly in a `minikube` instance.

```shell
$ make install
/Users/lanthieg/Developer/git/forks/cloud-operators/cache/controller-gen_0.4.1/controller-gen "crd" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
go run ./internal/cmd/fixcrd ./config/crd/bases/*.yaml
go run ./internal/cmd/firstsetup # Install ICO secret & configmap
IBM Cloud Operators configmap and secret already set up. Skipping...
kustomize build config/crd | kubectl apply -f -
customresourcedefinition.apiextensions.k8s.io/bindings.ibmcloud.ibm.com configured
customresourcedefinition.apiextensions.k8s.io/services.ibmcloud.ibm.com configured
$ kubectl explain --api-version=ibmcloud.ibm.com/v1 binding.spec.parameters
KIND:     Binding
VERSION:  ibmcloud.ibm.com/v1

RESOURCE: parameters <[]Object>

DESCRIPTION:
     Parameters pass configuration to the service during creation

     Param represents a key-value pair

FIELDS:
   attributes   <map[string]map[string]>
     A parameter may have attributes (e.g. message hub topic might have
     partitions)

   name <string> -required-
     Name representing the key.

   value        <map[string]>
     Defaults to null.

   valueFrom    <Object>
     Source for the value. Cannot be used if value is not empty.
$
```

Signed-off-by: Greg Lanthier <greg.lanthier@ca.ibm.com>
Signed-off-by: John Starich <johnstarich@johnstarich.com>
Signed-off-by: John Starich <johnstarich@johnstarich.com>
Signed-off-by: John Starich <johnstarich@johnstarich.com>
@JohnStarich
Copy link
Member Author

Looks like int tests can't run due to a revoked API key. We'll need to get that fixed up soon, but it can wait. I've manually vetted the changes work on k8s and openshift.

@JohnStarich JohnStarich marked this pull request as ready for review March 17, 2022 03:40
@JohnStarich JohnStarich merged commit c4e6b02 into master Mar 17, 2022
@JohnStarich JohnStarich deleted the bugfix/fix-1.22-compatibility branch March 17, 2022 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operator projects using the removed APIs in k8s 1.22 requires changes.
2 participants