Skip to content

Git Repositories #4

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

Merged
merged 9 commits into from
Jan 23, 2023
Merged

Git Repositories #4

merged 9 commits into from
Jan 23, 2023

Conversation

bigkevmcd
Copy link
Collaborator

This implements the first part of parsing from GitRepositories.

Copy link
Collaborator

@foot foot left a comment

Choose a reason for hiding this comment

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

Slick, tested it out, works as expected 👌

if err := mgr.GetCache().IndexField(
context.TODO(), &templatesv1.GitOpsSet{}, gitRepositoryIndexKey, indexGitRepositories); err != nil {
return fmt.Errorf("failed setting index fields: %w", err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting! Pure optimization or required to function?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, this is to start triggering reconciliations if the GitRepo's "change"

Copy link
Collaborator

Choose a reason for hiding this comment

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


// NewRepositoryParser creates and returns a RepositoryParser.
func NewRepositoryParser(logger logr.Logger) *RepositoryParser {
return &RepositoryParser{fetcher: fetch.NewArchiveFetcher(retries, tar.UnlimitedUntarSize, tar.UnlimitedUntarSize, ""), Logger: logger}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unlimited!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

// Interval is an implementation of the Generator interface.
func (g *GitRepositoryGenerator) Interval(sg *templatesv1.GitOpsSetGenerator) time.Duration {
return generators.NoRequeueInterval
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might not actually be connected up to the controller-runtime yet? (which is fine for this generator)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, this might be a bug :-)

Lemme take a look

result = append(result, r)
}

return result, nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it useful to have the path too? maybe wait for a use case but could namespace the file contents? 🤔

The .element PR brought this to mind..

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be .elementSpec.path or something too if it would be useful to access that stuff.

Just musing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

interesting idea...I like it...
.element.data and .element.path ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The .element idea is useful in context of repeat: ... because we can expose the repeating element as .repeat and the original element as .element which means you can still access bits of data from the surrounding generated element.

@bigkevmcd bigkevmcd merged commit c5ffa94 into main Jan 23, 2023
@bigkevmcd bigkevmcd deleted the gitrepositories branch January 23, 2023 16:18
casibbald pushed a commit that referenced this pull request Feb 11, 2025
…com/fluxcd/image-reflector-controller/api-0.31.2

Bump github.com/fluxcd/image-reflector-controller/api from 0.31.1 to 0.31.2
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.

None yet

2 participants