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

Integrate Kustomize #1370

Merged
merged 5 commits into from
Sep 8, 2022
Merged

Integrate Kustomize #1370

merged 5 commits into from
Sep 8, 2022

Conversation

clebs
Copy link
Contributor

@clebs clebs commented Sep 6, 2022

Description

Changes proposed in this pull request:

  • Kustomize integrated for rendering of kubebuilder operators
  • Added first version of the deploy command that installs lifecycle and module managers via kustomize
  • Added dry run mode: prints all manifests to stdout but does not apply them.

Related issue(s)
#1318

- Kustomize integrated for rendering of kubebuilder operators
- Added first version f the deploy command that installs lifecycle and module managers via kustmize
- Added dry run mode: prints all manifests to stdout but doe snot apply them.

Signed-off-by: Borja Clemente <borja.clemente.castanera@sap.com>
@kyma-bot kyma-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 6, 2022
@clebs clebs mentioned this pull request Sep 6, 2022
11 tasks
Signed-off-by: Borja Clemente <borja.clemente.castanera@sap.com>
Signed-off-by: Borja Clemente <borja.clemente.castanera@sap.com>
@clebs clebs linked an issue Sep 6, 2022 that may be closed by this pull request
11 tasks
@Tomasz-Smelcerz-SAP Tomasz-Smelcerz-SAP self-assigned this Sep 7, 2022
@Tomasz-Smelcerz-SAP
Copy link
Member

While running against a Gardener GCP cluster, I got the following error:

i303773 √ ..ng/src/github.com/kyma-project/cli/ % go run cmd/main.go alpha deploy
- Kustomize ready
/ Deploying KymaError: could not apply operator for lifecycle-manager: failed to create typed patch object (kcp-system/lifecycle-manager-controller-resources-metrics-dashboard; /v1, Kind=ConfigMap): .metadata.labels.grafana_dashboard: expected string, got &value.valueUnstructured{Value:1}
exit status 1

@Tomasz-Smelcerz-SAP
Copy link
Member

It also happens in a k3d cluster, and also when I am using a compiled binary. It looks like something's wrong with kustomize configuration

@clebs
Copy link
Contributor Author

clebs commented Sep 7, 2022

Hey @Tomasz-Smelcerz-SAP,
yes I am facing the same issue now in both k3d and gardener too. Please keep in mind that the deploy currently fetches whatever is in main for both managers. This is a breaking change to the operator templating caused by this commit.

I will debug it with @ruanxin, but in the meantime if you want to test a working state, you can use the flag --source/-s local and set your local clone of the managers to a previous commit.

@Tomasz-Smelcerz-SAP
Copy link
Member

Tomasz-Smelcerz-SAP commented Sep 7, 2022

It's probably related to this commit that introduced a label with an integer value.
Edit: haven't noticed your previous comment. The error looks like being caused by invalid label value, it should be a string, not an integer.

@@ -119,6 +110,25 @@ func ResolveLocalWorkspacePath(ws string, local bool) (string, error) {
return ws, nil
}

// resolveLocalRepo tries to find the repository with the given name in the GOPATH
// the repository must have its full name starting from $GOPATH/src
func resolveLocalRepo(repo string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a problem here. GOPATH should point to the workspace dir. In this directory there are "src" and "bin" subdirectories, and project sources should be located under "src" (docs)
On my system the "src" dir is not taken into account and I go this:

% echo $GOPATH
/Users/tsm/Documents/development/golang
% ./bin/kyma-darwin alpha deploy --source=local
- Kustomize ready
Error: error resolving lifecycle-manager: Local Kyma source directory '/Users/tsm/Documents/development/golang/github.com/kyma-project/lifecycle-manager' not found
% file $GOPATH/src/github.com/kyma-project/lifecycle-manager
/Users/tsm/Documents/development/golang/src/github.com/kyma-project/lifecycle-manager: directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that! Yes indeed there is a bug there; the src path element is missing.
Fixed it.

Signed-off-by: Borja Clemente <borja.clemente.castanera@sap.com>
Signed-off-by: Borja Clemente <borja.clemente.castanera@sap.com>
@kyma-bot kyma-bot added the lgtm Looks good to me! label Sep 7, 2022
@clebs clebs merged commit 1b53a5b into kyma-project:main Sep 8, 2022
@clebs clebs deleted the kustomize-integration branch September 8, 2022 10:19
@clebs clebs added area/cli Related to all activities around CLI area/installation Issues or PRs related to installation labels Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to all activities around CLI area/installation Issues or PRs related to installation lgtm Looks good to me! size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deploy: remake to use OCI images
4 participants