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

doc | ibmcloud: Inconsistency in default values for cos_service_instance_name #21

Closed
stevenhorsman opened this issue May 20, 2022 · 6 comments · Fixed by #29
Closed
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@stevenhorsman
Copy link
Member

stevenhorsman commented May 20, 2022

From #18 (comment):

In the next section the doc says:

cos_service_instance_name is the COS Service Instance Name, optional, default to value based on your cluster_name > tfvar if not set, ${cluster_name}-cos-service-instance.

I think we should make the defaults of these line up, otherwise it will get confusing.

We now have inconsistency in the default values of the cos_service_instance_name in the two sections it is used:

  • In creating the COS instance we have:

    cos_service_instance_name in variables.tf has the default value

  • In building the pod VM image and uploading it we have:

    cos_service_instance_name is the COS Service Instance Name, optional, default to value based on your cluster_name tfvar if not set, ${cluster_name}-cos-service-instance.

This is not a good user experience, so we have a few choices:

  • Either get rid of the defaults and stop them being optional altogether
  • Change both defaults to cos-image-instance. I don't think there is a requirement for the cos service instance name to be unique across users, so this should work
  • Change both defaults to <cluster_name>-cos-image-instance. Unless there is a way to read the cluster_name value from the cluster terraform.tfvars, I don't think this is a good solution, as there isn't another reason for cluster name to be required in the cos instance creation, so it's letting a user not supply one value by making them supply another
  • Any other solution someone smarter than me can think of?
@stevenhorsman stevenhorsman added bug Something isn't working documentation Improvements or additions to documentation labels May 20, 2022
@stevenhorsman
Copy link
Member Author

@yoheiueda - you have more knowledge of terraform than me, so do you have an opinion on which option is best?

@stevenhorsman stevenhorsman changed the title In the next section the doc says: doc | ibmcloud: Inconsistency in default values for cos_service_instance_name May 20, 2022
@yoheiueda
Copy link
Member

@stevenhorsman I prefer changing the default value to cos-image-instance.

I found the description of the default value <cluster_name>-cos-image-instance at

> - `cos_service_instance_name` is the COS Service Instance Name, optional, default to value based on your `cluster_name` tfvar if not set, `${cluster_name}-cos-service-instance`.

But the terraform configuration files uses a null value for the variable default value.

So, do we need to update the both files?

@stevenhorsman
Copy link
Member Author

@yoheiueda - thanks for the input. That matches what I'd expect.

I think that we need to update to the doc as you said and add a new default into

and remove the logic in

cos_service_instance_name = var.cos_service_instance_name != null ? var.cos_service_instance_name : "${var.cluster_name}-cos-service-instance"
which currently does the defaulting.

BTW - I think Jonah is probably going to be looking at this issue soon.

@Jonah-F
Copy link
Contributor

Jonah-F commented May 30, 2022

README requires change to manual running of ansible playbook as current command would not work because that playbook no longer exists.

> $ ansible-playbook -i ./inventory -u root ./playbook.yml

needs to be

> $ ansible-playbook -i ./inventory -u root ./kube-playbook.yml && ansible-playbook -i ./inventory -u root ./kata-playbook.yml

stevenhorsman pushed a commit that referenced this issue May 30, 2022
Updated README to reflect splitting of ansible playbook.
Step now runs two new playbooks consecutively.

Fixes #21

Signed-off-by: [Jonah-Farrow] <[email protected]>
@stevenhorsman stevenhorsman reopened this May 30, 2022
@stevenhorsman
Copy link
Member Author

issue accidentally closed by the wrong issue being labelled in the PR #37 commit, so re-opening.

stevenhorsman pushed a commit that referenced this issue May 30, 2022
Completed work to have consistent variable names across documentation.

/terraform/README now reflects COS variable name changes.
README now has consistent expectations for COS instance

and bucket names.

Fixes #21

Signed-off-by: [Jonah-Farrow] <[email protected]>
stevenhorsman pushed a commit that referenced this issue May 30, 2022
Completed work to have consistent variable names across different
Terraform templates.

cos_bucket_name now set in terraform.tfvars and has no default as

has to be unique.

Removed cos_service_instance_name prefix. Set new default value.

Fixes #21

Signed-off-by: [Jonah-Farrow] <[email protected]>
@stevenhorsman stevenhorsman linked a pull request May 30, 2022 that will close this issue
@stevenhorsman
Copy link
Member Author

Closed with #29 merging

bpradipt pushed a commit to bpradipt/cloud-api-adaptor that referenced this issue Aug 12, 2023
Updated README to reflect splitting of ansible playbook.
Step now runs two new playbooks consecutively.

Fixes confidential-containers#21

Signed-off-by: [Jonah-Farrow] <[email protected]>
bpradipt pushed a commit to bpradipt/cloud-api-adaptor that referenced this issue Aug 12, 2023
Completed work to have consistent variable names across documentation.

/terraform/README now reflects COS variable name changes.
README now has consistent expectations for COS instance

and bucket names.

Fixes confidential-containers#21

Signed-off-by: [Jonah-Farrow] <[email protected]>
bpradipt pushed a commit to bpradipt/cloud-api-adaptor that referenced this issue Aug 12, 2023
Completed work to have consistent variable names across different
Terraform templates.

cos_bucket_name now set in terraform.tfvars and has no default as

has to be unique.

Removed cos_service_instance_name prefix. Set new default value.

Fixes confidential-containers#21

Signed-off-by: [Jonah-Farrow] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants