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

Workload Managment Resource Need More Documentation and seperate namespace to differnete resource #2270

Open
4 tasks done
orenr2301 opened this issue Sep 30, 2024 · 4 comments
Assignees
Labels
documentation Type: Documentation enhancement Type: Enhancement

Comments

@orenr2301
Copy link

orenr2301 commented Sep 30, 2024

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

For a long time, we waited for the workload management resource so first of all thank you.

Secondly:
The doc of the supervisor resource is very light!
It just has a simple description of each attribute.

  • it doesn't show what are the requested types

  • Cannot know whether an attribute is optional or required

  • Doesn't show schemas of resource structure

  • Doesn't show if a block might be repeatable or not

  • No specific examples, and no description of other stuff

  • Also since each workload can have more than one namespace configured under it, you should set the namespace to a list object type, so a user can put more than one namespace

You should take into account, that not everyone who is familiar with Tanzu(tkgs), has expertise in vSpehere.
Therefore you need to describe as well, if there are crucial dependencies, and there are.

Use Case(s)

I need to assign more namespaces under one workload management cluster, currently, it's not enabled in your code

Potential Terraform Provider Configuration

For the namespace thing please look at below

resource_vsphere_supervisor.go
under func resourceVsphereSupervisor() *schema.Resource {

"namespace": {
				Type:        schema.TypeSet, ==> make it to be  "schema.TypeList" please 
				Optional:    true,
				Description: "List of namespaces associated with the cluster.",
				Elem:        namespaceSchema(),
			},
						

more say to be it dynamically so we can add multiple blocks

I Suggest to : 1) adding MinItems

"namespace": {
				Type:        schema.TypeSet, ==> make it to be  "schema.TypeList" please 
				Optional:    true,
				**MinItems:**    1, ==> tell it it can have more then one block and its repeatable 
				Description: "List of namespaces associated with the cluster.",
				Elem:        namespaceSchema(),
			},

For not having to call a function and maybe have it more organized, For you your judgment of course

Change the namespace scheme from:

"namespace": {
				Type:        schema.TypeSet,
				Optional:    true,
				Description: "List of namespaces associated with the cluster.",
				Elem:        namespaceSchema(),
			},

To:

"namespace": {
				Type:        schema.TypeList,
				Optional:    true,
				MinItem: 1
				Description: "List of namespaces associated with the cluster.",
				Elem:        &schema.Resource{
		                                Schema: map[string]*schema.Schema{
			                                      "name": {
				                                   Type:        schema.TypeString,
				                                   Required:    true,
				                                  Description: "The name of the namespace.",
			                                     },
			                                    "content_libraries": {
				                                Type:        schema.TypeList,
				                                Optional:    true,
				                                Description: "A list of content libraries.",
				                               Elem: &schema.Schema{
					                      Type: schema.TypeString,
				                            },
			                             },
			                               "vm_classes": {
				                           Type:        schema.TypeList,
				                          Optional:    true,
				                          Description: "A list of virtual machine classes.",
				                          Elem: &schema.Schema{
					                           Type: schema.TypeString,
				                    },
			                       },
			},

Also, you can take all of the blocks and create the schema in particular for each block and assign the element without having to have a return function that constructs the scheme back to the Elem key

Also if you would like to do so in addition
you can create or have in the beginning some constant that will represent your resource keys/attributes and then use specKey whenever needed based on the scheme structure under the relevant schema

References

No response

@orenr2301 orenr2301 added the enhancement Type: Enhancement label Sep 30, 2024
Copy link

Hello, orenr2301! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@tenthirtyam tenthirtyam added documentation Type: Documentation and removed enhancement Type: Enhancement labels Oct 25, 2024
@tenthirtyam
Copy link
Collaborator

@spacegospod could you review the above and provide your thoughts. It's a mix of documentation questions and changesthat could potentially be breaking with tyoe changes.

@tenthirtyam tenthirtyam added the enhancement Type: Enhancement label Nov 5, 2024
@spacegospod
Copy link
Collaborator

Thanks for the feedback @orenr2301

You are absolutely right in your description of the docs for r/supervisor as "light".
The resource itself is not implemented to cover the full set of options for supervisor enablement.

There's a request to add more functionality that has been waiting in the backlog for a while and we can think about a second iteration of the implementation.

Turning namespace into a standalone resource would be considered a breaking change and would probably have to wait for a major release before it can be rolled out. Making the "namespace" input a list so that we support multiple assignments however can probably be called a "minor breaking change" that can be adopted by users with little effort.
@tenthirtyam would that be something that we can roll out with a minor version?

@tenthirtyam
Copy link
Collaborator

Possibly but need input from @iBrandyJackson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Type: Documentation enhancement Type: Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants