Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Introduce config metadata #1049

Merged
merged 7 commits into from
Aug 17, 2017
Merged

Introduce config metadata #1049

merged 7 commits into from
Aug 17, 2017

Conversation

kyessenov
Copy link
Contributor

Step 2 of config update: define config metadata and config wrapper object.

Step 1 was switching to individual kinds for each config type.
Step 3 is to update config proto definitions to utilize the metadata.

@codecov
Copy link

codecov bot commented Aug 17, 2017

Codecov Report

Merging #1049 into master will decrease coverage by 2%.
The diff coverage is 48.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1049      +/-   ##
==========================================
- Coverage   71.74%   69.73%   -2.01%     
==========================================
  Files          47       47              
  Lines        5422     5522     +100     
==========================================
- Hits         3890     3851      -39     
- Misses       1350     1474     +124     
- Partials      182      197      +15
Impacted Files Coverage Δ
model/validation.go 85.94% <ø> (-0.2%) ⬇️
model/conversion.go 32.43% <0%> (-19.75%) ⬇️
test/mock/config.go 0% <0%> (ø) ⬆️
adapter/config/ingress/conversion.go 78.57% <100%> (+1.87%) ⬆️
adapter/config/crd/controller.go 67.78% <42.42%> (-5.47%) ⬇️
adapter/config/aggregate/config.go 46.06% <56.52%> (-7.78%) ⬇️
adapter/config/ingress/controller.go 68.46% <62.96%> (-4.19%) ⬇️
adapter/config/memory/config.go 81.37% <79.68%> (-18.63%) ⬇️
adapter/config/crd/client.go 68.91% <88.23%> (-3.69%) ⬇️
model/config.go 92.66% <90.32%> (+0.13%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4ac7cd...733b8f0. Read the comment docs.

@istio-testing
Copy link
Contributor

@kyessenov: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/pilot-e2e-smoketest.sh 733b8f0 link /test pilot-e2e-smoketest

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. I understand the commands that are listed here.

kyessenov added a commit to istio/istio that referenced this pull request Aug 17, 2017
@kyessenov
Copy link
Contributor Author

validated with istio/istio#571

@kyessenov
Copy link
Contributor Author

ping. PR in istio broke all PRs in pilot until this gets merged.

@@ -47,7 +46,8 @@ type cacheHandler struct {
}

// NewController creates a new Kubernetes controller for CRDs
func NewController(client *Client, resyncPeriod time.Duration) model.ConfigStoreCache {
// Use "" for namespace to listen for all namespace changes
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe add platform neutral equivalent to v1.NamespaceAll?

continue
}

if namespace != "" && namespace != item.GetObjectMeta().Namespace {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: s/""/v1.NamespaceAll

Content: rule,
})
}
if namespace != "" && namespace != ingress.Namespace {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: s/""/v1.NamespaceAll

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

func encodeIngressRuleName(ingressName, ingressNamespace string, ruleNum, pathNum int) string {
return fmt.Sprintf("%s.%s.%d.%d", ingressNamespace, ingressName, ruleNum, pathNum)
func encodeIngressRuleName(ingressName string, ruleNum, pathNum int) string {
return fmt.Sprintf("%s-%d-%d", ingressName, ruleNum, pathNum)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the switch from . to - as a separator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k8s allows only - in names.

// Type is a short configuration name that matches the content message type
Type string
// (e.g. "route-rule")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are type names normalized to non-k8s specific names? e.g. route-rule instead of route-rule.config.istio.io?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, type is route-rule, API is route-rules.config.istio.io/v1alpha2.

Copy link
Member

Choose a reason for hiding this comment

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

can we move to v1beta1 ? claim beta release with alpha api version is odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CRDs may only support one version at a time and mixer already started using v1alpha2

Copy link
Member

Choose a reason for hiding this comment

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

I chatted with @geeknoid. Let's please change everywhere to v1beta1

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we use v1beta1 then by k8s conventions, this API will provide future backwards compatibility, @geeknoid. As long as we're ok taking on the work to maintain it forever, i'm OK changing to v1beta1.

@kyessenov
Copy link
Contributor Author

let me merge this to unblock the others. will address namespace.All in a subsequent PR.

@kyessenov kyessenov merged commit e16f721 into istio:master Aug 17, 2017
out = append(out, rule)
}
}
return out
}

func (i *istioConfigStore) DestinationPolicy(destination string, tags Tags) *proxyconfig.DestinationVersionPolicy {
value, exists, _ := i.Get(DestinationPolicy.Type, destination)
names := strings.Split(destination, ".")
name, namespace := "", ""
Copy link
Member

Choose a reason for hiding this comment

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

what if I have foo.lyft.com as my destination and its in istio global namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't have a global namespace, CRDs are namespaces just like services themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is provisioning the "name" and "namespace" use from CRD like we discussed. It was already happening before under the hoods, this is just making it explicit.

Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

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

overall looks good. dont understand the need to extract namespace from dest policy

@andraxylia
Copy link
Contributor

Is this needed for 0.2? This changes all the code, I will not be able to merge my PR anymore.

@andraxylia
Copy link
Contributor

andraxylia commented Aug 18, 2017

Why did you force merge this when e2e smoke test does not pass?

@kyessenov
Copy link
Contributor Author

It passed on istio/istio against the SHA of this PR. This PR required coordinating changes across two repositories which is iffy each time.

@kyessenov kyessenov deleted the metadata branch August 18, 2017 06:53
rshriram pushed a commit to istio/istio that referenced this pull request Oct 30, 2017
* update configs

* update SHA


Former-commit-id: 96e9872
vbatts pushed a commit to vbatts/istio that referenced this pull request Oct 31, 2017
* update configs

* update SHA


Former-commit-id: 96e9872
mandarjog pushed a commit to istio/istio that referenced this pull request Nov 2, 2017
* update configs

* update SHA


Former-commit-id: 96e9872
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants