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

Directory expected error for resource 'https://github.com/projectcalico/calico/manifests/tigera-operator.yaml?ref=v3.24.4' #4862

Closed
jameshearttech opened this issue Nov 10, 2022 · 4 comments
Labels
kind/documentation Categorizes issue or PR as related to documentation. kind/support Categorizes issue or PR as a support question. triage/resolved Indicates an issue has been resolved or doesn't need to be resolved.

Comments

@jameshearttech
Copy link

Describe the bug

When a kustomization resource is a yaml file in github and ?ref= is used I get an error that a directory was expected. When I use the permanent link instead of the ref it works as expected.

Files that can reproduce the issue

examples.tar.gz

Expected output

$ kubectl apply -k ./calico-good/overlays/dev --dry-run='client'
namespace/tigera-operator configured (dry run)
customresourcedefinition.apiextensions.k8s.io/apiservers.operator.tigera.io configured (dry run)
customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/caliconodestatuses.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/imagesets.operator.tigera.io configured (dry run)
customresourcedefinition.apiextensions.k8s.io/installations.operator.tigera.io configured (dry run)
customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/ipreservations.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org configured (dry run)
customresourcedefinition.apiextensions.k8s.io/tigerastatuses.operator.tigera.io configured (dry run)
serviceaccount/tigera-operator configured (dry run)
clusterrole.rbac.authorization.k8s.io/tigera-operator configured (dry run)
clusterrolebinding.rbac.authorization.k8s.io/tigera-operator configured (dry run)
deployment.apps/tigera-operator configured (dry run)
apiserver.operator.tigera.io/default configured (dry run)
installation.operator.tigera.io/default configured (dry run)

Actual output

$ kubectl apply -k ./calico-bad/overlays/dev --dry-run='client'
error: accumulating resources: accumulation err='accumulating resources from '../../base': '/home/k8sadmin/downloads/calico-bad/base' must resolve to a file': recursed accumulation of path '/home/k8sadmin/downloads/calico-bad/base': accumulating resources: accumulation err='accumulating resources from 'https://github.com/projectcalico/calico/manifests/tigera-operator.yaml?ref=v3.24.4': URL is a git repository': '/tmp/kustomize-578762547/manifests/tigera-operator.yaml' refers to file 'tigera-operator.yaml'; expecting directory

Kustomize version

I'm not sure which version is included with kubectl 1.25.3. Is it 4.20?

Platform

OS: Ubuntu 22.04.1
Kubernetes: 1.25.3

Additional context

@jameshearttech jameshearttech added the kind/bug Categorizes issue or PR as related to a bug. label Nov 10, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 10, 2022
@k8s-ci-robot
Copy link
Contributor

@jameshearttech: This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jameshearttech jameshearttech changed the title Unexpected "expecting directory" error when resource is github Directory expected error for resource 'https://github.com/projectcalico/calico/manifests/tigera-operator.yaml?ref=v3.24.4' Nov 10, 2022
@sbanna-nomad
Copy link

We recently ran into this issue as well from yesterday and it magically resolved itself a few minutes ago. Curious if there was a root cause

@KnVerey
Copy link
Contributor

KnVerey commented Nov 23, 2022

The URL provided doesn't work for me with or without the ref. By default, Kustomize treats remote references as bases that it should clone. To reference a file, you need to provide a URL that directly provides content, i.e. for Github the raw URL. For example: https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/tigera-operator.yaml

This is one of the topics where our docs are fragmented (#4338), and the individual file support seems to only be explained here: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md#remote-files.

/kind support
/kind documentation
/triage resolved
/close

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. kind/documentation Categorizes issue or PR as related to documentation. triage/resolved Indicates an issue has been resolved or doesn't need to be resolved. labels Nov 23, 2022
@k8s-ci-robot
Copy link
Contributor

@KnVerey: Closing this issue.

In response to this:

The URL provided doesn't work for me with or without the ref. By default, Kustomize treats remote references as bases that it should clone. To reference a file, you need to provide a URL that directly provides content, i.e. for Github the raw URL. For example: https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/tigera-operator.yaml

This is one of the topics where our docs are fragmented (#4338), and the individual file support seems to only be explained here: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md#remote-files.

/kind support
/kind documentation
/triage resolved
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@KnVerey KnVerey removed kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. kind/support Categorizes issue or PR as a support question. triage/resolved Indicates an issue has been resolved or doesn't need to be resolved.
Projects
None yet
Development

No branches or pull requests

4 participants