| 948 | } |
| 949 | |
| 950 | func validateLifecycleCompat(descriptor buildpack.Descriptor, lifecycleDescriptor LifecycleDescriptor) error { |
| 951 | compatible := false |
| 952 | for _, version := range append(lifecycleDescriptor.APIs.Buildpack.Supported, lifecycleDescriptor.APIs.Buildpack.Deprecated...) { |
| 953 | compatible = version.Compare(descriptor.API()) == 0 |
| 954 | if compatible { |
| 955 | break |
| 956 | } |
| 957 | } |
| 958 | |
| 959 | if !compatible { |
| 960 | return fmt.Errorf( |
| 961 | "%s %s (Buildpack API %s) is incompatible with lifecycle %s (Buildpack API(s) %s)", |
| 962 | descriptor.Kind(), |
| 963 | style.Symbol(descriptor.Info().FullName()), |
| 964 | descriptor.API().String(), |
| 965 | style.Symbol(lifecycleDescriptor.Info.Version.String()), |
| 966 | strings.Join(lifecycleDescriptor.APIs.Buildpack.Supported.AsStrings(), ", "), |
| 967 | ) |
| 968 | } |
| 969 | |
| 970 | return nil |
| 971 | } |
| 972 | |
| 973 | func userAndGroupIDs(img imgutil.Image) (int, int, error) { |
| 974 | sUID, err := img.Env(EnvUID) |