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

[ENHANCEMENT] Update dependencies and improve docs #21

Merged
merged 19 commits into from
Nov 27, 2024

Conversation

ibakshay
Copy link
Contributor

@ibakshay ibakshay commented Oct 21, 2024

Changes

  • Upgraded to Go 1.23
  • Updated all project dependencies
  • Enhanced README
  • Refreshed config/samples manifests
  • Updated CRDs in config/crd/bases to reflect new schema
  • Added optional perses-server-url flag for localhost testing:
    flag.StringVar(&persesServerURL, "perses-server-url", "", "The Perses backend server URL")

fixes #16 cloudoperators/greenhouse-extensions#419

@ibakshay ibakshay force-pushed the akshay/update-dependencies branch 2 times, most recently from 254f17c to 249f796 Compare October 21, 2024 11:39
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
@ibakshay ibakshay force-pushed the akshay/update-dependencies branch from 249f796 to 249615f Compare October 21, 2024 11:40
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
@ibakshay ibakshay changed the title Update dependencies and improve docs [ENHANCEMENT] Update dependencies and improve docs Oct 21, 2024
@jgbernalp
Copy link
Contributor

@ibakshay thank you for your contribution!. Can you please take a look at the tests, they might need an update.

Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
@ibakshay
Copy link
Contributor Author

ibakshay commented Oct 22, 2024

@ibakshay thank you for your contribution!. Can you please take a look at the tests, they might need an update.

My pleasure. Thanks a lot for your review. The test is failing due to this serialization issue. I have already created a PR in prometheus/common repository for the fix. The test should be successfully after PR in prometheus/common gets merged.

Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
jgbernalp and others added 2 commits November 26, 2024 15:28
update perses API dependency to fix duration types
return nil, err
}
restClient, err := clientConfig.NewRESTClient(clientConfig.RestConfigClient{
URL: &common.URL{URL: parsedURL.URL},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
URL: &common.URL{URL: parsedURL.URL},
URL: parsedURL,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 4e2fa72 :)

persesv1 "github.com/perses/perses/pkg/model/api/v1"
)

type Dashboard struct {
persesv1.DashboardSpec `json:",inline"`
}

// DeepCopyInto is a manually implemented deep copy function and this is required because:
// 1. The embedded persesv1.DashboardSpec from the Perses project doesn't implement DeepCopyInto
// 2. controller-gen can't automatically generate DeepCopy methods for types it doesn't own
func (in *Dashboard) DeepCopyInto(out *Dashboard) {
Copy link
Member

Choose a reason for hiding this comment

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

for deep copy in the Perses repo we are using this package github.com/brunoga/deep. Works pretty well.
Maybe it's more efficient than marshalling and unmarshalling the data 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot for the pointer, Augustin. I have manually marshalled and unmarshalled as I was getting issue during deepcopying using go-deepcopy library. The github.com/brunoga/deep works great and I have fixed in this commit 4e2fa72 :)

Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>

restClient, err := clientConfig.NewRESTClient(clientConfig.RestConfigClient{
URL: &common.URL{URL: parsedURL.URL},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
URL: &common.URL{URL: parsedURL.URL},
URL: parsedURL,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 3849b48 :)

Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
@@ -41,8 +54,13 @@ func NewWithURL(url string) PersesClientFactory {
}

func (f *PersesClientFactoryWithURL) CreateClient(config persesv1alpha1.Perses) (v1.ClientInterface, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Since this method doesn't use the config I guess we can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Removed in 9847bb1 commit :)

Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
Signed-off-by: Akshay Iyyadurai Balasundaram <[email protected]>
@Nexucis
Copy link
Member

Nexucis commented Nov 27, 2024

awesome. Thank you @ibakshay for your constant contribution around the perses-operator !!

@Nexucis Nexucis merged commit 720eb74 into perses:main Nov 27, 2024
5 checks passed
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.

Needs Dependency Updates
3 participants