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

could not decode file into runtime.Object on config component returning #3048

Closed
lucasmellos opened this issue Oct 26, 2022 · 4 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/documentation Categorizes issue or PR as related to documentation.

Comments

@lucasmellos
Copy link

What broke? What's expected?

I've tested my multiple times and then tested the example available in the book here and the component config is returning

{"error": "could not decode file into runtime.Object"}

Reproducing this issue

git clone https://github.com/kubernetes-sigs/kubebuilder
cd docs/book/src/component-config-tutorial/testdata/project
# set some config file 
make run 

KubeBuilder (CLI) Version

Version: main.version{KubeBuilderVersion:"3.7.0", KubernetesVendor:"1.24.1", GitCommit:"3bfc84ec8767fa760d1771ce7a0cb05a9a8f6286", BuildDate:"2022-09-20T17:21:57Z", GoOs:"darwin", GoArch:"arm64"}

PROJECT version

3

Plugin versions

layout:
- go.kubebuilder.io/v3

and on too

layout:
- go.kubebuilder.io/v4-alpha

Other versions

go version go1.19.2 darwin/arm64
sigs.k8s.io/controller-runtime v0.13.0

Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"clean", BuildDate:"2022-06-15T14:22:29Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0", GitCommit:"4ce5a8954017644c5420bae81d72b09b735c21f0", GitTreeState:"clean", BuildDate:"2022-05-03T13:38:19Z", GoVersion:"go1.18.1", Compiler:"gc", Platform:"linux/arm64"}

Extra Labels

/kind documentation

@lucasmellos lucasmellos added the kind/bug Categorizes issue or PR as related to a bug. label Oct 26, 2022
@k8s-ci-robot k8s-ci-robot added the kind/documentation Categorizes issue or PR as related to documentation. label Oct 26, 2022
@camilamacedo86
Copy link
Member

camilamacedo86 commented Oct 26, 2022

Hi @lucasmellos,

make run will try run the manager outside of the cluster only. (You would any way need to apply the manifests first)
Can you try first:

  • go mod tidy (to ensure that you will get the deps)
  • make all (to run make manifest and make generate)

Then, I'd recommend you follow up the QUICK START steps/commands : https://book.kubebuilder.io/quick-start.html#test-it-out

  • make install
  • make run

If that does not work can you please try to check if that will work on cluster: https://book.kubebuilder.io/quick-start.html#run-it-on-the-cluster

Build and push your image to the location specified by IMG:

  • make docker-build docker-push IMG=<some-registry>/<project-name>:tag
    Deploy the controller to the cluster with image specified by IMG:
  • make deploy IMG=<some-registry>/<project-name>:tag

@lucasmellos
Copy link
Author

Hey @camilamacedo86 thanks for sharing these infos.

That was on my side within the GVK, although I noticed something that isn't 100% clear on the documentation.

On the manager_auth_proxy_patch.yaml file, the manager container specifies some flags that are now encapsulated by the config file. These flags generate some conflicts since we're using config file for them. Should we suppress all the args or should we mount it as volume?

As far as I've seen I didn't notice anything on the documentation related to the manager_auth_proxy_patch.yaml. Is it a missing part that should be added to the docs? If so, please, let me know I'll happy to collaborate.

@camilamacedo86
Copy link
Member

camilamacedo86 commented Oct 27, 2022

Hi @lucasmellos,

If you create the project with old versions you might fail in the issue: https://github.com/kubernetes-sigs/kubebuilder/pull/2826/files OR in the issue #3013 if you are using the latest version.

See that the componentConfig is an optional feature and the default scaffold should not have the files/changes required to work with. The idea is we have a plugin in the future instead of using the flag --component-config=true to enable it. See: #3022

About help

Could you please check if the master branch does not have it sorted out (by creating a new project with a bin built from master)? Also, feel free to check the master branch version of docs (https://master.book.kubebuilder.io/) to see if it has any hall for improvements and feel free to push a PR against it. If the issue is solved on master (doc or code), it will be all sorted out in the next release.

Thank you for your collaboration.

@lucasmellos
Copy link
Author

Improvements will be added to new issues due to their nature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

No branches or pull requests

3 participants