diff --git a/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/config/crd/bases/camel.apache.org_integrationplatforms.yaml index c1176fa410..8046048640 100644 --- a/config/crd/bases/camel.apache.org_integrationplatforms.yaml +++ b/config/crd/bases/camel.apache.org_integrationplatforms.yaml @@ -174,6 +174,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object profile: description: TraitProfile represents lists of traits that are enabled for the specific installation/integration @@ -338,6 +350,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object phase: description: IntegrationPlatformPhase -- type: string diff --git a/deploy/crd-integration-platform.yaml b/deploy/crd-integration-platform.yaml index c1176fa410..8046048640 100644 --- a/deploy/crd-integration-platform.yaml +++ b/deploy/crd-integration-platform.yaml @@ -174,6 +174,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object profile: description: TraitProfile represents lists of traits that are enabled for the specific installation/integration @@ -338,6 +350,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object phase: description: IntegrationPlatformPhase -- type: string diff --git a/deploy/olm-catalog/camel-k-dev/1.3.0-snapshot/integrationplatforms.camel.apache.org.crd.yaml b/deploy/olm-catalog/camel-k-dev/1.3.0-snapshot/integrationplatforms.camel.apache.org.crd.yaml index c1176fa410..8046048640 100644 --- a/deploy/olm-catalog/camel-k-dev/1.3.0-snapshot/integrationplatforms.camel.apache.org.crd.yaml +++ b/deploy/olm-catalog/camel-k-dev/1.3.0-snapshot/integrationplatforms.camel.apache.org.crd.yaml @@ -174,6 +174,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object profile: description: TraitProfile represents lists of traits that are enabled for the specific installation/integration @@ -338,6 +350,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object phase: description: IntegrationPlatformPhase -- type: string diff --git a/deploy/resources.go b/deploy/resources.go index a76d4376b7..476792903e 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -133,9 +133,9 @@ var assets = func() http.FileSystem { "/crd-integration-platform.yaml": &vfsgen۰CompressedFileInfo{ name: "crd-integration-platform.yaml", modTime: time.Time{}, - uncompressedSize: 15005, + uncompressedSize: 15857, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x5f\x93\xe2\x36\x12\x7f\xf7\xa7\xe8\x5a\x1e\x36\xa9\x1a\x60\x76\x72\x49\x25\xdc\xc3\xd5\x84\xdd\xad\xe3\xb2\x3b\x33\x35\xb0\x9b\xca\x63\x63\x37\x46\x87\x2c\xf9\x24\x19\x96\x5c\xdd\x77\xbf\x6a\xc9\x06\x03\x36\x30\x33\xc9\x5d\x25\x85\x5e\x66\xb0\xa5\xd6\xaf\xff\xb7\xda\x76\x07\xba\xbf\xdd\x88\x3a\xf0\x41\xc4\xa4\x2c\x25\xe0\x34\xb8\x39\xc1\x6d\x8e\xf1\x9c\x60\xac\x67\x6e\x85\x86\xe0\xbd\x2e\x54\x82\x4e\x68\x05\x5f\xdd\x8e\xdf\x7f\x0d\x85\x4a\xc8\x80\x56\x04\xda\x40\xa6\x0d\x45\x1d\x88\xb5\x72\x46\x4c\x0b\xa7\x0d\xc8\x40\x10\x30\x35\x44\x19\x29\x67\x7b\x00\x63\x22\x4f\xfd\xee\x7e\x32\x1a\xbe\x83\x99\x90\x04\x89\xb0\x61\x11\x25\xb0\x12\x6e\x1e\x75\xc0\xcd\x85\x85\x95\x36\x0b\x98\x69\x03\x98\x24\x82\x37\x46\x09\x42\xcd\xb4\xc9\x02\x0c\x43\x29\x9a\x44\xa8\x14\x62\x9d\xaf\x8d\x48\xe7\x0e\xf4\x4a\x91\xb1\x73\x91\xf7\xa2\x0e\x4c\x98\x8d\xf1\xfb\x0a\x89\x0d\x64\xfd\x9e\x4e\xc3\x2f\xba\x28\x79\xa8\xb1\x5b\x4a\xe1\x0a\x3e\x93\xb1\xbc\xc9\x4d\xef\x3a\xea\xc0\x57\x3c\xe5\x55\x79\xf3\xd5\xd7\x7f\x85\xb5\x2e\x20\xc3\x35\x28\xed\xa0\xb0\x54\xa3\x4c\x5f\x62\xca\x1d\x08\x05\xb1\xce\x72\x29\x50\xc5\xb4\x65\x6b\xb3\x43\x0f\x3c\x00\xa6\xa1\xa7\x0e\x85\x02\xf4\x6c\x80\x9e\xd5\xa7\x01\xba\xa8\x13\x75\xc0\x8f\xb9\x73\xf9\xa0\xdf\x5f\xad\x56\x3d\xf4\x70\x7b\xda\xa4\xfd\x8a\xbb\xfe\x87\xd1\xf0\xdd\xdd\xf8\x5d\xd7\x43\x8e\x3a\xf0\x49\x49\xb2\x16\x0c\xfd\xab\x10\x86\x12\x98\xae\x01\xf3\x5c\x8a\x18\xa7\x92\x40\xe2\x8a\x15\xe7\xb5\xe3\x95\x2e\x14\xac\x8c\x70\x42\xa5\x57\x60\x4b\xad\x47\x9d\x1d\xed\x6c\xc5\x55\xc1\x13\x76\x67\x82\x56\x80\x0a\x5e\xdd\x8e\x61\x34\x7e\x05\x3f\xde\x8e\x47\xe3\xab\xa8\x03\x3f\x8f\x26\x7f\xbf\xff\x34\x81\x9f\x6f\x1f\x1f\x6f\xef\x26\xa3\x77\x63\xb8\x7f\x84\xe1\xfd\xdd\xdb\xd1\x64\x74\x7f\x37\x86\xfb\xf7\x70\x7b\xf7\x0b\xfc\x34\xba\x7b\x7b\x05\x24\xdc\x9c\x0c\xd0\x97\xdc\x30\x7e\x6d\x40\xb0\x20\x29\x61\x9d\x56\x06\x54\x01\x60\xfb\xe0\xdf\x36\xa7\x58\xcc\x44\x0c\x12\x55\x5a\x60\x4a\x90\xea\x25\x19\xc5\xe6\x91\x93\xc9\x84\x65\x75\x5a\x40\x95\x44\x1d\x90\x22\x13\xce\x5b\x91\x3d\x64\x8a\xb7\xf9\x2d\x7d\x2b\xc2\x5c\x94\xe6\x34\x00\xcc\x05\x7d\x71\xa4\x3c\x9a\xde\xe2\x7b\xdb\x13\xba\xbf\x7c\x33\x25\x87\x6f\xa2\x85\x50\xc9\x00\x86\x85\x75\x3a\x7b\x24\xab\x0b\x13\xd3\x5b\x9a\x09\xe5\xcd\x3f\xca\xc8\x61\x82\x0e\x07\x11\x80\xc4\x29\x49\xcb\xff\x01\x6b\x75\x00\xaf\x62\xcc\x48\x76\x17\xaf\x22\x00\x54\x4a\x97\xec\x85\x19\xde\x2f\xb5\x94\x64\xba\x29\xa9\xde\xa2\x98\xd2\xb4\x10\x32\x21\xe3\xb7\xaf\xc0\x2d\xaf\x7b\xd7\xbd\xeb\xee\xcd\xf5\xcd\xf5\xf5\xb7\x37\xdf\xbf\xb9\xf9\xf6\x87\x9b\x1f\xba\xdf\xc6\xd7\xf1\x77\x48\xdf\x4c\xbf\xfb\xcb\x34\x02\x88\x0d\x79\xd2\x13\x91\x91\x75\x98\xe5\x03\x50\x85\x94\x11\x80\xc2\x8c\x06\x20\x94\xa3\xd4\xf8\x29\xb9\x44\xc7\xfe\x6a\x7b\x1e\x5c\xcd\x6a\x23\xd6\x17\x63\xdb\xfa\xf6\x83\xe1\x95\x66\xa8\x65\x91\x05\xdc\x5d\xf8\xc7\xf8\xfe\xee\x01\xdd\x7c\x00\x3d\xeb\xd0\x15\xb6\x97\xcf\xd1\x92\xe7\x29\x21\x1b\x1b\x91\x3b\x8f\x9c\x5d\xbd\xb6\x31\x54\x3b\xc3\x76\x7e\x40\xf7\xb0\xf9\xed\xd6\x39\x0d\x80\x6d\x57\xa5\x11\x40\x6a\x74\x91\x0f\xe0\x00\x68\x58\x58\xc9\x11\x1d\xa5\xda\x88\xea\x77\x17\x16\x3c\xbf\xfc\x3f\xde\xfc\x1f\x14\x39\xda\x02\x7a\x28\xf1\xf8\xbb\x52\x58\xf7\x53\xdb\x8c\x0f\xc2\x3a\x3f\x2b\x97\x85\x41\xd9\x2c\x4f\x3f\xc1\xce\xb5\x71\x77\x5b\x70\x5d\x10\x79\xb8\x21\x54\x5a\x48\x34\x8d\x6b\x23\x00\x1b\x6b\x66\xdd\x2f\xcd\x31\xa6\x84\xaf\x15\x53\x53\x5a\x5c\x49\x2e\x08\x7c\x00\xff\xfe\x4f\x04\xb0\x44\x29\x42\xf4\x0f\x37\x75\x4e\xea\xf6\x61\xf4\xf9\x9b\x71\x3c\xa7\x0c\xc3\xc5\x3d\x9d\x34\x30\xc7\xf1\x82\x3d\x2d\xac\xda\x38\x6f\x2b\x8b\x3c\x6e\x1f\x46\xe5\xff\xb9\xd1\x39\x19\xb7\x91\x7e\xb0\xfd\x8d\x6f\x6d\xae\xed\xe1\x78\xcd\x40\xcb\x70\x9e\xb0\x37\x51\x00\x51\x9a\x3d\x25\x60\x03\x1c\x1f\x7a\x05\x47\x4c\x8e\x3c\xa4\x82\x0b\xd5\xc8\x02\x4f\x41\x05\x7a\xfa\x4f\x8a\x5d\x0f\xc6\x64\x98\x08\x6b\xa2\x90\x09\x7b\xd9\x92\x8c\x03\x43\xb1\x4e\x95\xf8\x75\x43\xd9\x56\x49\x55\xa2\xa3\x52\xbd\xd5\xf0\x46\xcf\xa9\x6d\x89\xb2\xa0\x2b\x0e\x50\x3e\x2b\x18\xe2\x3d\xa0\x50\x35\x6a\x7e\x8a\xed\xc1\x47\x6d\xc8\xa7\xc2\x81\xcf\x09\x76\xd0\xef\xa7\xc2\x55\xd1\x24\xd6\x59\x56\x28\xe1\xd6\xfd\x5a\x3a\xb6\xfd\x84\x96\x24\xfb\x56\xa4\x5d\x34\xf1\x5c\x38\x8a\x5d\x61\xa8\x8f\xb9\xe8\x7a\xe0\xca\xc7\x8b\x5e\x96\x74\x36\x86\xf0\xba\x86\x74\xcf\x5d\xc2\xf0\x76\xde\x2a\x77\xb6\x71\xd6\x38\x96\xcb\x02\xfe\xad\x78\xf9\x12\x4b\xe5\xf1\xdd\x78\x02\xd5\xa6\x5e\x05\xbb\x32\xf7\xd2\xde\x2e\xb3\x5b\xc1\xb3\xa0\x84\x9a\xf9\xf8\xcd\x09\xd8\xe8\xcc\x53\x24\x95\xe4\x5a\x28\xe7\x7f\xc4\x52\x90\xda\x15\xba\x2d\xa6\x99\x70\x21\x37\x92\x75\xac\x9f\x1e\x0c\x7d\xd8\x84\x29\x41\x91\x27\xe8\x28\xe9\xc1\x48\xc1\x90\x9d\x7a\x88\x9c\xb1\x7f\x67\xb1\xb3\x84\x6d\x97\x45\x7a\x5a\xf0\xf5\x54\xb0\x3b\x31\x48\x6b\x73\xb9\x8a\xb3\x8d\x1a\x6a\xf0\xd0\x71\x4e\xf1\x8e\x97\x24\x64\x7d\xf5\xc0\xe1\x80\xd8\xfe\xdb\xa2\x5a\xbb\x8f\xf2\xf0\xe9\x66\xf7\xd2\x69\x30\x3f\xf2\x22\x8f\x88\x45\x8a\x42\xd9\x6d\x60\x37\xc4\xce\x94\xec\x51\x2c\x37\xaa\xd7\x89\x7b\x33\xda\x00\xfa\xb5\x68\x69\x94\x61\x4a\x87\xb7\x5a\xf4\xb0\xb3\xeb\xd8\x19\xce\x0f\xeb\xa6\xd5\xe7\xb1\x5a\x12\x00\x52\x45\x46\xfc\xbf\x05\x94\xd2\xd7\x3f\xbe\x84\x6e\xe0\x77\xcb\xb3\x0d\xab\x05\xd9\xa7\xa2\x67\x6b\x7e\x30\xfa\xcb\x7a\x4c\xb1\x21\xf7\x64\xee\x17\xa8\xc4\x42\x7b\x16\x86\x9c\x38\xdb\x09\x4c\xb5\x96\x84\xfb\x3a\x01\xc8\x70\x49\xea\xa4\xdc\x3e\xf2\x2c\x6f\x0f\xdd\x6e\xc3\xdc\x63\xaa\xe5\x21\x75\x8c\xf2\x91\x72\x6d\x85\xd3\xa6\x51\x4d\x27\x59\xe5\x61\xc9\x71\xec\x6a\xd9\x65\x0f\xf3\x67\x8e\x79\xe3\x10\xda\x1a\x51\x9f\x83\x1c\x42\x0d\x37\x13\xe9\x47\xcc\x7f\xa2\xf5\x23\xcd\xda\x27\xee\x01\x18\x93\xa4\xd8\x71\x14\x5e\x90\x3f\x5e\x20\x0c\x2b\x52\xbd\x23\x44\xce\xc1\xc4\x63\x41\xad\x92\x6c\xc4\xc3\xa5\x1a\x23\x71\x1a\xac\x87\x76\x0c\x04\x9c\xa3\x8f\x6a\xf8\x0a\xef\x29\x50\x5e\x73\x09\x54\x9d\xb8\x0c\xcd\xc8\x90\x72\x8d\x71\x9e\x2b\x66\xa3\xc8\x91\x0f\xf5\x89\x8e\x2d\x47\x79\x3e\xe9\xd9\x3e\x9f\x33\x96\x82\x56\x7d\x3e\xb0\x0a\x95\x76\xf9\xb4\xd7\x0d\x71\xd8\xf6\x7d\xf5\xd8\xef\xf8\x3f\x27\xb0\x01\x4c\xee\xdf\xde\x0f\xe0\x36\x49\x40\xfb\x33\x50\x61\x69\x56\x48\x98\x09\x92\x89\xed\xd5\x8a\x9d\x2b\x9f\x7a\xaf\xa0\x10\xc9\xdf\x5e\xff\x56\xf2\xd3\x79\xa8\xc4\x9f\x24\xc3\xb1\x3f\x78\xad\x61\x35\x27\x0f\x99\x45\xb9\xb1\x2f\x7f\x78\x73\x96\xf5\x7d\x92\xf7\xac\xb0\x3e\xf9\x86\xe4\xd3\x1c\xe8\xf6\x99\x6a\x0b\x27\xdb\x51\x9d\x7e\x8f\xf1\xd4\x3d\x81\xaf\x31\xb1\xee\x0f\xeb\x43\xe7\xcb\x7d\x33\xd0\xf9\x7f\x3a\x66\xe9\x0f\x01\xc8\xd6\x4d\x7d\x75\xd5\x03\xf8\x58\xd8\x76\x29\x54\x63\x4a\x80\xe1\xd0\x50\xd1\x59\xd0\xfa\xe2\xe8\x9b\xf1\x27\x71\xf4\x50\x2f\xd4\xbc\xdc\x7b\xf1\x39\xd6\xf1\x87\xf4\xf2\x93\x53\x9c\xc8\x48\x17\x8d\x05\x14\x9c\x56\xd0\x51\xf2\x39\xdb\x83\x75\xa4\xdc\x67\x2d\x8b\x8c\x86\x12\x45\xf6\xe4\x4a\xed\x78\xec\xa8\x37\x63\x8e\xc7\x98\x17\x71\x52\x4c\xa5\xb0\xf3\x17\x57\xcb\x0f\xbb\x74\x6a\x45\x73\x23\xe4\xbd\x42\xba\x82\xf1\x82\xb2\xd9\x50\x2a\xac\x6b\x2e\x24\x4f\x71\xf0\x58\xae\x7d\x7e\x35\x8b\x49\x62\xc8\xb6\xe6\x80\x93\xc1\x20\xc6\x67\x2f\x15\xca\x52\x5c\x98\xd6\x18\x7c\xda\x6d\xb5\x49\x51\x89\x5f\x6b\x1d\xa5\x67\xc0\xb0\xad\xa7\x95\x33\x96\x1f\x35\x51\x53\x28\x76\xe5\x07\xa3\x97\x22\x21\x73\x52\xc1\x8f\xbb\xf3\x9b\x15\x7a\xdc\x96\x02\x85\x86\x5e\xd6\x59\xcb\x8f\x04\x9e\x23\xeb\x5a\x65\x10\xcb\xc2\xba\x43\xbe\x4f\x19\xf5\x30\x2c\xab\xba\x7c\x9c\xb9\x38\xe9\x6a\x13\xcf\xc9\xbb\xd9\xe1\x71\x7c\xb3\x97\x5f\x91\xd7\xfa\x84\x42\x59\x87\x52\x12\x1f\xe6\x9d\x6e\x44\xde\xc0\x54\x38\x25\x15\xa6\xd1\xb2\x84\xa3\xac\xc1\x61\x76\xd8\x1a\xd6\x09\xb4\x79\xe7\x71\xdf\xf4\xe0\x9e\x13\x36\x7d\x7f\xec\x19\x2b\xdb\xd3\x5f\xd7\x2f\x6c\xb8\xec\xb7\x3a\x34\xa3\x76\xa7\x08\xb7\xd0\x18\xdc\x4d\xa2\xb9\xd1\x33\x21\x0f\x50\xef\x56\x96\x06\x85\x7b\x08\x13\x6b\x7d\x3c\xdf\x08\xb7\xbe\x2c\xe3\x09\x6c\x34\xe8\x00\x0d\x01\x29\x9c\xca\x86\xea\xe0\xe0\x69\x4f\x69\x24\x5e\x59\xfd\x5a\x1b\xf9\x5c\x73\xd9\xeb\x79\xb7\xe0\x6f\x8c\xdf\xe5\xc2\x27\xb6\xa7\x36\x1b\x9e\xeb\x8a\x41\x34\xfb\xf0\xce\xcb\xd4\x3b\x4c\xdc\x06\x35\xec\xe2\xf5\xfd\xd1\xba\xc5\x87\x43\x88\xdf\xf4\x89\x56\x7f\xd4\xf3\x4e\x30\x09\x27\x8c\x78\x87\xf6\xd3\xad\xf6\xe0\x56\x73\xab\x34\x3c\xf0\x88\x5a\xe4\xd7\xd4\x2c\xf5\x2b\x76\xda\xa5\x7a\x6a\xc9\x2c\x2f\xfd\xd2\x4b\xbf\xf4\xd2\x2f\xad\xc6\xa5\x5f\x5a\x1f\x97\x7e\xe9\xa5\x8d\x72\xe9\x97\x5e\xfa\xa5\x3b\xe3\xd2\x2f\x3d\x3e\xfe\x24\x8e\x7e\xe9\x97\xee\x4d\xb8\xf4\x4b\xcf\xe0\xe4\xd2\x2f\xbd\xf4\x4b\x2f\xfd\xd2\xc6\x1d\x2f\xfd\xd2\x97\xf7\x4b\x43\x0c\x3b\x70\x8c\x73\x9a\xa5\x4d\x3c\x55\x04\xcb\x99\xd3\xb2\x31\xb2\xe9\x87\x60\x83\xcc\x37\x2f\xff\xa1\x03\x84\x98\x8c\x7f\x23\xde\xbf\xc2\x77\x58\x04\x1d\x77\x74\x89\xd6\x4d\x0c\x2a\x2b\xaa\x97\x94\x9b\x0d\x7e\x87\x8f\x0f\x68\x9d\xb7\x89\xaa\x21\x56\xb2\xe0\x36\x84\x28\x09\x6f\x17\x6a\x45\x65\xa3\xa8\xcd\x8d\x34\xa0\xf2\x45\x4a\x73\xf9\x16\xfa\x2c\x03\x48\xd0\x51\x97\xb7\x7c\x4e\xbe\x60\x26\x3f\xf9\x97\x14\xcf\x64\x70\xe2\x5f\x3e\xdd\x32\x29\x6c\x8d\xcb\x15\xda\xcd\x2b\x8f\xbf\x1f\xe6\x8c\xac\x6d\x69\x15\x1d\x74\x2a\xe7\x45\x86\x0a\x0c\x61\xe2\xbf\x55\x28\x97\x82\x50\x89\x88\xd1\xbf\x37\x9a\x90\x43\x21\x2d\xe0\x54\x17\xad\xe5\xc7\x9c\x6a\x1a\x6c\x66\xed\x04\x68\x43\x68\xdb\x22\xee\x81\x80\xc3\xe4\x4d\x93\x7a\x23\xe0\xd7\xb6\x94\xfd\xcb\xb0\x1c\xf6\x27\x5b\xb0\x94\x6d\xc9\xb2\x7c\xdf\xc0\xb8\x0a\x1f\xeb\xcc\x60\x62\x0a\xba\x82\xf7\x28\x2d\x5d\xc1\x27\xb5\x50\x7a\xf5\x3c\x44\xed\x0f\x3a\x76\x65\xb3\xce\xfd\xbe\xf5\x17\xf4\x37\xa8\x9e\xb1\xf1\xb1\x4e\x71\x8b\x6f\xb6\x3c\x07\x79\xc6\xf3\x8e\xcb\x03\xa6\x9d\xf1\x3f\x78\xc0\x34\x47\x7b\xfc\xf1\x52\x43\x16\xf2\x9f\x79\x1c\x0a\xb6\x95\xc9\xcb\x53\xac\xcb\x53\x2c\x3f\xfe\x48\x4f\xb1\xa0\xfa\x84\x65\x7f\xb3\x16\x43\x69\x20\xb3\x77\x69\xfb\x25\xd8\x9b\xed\xaf\xf2\x5b\xac\xf0\xfd\x94\xbf\xc1\x47\x09\xb3\xa4\x64\x00\xce\x94\x4e\x6e\x9d\x36\x9c\xdd\xc3\x95\xff\x06\x00\x00\xff\xff\x60\xba\x2a\x05\x9d\x3a\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\xdf\x93\xe2\x36\xf2\x7f\xf7\x5f\xd1\xb5\x3c\x6c\x52\x35\xc0\xec\xe4\x9b\x54\xc2\xf7\xe1\x6a\xc2\xee\xd6\x71\xbb\x3b\x33\x35\xb0\x9b\xca\x63\x63\x37\x46\x87\x2c\xf9\x24\x19\x96\x5c\xdd\xff\x7e\xd5\x92\x0d\x06\x6c\x60\x66\x92\xba\x4a\x0a\xbd\xcc\x60\xab\x5b\x9f\xfe\xa9\x56\xdb\xee\x40\xf7\xf7\x1b\x51\x07\x3e\x8a\x98\x94\xa5\x04\x9c\x06\x37\x27\xb8\xcd\x31\x9e\x13\x8c\xf5\xcc\xad\xd0\x10\xbc\xd7\x85\x4a\xd0\x09\xad\xe0\x9b\xdb\xf1\xfb\x6f\xa1\x50\x09\x19\xd0\x8a\x40\x1b\xc8\xb4\xa1\xa8\x03\xb1\x56\xce\x88\x69\xe1\xb4\x01\x19\x18\x02\xa6\x86\x28\x23\xe5\x6c\x0f\x60\x4c\xe4\xb9\xdf\xdd\x4f\x46\xc3\x77\x30\x13\x92\x20\x11\x36\x10\x51\x02\x2b\xe1\xe6\x51\x07\xdc\x5c\x58\x58\x69\xb3\x80\x99\x36\x80\x49\x22\x78\x61\x94\x20\xd4\x4c\x9b\x2c\xc0\x30\x94\xa2\x49\x84\x4a\x21\xd6\xf9\xda\x88\x74\xee\x40\xaf\x14\x19\x3b\x17\x79\x2f\xea\xc0\x84\xc5\x18\xbf\xaf\x90\xd8\xc0\xd6\xaf\xe9\x34\xfc\xaa\x8b\x52\x86\x9a\xb8\xa5\x16\xae\xe0\x0b\x19\xcb\x8b\xdc\xf4\xae\xa3\x0e\x7c\xc3\x53\x5e\x95\x37\x5f\x7d\xfb\xff\xb0\xd6\x05\x64\xb8\x06\xa5\x1d\x14\x96\x6a\x9c\xe9\x6b\x4c\xb9\x03\xa1\x20\xd6\x59\x2e\x05\xaa\x98\xb6\x62\x6d\x56\xe8\x81\x07\xc0\x3c\xf4\xd4\xa1\x50\x80\x5e\x0c\xd0\xb3\xfa\x34\x40\x17\x75\xa2\x0e\xf8\x31\x77\x2e\x1f\xf4\xfb\xab\xd5\xaa\x87\x1e\x6e\x4f\x9b\xb4\x5f\x49\xd7\xff\x38\x1a\xbe\xbb\x1b\xbf\xeb\x7a\xc8\x51\x07\x3e\x2b\x49\xd6\x82\xa1\x7f\x15\xc2\x50\x02\xd3\x35\x60\x9e\x4b\x11\xe3\x54\x12\x48\x5c\xb1\xe1\xbc\x75\xbc\xd1\x85\x82\x95\x11\x4e\xa8\xf4\x0a\x6c\x69\xf5\xa8\xb3\x63\x9d\xad\xba\x2a\x78\xc2\xee\x4c\xd0\x0a\x50\xc1\xab\xdb\x31\x8c\xc6\xaf\xe0\xe7\xdb\xf1\x68\x7c\x15\x75\xe0\x97\xd1\xe4\xef\xf7\x9f\x27\xf0\xcb\xed\xe3\xe3\xed\xdd\x64\xf4\x6e\x0c\xf7\x8f\x30\xbc\xbf\x7b\x3b\x9a\x8c\xee\xef\xc6\x70\xff\x1e\x6e\xef\x7e\x85\x0f\xa3\xbb\xb7\x57\x40\xc2\xcd\xc9\x00\x7d\xcd\x0d\xe3\xd7\x06\x04\x2b\x92\x12\xb6\x69\xe5\x40\x15\x00\xf6\x0f\xfe\x6d\x73\x8a\xc5\x4c\xc4\x20\x51\xa5\x05\xa6\x04\xa9\x5e\x92\x51\xec\x1e\x39\x99\x4c\x58\x36\xa7\x05\x54\x49\xd4\x01\x29\x32\xe1\xbc\x17\xd9\x43\xa1\x78\x99\xdf\x33\xb6\x22\xcc\x45\xe9\x4e\x03\xc0\x5c\xd0\x57\x47\xca\xa3\xe9\x2d\x7e\xb4\x3d\xa1\xfb\xcb\x37\x53\x72\xf8\x26\x5a\x08\x95\x0c\x60\x58\x58\xa7\xb3\x47\xb2\xba\x30\x31\xbd\xa5\x99\x50\xde\xfd\xa3\x8c\x1c\x26\xe8\x70\x10\x01\x48\x9c\x92\xb4\xfc\x1f\xb0\x55\x07\xf0\x2a\xc6\x8c\x64\x77\xf1\x2a\x02\x40\xa5\x74\x29\x5e\x98\xe1\xe3\x52\x4b\x49\xa6\x9b\x92\xea\x2d\x8a\x29\x4d\x0b\x21\x13\x32\x7e\xf9\x0a\xdc\xf2\xba\x77\xdd\xbb\xee\xde\x5c\xdf\x5c\x5f\x7f\x7f\xf3\xe3\x9b\x9b\xef\x7f\xba\xf9\xa9\xfb\x7d\x7c\x1d\xff\x80\xf4\xdd\xf4\x87\xff\x9b\x46\x00\xb1\x21\xcf\x7a\x22\x32\xb2\x0e\xb3\x7c\x00\xaa\x90\x32\x02\x50\x98\xd1\x00\x84\x72\x94\x1a\x3f\x25\x97\xe8\x38\x5e\x6d\xcf\x83\xab\x79\x6d\xc4\xf6\x62\x6c\xdb\xd8\x7e\x30\x4c\x69\x86\x5a\x16\x59\xc0\xdd\x85\x7f\x8c\xef\xef\x1e\xd0\xcd\x07\xd0\xb3\x0e\x5d\x61\x7b\xf9\x1c\x2d\x79\x99\x12\xb2\xb1\x11\xb9\xf3\xc8\x39\xd4\x6b\x0b\x43\xb5\x32\x6c\xe7\x07\x74\x0f\x9b\xdf\x6e\x9d\xd3\x00\xd8\x77\x55\x1a\x01\xa4\x46\x17\xf9\x00\x0e\x80\x06\xc2\x4a\x8f\xe8\x28\xd5\x46\x54\xbf\xbb\xb0\xe0\xf9\xe5\xff\xf1\xe6\xff\x60\xc8\xd1\x16\xd0\x43\x89\xc7\xdf\x95\xc2\xba\x0f\x6d\x33\x3e\x0a\xeb\xfc\xac\x5c\x16\x06\x65\xb3\x3e\xfd\x04\x3b\xd7\xc6\xdd\x6d\xc1\x75\x41\xe4\xe1\x86\x50\x69\x21\xd1\x34\xd2\x46\x00\x36\xd6\x2c\xba\x27\xcd\x31\xa6\x84\xaf\x15\x53\x53\x7a\x5c\xc9\x2e\x28\x7c\x00\xff\xfe\x4f\x04\xb0\x44\x29\x42\xf6\x0f\x37\x75\x4e\xea\xf6\x61\xf4\xe5\xbb\x71\x3c\xa7\x0c\xc3\xc5\x3d\x9b\x34\x08\xc7\xf9\x82\x23\x2d\x50\x6d\x82\xb7\x55\x44\x1e\xb7\x0f\xa3\xf2\xff\xdc\xe8\x9c\x8c\xdb\x68\x3f\xf8\xfe\x26\xb6\x36\xd7\xf6\x70\xbc\x66\xa0\x65\x3a\x4f\x38\x9a\x28\x80\x28\xdd\x9e\x12\xb0\x01\x8e\x4f\xbd\x82\x33\x26\x67\x1e\x52\x21\x84\x6a\x6c\x81\xa7\xa0\x02\x3d\xfd\x27\xc5\xae\x07\x63\x32\xcc\x84\x2d\x51\xc8\x84\xa3\x6c\x49\xc6\x81\xa1\x58\xa7\x4a\xfc\xb6\xe1\x6c\xab\x4d\x55\xa2\xa3\xd2\xbc\xd5\xf0\x4e\xcf\x5b\xdb\x12\x65\x41\x57\x9c\xa0\xfc\xae\x60\x88\xd7\x80\x42\xd5\xb8\xf9\x29\xb6\x07\x9f\xb4\x21\xbf\x15\x0e\xfc\x9e\x60\x07\xfd\x7e\x2a\x5c\x95\x4d\x62\x9d\x65\x85\x12\x6e\xdd\xaf\x6d\xc7\xb6\x9f\xd0\x92\x64\xdf\x8a\xb4\x8b\x26\x9e\x0b\x47\xb1\x2b\x0c\xf5\x31\x17\x5d\x0f\x5c\xf9\x7c\xd1\xcb\x92\xce\xc6\x11\x5e\xd7\x90\xee\x85\x4b\x18\xde\xcf\x5b\xf5\xce\x3e\xce\x16\xc7\x92\x2c\xe0\xdf\xaa\x97\x2f\xb1\x56\x1e\xdf\x8d\x27\x50\x2d\xea\x4d\xb0\xab\x73\xaf\xed\x2d\x99\xdd\x2a\x9e\x15\x25\xd4\xcc\xe7\x6f\xde\x80\x8d\xce\x3c\x47\x52\x49\xae\x85\x72\xfe\x47\x2c\x05\xa9\x5d\xa5\xdb\x62\x9a\x09\x17\xf6\x46\xb2\x8e\xed\xd3\x83\xa1\x4f\x9b\x30\x25\x28\xf2\x04\x1d\x25\x3d\x18\x29\x18\x72\x50\x0f\x91\x77\xec\x3f\x58\xed\xac\x61\xdb\x65\x95\x9e\x56\x7c\x7d\x2b\xd8\x9d\x18\xb4\xb5\xb9\x5c\xe5\xd9\x46\x0b\x35\x44\xe8\x38\xa7\x78\x27\x4a\x12\xb2\xbe\x7a\xe0\x74\x40\xec\xff\x6d\x59\xad\x3d\x46\x79\xf8\xed\x66\xf7\xd2\x69\x30\x3f\x33\x91\x47\xc4\x2a\x45\xa1\xec\x36\xb1\x1b\xe2\x60\x4a\xf6\x38\x96\x0b\xd5\xeb\xc4\xbd\x19\x6d\x00\x3d\x2d\x5a\x1a\x65\x98\xd2\xe1\xad\x16\x3b\xec\xac\x3a\x76\x86\xf7\x87\x75\x13\xf5\x79\xa2\x96\x0c\x80\x54\x91\x11\xff\x6f\x01\xa5\xf4\xf5\x8f\x2f\xa1\x1b\xe4\xdd\xca\x6c\x03\xb5\x20\xfb\x54\xf4\xec\xcd\x0f\x46\x7f\x5d\x8f\x29\x36\xe4\x9e\x2c\xfd\x02\x95\x58\x68\x2f\xc2\x90\x37\xce\x76\x06\x53\xad\x25\xe1\xbe\x4d\x00\x32\x5c\x92\x3a\xa9\xb7\x4f\x3c\xcb\xfb\x43\xb7\xdb\x30\xf7\x98\x69\x79\x48\x1d\xa3\x7c\xa4\x5c\x5b\xe1\xb4\x69\x34\xd3\x49\x51\x79\x58\x72\x9c\xbb\x5a\x56\xd9\xc3\xfc\x85\x73\xde\x38\xa4\xb6\x46\xd4\xe7\x20\x87\x50\xc3\xcd\x44\xfa\x09\xf3\x0f\xb4\x7e\xa4\x59\xfb\xc4\x3d\x00\x63\x92\x14\x3b\xce\xc2\x0b\xf2\xc7\x0b\x84\x61\xc5\xaa\x77\x84\xc9\x39\x98\x78\x2c\xa8\x55\x93\x8d\x78\xb8\x54\x63\x24\x4e\x83\xf5\xd0\x8e\x81\x80\x73\xec\x51\x0d\x5f\xe1\x3d\x05\xca\x6b\x2e\x81\xaa\x13\x97\xa1\x19\x19\x52\xae\x31\xcf\x73\xc5\x6c\x14\x39\xf2\xa9\x3e\xd1\xb1\xe5\x2c\xcf\x27\x3d\xdb\xe7\x73\xc6\x52\xd0\xaa\xcf\x07\x56\xa1\xd2\x2e\x9f\xf6\xba\x21\x0f\xdb\xbe\xaf\x1e\xfb\x1d\xff\xe7\x04\x36\x80\xc9\xfd\xdb\xfb\x01\xdc\x26\x09\x68\x7f\x06\x2a\x2c\xcd\x0a\x09\x33\x41\x32\xb1\xbd\x5a\xb1\x73\xe5\xb7\xde\x2b\x28\x44\xf2\xb7\xd7\xbf\x97\xfe\x74\x1e\x2a\xf1\x27\xe9\x70\xec\x0f\x5e\x6b\x58\xcd\xc9\x43\x66\x55\x6e\xfc\xcb\x1f\xde\x9c\x65\x7b\x9f\x94\x3d\x2b\xac\xdf\x7c\xc3\xe6\xd3\x9c\xe8\xf6\x85\x6a\x4b\x27\xdb\x51\x9d\x7e\x8f\xc9\xd4\x3d\x81\xaf\x71\x63\xdd\x1f\xd6\xa7\xce\x97\xc7\x66\xe0\xf3\xbf\x0c\xcc\x32\x1e\x02\x90\x6d\x98\xfa\xea\xaa\x07\xf0\xa9\xb0\xed\x5a\xa8\xc6\x94\x00\xc3\xa1\xa1\xe2\xb3\xa0\xf5\x25\xd0\x37\xe3\x2f\x12\xe8\xa1\x5e\xa8\x45\xb9\x8f\xe2\x73\xbc\xe3\x4f\x19\xe5\x27\xa7\x38\x91\x91\x2e\x1a\x0b\x28\x38\x6d\xa0\xa3\xec\x73\xf6\x07\xeb\x48\xb9\x2f\x5a\x16\x19\x0d\x25\x8a\xec\xc9\x95\xda\xf1\xdc\x51\x6f\xc6\x1c\xcf\x31\x2f\x92\xa4\x98\x4a\x61\xe7\x2f\xae\x96\x1f\x76\xf9\xd4\x8a\xe6\x46\xc8\x7b\x85\x74\x05\xe3\x05\x65\xb3\xa1\x54\x58\xd7\x5c\x48\x9e\x92\xe0\xb1\xa4\x7d\x7e\x35\x8b\x49\x62\xc8\xb6\xee\x01\x27\x93\x41\x8c\xcf\x26\x15\xca\x52\x5c\x98\xd6\x1c\x7c\x3a\x6c\xb5\x49\x51\x89\xdf\x6a\x1d\xa5\x67\xc0\xb0\xad\xa7\x95\x33\xc8\x8f\xba\xa8\x29\x14\x87\xf2\x83\xd1\x4b\x91\x90\x39\x69\xe0\xc7\xdd\xf9\xcd\x06\x3d\xee\x4b\x81\x43\x43\x2f\xeb\x2c\xf2\x23\x89\xe7\x08\x5d\xab\x0e\x62\x59\x58\x77\x28\xf7\x29\xa7\x1e\x06\xb2\xaa\xcb\xc7\x3b\x17\x6f\xba\xda\xc4\x73\xf2\x61\x76\x78\x1c\xdf\xac\xe5\x29\xf2\x5a\x9f\x50\x28\xeb\x50\x4a\xe2\xc3\xbc\xd3\x8d\xc8\x1b\x84\x0a\xa7\xa4\xc2\x34\x7a\x96\x70\x94\x35\x04\xcc\x8e\x58\xc3\x3a\x83\xb6\xe8\x3c\x1e\x9b\x1e\xdc\x73\xd2\xa6\xef\x8f\x3d\x83\xb2\x7d\xfb\xeb\x7a\xc2\x86\xcb\x7e\xa9\x43\x37\x6a\x0f\x8a\x70\x0b\x8d\xc1\xdd\x4d\xd4\x37\xc0\x0f\xa3\xf0\x94\xab\x7c\x08\x64\xcd\x0a\x3e\xa6\x5e\x53\x9d\xdf\x5b\x94\xdf\x62\xe3\x27\x60\xda\x76\x08\xda\x93\xf3\x39\x55\x78\x61\x44\x7b\x3d\x72\x32\xb9\x9d\xa8\x35\xda\xcc\x71\x84\x30\x37\x7a\x26\xe4\x81\x7f\xed\x9e\x01\x0c\x0a\xf7\x10\x26\xd6\x3a\xae\xfe\x91\x85\xf5\x05\x34\x4f\xe0\xf0\x46\x07\x68\x08\x48\xe1\x54\x36\xd4\x71\x07\xcf\xe5\xca\x70\xf6\x0a\xef\xd7\x1a\xfe\xe7\x06\xf6\xde\xd3\x89\x16\xfc\x8d\x3b\x6d\x49\xf8\xc4\x46\xe2\x66\xc1\x73\xf5\x1b\x54\xb3\x0f\xef\xbc\x9a\x6a\x47\x88\xdb\x60\x86\x5d\xbc\xbe\x93\x5d\xcf\x4d\xe1\xb8\xe8\x17\x7d\x62\x7e\x3a\x9a\x23\x4f\x08\x09\x27\xd2\xcd\x0e\xef\xa7\xe7\x97\x83\x5b\xcd\x4d\xed\xf0\x68\x2a\x6a\xd1\x5f\x53\x5b\xdb\x53\xec\x34\xb6\xf5\xd4\x92\x59\x5e\x3a\xdb\x97\xce\xf6\xa5\xb3\x5d\x8d\x4b\x67\xbb\x3e\x2e\x9d\xed\x4b\xc3\xeb\xd2\xd9\xbe\x74\xb6\x77\xc6\xa5\xb3\x7d\x7c\xfc\x45\x02\xfd\xd2\xd9\xde\x9b\x70\xe9\x6c\x9f\x21\xc9\xa5\xb3\x7d\xe9\x6c\x5f\x3a\xdb\x8d\x2b\x5e\x3a\xdb\x2f\xef\x6c\x87\x1c\x76\x10\x18\xe7\xb4\xb5\x9b\x64\xaa\x18\x96\x33\xa7\x65\x63\x64\xd3\x0f\xc1\x06\x9d\x6f\x5e\xd3\x44\x07\x08\x31\x19\xff\xed\x82\x7f\xd9\xf2\xb0\x08\x3a\x1e\xe8\x12\xad\x9b\x18\x54\x56\x54\xaf\x93\x9f\xd1\xb6\xfd\x88\xd6\x79\x9f\xa8\x1a\x62\xa5\x08\x6e\xc3\x88\x92\xf0\x1e\xa8\x56\x54\x36\x8a\xda\xc2\x48\x03\x2a\x5f\xa4\x34\x97\x6f\xa1\xcf\x32\x80\x04\x1d\x75\x79\xc9\xe7\xec\x17\x2c\xe4\x67\xff\x3a\xe9\x99\x02\x4e\xfc\x6b\xc2\x5b\x21\x85\xad\x49\xb9\x42\xbb\x79\x39\xf5\x8f\xc3\x9c\x91\xb5\x2d\xad\xa2\x83\x4e\xe5\xbc\xc8\x50\x81\x21\x4c\xfc\x57\x25\x25\x29\x08\x95\x88\x18\xfd\x1b\xbe\x09\x39\x14\xd2\x02\x4e\x75\xd1\x5a\x7e\xcc\xa9\x66\xc1\x66\xd1\x4e\x80\x36\x84\xb6\x2d\xe3\x1e\x28\x38\x4c\xde\x34\xa9\x37\x0a\x7e\x6d\x4b\xdd\xbf\x0c\xcb\x61\x7f\xb2\x05\x4b\xd9\x96\x2c\xcb\xf7\x0d\x8c\xab\xf0\x59\xd5\x0c\x26\xa6\xa0\x2b\x78\x8f\xd2\xd2\x15\x7c\x56\x0b\xa5\x57\xcf\x43\xd4\xfe\x48\x6a\x57\x37\xeb\xdc\xaf\x5b\xff\x94\x62\x83\xea\x19\x0b\x1f\xeb\x14\xb7\xc4\x66\xcb\x13\xab\x67\x3c\x99\xba\x3c\x0a\xdc\x19\x97\x47\x81\x4f\xc7\xf4\x97\x7d\x14\x38\x47\x7b\xfc\x41\x60\x83\x4e\xfc\xa7\x53\x87\x3a\x68\x85\x7f\x79\xde\x78\x79\xde\xe8\xc7\x9f\xe9\x79\x23\x54\x9f\x85\xed\x2f\xd6\xe2\x28\x0d\x6c\xf6\x2e\x6d\xbf\xae\x7c\xb3\xfd\x55\x7e\xdf\x18\xbe\x49\xf4\x37\xf8\xd0\x67\x96\x94\x0c\xc0\x99\x32\x1d\x5b\xa7\x0d\xd7\x61\xe1\xca\x7f\x03\x00\x00\xff\xff\x0e\x8c\xf0\x34\xf1\x3d\x00\x00"), }, "/crd-integration.yaml": &vfsgen۰CompressedFileInfo{ name: "crd-integration.yaml", diff --git a/e2e/yaks/common/apache-kamelet-catalog/kamelet.feature b/e2e/yaks/common/apache-kamelet-catalog/kamelet.feature new file mode 100644 index 0000000000..3c4c83ebcc --- /dev/null +++ b/e2e/yaks/common/apache-kamelet-catalog/kamelet.feature @@ -0,0 +1,5 @@ +Feature: Camel K can run Kamelets from default catalog + + Scenario: Integrations can use default catalog + Given integration logger is running + Then integration logger should print Camel K diff --git a/e2e/yaks/common/apache-kamelet-catalog/logger.groovy b/e2e/yaks/common/apache-kamelet-catalog/logger.groovy new file mode 100755 index 0000000000..75cd5634bf --- /dev/null +++ b/e2e/yaks/common/apache-kamelet-catalog/logger.groovy @@ -0,0 +1,22 @@ +// camel-k: language=groovy + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// timer-source is defined in the default Camel Kamelets catalog +from('kamelet:timer-source?message=Camel+K') + .log('${body}') diff --git a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml b/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml new file mode 100644 index 0000000000..ab0c02e724 --- /dev/null +++ b/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml @@ -0,0 +1,26 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +config: + namespace: + temporary: true +pre: +- name: installation + run: | + kamel install -n $YAKS_NAMESPACE + + kamel run logger.groovy -w -n $YAKS_NAMESPACE diff --git a/go.mod b/go.mod index d0ea343364..ac13077471 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/Masterminds/semver v1.5.0 github.com/apache/camel-k/pkg/apis/camel v0.0.0 github.com/apache/camel-k/pkg/client/camel v0.0.0 + github.com/apache/camel-k/pkg/kamelet/repository v0.0.0 github.com/container-tools/spectrum v0.3.2 github.com/evanphx/json-patch v4.9.0+incompatible github.com/fatih/structs v1.1.0 @@ -66,4 +67,5 @@ replace github.com/google/go-containerregistry => github.com/nicolaferraro/go-co replace ( github.com/apache/camel-k/pkg/apis/camel => ./pkg/apis/camel github.com/apache/camel-k/pkg/client/camel => ./pkg/client/camel + github.com/apache/camel-k/pkg/kamelet/repository => ./pkg/kamelet/repository ) diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml index c1176fa410..8046048640 100644 --- a/helm/camel-k/crds/crd-integration-platform.yaml +++ b/helm/camel-k/crds/crd-integration-platform.yaml @@ -174,6 +174,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object profile: description: TraitProfile represents lists of traits that are enabled for the specific installation/integration @@ -338,6 +350,18 @@ spec: - value type: object type: array + kamelet: + description: IntegrationPlatformKameletSpec -- + properties: + repositories: + items: + description: IntegrationPlatformKameletRepositorySpec -- + properties: + uri: + type: string + type: object + type: array + type: object phase: description: IntegrationPlatformPhase -- type: string diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go index 34d0baaf6a..b106a5bbab 100644 --- a/pkg/apis/camel/v1/integrationplatform_types.go +++ b/pkg/apis/camel/v1/integrationplatform_types.go @@ -33,6 +33,7 @@ type IntegrationPlatformSpec struct { Resources IntegrationPlatformResourcesSpec `json:"resources,omitempty"` Traits map[string]TraitSpec `json:"traits,omitempty"` Configuration []ConfigurationSpec `json:"configuration,omitempty"` + Kamelet IntegrationPlatformKameletSpec `json:"kamelet,omitempty"` } // IntegrationPlatformResourcesSpec contains platform related resources @@ -128,6 +129,16 @@ type IntegrationPlatformRegistrySpec struct { Organization string `json:"organization,omitempty"` } +// IntegrationPlatformKameletSpec -- +type IntegrationPlatformKameletSpec struct { + Repositories []IntegrationPlatformKameletRepositorySpec `json:"repositories,omitempty"` +} + +// IntegrationPlatformKameletRepositorySpec -- +type IntegrationPlatformKameletRepositorySpec struct { + URI string `json:"uri,omitempty"` +} + // IntegrationPlatformBuildStrategy enumerates all implemented build strategies type IntegrationPlatformBuildStrategy string diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go index a38ad744c1..6a830ab4c9 100644 --- a/pkg/apis/camel/v1/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go @@ -934,6 +934,41 @@ func (in *IntegrationPlatformCondition) DeepCopy() *IntegrationPlatformCondition return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntegrationPlatformKameletRepositorySpec) DeepCopyInto(out *IntegrationPlatformKameletRepositorySpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationPlatformKameletRepositorySpec. +func (in *IntegrationPlatformKameletRepositorySpec) DeepCopy() *IntegrationPlatformKameletRepositorySpec { + if in == nil { + return nil + } + out := new(IntegrationPlatformKameletRepositorySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntegrationPlatformKameletSpec) DeepCopyInto(out *IntegrationPlatformKameletSpec) { + *out = *in + if in.Repositories != nil { + in, out := &in.Repositories, &out.Repositories + *out = make([]IntegrationPlatformKameletRepositorySpec, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationPlatformKameletSpec. +func (in *IntegrationPlatformKameletSpec) DeepCopy() *IntegrationPlatformKameletSpec { + if in == nil { + return nil + } + out := new(IntegrationPlatformKameletSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IntegrationPlatformList) DeepCopyInto(out *IntegrationPlatformList) { *out = *in @@ -1013,6 +1048,7 @@ func (in *IntegrationPlatformSpec) DeepCopyInto(out *IntegrationPlatformSpec) { *out = make([]ConfigurationSpec, len(*in)) copy(*out, *in) } + in.Kamelet.DeepCopyInto(&out.Kamelet) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationPlatformSpec. diff --git a/pkg/client/client.go b/pkg/client/client.go index 219cd1433f..753fe3e2e7 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -22,6 +22,8 @@ import ( "os" "path/filepath" + camelv1 "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/typed/camel/v1" + camelv1alpha1 "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/typed/camel/v1alpha1" user "github.com/mitchellh/go-homedir" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -42,6 +44,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "github.com/apache/camel-k/pkg/apis" + camel "github.com/apache/camel-k/pkg/client/camel/clientset/versioned" ) const ( @@ -53,6 +56,8 @@ const ( type Client interface { controller.Client kubernetes.Interface + CamelV1() camelv1.CamelV1Interface + CamelV1alpha1() camelv1alpha1.CamelV1alpha1Interface GetScheme() *runtime.Scheme GetConfig() *rest.Config GetCurrentNamespace(kubeConfig string) (string, error) @@ -71,10 +76,22 @@ type Provider struct { type defaultClient struct { controller.Client kubernetes.Interface + camel camel.Interface scheme *runtime.Scheme config *rest.Config } +// Check interface compliance +var _ Client = &defaultClient{} + +func (c *defaultClient) CamelV1() camelv1.CamelV1Interface { + return c.camel.CamelV1() +} + +func (c *defaultClient) CamelV1alpha1() camelv1alpha1.CamelV1alpha1Interface { + return c.camel.CamelV1alpha1() +} + func (c *defaultClient) GetScheme() *runtime.Scheme { return c.scheme } @@ -114,6 +131,11 @@ func NewClient(fastDiscovery bool) (Client, error) { return nil, err } + var camelClientset camel.Interface + if camelClientset, err = camel.NewForConfig(cfg); err != nil { + return nil, err + } + var mapper meta.RESTMapper if fastDiscovery { mapper = newFastDiscoveryRESTMapper(cfg) @@ -132,6 +154,7 @@ func NewClient(fastDiscovery bool) (Client, error) { return &defaultClient{ Client: dynClient, Interface: clientset, + camel: camelClientset, scheme: clientOptions.Scheme, config: cfg, }, nil @@ -144,9 +167,14 @@ func FromManager(manager manager.Manager) (Client, error) { if clientset, err = kubernetes.NewForConfig(manager.GetConfig()); err != nil { return nil, err } + var camelClientset camel.Interface + if camelClientset, err = camel.NewForConfig(manager.GetConfig()); err != nil { + return nil, err + } return &defaultClient{ Client: manager.GetClient(), Interface: clientset, + camel: camelClientset, scheme: manager.GetScheme(), config: manager.GetConfig(), }, nil diff --git a/pkg/controller/kamelet/initialize.go b/pkg/controller/kamelet/initialize.go index eeae30184f..f1bbc1e185 100644 --- a/pkg/controller/kamelet/initialize.go +++ b/pkg/controller/kamelet/initialize.go @@ -21,6 +21,7 @@ import ( "context" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + kameletutils "github.com/apache/camel-k/pkg/kamelet" ) // NewInitializeAction returns a action that initializes the kamelet configuration when not provided by the user @@ -41,5 +42,5 @@ func (action *initializeAction) CanHandle(kamelet *v1alpha1.Kamelet) bool { } func (action *initializeAction) Handle(ctx context.Context, kamelet *v1alpha1.Kamelet) (*v1alpha1.Kamelet, error) { - return updateStatus(kamelet) + return kameletutils.Initialize(kamelet) } diff --git a/pkg/controller/kamelet/monitor.go b/pkg/controller/kamelet/monitor.go index 99e5224b3e..8d90029c18 100644 --- a/pkg/controller/kamelet/monitor.go +++ b/pkg/controller/kamelet/monitor.go @@ -21,6 +21,7 @@ import ( "context" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + kameletutils "github.com/apache/camel-k/pkg/kamelet" ) // NewMonitorAction returns an action that monitors the kamelet after it's fully initialized @@ -41,5 +42,5 @@ func (action *monitorAction) CanHandle(kamelet *v1alpha1.Kamelet) bool { } func (action *monitorAction) Handle(ctx context.Context, kamelet *v1alpha1.Kamelet) (*v1alpha1.Kamelet, error) { - return updateStatus(kamelet) + return kameletutils.Initialize(kamelet) } diff --git a/pkg/controller/kameletbinding/initialize.go b/pkg/controller/kameletbinding/initialize.go index cc9c38f16b..7235cd9ccb 100644 --- a/pkg/controller/kameletbinding/initialize.go +++ b/pkg/controller/kameletbinding/initialize.go @@ -22,6 +22,7 @@ import ( "strings" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/kamelet/repository" "github.com/apache/camel-k/pkg/util/kubernetes" "github.com/apache/camel-k/pkg/util/patch" "github.com/pkg/errors" @@ -108,13 +109,18 @@ func (action *initializeAction) findIcon(ctx context.Context, binding *v1alpha1. return "", nil } - key := client.ObjectKey{ - Namespace: binding.Namespace, - Name: kameletRef.Name, + repo, err := repository.New(ctx, action.client, binding.Namespace) + if err != nil { + return "", err } - var kamelet v1alpha1.Kamelet - if err := action.client.Get(ctx, key, &kamelet); err != nil { + + kamelet, err := repo.Get(ctx, kameletRef.Name) + if err != nil { return "", err } + if kamelet == nil { + return "", nil + } + return kamelet.Annotations[v1alpha1.AnnotationIcon], nil } diff --git a/pkg/controller/kamelet/common.go b/pkg/kamelet/initialize.go similarity index 97% rename from pkg/controller/kamelet/common.go rename to pkg/kamelet/initialize.go index 437170ee7a..991b5bd9bc 100644 --- a/pkg/controller/kamelet/common.go +++ b/pkg/kamelet/initialize.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -func updateStatus(kamelet *v1alpha1.Kamelet) (*v1alpha1.Kamelet, error) { +func Initialize(kamelet *v1alpha1.Kamelet) (*v1alpha1.Kamelet, error) { target := kamelet.DeepCopy() if !v1alpha1.ValidKameletName(kamelet.Name) { diff --git a/pkg/kamelet/repository/common.go b/pkg/kamelet/repository/common.go new file mode 100644 index 0000000000..3793ef2acd --- /dev/null +++ b/pkg/kamelet/repository/common.go @@ -0,0 +1,50 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "strings" +) + +var fileSuffixes = []string{".kamelet.yaml", ".kamelet.yml", ".kamelet.json"} + +func isKameletFileName(fileName string) bool { + for _, suffix := range fileSuffixes { + if strings.HasSuffix(fileName, suffix) { + return true + } + } + return false +} + +func isFileNameForKamelet(name, fileName string) bool { + for _, suffix := range fileSuffixes { + if name+suffix == fileName { + return true + } + } + return false +} + +func getKameletNameFromFile(fileName string) string { + name := fileName + for _, suffix := range fileSuffixes { + name = strings.TrimSuffix(name, suffix) + } + return name +} diff --git a/pkg/kamelet/repository/composite_repository.go b/pkg/kamelet/repository/composite_repository.go new file mode 100644 index 0000000000..5dc45dc6a0 --- /dev/null +++ b/pkg/kamelet/repository/composite_repository.go @@ -0,0 +1,76 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "fmt" + "sort" + "strings" + + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" +) + +type compositeKameletRepository struct { + repositories []KameletRepository +} + +var _ KameletRepository = &compositeKameletRepository{} + +func newCompositeKameletRepository(repositories ...KameletRepository) KameletRepository { + return &compositeKameletRepository{ + repositories: repositories, + } +} + +func (c compositeKameletRepository) List(ctx context.Context) ([]string, error) { + kSet := make(map[string]bool) + for _, repo := range c.repositories { + lst, err := repo.List(ctx) + if err != nil { + return nil, err + } + for _, kam := range lst { + kSet[kam] = true + } + } + res := make([]string, 0, len(kSet)) + for kam := range kSet { + res = append(res, kam) + } + sort.Strings(res) + return res, nil +} + +func (c compositeKameletRepository) Get(ctx context.Context, name string) (*v1alpha1.Kamelet, error) { + for _, repo := range c.repositories { + kam, err := repo.Get(ctx, name) + if kam != nil || err != nil { + return kam, err + } + } + return nil, nil +} + +func (c *compositeKameletRepository) String() string { + descs := make([]string, 0, len(c.repositories)) + for _, repo := range c.repositories { + descs = append(descs, repo.String()) + } + return fmt.Sprintf("(%s)", strings.Join(descs, ", ")) +} diff --git a/pkg/kamelet/repository/composite_repository_test.go b/pkg/kamelet/repository/composite_repository_test.go new file mode 100644 index 0000000000..aaeffae64a --- /dev/null +++ b/pkg/kamelet/repository/composite_repository_test.go @@ -0,0 +1,58 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "testing" + + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/fake" + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestKubernetesRepositoryMultiNS(t *testing.T) { + ctx := context.Background() + fakeClient := fake.NewSimpleClientset( + &v1alpha1.Kamelet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test1", + Name: "kamelet1", + }, + }, + &v1alpha1.Kamelet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test2", + Name: "kamelet2", + }, + }) + repo := newCompositeKameletRepository( + newKubernetesKameletRepository(fakeClient, "test1"), + newKubernetesKameletRepository(fakeClient, "test2"), + ) + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.Len(t, list, 2) + k1, err := repo.Get(ctx, "kamelet1") + assert.NoError(t, err) + assert.Equal(t, "kamelet1", k1.Name) + k2, err := repo.Get(ctx, "kamelet2") + assert.NoError(t, err) + assert.Equal(t, "kamelet2", k2.Name) +} diff --git a/pkg/kamelet/repository/empty_repository.go b/pkg/kamelet/repository/empty_repository.go new file mode 100644 index 0000000000..6596f579fe --- /dev/null +++ b/pkg/kamelet/repository/empty_repository.go @@ -0,0 +1,46 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" +) + +type emptyKameletRepository struct { +} + +func newEmptyKameletRepository() KameletRepository { + return &emptyKameletRepository{} +} + +// Enforce type +var _ KameletRepository = &emptyKameletRepository{} + +func (e *emptyKameletRepository) List(_ context.Context) ([]string, error) { + return nil, nil +} + +func (e *emptyKameletRepository) Get(_ context.Context, _ string) (*v1alpha1.Kamelet, error) { + return nil, nil +} + +func (c *emptyKameletRepository) String() string { + return "Empty[]" +} diff --git a/pkg/kamelet/repository/empty_repository_test.go b/pkg/kamelet/repository/empty_repository_test.go new file mode 100644 index 0000000000..79c96c3361 --- /dev/null +++ b/pkg/kamelet/repository/empty_repository_test.go @@ -0,0 +1,36 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestEmptyRepository(t *testing.T) { + ctx := context.Background() + repo := newEmptyKameletRepository() + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.Len(t, list, 0) + k, err := repo.Get(ctx, "non-existing") + assert.NoError(t, err) + assert.Nil(t, k) +} diff --git a/pkg/kamelet/repository/github_repository.go b/pkg/kamelet/repository/github_repository.go new file mode 100644 index 0000000000..de7e3a3687 --- /dev/null +++ b/pkg/kamelet/repository/github_repository.go @@ -0,0 +1,150 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "os" + "sort" + "strings" + + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/google/go-github/v32/github" + "golang.org/x/oauth2" + + "k8s.io/apimachinery/pkg/util/yaml" + + "github.com/gregjones/httpcache" +) + +type githubKameletRepository struct { + httpClient *http.Client + owner string + repo string + path string + ref string +} + +func newGithubKameletRepository(owner, repo, path, ref string) KameletRepository { + httpClient := httpcache.NewMemoryCacheTransport().Client() + if token, ok := os.LookupEnv("GITHUB_TOKEN"); ok { + ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}) + ctx := context.WithValue(context.Background(), oauth2.HTTPClient, httpClient) + httpClient = oauth2.NewClient(ctx, ts) + } + + return &githubKameletRepository{ + httpClient: httpClient, + owner: owner, + repo: repo, + path: path, + ref: ref, + } +} + +// Enforce type +var _ KameletRepository = &githubKameletRepository{} + +func (c *githubKameletRepository) List(ctx context.Context) ([]string, error) { + dir, err := c.listFiles(ctx) + if err != nil { + return nil, err + } + res := make([]string, 0, len(dir)) + for _, file := range dir { + if file != nil && file.Name != nil && isKameletFileName(*file.Name) { + res = append(res, getKameletNameFromFile(*file.Name)) + } + } + sort.Strings(res) + return res, nil +} + +func (c *githubKameletRepository) Get(ctx context.Context, name string) (*v1alpha1.Kamelet, error) { + dir, err := c.listFiles(ctx) + if err != nil { + return nil, err + } + + for _, file := range dir { + if file == nil || file.Name == nil { + continue + } + if isFileNameForKamelet(name, *file.Name) && file.DownloadURL != nil { + kamelet, err := c.downloadKamelet(ctx, *file.DownloadURL) + if err != nil { + return kamelet, err + } + if kamelet.Name != name { + return nil, fmt.Errorf("kamelet names do not match: expected %s, got %s", name, kamelet.Name) + } + return kamelet, nil + } + } + return nil, nil +} + +func (c *githubKameletRepository) listFiles(ctx context.Context) ([]*github.RepositoryContent, error) { + gc := github.NewClient(c.httpClient) + var ref *github.RepositoryContentGetOptions + if c.ref != "" { + ref = &github.RepositoryContentGetOptions{Ref: c.ref} + } + _, dir, _, err := gc.Repositories.GetContents(ctx, c.owner, c.repo, c.path, ref) + return dir, err +} + +func (c *githubKameletRepository) downloadKamelet(ctx context.Context, url string) (*v1alpha1.Kamelet, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := c.httpClient.Do(req) + if err != nil { + return nil, err + } + if resp.StatusCode != 200 { + return nil, fmt.Errorf("cannot download file %s: %d %s", url, resp.StatusCode, resp.Status) + } + + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + if strings.HasSuffix(url, ".yaml") || strings.HasSuffix(url, ".yml") { + content, err = yaml.ToJSON(content) + if err != nil { + return nil, err + } + } + + var kamelet v1alpha1.Kamelet + if err := json.Unmarshal(content, &kamelet); err != nil { + return nil, err + } + return &kamelet, nil +} + +func (c *githubKameletRepository) String() string { + return fmt.Sprintf("Github[owner=%s, repo=%s, path=%s, ref=%s]", c.owner, c.repo, c.path, c.ref) +} diff --git a/pkg/kamelet/repository/github_repository_test.go b/pkg/kamelet/repository/github_repository_test.go new file mode 100644 index 0000000000..48c0dc5673 --- /dev/null +++ b/pkg/kamelet/repository/github_repository_test.go @@ -0,0 +1,46 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestGithubRepository(t *testing.T) { + ctx := context.Background() + repo := newGithubKameletRepository("apache", "camel-kamelets", "", "") + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.True(t, len(list) > 0) + // Repeat multiple times to be sure cache is working and we don't hit rate limits + maxDistinct := 5 + for i := 0; i < 200; i++ { + maxPos := maxDistinct + if len(list) < maxDistinct { + maxPos = len(list) + } + kameletName := list[i%maxPos] + kamelet, err := repo.Get(ctx, kameletName) + assert.NoError(t, err) + assert.Equal(t, kameletName, kamelet.Name) + } + +} diff --git a/pkg/kamelet/repository/go.mod b/pkg/kamelet/repository/go.mod new file mode 100644 index 0000000000..96bb552fc3 --- /dev/null +++ b/pkg/kamelet/repository/go.mod @@ -0,0 +1,17 @@ +module github.com/apache/camel-k/pkg/kamelet/repository + +go 1.13 + +require ( + github.com/apache/camel-k/pkg/apis/camel v0.0.0 + github.com/apache/camel-k/pkg/client/camel v0.0.0 + github.com/google/go-github/v32 v32.1.0 + github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d + k8s.io/apimachinery v0.18.9 + github.com/stretchr/testify v1.5.1 +) + +// Local modules +replace github.com/apache/camel-k/pkg/apis/camel => ../../apis/camel +replace github.com/apache/camel-k/pkg/client/camel => ../../client/camel diff --git a/pkg/kamelet/repository/go.sum b/pkg/kamelet/repository/go.sum new file mode 100644 index 0000000000..dde23bd0df --- /dev/null +++ b/pkg/kamelet/repository/go.sum @@ -0,0 +1,428 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II= +github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.1.0 h1:rVsPeBmXbYv4If/cumu1AzZPwV58q433hvONV1UEZoI= +github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo= +golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7 h1:HmbHVPwrPEKPGLAcHSrMe6+hqSUlvZU0rab6x5EXfGU= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= +k8s.io/api v0.18.9 h1:7VDtivqwbvLOf8hmXSd/PDSSbpCBq49MELg84EYBYiQ= +k8s.io/api v0.18.9/go.mod h1:9u/h6sUh6FxfErv7QqetX1EB3yBMIYOBXzdcf0Gf0rc= +k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= +k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.9 h1:3ZABKQx3F3xPWlsGhCfUl8W+JXRRblV6Wo2A3zn0pvY= +k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= +k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= +k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= +k8s.io/client-go v0.18.9 h1:sPHX49yOtUqv1fl49TwV3f8cC0N3etSnwgFGsIsXnZc= +k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY= +k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= +k8s.io/code-generator v0.18.9/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= +k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 h1:Oh3Mzx5pJ+yIumsAD0MOECPVeXsVot0UkiaCGVyfGQY= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTUt3aVoBpi2DqRsU= +k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= +sigs.k8s.io/controller-tools v0.0.0-20200528125929-5c0c6ae3b64b/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/kamelet/repository/kubernetes_repository.go b/pkg/kamelet/repository/kubernetes_repository.go new file mode 100644 index 0000000000..cf64a8fc57 --- /dev/null +++ b/pkg/kamelet/repository/kubernetes_repository.go @@ -0,0 +1,71 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "fmt" + "sort" + + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/client/camel/clientset/versioned" + k8serrors "k8s.io/apimachinery/pkg/api/errors" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type kubernetesKameletRepository struct { + client versioned.Interface + namespace string +} + +func newKubernetesKameletRepository(client versioned.Interface, namespace string) KameletRepository { + return &kubernetesKameletRepository{ + client: client, + namespace: namespace, + } +} + +// Enforce type +var _ KameletRepository = &kubernetesKameletRepository{} + +func (c *kubernetesKameletRepository) List(ctx context.Context) ([]string, error) { + list, err := c.client.CamelV1alpha1().Kamelets(c.namespace).List(ctx, v1.ListOptions{}) + if err != nil { + return nil, err + } + + res := make([]string, 0, len(list.Items)) + for _, item := range list.Items { + res = append(res, item.Name) + } + sort.Strings(res) + return res, nil +} + +func (c *kubernetesKameletRepository) Get(ctx context.Context, name string) (*v1alpha1.Kamelet, error) { + kamelet, err := c.client.CamelV1alpha1().Kamelets(c.namespace).Get(ctx, name, v1.GetOptions{}) + if err != nil && k8serrors.IsNotFound(err) { + // return nil if not found, so other repositories can try to find it + return nil, nil + } + return kamelet, err +} + +func (c *kubernetesKameletRepository) String() string { + return fmt.Sprintf("Kubernetes[namespace=%s]", c.namespace) +} diff --git a/pkg/kamelet/repository/kubernetes_repository_test.go b/pkg/kamelet/repository/kubernetes_repository_test.go new file mode 100644 index 0000000000..a8ca1a8267 --- /dev/null +++ b/pkg/kamelet/repository/kubernetes_repository_test.go @@ -0,0 +1,64 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "testing" + + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/fake" + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestKubernetesEmptyRepository(t *testing.T) { + ctx := context.Background() + fakeClient := fake.NewSimpleClientset() + repo := newKubernetesKameletRepository(fakeClient, "test") + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.Len(t, list, 0) +} + +func TestKubernetesRepository(t *testing.T) { + ctx := context.Background() + fakeClient := fake.NewSimpleClientset( + &v1alpha1.Kamelet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test", + Name: "kamelet1", + }, + }, + &v1alpha1.Kamelet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test", + Name: "kamelet2", + }, + }) + repo := newKubernetesKameletRepository(fakeClient, "test") + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.Len(t, list, 2) + k1, err := repo.Get(ctx, "kamelet1") + assert.NoError(t, err) + assert.Equal(t, "kamelet1", k1.Name) + k2, err := repo.Get(ctx, "kamelet2") + assert.NoError(t, err) + assert.Equal(t, "kamelet2", k2.Name) +} diff --git a/pkg/kamelet/repository/repository.go b/pkg/kamelet/repository/repository.go new file mode 100644 index 0000000000..a0f8a1bd92 --- /dev/null +++ b/pkg/kamelet/repository/repository.go @@ -0,0 +1,178 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "fmt" + "strings" + + v1 "github.com/apache/camel-k/pkg/apis/camel/v1" + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + camel "github.com/apache/camel-k/pkg/client/camel/clientset/versioned" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // NoneRepository is a marker used to indicate that no repository should be used + NoneRepository = "none" +) + +var DefaultRemoteRepository = "github:apache/camel-kamelets" + +// KameletRepository can be used to obtain a Kamelet definition, looking it up in one or more physical locations +type KameletRepository interface { + + // List the kamelets available in the repository + List(ctx context.Context) ([]string, error) + + // Get the Kamelet corresponding to the given name, or nil if not found + Get(ctx context.Context, name string) (*v1alpha1.Kamelet, error) + + // String information about the repository + String() string +} + +// New creates a KameletRepository for the given namespaces. +// Kamelets are first looked up in all the given namespaces, in the order they appear. +// If one namespace defines an IntegrationPlatform (only the first IntegrationPlatform in state "Ready" found), +// then all kamelet repository URIs defined in the IntegrationPlatform are included. +func New(ctx context.Context, client camel.Interface, namespaces ...string) (KameletRepository, error) { + platform, err := lookupPlatform(ctx, client, namespaces...) + if err != nil { + return nil, err + } + return NewForPlatform(ctx, client, platform, namespaces...) +} + +// NewForPlatform creates a KameletRepository for the given namespaces and platform. +// Kamelets are first looked up in all the given namespaces, in the order they appear, +// then repositories defined in the platform are looked up. +func NewForPlatform(ctx context.Context, client camel.Interface, platform *v1.IntegrationPlatform, namespaces ...string) (KameletRepository, error) { + repoImpls := make([]KameletRepository, 0) + for _, namespace := range namespaces { + // Add first a namespace local repository for each namespace + repoImpls = append(repoImpls, newKubernetesKameletRepository(client, namespace)) + } + if platform != nil { + repos := getRepositoriesFromPlatform(platform) + for _, repoURI := range repos { + repoImpl, err := newFromURI(repoURI) + if err != nil { + return nil, err + } + repoImpls = append(repoImpls, repoImpl) + } + } else { + // Add default repo + defaultRepoImpl, err := newFromURI(DefaultRemoteRepository) + if err != nil { + return nil, err + } + repoImpls = append(repoImpls, defaultRepoImpl) + } + + return newCompositeKameletRepository(repoImpls...), nil +} + +// NewStandalone creates a KameletRepository that can be used in cases where there's no connection to a Kubernetes cluster. +// The given uris are used to construct the repositories. +// If the uris parameter is nil, then only the DefaultRemoteRepository will be included. +func NewStandalone(uris ...string) (KameletRepository, error) { + repoImpls := make([]KameletRepository, 0, len(uris)+1) + for _, repoURI := range uris { + repoImpl, err := newFromURI(repoURI) + if err != nil { + return nil, err + } + if repoImpl != nil { + repoImpls = append(repoImpls, repoImpl) + } + } + if len(repoImpls) == 0 { + defaultRepoImpl, err := newFromURI(DefaultRemoteRepository) + if err != nil { + return nil, err + } + if defaultRepoImpl != nil { + repoImpls = append(repoImpls, defaultRepoImpl) + } + } + return newCompositeKameletRepository(repoImpls...), nil +} + +func lookupPlatform(ctx context.Context, client camel.Interface, namespaces ...string) (*v1.IntegrationPlatform, error) { + for _, namespace := range namespaces { + pls, err := client.CamelV1().IntegrationPlatforms(namespace).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, pl := range pls.Items { + if pl.Status.Phase == v1.IntegrationPlatformPhaseReady { + return &pl, nil + } + } + if len(pls.Items) > 0 { + // If none is ready, return the first one + return &pls.Items[0], nil + } + } + return nil, nil +} + +func getRepositoriesFromPlatform(platform *v1.IntegrationPlatform) []string { + if platform == nil { + return nil + } + repos := platform.Status.Kamelet.Repositories + if len(repos) == 0 { + // Maybe not reconciled yet + repos = platform.Spec.Kamelet.Repositories + } + res := make([]string, 0, len(repos)) + for _, repo := range repos { + res = append(res, repo.URI) + } + return res +} + +func newFromURI(uri string) (KameletRepository, error) { + if uri == NoneRepository { + return newEmptyKameletRepository(), nil + } else if strings.HasPrefix(uri, "github:") { + desc := strings.TrimPrefix(uri, "github:") + var version string + if strings.Contains(desc, "@") { + pos := strings.LastIndex(desc, "@") + version = desc[pos+1:] + desc = desc[0:pos] + } + parts := strings.Split(desc, "/") + if len(parts) < 2 { + return nil, fmt.Errorf("expected format is github:owner/repo[/path][@version], got: %s", uri) + } + owner := parts[0] + repo := parts[1] + var path string + if len(parts) >= 3 { + path = strings.Join(parts[2:], "/") + } + return newGithubKameletRepository(owner, repo, path, version), nil + } + return nil, fmt.Errorf("invalid uri: %s", uri) +} diff --git a/pkg/kamelet/repository/repository_test.go b/pkg/kamelet/repository/repository_test.go new file mode 100644 index 0000000000..5fe4f7ac2b --- /dev/null +++ b/pkg/kamelet/repository/repository_test.go @@ -0,0 +1,215 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package repository + +import ( + "context" + "fmt" + "testing" + + v1 "github.com/apache/camel-k/pkg/apis/camel/v1" + "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/fake" + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +func TestURIParse(t *testing.T) { + tests := []struct { + uri string + error bool + repository KameletRepository + }{ + { + uri: "github:apache/camel-kamelets", + repository: &githubKameletRepository{ + owner: "apache", + repo: "camel-kamelets", + }, + }, + { + uri: "github:apache/camel-kamelets/catalog", + repository: &githubKameletRepository{ + owner: "apache", + repo: "camel-kamelets", + path: "catalog", + }, + }, + { + uri: "github:apache/camel-kamelets/catalog@v1.2.3", + repository: &githubKameletRepository{ + owner: "apache", + repo: "camel-kamelets", + path: "catalog", + ref: "v1.2.3", + }, + }, + { + uri: "github:apache/camel-kamelets@v1.2.3", + repository: &githubKameletRepository{ + owner: "apache", + repo: "camel-kamelets", + ref: "v1.2.3", + }, + }, + { + uri: "github:apache@v1.2.3", + error: true, + }, + { + uri: "github:apache/camel-kamelets/the/path@v1.2.3", + repository: &githubKameletRepository{ + owner: "apache", + repo: "camel-kamelets", + path: "the/path", + ref: "v1.2.3", + }, + }, + { + uri: "github:apache/camel-kamelets/the/path", + repository: &githubKameletRepository{ + owner: "apache", + repo: "camel-kamelets", + path: "the/path", + }, + }, + { + uri: "zithub:apache/camel-kamelets/the/path", + error: true, + }, + { + uri: "none", + repository: &emptyKameletRepository{}, + }, + } + for i, test := range tests { + t.Run(fmt.Sprintf("%d-%s", i, test.uri), func(t *testing.T) { + catalog, err := newFromURI(test.uri) + if test.error { + assert.Error(t, err) + } else { + assert.NoError(t, err) + switch r := test.repository.(type) { + case *githubKameletRepository: + gc, ok := catalog.(*githubKameletRepository) + assert.True(t, ok) + assert.Equal(t, r.owner, gc.owner) + assert.Equal(t, r.repo, gc.repo) + assert.Equal(t, r.path, gc.path) + assert.Equal(t, r.ref, gc.ref) + case *emptyKameletRepository: + _, ok := catalog.(*emptyKameletRepository) + assert.True(t, ok) + default: + t.Fatal("missing case") + } + + } + }) + } + +} + +func TestNewRepository(t *testing.T) { + ctx := context.Background() + fakeClient := fake.NewSimpleClientset(createTestContext("none")...) + repo, err := New(ctx, fakeClient, "test") + assert.NoError(t, err) + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.Len(t, list, 2) + k1, err := repo.Get(ctx, "kamelet1") + assert.NoError(t, err) + assert.Equal(t, "kamelet1", k1.Name) + k2, err := repo.Get(ctx, "kamelet2") + assert.NoError(t, err) + assert.Equal(t, "kamelet2", k2.Name) +} + +func TestNewRepositoryWithCamelKamelets(t *testing.T) { + ctx := context.Background() + fakeClient := fake.NewSimpleClientset(createTestContext("github:apache/camel-kamelets")...) + repo, err := New(ctx, fakeClient, "test") + assert.NoError(t, err) + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.True(t, len(list) > 2) + k1, err := repo.Get(ctx, "kamelet1") + assert.NoError(t, err) + assert.Equal(t, "kamelet1", k1.Name) + k2, err := repo.Get(ctx, "kamelet2") + assert.NoError(t, err) + assert.Equal(t, "kamelet2", k2.Name) +} + +func TestNewRepositoryWithDefault(t *testing.T) { + ctx := context.Background() + fakeClient := fake.NewSimpleClientset(createTestContext()...) + repo, err := New(ctx, fakeClient, "test") + assert.NoError(t, err) + list, err := repo.List(ctx) + assert.NoError(t, err) + assert.True(t, len(list) > 2) + k1, err := repo.Get(ctx, "kamelet1") + assert.NoError(t, err) + assert.Equal(t, "kamelet1", k1.Name) + k2, err := repo.Get(ctx, "kamelet2") + assert.NoError(t, err) + assert.Equal(t, "kamelet2", k2.Name) +} + +func createTestContext(uris ...string) (res []runtime.Object) { + res = []runtime.Object{ + &v1alpha1.Kamelet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test", + Name: "kamelet1", + }, + }, + &v1alpha1.Kamelet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test", + Name: "kamelet2", + }, + }, + } + if len(uris) > 0 { + repos := make([]v1.IntegrationPlatformKameletRepositorySpec, 0, len(uris)) + for _, uri := range uris { + repos = append(repos, v1.IntegrationPlatformKameletRepositorySpec{ + URI: uri, + }) + } + res = append(res, &v1.IntegrationPlatform{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test", + Name: "camel-k", + }, + Status: v1.IntegrationPlatformStatus{ + IntegrationPlatformSpec: v1.IntegrationPlatformSpec{ + Kamelet: v1.IntegrationPlatformKameletSpec{ + Repositories: repos, + }, + }, + Phase: v1.IntegrationPlatformPhaseReady, + }, + }) + } + return res +} diff --git a/pkg/platform/defaults.go b/pkg/platform/defaults.go index 5e83379401..db3dfabe2b 100644 --- a/pkg/platform/defaults.go +++ b/pkg/platform/defaults.go @@ -23,6 +23,7 @@ import ( "strings" "time" + "github.com/apache/camel-k/pkg/kamelet/repository" "github.com/apache/camel-k/pkg/util/patch" "github.com/pkg/errors" @@ -247,6 +248,12 @@ func setPlatformDefaults(ctx context.Context, c client.Client, p *v1.Integration } } + if len(p.Status.Kamelet.Repositories) == 0 { + p.Status.Kamelet.Repositories = append(p.Status.Kamelet.Repositories, v1.IntegrationPlatformKameletRepositorySpec{ + URI: repository.DefaultRemoteRepository, + }) + } + if verbose { log.Log.Infof("RuntimeVersion set to %s", p.Status.Build.RuntimeVersion) log.Log.Infof("BaseImage set to %s", p.Status.Build.BaseImage) diff --git a/pkg/trait/kamelets.go b/pkg/trait/kamelets.go index c5de266c7a..13c5beecef 100644 --- a/pkg/trait/kamelets.go +++ b/pkg/trait/kamelets.go @@ -27,6 +27,8 @@ import ( v1 "github.com/apache/camel-k/pkg/apis/camel/v1" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" + kameletutils "github.com/apache/camel-k/pkg/kamelet" + "github.com/apache/camel-k/pkg/kamelet/repository" "github.com/apache/camel-k/pkg/metadata" "github.com/apache/camel-k/pkg/util" "github.com/apache/camel-k/pkg/util/digest" @@ -34,7 +36,6 @@ import ( "github.com/apache/camel-k/pkg/util/kubernetes" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" ) // The kamelets trait is a platform trait used to inject Kamelets into the integration runtime. @@ -129,58 +130,81 @@ func (t *kameletsTrait) Apply(e *Environment) error { } func (t *kameletsTrait) addKamelets(e *Environment) error { - for _, k := range t.getKameletKeys() { - var kamelet v1alpha1.Kamelet - key := client.ObjectKey{ - Namespace: e.Integration.Namespace, - Name: k, - } - if err := t.Client.Get(t.Ctx, key, &kamelet); err != nil { + kameletKeys := t.getKameletKeys() + if len(kameletKeys) > 0 { + repo, err := repository.NewForPlatform(e.C, e.Client, e.Platform, e.Integration.Namespace) + if err != nil { return err } + for _, k := range t.getKameletKeys() { + kamelet, err := repo.Get(e.C, k) + if err != nil { + return err + } + if kamelet == nil { + return fmt.Errorf("kamelet %s not found in any of the defined repositories: %s", k, repo.String()) + } - if kamelet.Status.Phase != v1alpha1.KameletPhaseReady { - return fmt.Errorf("kamelet %q is not %s: %s", k, v1alpha1.KameletPhaseReady, kamelet.Status.Phase) - } + // Initialize remote kamelets + kamelet, err = kameletutils.Initialize(kamelet) + if err != nil { + return err + } - if err := t.addKameletAsSource(e, kamelet); err != nil { - return err - } + if kamelet.Status.Phase != v1alpha1.KameletPhaseReady { + return fmt.Errorf("kamelet %q is not %s: %s", k, v1alpha1.KameletPhaseReady, kamelet.Status.Phase) + } + + if err := t.addKameletAsSource(e, kamelet); err != nil { + return err + } - // Adding dependencies from Kamelets - util.StringSliceUniqueConcat(&e.Integration.Status.Dependencies, kamelet.Spec.Dependencies) + // Adding dependencies from Kamelets + util.StringSliceUniqueConcat(&e.Integration.Status.Dependencies, kamelet.Spec.Dependencies) + } + // resort dependencies + sort.Strings(e.Integration.Status.Dependencies) } - // resort dependencies - sort.Strings(e.Integration.Status.Dependencies) return nil } func (t *kameletsTrait) configureApplicationProperties(e *Environment) error { - for _, k := range t.getKameletKeys() { - var kamelet v1alpha1.Kamelet - key := client.ObjectKey{ - Namespace: e.Integration.Namespace, - Name: k, - } - if err := t.Client.Get(t.Ctx, key, &kamelet); err != nil { + if len(t.getKameletKeys()) > 0 { + repo, err := repository.NewForPlatform(e.C, e.Client, e.Platform, e.Integration.Namespace) + if err != nil { return err } + for _, k := range t.getKameletKeys() { + kamelet, err := repo.Get(e.C, k) + if err != nil { + return err + } + if kamelet == nil { + return fmt.Errorf("kamelet %s not found in any of the defined repositories: %s", k, repo.String()) + } + + // remote Kamelets may not be fully initialized + kamelet, err = kameletutils.Initialize(kamelet) + if err != nil { + return err + } - // Configuring defaults from Kamelet - for _, prop := range kamelet.Status.Properties { - if prop.Default != "" { - // Check whether user specified a value - userDefined := false - propName := fmt.Sprintf("camel.kamelet.%s.%s", kamelet.Name, prop.Name) - propPrefix := propName + "=" - for _, userProp := range e.Integration.Spec.Configuration { - if strings.HasPrefix(userProp.Value, propPrefix) { - userDefined = true - break + // Configuring defaults from Kamelet + for _, prop := range kamelet.Status.Properties { + if prop.Default != "" { + // Check whether user specified a value + userDefined := false + propName := fmt.Sprintf("camel.kamelet.%s.%s", kamelet.Name, prop.Name) + propPrefix := propName + "=" + for _, userProp := range e.Integration.Spec.Configuration { + if strings.HasPrefix(userProp.Value, propPrefix) { + userDefined = true + break + } + } + if !userDefined { + e.ApplicationProperties[propName] = prop.Default } - } - if !userDefined { - e.ApplicationProperties[propName] = prop.Default } } } @@ -188,7 +212,7 @@ func (t *kameletsTrait) configureApplicationProperties(e *Environment) error { return nil } -func (t *kameletsTrait) addKameletAsSource(e *Environment, kamelet v1alpha1.Kamelet) error { +func (t *kameletsTrait) addKameletAsSource(e *Environment, kamelet *v1alpha1.Kamelet) error { sources := make([]v1.SourceSpec, 0) if kamelet.Spec.Flow != nil { @@ -323,7 +347,7 @@ func (t *kameletsTrait) getConfigurationKeys() []configurationKey { return answer } -func integrationSourceFromKameletSource(e *Environment, kamelet v1alpha1.Kamelet, source v1.SourceSpec, name string) (v1.SourceSpec, error) { +func integrationSourceFromKameletSource(e *Environment, kamelet *v1alpha1.Kamelet, source v1.SourceSpec, name string) (v1.SourceSpec, error) { if source.Type == v1.SourceTypeTemplate { // Kamelets must be named ".extension" language := source.InferLanguage() diff --git a/pkg/trait/kamelets_test.go b/pkg/trait/kamelets_test.go index e72ad7889e..6ad36788ed 100644 --- a/pkg/trait/kamelets_test.go +++ b/pkg/trait/kamelets_test.go @@ -491,7 +491,8 @@ func createKameletsTestEnvironment(flow string, objects ...runtime.Object) (*kam trait.Client = client environment := &Environment{ - Catalog: NewCatalog(context.TODO(), nil), + Catalog: NewCatalog(context.TODO(), client), + Client: client, CamelCatalog: catalog, Integration: &v1.Integration{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/util/test/client.go b/pkg/util/test/client.go index 22e7d0b8c4..0657673d9c 100644 --- a/pkg/util/test/client.go +++ b/pkg/util/test/client.go @@ -22,7 +22,12 @@ import ( "github.com/apache/camel-k/pkg/apis" "github.com/apache/camel-k/pkg/client" + camel "github.com/apache/camel-k/pkg/client/camel/clientset/versioned" + fakecamelclientset "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/fake" + camelv1 "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/typed/camel/v1" + camelv1alpha1 "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/typed/camel/v1alpha1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes" fakeclientset "k8s.io/client-go/kubernetes/fake" clientscheme "k8s.io/client-go/kubernetes/scheme" @@ -41,35 +46,47 @@ func NewFakeClient(initObjs ...runtime.Object) (client.Client, error) { } c := fake.NewFakeClientWithScheme(scheme, initObjs...) - filtered := make([]runtime.Object, 0, len(initObjs)) - skipList := []string{"camel", "knative"} - for _, o := range initObjs { - kinds, _, _ := scheme.ObjectKinds(o) - allow := true - for _, k := range kinds { - for _, skip := range skipList { - if strings.Contains(k.Group, skip) { - allow = false - break - } - } - } - if allow { - filtered = append(filtered, o) - } - } - clientset := fakeclientset.NewSimpleClientset(filtered...) + + camelClientset := fakecamelclientset.NewSimpleClientset(filterObjects(scheme, initObjs, func(gvk schema.GroupVersionKind) bool { + return strings.Contains(gvk.Group, "camel") + })...) + clientset := fakeclientset.NewSimpleClientset(filterObjects(scheme, initObjs, func(gvk schema.GroupVersionKind) bool { + return !strings.Contains(gvk.Group, "camel") && !strings.Contains(gvk.Group, "knative") + })...) return &FakeClient{ Client: c, Interface: clientset, + camel: camelClientset, }, nil } +func filterObjects(scheme *runtime.Scheme, input []runtime.Object, filter func(gvk schema.GroupVersionKind) bool) (res []runtime.Object) { + for _, obj := range input { + kinds, _, _ := scheme.ObjectKinds(obj) + for _, k := range kinds { + if filter(k) { + res = append(res, obj) + break + } + } + } + return res +} + // FakeClient --- type FakeClient struct { controller.Client kubernetes.Interface + camel camel.Interface +} + +func (c *FakeClient) CamelV1() camelv1.CamelV1Interface { + return c.camel.CamelV1() +} + +func (c *FakeClient) CamelV1alpha1() camelv1alpha1.CamelV1alpha1Interface { + return c.camel.CamelV1alpha1() } // GetScheme --- diff --git a/script/build_submodules.sh b/script/build_submodules.sh index 0ba1889e53..647e86c8db 100755 --- a/script/build_submodules.sh +++ b/script/build_submodules.sh @@ -29,3 +29,7 @@ go build ./... echo "Building submodule pkg/client/camel..." cd ../../client/camel go build ./... + +echo "Building submodule pkg/kamelet/repository..." +cd ../../kamelet/repository +go build ./... diff --git a/script/git_tag.sh b/script/git_tag.sh index 7589f3ad68..141ef33e35 100755 --- a/script/git_tag.sh +++ b/script/git_tag.sh @@ -46,3 +46,8 @@ client_tag="pkg/client/camel/$target_tag" git tag --force ${client_tag} ${target_staging} git push --force ${target_remote} ${client_tag} echo "Tag ${client_tag} pushed to ${target_remote}" + +kamelet_repo_tag="pkg/kamelet/repository/$target_tag" +git tag --force ${kamelet_repo_tag} ${target_staging} +git push --force ${target_remote} ${kamelet_repo_tag} +echo "Tag ${kamelet_repo_tag} pushed to ${target_remote}" diff --git a/script/set_go_modules_version.sh b/script/set_go_modules_version.sh index 5e2a0addcc..091f8533a8 100755 --- a/script/set_go_modules_version.sh +++ b/script/set_go_modules_version.sh @@ -28,14 +28,21 @@ target_tag=v$target_version api_rule="s/github.com\/apache\/camel-k\/pkg\/apis\/camel [A-Za-z0-9\.\-]+.*$/github.com\/apache\/camel-k\/pkg\/apis\/camel $target_tag/" client_rule="s/github.com\/apache\/camel-k\/pkg\/client\/camel [A-Za-z0-9\.\-]+.*$/github.com\/apache\/camel-k\/pkg\/client\/camel $target_tag/" +kr_rule="s/github.com\/apache\/camel-k\/pkg\/kamelet\/repository [A-Za-z0-9\.\-]+.*$/github.com\/apache\/camel-k\/pkg\/kamelet\/repository $target_tag/" if [[ "$OSTYPE" == "linux-gnu"* ]]; then - sed -i -r "$api_rule" $location/../go.mod + sed -i -r "$api_rule" $location/../go.mod sed -i -r "$client_rule" $location/../go.mod - sed -i -r "$api_rule" $location/../pkg/client/camel/go.mod + sed -i -r "$kr_rule" $location/../go.mod + sed -i -r "$api_rule" $location/../pkg/client/camel/go.mod + sed -i -r "$api_rule" $location/../pkg/kamelet/repository/go.mod + sed -i -r "$client_rule" $location/../pkg/kamelet/repository/go.mod elif [[ "$OSTYPE" == "darwin"* ]]; then # Mac OSX - sed -i '' -E "$api_rule" $location/../go.mod + sed -i '' -E "$api_rule" $location/../go.mod sed -i '' -E "$client_rule" $location/../go.mod - sed -i '' -E "$api_rule" $location/../pkg/client/camel/go.mod + sed -i '' -E "$kr_rule" $location/../go.mod + sed -i '' -E "$api_rule" $location/../pkg/client/camel/go.mod + sed -i '' -E "$api_rule" $location/../pkg/kamelet/repository/go.mod + sed -i '' -E "$client_rule" $location/../pkg/kamelet/repository/go.mod fi