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

Mandatory tag #87

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Mandatory tag #87

wants to merge 7 commits into from

Conversation

prkhrkat
Copy link
Contributor

No description provided.

annotations := make(map[string]string)

// Read labels and annotations from files
labelsPath := utils.DEVTRON_SELF_DOWNWARD_API_VOLUME_PATH + "/labels"
Copy link
Member

Choose a reason for hiding this comment

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

use constant

if err != nil {
log.Println(util.DEVTRON, "error in reading labels from podinfo, err:", err)
}
annotationsPath := utils.DEVTRON_SELF_DOWNWARD_API_VOLUME_PATH + "/annotations"
Copy link
Member

Choose a reason for hiding this comment

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

use constant

labelsPath := utils.DEVTRON_SELF_DOWNWARD_API_VOLUME_PATH + "/labels"
labelsOut, err := os.ReadFile(labelsPath)
if err != nil {
log.Println(util.DEVTRON, "error in reading labels from podinfo, err:", err)
Copy link
Member

Choose a reason for hiding this comment

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

1.not found
2. IO error

}

// Combine driver options
driverOptions = getBuildXDriverOptions("labels", labels, driverOptions)
Copy link
Member

Choose a reason for hiding this comment

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

enum/constant

return driverOptions
}

func parseKeyValuePairs(input string) map[string]string {
Copy link
Member

Choose a reason for hiding this comment

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

use std utility function/library

return keyValuePairs
}

func getBuildXDriverOptions(optionType string, options map[string]string, driverOptions string) string {
Copy link
Member

Choose a reason for hiding this comment

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

use library/utility function

Copy link
Member

Choose a reason for hiding this comment

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

revisit this logic within buildx and explore library

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<img width="876" alt="Screenshot 2024-12-31 at 6 05 34 PM" src="https://git
Screenshot 2024-12-31 at 6 05 46 PM
hub.com/user-attachments/assets/d05eb13b-0790-464e-8a5c-ecd29c5e444f" />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

buildx has also written parsing logic in same manner

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

Successfully merging this pull request may close these issues.

2 participants