-
Notifications
You must be signed in to change notification settings - Fork 82
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
Code Clean Up for Platfrom Controller #1375
Conversation
break | ||
} | ||
_, err := c.platformStackclientset.WorkflowsV1alpha1().ResourceCompositions(namespace).Update(context.Background(), fooCopy, metav1.UpdateOptions{}) | ||
//_, err := c.sampleclientset.MoodlecontrollerV1().Moodles(foo.Namespace).Update(fooCopy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this commented out line.
@@ -566,15 +566,15 @@ func createResourcePolicy(resPolicySpec interface{}, namespace string) { | |||
} | |||
} | |||
|
|||
func deleteResourcePolicy(resPolicySpec interface{}, namespace string) { | |||
func deleteResourcePolicy(resPolicySpec interface{}, namespace string) { | |||
fmt.Println("Inside deleteResourcePolicy.") | |||
resPolicyObject := resPolicySpec.(platformworkflowv1alpha1.ResourcePolicy) | |||
inputResPolicyName := resPolicyObject.ObjectMeta.Name | |||
/*namespace := resPolicyObject.ObjectMeta.Namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete these commented out lines as well.
/* _, err1 := crdClient.CustomResourceDefinitions().Create(context.Background(), crd, metav1.CreateOptions{}) | ||
if err1 != nil { | ||
panic(err1.Error()) | ||
/* _, err1 := crdClient.CustomResourceDefinitions().Create(context.Background(), crd, metav1.CreateOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete these commented out lines (732-736).
@SuyogShinde942 Mostly looks good. There are some commented lines that we can delete as well. |
I have removed the commented and some debugging code |
platform-operator/main.go
Outdated
@@ -58,10 +57,10 @@ func main() { | |||
}() | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also remove the comment strings (/* */)
@@ -603,57 +594,50 @@ func deleteResourcePolicy(resPolicySpec interface{}, namespace string) { | |||
|
|||
func flatten(yaml_contents map[string]interface{}, types_dict map[string]apiextensionsv1beta1.JSONSchemaProps) map[string]apiextensionsv1beta1.JSONSchemaProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you verify if flatten method is being referred to anywhere?
If not, we can delete it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using it in the getChartValueTypes function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But getChartValueTypes() is part of the commented out code that you have removed.
So I think we can safely remove flatten().
@SuyogShinde942 I have added some more comments. |
|
||
types_dict[key] = jsonSchemaInner | ||
} | ||
|
||
} | ||
//fmt.Println(types_dict) | ||
return types_dict | ||
} | ||
|
||
func getChartValueTypes(data []byte) map[string]apiextensionsv1beta1.JSONSchemaProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can get rid of this method as well.
@SuyogShinde942 I have added couple of more comments. |
1d1740c
to
694b58a
Compare
This PR resolves issues #1371 and #1370:
Cleanup Unused Resource Policy Controller (#1371):
Removed the unused resourcepolicycontroller.go file.
Deleted commented-out references to resourcepolicycontroller in main.go, as it was never utilized.
Enhancements in Resource Composition Handling (#1370):
Improved PlatformController by ensuring the handleCRD method registers the CRD defined in the ResourceComposition spec.