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

Add MultiClusterEngine to OCM package #427

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ddmitrie
Copy link
Contributor

No description provided.

@ddmitrie ddmitrie force-pushed the multiclusterengine-pkg-addition branch 3 times, most recently from a58b4ad to cc71626 Compare May 15, 2024 14:22
@achuzhoy
Copy link
Collaborator

is OCM the right place?
cc @trewest @vkolodny

@ddmitrie ddmitrie force-pushed the multiclusterengine-pkg-addition branch 3 times, most recently from 7da4a0d to 080c630 Compare May 16, 2024 13:42
func NewMultiClusterEngineBuilder(apiClient *clients.Settings, name string) *MultiClusterEngineBuilder {
glog.V(100).Infof(
`Initializing new MultiClusterEngine structure with the following params: name: %s`, name)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check that apiClient is not nil before accessing it's members

// PullMultiClusterEngine loads an existing MultiClusterEngine into MultiClusterEngineBuilder struct.
func PullMultiClusterEngine(apiClient *clients.Settings, name string) (*MultiClusterEngineBuilder, error) {
glog.V(100).Infof("Pulling existing MultiClusterEngine name: %s", name)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check that apiClient is not nil before accessing it's members


glog.V(100).Infof("Getting MultiClusterEngine %s", builder.Definition.Name)

MultiClusterEngine := &mceV1.MultiClusterEngine{}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
MultiClusterEngine := &mceV1.MultiClusterEngine{}
multiclusterengine := &mceV1.MultiClusterEngine{}

}

glog.V(100).Infof("Updating MultiClusterEngine %s", builder.Definition.Name)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check that the multiclusterengine exists before attempting to update

glog.V(100).Infof("Updating MultiClusterEngine %s", builder.Definition.Name)

err := builder.apiClient.Update(context.TODO(), builder.Definition)
builder.Object = builder.Definition
Copy link
Collaborator

Choose a reason for hiding this comment

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

This runs regardless of if the above operation is successful or not. if err != nil, you should return without updating builder.Object

@ddmitrie ddmitrie force-pushed the multiclusterengine-pkg-addition branch from 080c630 to 66a73cf Compare May 27, 2024 17:15
glog.V(100).Infof("Deleting the MultiClusterEngine %s", builder.Definition.Name)

if !builder.Exists() {
return fmt.Errorf("multiclusterengine cannot be deleted because it does not exist")
Copy link
Collaborator

Choose a reason for hiding this comment

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

if the object doesn't exist and Delete method is invoked probably worth returning success?

@ddmitrie ddmitrie force-pushed the multiclusterengine-pkg-addition branch from 66a73cf to 2a42ac7 Compare May 29, 2024 17:41
@trewest trewest marked this pull request as draft June 17, 2024 18:53
@trewest
Copy link
Collaborator

trewest commented Jun 17, 2024

Converted to Draft. Seems like there are some conflicts between this pkg and the assisted pkg. We need to implement these APIs ourselves to address them.

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

Successfully merging this pull request may close these issues.

4 participants