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

PROJECT: cannot make change to container annotation cnrm.cloud.google.com/folder-id #181

Closed
tdigangi opened this issue May 19, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@tdigangi
Copy link

tdigangi commented May 19, 2020

Describe the bug
When trying to change the folder number in the cnrm.cloud.google.com/folder-id annotation of the already deployed project. I receive the following message.

Step #1: Error: UPGRADE FAILED: cannot patch "ui-tst-lpi-zn-972" with kind Project: admission webhook "deny-immutable-field-updates.cnrm.cloud.google.com" denied the request: error validating container annotations: cannot make change to container annotation cnrm.cloud.google.com/folder-id

ConfigConnector Version
1.8.0

To Reproduce
Using helm install the following snippet with the initial folder number. Once deployed run an upgrade with the new folder number.

YAML snippets:

apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
  name: "{{ $.Values.labels.business_entity }}-{{ $.Values.labels.team_id }}-{{ $.Values.labels.function }}-{{ $.Values.labels.environment }}-{{ $.Values.randNum }}"
  annotations:
     cnrm.cloud.google.com/auto-create-network: "false"
     cnrm.cloud.google.com/folder-id: "<this is changed after install>"
  labels:
    business_entity: {{ $.Values.labels.business_entity }}
spec:
  name: "{{ $.Values.labels.business_entity }}-{{ $.Values.labels.team_id }}-{{ $.Values.labels.function }}-{{ $.Values.labels.environment }}-{{ $.Values.randNum }}"
  billingAccountRef:
    external: "{{ $.Values.billingAccount }}"
@tdigangi tdigangi added the bug Something isn't working label May 19, 2020
@AlexBulankou AlexBulankou added enhancement New feature or request and removed bug Something isn't working labels May 21, 2020
@AlexBulankou
Copy link
Contributor

@tdigangi , thanks for filing it. Folder-id annotation is currently immutable and moving projects into a different folder is not supported with Config Connector.
Changing this to type=enhancement. Can you please provide more details on the customer usage? (and please feel free to provide more details over email/file internal bug). Thanks!

@tdigangi
Copy link
Author

In general folder structure can change for many reasons in a business this can occur as a migration effort to new IAM roles, org constraints, or to transition to a different folder structure(more nested folders or less). Often times a consumer may wish to keep the same project as well to alleviate potential project migration challenges.

@tedelwartowski-bestbuy
Copy link

@AlexBulankou regarding your comment about config connector not supporting moving projects to other folders; I believe this has been incorrectly stated as we are currently able to utilize config connector to move projects between folders. As you indicated, the annotation for folder-id is immutable, however if you abandon the project object, remove it and then apply it with an updated annotation, config connector will in fact correctly move the project to the new folder. Moving a projects does appear to be fully supported by config connector and the only limitation is based on the annotation currently being defined as immutable.

@jcanseco
Copy link
Member

jcanseco commented Jan 6, 2021

Hi all, it is now possible to update the folder-id annotation on a Project or Folder resource to move them across folders in KCC v1.34.0, removing the need for the workaround that @tedelwartowski-bestbuy mentioned above.

Also @tedelwartowski-bestbuy: yes you are correct! This was actually not behavior that had been known until recently and was more of a workaround that worked unintentionally. In any case, you shouldn't have to rely on such a workaround anymore to move projects across folders.

@jcanseco jcanseco closed this as completed Jan 6, 2021
@tedelwartowski-bestbuy
Copy link

@jcanseco - thank you; we tested the updated version and it now works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants