GeezerVison is showing github.com — Remember `--registry-insecure` setting on recurring runs by creydr · Pull Request #3490 · knative/func
Remember --registry-insecure setting on recurring runs
#3490
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
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
6552187
Revert "Pass --registry-insecure flag to Tekton pipeline tlsVerify pa…
creydr Mar 12, 2026
37ae142
Remember `--registry-insecure` setting on recurring runs
creydr Mar 12, 2026
7def61f
Run `make schema-generate`
creydr Mar 12, 2026
10bfeeb
Simplify parsing
creydr Mar 13, 2026
a016a3b
Extend description of flag, that values are persited
creydr Mar 13, 2026
f67d995
Add warning, when registry changed but insecure-registry is still set…
creydr Mar 13, 2026
cfa6a24
Fix typo
creydr Mar 13, 2026
ea492f9
Rerun update-codegen
creydr Mar 13, 2026
2cfb280
Cleanup test names
creydr Mar 13, 2026
5986c9d
Add unit test for WarnRegistryInsecureChange
creydr Mar 13, 2026
f42ecfd
Run schema-generate
creydr Mar 13, 2026
57d8c41
Update pkg/functions/client.go
creydr Mar 13, 2026
ad88a8b
Update pkg/functions/client.go
creydr Mar 13, 2026
d75206e
Update pkg/config/config.go
creydr Mar 13, 2026
00d336c
Update pkg/config/config.go
creydr Mar 13, 2026
96e1157
Fix format issues (goimport and gofmt)
creydr Mar 13, 2026
6ef0d42
Refactor registry-insecure unit test to make it available for the Dep…
creydr Mar 13, 2026
5a87051
Refactor GlobalConfig.WarnRegistryInsecureChange() method to function…
creydr Mar 13, 2026
File filter
Filter by extension
.go
(6)
All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
Revert "Pass --registry-insecure flag to Tekton pipeline tlsVerify pa…
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
commit 6552187081e49dca828cccb237c2523fd2394d5b
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
Expand Up
@@ -62,7 +62,7 @@ func NewClient(cfg ClientConfig, options ...fn.Option) (*fn.Client, func()) {
t = newTransport(cfg.InsecureSkipVerify) // may provide a custom impl which proxies
c = newCredentialsProvider(config.Dir(), t, "") // for accessing registries
d = newKnativeDeployer(cfg.Verbose) // default deployer (can be overridden via options)
pp = newTektonPipelinesProvider(c, cfg.Verbose, cfg.InsecureSkipVerify )
pp = newTektonPipelinesProvider(c, cfg.Verbose)
o = []fn.Option{ // standard (shared) options for all commands
fn.WithVerbose(cfg.Verbose),
fn.WithTransport(t),
Expand Down
Expand Up
@@ -143,11 +143,10 @@ func newCredentialsProvider(configPath string, t http.RoundTripper, authFilePath
return creds.NewCredentialsProvider(configPath, options...)
}
func newTektonPipelinesProvider(creds oci.CredentialsProvider, verbose bool, registryInsecure bool ) *tekton.PipelinesProvider {
func newTektonPipelinesProvider(creds oci.CredentialsProvider, verbose bool) *tekton.PipelinesProvider {
options := []tekton.Opt{
tekton.WithCredentialsProvider(creds),
tekton.WithVerbose(verbose),
tekton.WithRegistryInsecure(registryInsecure),
tekton.WithPipelineDecorator(deployDecorator{}),
}
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -778,7 +778,7 @@ func (c deployConfig) clientOptions() ([]fn.Option, error) {
// Override the pipelines provider to use custom credentials
// This is needed for remote builds (deploy --remote)
o = append(o, fn.WithPipelinesProvider(newTektonPipelinesProvider(creds, c.Verbose, c.RegistryInsecure )))
o = append(o, fn.WithPipelinesProvider(newTektonPipelinesProvider(creds, c.Verbose)))
// Add the appropriate deployer based on deploy type
deployer := c.Deployer
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -129,7 +129,7 @@ func (pp *PipelinesProvider) createLocalPACResources(ctx context.Context, f fn.F
return err
}
err = createPipelineRunTemplatePAC(f, labels, pp.registryInsecure )
err = createPipelineRunTemplatePAC(f, labels)
if err != nil {
return err
}
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -52,7 +52,6 @@ type pacURLCallback = func() (string, error)
type PipelinesProvider struct {
verbose bool
registryInsecure bool
getPacURL pacURLCallback
credentialsProvider oci.CredentialsProvider
decorator PipelineDecorator
Expand All
@@ -70,12 +69,6 @@ func WithVerbose(verbose bool) Opt {
}
}
func WithRegistryInsecure(insecure bool) Opt {
return func(pp *PipelinesProvider) {
pp.registryInsecure = insecure
}
}
func WithPipelineDecorator(decorator PipelineDecorator) Opt {
return func(pp *PipelinesProvider) {
pp.decorator = decorator
Expand Down
Expand Up
@@ -210,7 +203,7 @@ func (pp *PipelinesProvider) Run(ctx context.Context, f fn.Function) (string, fn
return "", f, fmt.Errorf("problem in creating secret: %v", err)
}
err = createAndApplyPipelineRunTemplate(f, namespace, labels, pp.registryInsecure )
err = createAndApplyPipelineRunTemplate(f, namespace, labels)
if err != nil {
return "", f, fmt.Errorf("problem in creating pipeline run: %v", err)
}
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -131,7 +131,7 @@ func createPipelineTemplatePAC(f fn.Function, labels map[string]string) error {
// createPipelineRunTemplatePAC creates a PipelineRun template used for PAC on-cluster build
// it creates the resource in the project directory
func createPipelineRunTemplatePAC(f fn.Function, labels map[string]string, registryInsecure bool ) error {
func createPipelineRunTemplatePAC(f fn.Function, labels map[string]string) error {
contextDir := f.Build.Git.ContextDir
if contextDir == "" && f.Build.Builder == builders.S2I {
// TODO(lkingland): could instead update S2I to interpret empty string
Expand Down
Expand Up
@@ -167,7 +167,7 @@ func createPipelineRunTemplatePAC(f fn.Function, labels map[string]string, regis
// Determine if TLS verification should be skipped
tlsVerify := "true"
if registryInsecure || isInsecureRegistry(f.Registry) {
if isInsecureRegistry(f.Registry) {
tlsVerify = "false"
}
Expand Down
Expand Up
@@ -330,7 +330,7 @@ func createAndApplyPipelineTemplate(f fn.Function, namespace string, labels map[
// createAndApplyPipelineRunTemplate creates and applies PipelineRun template for a standard on-cluster build
// all resources are created on the fly, if there's a PipelineRun defined in the project directory, it is used instead
func createAndApplyPipelineRunTemplate(f fn.Function, namespace string, labels map[string]string, registryInsecure bool ) error {
func createAndApplyPipelineRunTemplate(f fn.Function, namespace string, labels map[string]string) error {
contextDir := f.Build.Git.ContextDir
if contextDir == "" && f.Build.Builder == builders.S2I {
// TODO(lkingland): could instead update S2I to interpret empty string
Expand Down
Expand Up
@@ -366,7 +366,7 @@ func createAndApplyPipelineRunTemplate(f fn.Function, namespace string, labels m
// Determine if TLS verification should be skipped
tlsVerify := "true"
if registryInsecure || isInsecureRegistry(f.Registry) {
if isInsecureRegistry(f.Registry) {
tlsVerify = "false"
}
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -147,7 +147,7 @@ func Test_createPipelineRunTemplatePAC(t *testing.T) {
f.Image = "docker.io/alice/" + f.Name
f.Registry = TestRegistry
err = createPipelineRunTemplatePAC(f, make(map[string]string), false )
err = createPipelineRunTemplatePAC(f, make(map[string]string))
if (err != nil) != tt.wantErr {
t.Errorf("createPipelineRunTemplate() error = %v, wantErr %v", err, tt.wantErr)
Expand Down
Expand Up
@@ -316,7 +316,7 @@ func Test_createAndApplyPipelineRunTemplate(t *testing.T) {
f.Image = "docker.io/alice/" + f.Name
f.Registry = TestRegistry
if err := createAndApplyPipelineRunTemplate(f, tt.namespace, tt.labels, false ); (err != nil) != tt.wantErr {
if err := createAndApplyPipelineRunTemplate(f, tt.namespace, tt.labels); (err != nil) != tt.wantErr {
t.Errorf("createAndApplyPipelineRunTemplate() error = %v, wantErr %v", err, tt.wantErr)
}
})
Expand Down
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.